From ca645b3ae1bbf8748691b8635bdf4393e51f8bfa 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 02:09:37 +0800 Subject: [PATCH] WebUI 889fcb00b1af0ba298fb14fa0657f1c22ff63334 --- ...{charts-BH1Uno6i.js => charts-0z-hIQr-.js} | 2 +- webui/dist/assets/icons-Bom2zaMH.js | 1 - webui/dist/assets/icons-DMlhlQyz.js | 1 + webui/dist/assets/index--0Z4-njD.js | 407 ++++++++++++++++++ webui/dist/assets/index-BwXMDuHV.css | 1 - webui/dist/assets/index-Bzl8QBn9.css | 1 + webui/dist/assets/index-CrIP7TYI.js | 381 ---------------- webui/dist/index.html | 8 +- 8 files changed, 414 insertions(+), 388 deletions(-) rename webui/dist/assets/{charts-BH1Uno6i.js => charts-0z-hIQr-.js} (99%) delete mode 100644 webui/dist/assets/icons-Bom2zaMH.js create mode 100644 webui/dist/assets/icons-DMlhlQyz.js create mode 100644 webui/dist/assets/index--0Z4-njD.js delete mode 100644 webui/dist/assets/index-BwXMDuHV.css create mode 100644 webui/dist/assets/index-Bzl8QBn9.css delete mode 100644 webui/dist/assets/index-CrIP7TYI.js diff --git a/webui/dist/assets/charts-BH1Uno6i.js b/webui/dist/assets/charts-0z-hIQr-.js similarity index 99% rename from webui/dist/assets/charts-BH1Uno6i.js rename to webui/dist/assets/charts-0z-hIQr-.js index 27531334..1b0cb22d 100644 --- a/webui/dist/assets/charts-BH1Uno6i.js +++ b/webui/dist/assets/charts-0z-hIQr-.js @@ -62,4 +62,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qq(e,t){if(e){if(typeof e=="string")return dh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dh(e,t)}}function e2(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function t2(e){if(Array.isArray(e))return dh(e)}function dh(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rl){p=[].concat(Or(c.slice(0,y)),[l-v]);break}var d=p.length%2===0?[0,h]:[h];return[].concat(Or(t.repeat(c,f)),Or(p),d).map(function(m){return"".concat(m,"px")}).join(", ")}),ut(r,"id",un("recharts-line-")),ut(r,"pathRef",function(o){r.mainCurve=o}),ut(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),ut(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return u2(t,e),n2(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,u=a.xAxis,c=a.yAxis,s=a.layout,f=a.children,l=Ye(f,_i);if(!l)return null;var h=function(v,d){return{x:v.x,y:v.y,value:v.value,errorVal:Ae(v.payload,d)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return S.createElement(ne,p,l.map(function(y){return S.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:o,xAxis:u,yAxis:c,layout:s,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var u=this.props,c=u.dot,s=u.points,f=u.dataKey,l=K(this.props,!1),h=K(c,!0),p=s.map(function(v,d){var m=ze(ze(ze({key:"dot-".concat(d),r:3},l),h),{},{index:d,cx:v.x,cy:v.y,value:v.value,dataKey:f,payload:v.payload,points:s});return t.renderDotItem(c,m)}),y={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return S.createElement(ne,Rn({className:"recharts-line-dots",key:"dots"},y),p)}},{key:"renderCurveStatically",value:function(n,i,a,o){var u=this.props,c=u.type,s=u.layout,f=u.connectNulls;u.ref;var l=C0(u,Xq),h=ze(ze(ze({},K(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:c,layout:s,connectNulls:f});return S.createElement(pa,Rn({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,u=o.points,c=o.strokeDasharray,s=o.isAnimationActive,f=o.animationBegin,l=o.animationDuration,h=o.animationEasing,p=o.animationId,y=o.animateNewValues,v=o.width,d=o.height,m=this.state,x=m.prevPoints,w=m.totalLength;return S.createElement(bt,{begin:f,duration:l,isActive:s,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var g=O.t;if(x){var b=x.length/u.length,_=u.map(function(E,M){var I=Math.floor(M*b);if(x[I]){var $=x[I],k=Ge($.x,E.x),R=Ge($.y,E.y);return ze(ze({},E),{},{x:k(g),y:R(g)})}if(y){var L=Ge(v*2,E.x),B=Ge(d/2,E.y);return ze(ze({},E),{},{x:L(g),y:B(g)})}return ze(ze({},E),{},{x:E.x,y:E.y})});return a.renderCurveStatically(_,n,i)}var A=Ge(0,w),P=A(g),j;if(c){var T="".concat(c).split(/[,\s]+/gim).map(function(E){return parseFloat(E)});j=a.getStrokeDasharray(P,w,T)}else j=a.generateSimpleStrokeDasharray(w,P);return a.renderCurveStatically(u,n,i,{strokeDasharray:j})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,u=a.isAnimationActive,c=this.state,s=c.prevPoints,f=c.totalLength;return u&&o&&o.length&&(!s&&f>0||!Oi(s,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,u=i.points,c=i.className,s=i.xAxis,f=i.yAxis,l=i.top,h=i.left,p=i.width,y=i.height,v=i.isAnimationActive,d=i.id;if(a||!u||!u.length)return null;var m=this.state.isAnimationFinished,x=u.length===1,w=te("recharts-line",c),O=s&&s.allowDataOverflow,g=f&&f.allowDataOverflow,b=O||g,_=J(d)?this.id:d,A=(n=K(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},P=A.r,j=P===void 0?3:P,T=A.strokeWidth,E=T===void 0?2:T,M=V1(o)?o:{},I=M.clipDot,$=I===void 0?!0:I,k=j*2+E;return S.createElement(ne,{className:w},O||g?S.createElement("defs",null,S.createElement("clipPath",{id:"clipPath-".concat(_)},S.createElement("rect",{x:O?h:h-p/2,y:g?l:l-y/2,width:O?p:p*2,height:g?y:y*2})),!$&&S.createElement("clipPath",{id:"clipPath-dots-".concat(_)},S.createElement("rect",{x:h-k/2,y:l-k/2,width:p+k,height:y+k}))):null,!x&&this.renderCurve(b,_),this.renderErrorBar(b,_),(x||o)&&this.renderDots(b,$,_),(!v||m)&&Mt.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Or(n),[0]):n,o=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Z2(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 J2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q2(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&q(i)&&q(a)?t.slice(i,a+1):[]};function K_(e){return e==="number"?[0,"auto"]:void 0}var Ah=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,u=Ao(r,t);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(c,s){var f,l=(f=s.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=l===void 0?u:l;h=Bi(p,o.dataKey,i)}else h=l&&l[n]||u[n];return h?[].concat(rn(c),[RO(s,h)]):c},[])},U0=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=fL(a,n),u=t.orderedTooltipTicks,c=t.tooltipAxis,s=t.tooltipTicks,f=q$(o,u,s,c);if(f>=0&&s){var l=s[f]&&s[f].value,h=Ah(t,r,f,l),p=hL(n,u,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:h,activeCoordinate:p}}return null},pL=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=t.stackOffset,p=jO(f,a);return n.reduce(function(y,v){var d,m=v.type.defaultProps!==void 0?C(C({},v.type.defaultProps),v.props):v.props,x=m.type,w=m.dataKey,O=m.allowDataOverflow,g=m.allowDuplicatedCategory,b=m.scale,_=m.ticks,A=m.includeHidden,P=m[o];if(y[P])return y;var j=Ao(t.data,{graphicalItems:i.filter(function(U){var G,se=o in U.props?U.props[o]:(G=U.type.defaultProps)===null||G===void 0?void 0:G[o];return se===P}),dataStartIndex:c,dataEndIndex:s}),T=j.length,E,M,I;L2(m.domain,O,x)&&(E=qf(m.domain,null,O),p&&(x==="number"||b!=="auto")&&(I=$n(j,w,"category")));var $=K_(x);if(!E||E.length===0){var k,R=(k=m.domain)!==null&&k!==void 0?k:$;if(w){if(E=$n(j,w,x),x==="category"&&p){var L=q1(E);g&&L?(M=E,E=_a(0,T)):g||(E=Bm(R,E,v).reduce(function(U,G){return U.indexOf(G)>=0?U:[].concat(rn(U),[G])},[]))}else if(x==="category")g?E=E.filter(function(U){return U!==""&&!J(U)}):E=Bm(R,E,v).reduce(function(U,G){return U.indexOf(G)>=0||G===""||J(G)?U:[].concat(rn(U),[G])},[]);else if(x==="number"){var B=W$(j,i.filter(function(U){var G,se,me=o in U.props?U.props[o]:(G=U.type.defaultProps)===null||G===void 0?void 0:G[o],De="hide"in U.props?U.props.hide:(se=U.type.defaultProps)===null||se===void 0?void 0:se.hide;return me===P&&(A||!De)}),w,a,f);B&&(E=B)}p&&(x==="number"||b!=="auto")&&(I=$n(j,w,"category"))}else p?E=_a(0,T):u&&u[P]&&u[P].hasStack&&x==="number"?E=h==="expand"?[0,1]:kO(u[P].stackGroups,c,s):E=EO(j,i.filter(function(U){var G=o in U.props?U.props[o]:U.type.defaultProps[o],se="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return G===P&&(A||!se)}),x,f,!0);if(x==="number")E=wh(l,E,P,a,_),R&&(E=qf(R,E,O));else if(x==="category"&&R){var z=R,H=E.every(function(U){return z.indexOf(U)>=0});H&&(E=z)}}return C(C({},y),{},V({},P,C(C({},m),{},{axisType:a,domain:E,categoricalDomain:I,duplicateDomain:M,originalDomain:(d=m.domain)!==null&&d!==void 0?d:$,isCategorical:p,layout:f})))},{})},dL=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=Ao(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:s}),p=h.length,y=jO(f,a),v=-1;return n.reduce(function(d,m){var x=m.type.defaultProps!==void 0?C(C({},m.type.defaultProps),m.props):m.props,w=x[o],O=K_("number");if(!d[w]){v++;var g;return y?g=_a(0,p):u&&u[w]&&u[w].hasStack?(g=kO(u[w].stackGroups,c,s),g=wh(l,g,w,a)):(g=qf(O,EO(h,n.filter(function(b){var _,A,P=o in b.props?b.props[o]:(_=b.type.defaultProps)===null||_===void 0?void 0:_[o],j="hide"in b.props?b.props.hide:(A=b.type.defaultProps)===null||A===void 0?void 0:A.hide;return P===w&&!j}),"number",f),i.defaultProps.allowDataOverflow),g=wh(l,g,w,a)),C(C({},d),{},V({},w,C(C({axisType:a},i.defaultProps),{},{hide:!0,orientation:Xe(sL,"".concat(a,".").concat(v%2),null),domain:g,originalDomain:O,isCategorical:y,layout:f})))}return d},{})},vL=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),h=Ye(f,a),p={};return h&&h.length?p=pL(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s}):o&&o.length&&(p=dL(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s})),p},yL=function(t){var r=qt(t),n=Tt(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Zh(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:la(r,n)}},W0=function(t){var r=t.children,n=t.defaultShowTooltip,i=He(r,Hr),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},gL=function(t){return!t||!t.length?!1:t.some(function(r){var n=Et(r&&r.type);return n&&n.indexOf("Bar")>=0})},z0=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},mL=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,u=t.yAxisMap,c=u===void 0?{}:u,s=n.width,f=n.height,l=n.children,h=n.margin||{},p=He(l,Hr),y=He(l,jr),v=Object.keys(c).reduce(function(g,b){var _=c[b],A=_.orientation;return!_.mirror&&!_.hide?C(C({},g),{},V({},A,g[A]+_.width)):g},{left:h.left||0,right:h.right||0}),d=Object.keys(o).reduce(function(g,b){var _=o[b],A=_.orientation;return!_.mirror&&!_.hide?C(C({},g),{},V({},A,Xe(g,"".concat(A))+_.height)):g},{top:h.top||0,bottom:h.bottom||0}),m=C(C({},d),v),x=m.bottom;p&&(m.bottom+=p.props.height||Hr.defaultProps.height),y&&r&&(m=F$(m,i,n,r));var w=s-m.left-m.right,O=f-m.top-m.bottom;return C(C({brushBottom:x},m),{},{width:Math.max(w,0),height:Math.max(O,0)})},bL=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Np=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,c=t.axisComponents,s=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,h=function(m,x){var w=x.graphicalItems,O=x.stackGroups,g=x.offset,b=x.updateId,_=x.dataStartIndex,A=x.dataEndIndex,P=m.barSize,j=m.layout,T=m.barGap,E=m.barCategoryGap,M=m.maxBarSize,I=z0(j),$=I.numericAxisName,k=I.cateAxisName,R=gL(w),L=[];return w.forEach(function(B,z){var H=Ao(m.data,{graphicalItems:[B],dataStartIndex:_,dataEndIndex:A}),U=B.type.defaultProps!==void 0?C(C({},B.type.defaultProps),B.props):B.props,G=U.dataKey,se=U.maxBarSize,me=U["".concat($,"Id")],De=U["".concat(k,"Id")],wt={},Ie=c.reduce(function(Ze,Ce){var Te=x["".concat(Ce.axisType,"Map")],Kt=U["".concat(Ce.axisType,"Id")];Te&&Te[Kt]||Ce.axisType==="zAxis"||or(!1);var Ht=Te[Kt];return C(C({},Ze),{},V(V({},Ce.axisType,Ht),"".concat(Ce.axisType,"Ticks"),Tt(Ht)))},wt),F=Ie[k],Q=Ie["".concat(k,"Ticks")],ee=O&&O[me]&&O[me].hasStack&&J$(B,O[me].stackGroups),D=Et(B.type).indexOf("Bar")>=0,ve=la(F,Q),re=[],Y=R&&L$({barSize:P,stackGroups:O,totalSize:bL(Ie,k)});if(D){var ye,Z,Ne=J(se)?M:se,We=(ye=(Z=la(F,Q,!0))!==null&&Z!==void 0?Z:Ne)!==null&&ye!==void 0?ye:0;re=B$({barGap:T,barCategoryGap:E,bandSize:We!==ve?We:ve,sizeList:Y[De],maxBarSize:Ne}),We!==ve&&(re=re.map(function(Ze){return C(C({},Ze),{},{position:C(C({},Ze.position),{},{offset:Ze.position.offset-We/2})})}))}var gr=B&&B.type&&B.type.getComposedData;gr&&L.push({props:C(C({},gr(C(C({},Ie),{},{displayedData:H,props:m,dataKey:G,item:B,bandSize:ve,barPosition:re,offset:g,stackedData:ee,layout:j,dataStartIndex:_,dataEndIndex:A}))),{},V(V(V({key:B.key||"item-".concat(z)},$,Ie[$]),k,Ie[k]),"animationId",b)),childIndex:Z1(B,m.children),item:B})}),L},p=function(m,x){var w=m.props,O=m.dataStartIndex,g=m.dataEndIndex,b=m.updateId;if(!Jd({props:w}))return null;var _=w.children,A=w.layout,P=w.stackOffset,j=w.data,T=w.reverseStackOrder,E=z0(A),M=E.numericAxisName,I=E.cateAxisName,$=Ye(_,n),k=Y$(j,$,"".concat(M,"Id"),"".concat(I,"Id"),P,T),R=c.reduce(function(U,G){var se="".concat(G.axisType,"Map");return C(C({},U),{},V({},se,vL(w,C(C({},G),{},{graphicalItems:$,stackGroups:G.axisType===M&&k,dataStartIndex:O,dataEndIndex:g}))))},{}),L=mL(C(C({},R),{},{props:w,graphicalItems:$}),x?.legendBBox);Object.keys(R).forEach(function(U){R[U]=f(w,R[U],L,U.replace("Map",""),r)});var B=R["".concat(I,"Map")],z=yL(B),H=h(w,C(C({},R),{},{dataStartIndex:O,dataEndIndex:g,updateId:b,graphicalItems:$,stackGroups:k,offset:L}));return C(C({formattedGraphicalItems:H,graphicalItems:$,offset:L,stackGroups:k},z),R)},y=(function(d){function m(x){var w,O,g;return J2(this,m),g=tL(this,m,[x]),V(g,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),V(g,"accessibilityManager",new q2),V(g,"handleLegendBBoxUpdate",function(b){if(b){var _=g.state,A=_.dataStartIndex,P=_.dataEndIndex,j=_.updateId;g.setState(C({legendBBox:b},p({props:g.props,dataStartIndex:A,dataEndIndex:P,updateId:j},C(C({},g.state),{},{legendBBox:b}))))}}),V(g,"handleReceiveSyncEvent",function(b,_,A){if(g.props.syncId===b){if(A===g.eventEmitterSymbol&&typeof g.props.syncMethod!="function")return;g.applySyncEvent(_)}}),V(g,"handleBrushChange",function(b){var _=b.startIndex,A=b.endIndex;if(_!==g.state.dataStartIndex||A!==g.state.dataEndIndex){var P=g.state.updateId;g.setState(function(){return C({dataStartIndex:_,dataEndIndex:A},p({props:g.props,dataStartIndex:_,dataEndIndex:A,updateId:P},g.state))}),g.triggerSyncEvent({dataStartIndex:_,dataEndIndex:A})}}),V(g,"handleMouseEnter",function(b){var _=g.getMouseInfo(b);if(_){var A=C(C({},_),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var P=g.props.onMouseEnter;X(P)&&P(A,b)}}),V(g,"triggeredAfterMouseMove",function(b){var _=g.getMouseInfo(b),A=_?C(C({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};g.setState(A),g.triggerSyncEvent(A);var P=g.props.onMouseMove;X(P)&&P(A,b)}),V(g,"handleItemMouseEnter",function(b){g.setState(function(){return{isTooltipActive:!0,activeItem:b,activePayload:b.tooltipPayload,activeCoordinate:b.tooltipPosition||{x:b.cx,y:b.cy}}})}),V(g,"handleItemMouseLeave",function(){g.setState(function(){return{isTooltipActive:!1}})}),V(g,"handleMouseMove",function(b){b.persist(),g.throttleTriggeredAfterMouseMove(b)}),V(g,"handleMouseLeave",function(b){g.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};g.setState(_),g.triggerSyncEvent(_);var A=g.props.onMouseLeave;X(A)&&A(_,b)}),V(g,"handleOuterEvent",function(b){var _=Y1(b),A=Xe(g.props,"".concat(_));if(_&&X(A)){var P,j;/.*touch.*/i.test(_)?j=g.getMouseInfo(b.changedTouches[0]):j=g.getMouseInfo(b),A((P=j)!==null&&P!==void 0?P:{},b)}}),V(g,"handleClick",function(b){var _=g.getMouseInfo(b);if(_){var A=C(C({},_),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var P=g.props.onClick;X(P)&&P(A,b)}}),V(g,"handleMouseDown",function(b){var _=g.props.onMouseDown;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleMouseUp",function(b){var _=g.props.onMouseUp;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleTouchMove",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.throttleTriggeredAfterMouseMove(b.changedTouches[0])}),V(g,"handleTouchStart",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseDown(b.changedTouches[0])}),V(g,"handleTouchEnd",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseUp(b.changedTouches[0])}),V(g,"handleDoubleClick",function(b){var _=g.props.onDoubleClick;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleContextMenu",function(b){var _=g.props.onContextMenu;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"triggerSyncEvent",function(b){g.props.syncId!==void 0&&Al.emit(Sl,g.props.syncId,b,g.eventEmitterSymbol)}),V(g,"applySyncEvent",function(b){var _=g.props,A=_.layout,P=_.syncMethod,j=g.state.updateId,T=b.dataStartIndex,E=b.dataEndIndex;if(b.dataStartIndex!==void 0||b.dataEndIndex!==void 0)g.setState(C({dataStartIndex:T,dataEndIndex:E},p({props:g.props,dataStartIndex:T,dataEndIndex:E,updateId:j},g.state)));else if(b.activeTooltipIndex!==void 0){var M=b.chartX,I=b.chartY,$=b.activeTooltipIndex,k=g.state,R=k.offset,L=k.tooltipTicks;if(!R)return;if(typeof P=="function")$=P(L,b);else if(P==="value"){$=-1;for(var B=0;B=0){var ee,D;if(M.dataKey&&!M.allowDuplicatedCategory){var ve=typeof M.dataKey=="function"?Q:"payload.".concat(M.dataKey.toString());ee=Bi(B,ve,$),D=z&&H&&Bi(H,ve,$)}else ee=B?.[I],D=z&&H&&H[I];if(De||me){var re=b.props.activeIndex!==void 0?b.props.activeIndex:I;return[N.cloneElement(b,C(C(C({},P.props),Ie),{},{activeIndex:re})),null,null]}if(!J(ee))return[F].concat(rn(g.renderActivePoints({item:P,activePoint:ee,basePoint:D,childIndex:I,isRange:z})))}else{var Y,ye=(Y=g.getItemByXY(g.state.activeCoordinate))!==null&&Y!==void 0?Y:{graphicalItem:F},Z=ye.graphicalItem,Ne=Z.item,We=Ne===void 0?b:Ne,gr=Z.childIndex,Ze=C(C(C({},P.props),Ie),{},{activeIndex:gr});return[N.cloneElement(We,Ze),null,null]}return z?[F,null,null]:[F,null]}),V(g,"renderCustomized",function(b,_,A){return N.cloneElement(b,C(C({key:"recharts-customized-".concat(A)},g.props),g.state))}),V(g,"renderMap",{CartesianGrid:{handler:qi,once:!0},ReferenceArea:{handler:g.renderReferenceElement},ReferenceLine:{handler:qi},ReferenceDot:{handler:g.renderReferenceElement},XAxis:{handler:qi},YAxis:{handler:qi},Brush:{handler:g.renderBrush,once:!0},Bar:{handler:g.renderGraphicChild},Line:{handler:g.renderGraphicChild},Area:{handler:g.renderGraphicChild},Radar:{handler:g.renderGraphicChild},RadialBar:{handler:g.renderGraphicChild},Scatter:{handler:g.renderGraphicChild},Pie:{handler:g.renderGraphicChild},Funnel:{handler:g.renderGraphicChild},Tooltip:{handler:g.renderCursor,once:!0},PolarGrid:{handler:g.renderPolarGrid,once:!0},PolarAngleAxis:{handler:g.renderPolarAxis},PolarRadiusAxis:{handler:g.renderPolarAxis},Customized:{handler:g.renderCustomized}}),g.clipPathId="".concat((w=x.id)!==null&&w!==void 0?w:un("recharts"),"-clip"),g.throttleTriggeredAfterMouseMove=_w(g.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),g.state={},g}return iL(m,d),eL(m,[{key:"componentDidMount",value:function(){var w,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,O=w.children,g=w.data,b=w.height,_=w.layout,A=He(O,_t);if(A){var P=A.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var j=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,T=Ah(this.state,g,P,j),E=this.state.tooltipTicks[P].coordinate,M=(this.state.offset.top+b)/2,I=_==="horizontal",$=I?{x:E,y:M}:{y:E,x:M},k=this.state.formattedGraphicalItems.find(function(L){var B=L.item;return B.type.name==="Scatter"});k&&($=C(C({},$),k.props.points[P].tooltipPosition),T=k.props.points[P].tooltipPayload);var R={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:j,activePayload:T,activeCoordinate:$};this.setState(R),this.renderCursor(A),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var g,b;this.accessibilityManager.setDetails({offset:{left:(g=this.props.margin.left)!==null&&g!==void 0?g:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0}})}return null}},{key:"componentDidUpdate",value:function(w){af([He(w.children,_t)],[He(this.props.children,_t)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=He(this.props.children,_t);if(w&&typeof w.props.shared=="boolean"){var O=w.props.shared?"axis":"item";return u.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var O=this.container,g=O.getBoundingClientRect(),b=PT(g),_={chartX:Math.round(w.pageX-b.left),chartY:Math.round(w.pageY-b.top)},A=g.width/O.offsetWidth||1,P=this.inRange(_.chartX,_.chartY,A);if(!P)return null;var j=this.state,T=j.xAxisMap,E=j.yAxisMap,M=this.getTooltipEventType(),I=U0(this.state,this.props.data,this.props.layout,P);if(M!=="axis"&&T&&E){var $=qt(T).scale,k=qt(E).scale,R=$&&$.invert?$.invert(_.chartX):null,L=k&&k.invert?k.invert(_.chartY):null;return C(C({},_),{},{xValue:R,yValue:L},I)}return I?C(C({},_),I):null}},{key:"inRange",value:function(w,O){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,b=this.props.layout,_=w/g,A=O/g;if(b==="horizontal"||b==="vertical"){var P=this.state.offset,j=_>=P.left&&_<=P.left+P.width&&A>=P.top&&A<=P.top+P.height;return j?{x:_,y:A}:null}var T=this.state,E=T.angleAxisMap,M=T.radiusAxisMap;if(E&&M){var I=qt(E);return Wm({x:_,y:A},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,O=this.getTooltipEventType(),g=He(w,_t),b={};g&&O==="axis"&&(g.props.trigger==="click"?b={onClick:this.handleClick}:b={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=Fi(this.props,this.handleOuterEvent);return C(C({},_),b)}},{key:"addListener",value:function(){Al.on(Sl,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Al.removeListener(Sl,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,O,g){for(var b=this.state.formattedGraphicalItems,_=0,A=b.length;_e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&q(i)&&q(a)?t.slice(i,a+1):[]};function K_(e){return e==="number"?[0,"auto"]:void 0}var Ah=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,u=Ao(r,t);return n<0||!a||!a.length||n>=u.length?null:a.reduce(function(c,s){var f,l=(f=s.props.data)!==null&&f!==void 0?f:r;l&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(l=l.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=l===void 0?u:l;h=Bi(p,o.dataKey,i)}else h=l&&l[n]||u[n];return h?[].concat(rn(c),[RO(s,h)]):c},[])},U0=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=fL(a,n),u=t.orderedTooltipTicks,c=t.tooltipAxis,s=t.tooltipTicks,f=q$(o,u,s,c);if(f>=0&&s){var l=s[f]&&s[f].value,h=Ah(t,r,f,l),p=hL(n,u,f,a);return{activeTooltipIndex:f,activeLabel:l,activePayload:h,activeCoordinate:p}}return null},pL=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=t.stackOffset,p=jO(f,a);return n.reduce(function(y,v){var d,m=v.type.defaultProps!==void 0?C(C({},v.type.defaultProps),v.props):v.props,x=m.type,w=m.dataKey,O=m.allowDataOverflow,g=m.allowDuplicatedCategory,b=m.scale,_=m.ticks,A=m.includeHidden,P=m[o];if(y[P])return y;var j=Ao(t.data,{graphicalItems:i.filter(function(U){var G,se=o in U.props?U.props[o]:(G=U.type.defaultProps)===null||G===void 0?void 0:G[o];return se===P}),dataStartIndex:c,dataEndIndex:s}),T=j.length,E,M,I;L2(m.domain,O,x)&&(E=qf(m.domain,null,O),p&&(x==="number"||b!=="auto")&&(I=$n(j,w,"category")));var $=K_(x);if(!E||E.length===0){var k,R=(k=m.domain)!==null&&k!==void 0?k:$;if(w){if(E=$n(j,w,x),x==="category"&&p){var L=q1(E);g&&L?(M=E,E=_a(0,T)):g||(E=Bm(R,E,v).reduce(function(U,G){return U.indexOf(G)>=0?U:[].concat(rn(U),[G])},[]))}else if(x==="category")g?E=E.filter(function(U){return U!==""&&!J(U)}):E=Bm(R,E,v).reduce(function(U,G){return U.indexOf(G)>=0||G===""||J(G)?U:[].concat(rn(U),[G])},[]);else if(x==="number"){var B=W$(j,i.filter(function(U){var G,se,me=o in U.props?U.props[o]:(G=U.type.defaultProps)===null||G===void 0?void 0:G[o],De="hide"in U.props?U.props.hide:(se=U.type.defaultProps)===null||se===void 0?void 0:se.hide;return me===P&&(A||!De)}),w,a,f);B&&(E=B)}p&&(x==="number"||b!=="auto")&&(I=$n(j,w,"category"))}else p?E=_a(0,T):u&&u[P]&&u[P].hasStack&&x==="number"?E=h==="expand"?[0,1]:kO(u[P].stackGroups,c,s):E=EO(j,i.filter(function(U){var G=o in U.props?U.props[o]:U.type.defaultProps[o],se="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return G===P&&(A||!se)}),x,f,!0);if(x==="number")E=wh(l,E,P,a,_),R&&(E=qf(R,E,O));else if(x==="category"&&R){var z=R,H=E.every(function(U){return z.indexOf(U)>=0});H&&(E=z)}}return C(C({},y),{},V({},P,C(C({},m),{},{axisType:a,domain:E,categoricalDomain:I,duplicateDomain:M,originalDomain:(d=m.domain)!==null&&d!==void 0?d:$,isCategorical:p,layout:f})))},{})},dL=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.layout,l=t.children,h=Ao(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:s}),p=h.length,y=jO(f,a),v=-1;return n.reduce(function(d,m){var x=m.type.defaultProps!==void 0?C(C({},m.type.defaultProps),m.props):m.props,w=x[o],O=K_("number");if(!d[w]){v++;var g;return y?g=_a(0,p):u&&u[w]&&u[w].hasStack?(g=kO(u[w].stackGroups,c,s),g=wh(l,g,w,a)):(g=qf(O,EO(h,n.filter(function(b){var _,A,P=o in b.props?b.props[o]:(_=b.type.defaultProps)===null||_===void 0?void 0:_[o],j="hide"in b.props?b.props.hide:(A=b.type.defaultProps)===null||A===void 0?void 0:A.hide;return P===w&&!j}),"number",f),i.defaultProps.allowDataOverflow),g=wh(l,g,w,a)),C(C({},d),{},V({},w,C(C({axisType:a},i.defaultProps),{},{hide:!0,orientation:Xe(sL,"".concat(a,".").concat(v%2),null),domain:g,originalDomain:O,isCategorical:y,layout:f})))}return d},{})},vL=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,c=r.dataStartIndex,s=r.dataEndIndex,f=t.children,l="".concat(i,"Id"),h=Ye(f,a),p={};return h&&h.length?p=pL(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s}):o&&o.length&&(p=dL(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:l,stackGroups:u,dataStartIndex:c,dataEndIndex:s})),p},yL=function(t){var r=qt(t),n=Tt(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Zh(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:la(r,n)}},W0=function(t){var r=t.children,n=t.defaultShowTooltip,i=He(r,Hr),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},gL=function(t){return!t||!t.length?!1:t.some(function(r){var n=Et(r&&r.type);return n&&n.indexOf("Bar")>=0})},z0=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},mL=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,u=t.yAxisMap,c=u===void 0?{}:u,s=n.width,f=n.height,l=n.children,h=n.margin||{},p=He(l,Hr),y=He(l,jr),v=Object.keys(c).reduce(function(g,b){var _=c[b],A=_.orientation;return!_.mirror&&!_.hide?C(C({},g),{},V({},A,g[A]+_.width)):g},{left:h.left||0,right:h.right||0}),d=Object.keys(o).reduce(function(g,b){var _=o[b],A=_.orientation;return!_.mirror&&!_.hide?C(C({},g),{},V({},A,Xe(g,"".concat(A))+_.height)):g},{top:h.top||0,bottom:h.bottom||0}),m=C(C({},d),v),x=m.bottom;p&&(m.bottom+=p.props.height||Hr.defaultProps.height),y&&r&&(m=F$(m,i,n,r));var w=s-m.left-m.right,O=f-m.top-m.bottom;return C(C({brushBottom:x},m),{},{width:Math.max(w,0),height:Math.max(O,0)})},bL=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Np=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,c=t.axisComponents,s=t.legendContent,f=t.formatAxisMap,l=t.defaultProps,h=function(m,x){var w=x.graphicalItems,O=x.stackGroups,g=x.offset,b=x.updateId,_=x.dataStartIndex,A=x.dataEndIndex,P=m.barSize,j=m.layout,T=m.barGap,E=m.barCategoryGap,M=m.maxBarSize,I=z0(j),$=I.numericAxisName,k=I.cateAxisName,R=gL(w),L=[];return w.forEach(function(B,z){var H=Ao(m.data,{graphicalItems:[B],dataStartIndex:_,dataEndIndex:A}),U=B.type.defaultProps!==void 0?C(C({},B.type.defaultProps),B.props):B.props,G=U.dataKey,se=U.maxBarSize,me=U["".concat($,"Id")],De=U["".concat(k,"Id")],wt={},Ie=c.reduce(function(Ze,Ce){var Te=x["".concat(Ce.axisType,"Map")],Kt=U["".concat(Ce.axisType,"Id")];Te&&Te[Kt]||Ce.axisType==="zAxis"||or(!1);var Ht=Te[Kt];return C(C({},Ze),{},V(V({},Ce.axisType,Ht),"".concat(Ce.axisType,"Ticks"),Tt(Ht)))},wt),F=Ie[k],Q=Ie["".concat(k,"Ticks")],ee=O&&O[me]&&O[me].hasStack&&J$(B,O[me].stackGroups),D=Et(B.type).indexOf("Bar")>=0,ve=la(F,Q),re=[],Y=R&&L$({barSize:P,stackGroups:O,totalSize:bL(Ie,k)});if(D){var ye,Z,Ne=J(se)?M:se,We=(ye=(Z=la(F,Q,!0))!==null&&Z!==void 0?Z:Ne)!==null&&ye!==void 0?ye:0;re=B$({barGap:T,barCategoryGap:E,bandSize:We!==ve?We:ve,sizeList:Y[De],maxBarSize:Ne}),We!==ve&&(re=re.map(function(Ze){return C(C({},Ze),{},{position:C(C({},Ze.position),{},{offset:Ze.position.offset-We/2})})}))}var gr=B&&B.type&&B.type.getComposedData;gr&&L.push({props:C(C({},gr(C(C({},Ie),{},{displayedData:H,props:m,dataKey:G,item:B,bandSize:ve,barPosition:re,offset:g,stackedData:ee,layout:j,dataStartIndex:_,dataEndIndex:A}))),{},V(V(V({key:B.key||"item-".concat(z)},$,Ie[$]),k,Ie[k]),"animationId",b)),childIndex:Z1(B,m.children),item:B})}),L},p=function(m,x){var w=m.props,O=m.dataStartIndex,g=m.dataEndIndex,b=m.updateId;if(!Jd({props:w}))return null;var _=w.children,A=w.layout,P=w.stackOffset,j=w.data,T=w.reverseStackOrder,E=z0(A),M=E.numericAxisName,I=E.cateAxisName,$=Ye(_,n),k=Y$(j,$,"".concat(M,"Id"),"".concat(I,"Id"),P,T),R=c.reduce(function(U,G){var se="".concat(G.axisType,"Map");return C(C({},U),{},V({},se,vL(w,C(C({},G),{},{graphicalItems:$,stackGroups:G.axisType===M&&k,dataStartIndex:O,dataEndIndex:g}))))},{}),L=mL(C(C({},R),{},{props:w,graphicalItems:$}),x?.legendBBox);Object.keys(R).forEach(function(U){R[U]=f(w,R[U],L,U.replace("Map",""),r)});var B=R["".concat(I,"Map")],z=yL(B),H=h(w,C(C({},R),{},{dataStartIndex:O,dataEndIndex:g,updateId:b,graphicalItems:$,stackGroups:k,offset:L}));return C(C({formattedGraphicalItems:H,graphicalItems:$,offset:L,stackGroups:k},z),R)},y=(function(d){function m(x){var w,O,g;return J2(this,m),g=tL(this,m,[x]),V(g,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),V(g,"accessibilityManager",new q2),V(g,"handleLegendBBoxUpdate",function(b){if(b){var _=g.state,A=_.dataStartIndex,P=_.dataEndIndex,j=_.updateId;g.setState(C({legendBBox:b},p({props:g.props,dataStartIndex:A,dataEndIndex:P,updateId:j},C(C({},g.state),{},{legendBBox:b}))))}}),V(g,"handleReceiveSyncEvent",function(b,_,A){if(g.props.syncId===b){if(A===g.eventEmitterSymbol&&typeof g.props.syncMethod!="function")return;g.applySyncEvent(_)}}),V(g,"handleBrushChange",function(b){var _=b.startIndex,A=b.endIndex;if(_!==g.state.dataStartIndex||A!==g.state.dataEndIndex){var P=g.state.updateId;g.setState(function(){return C({dataStartIndex:_,dataEndIndex:A},p({props:g.props,dataStartIndex:_,dataEndIndex:A,updateId:P},g.state))}),g.triggerSyncEvent({dataStartIndex:_,dataEndIndex:A})}}),V(g,"handleMouseEnter",function(b){var _=g.getMouseInfo(b);if(_){var A=C(C({},_),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var P=g.props.onMouseEnter;X(P)&&P(A,b)}}),V(g,"triggeredAfterMouseMove",function(b){var _=g.getMouseInfo(b),A=_?C(C({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};g.setState(A),g.triggerSyncEvent(A);var P=g.props.onMouseMove;X(P)&&P(A,b)}),V(g,"handleItemMouseEnter",function(b){g.setState(function(){return{isTooltipActive:!0,activeItem:b,activePayload:b.tooltipPayload,activeCoordinate:b.tooltipPosition||{x:b.cx,y:b.cy}}})}),V(g,"handleItemMouseLeave",function(){g.setState(function(){return{isTooltipActive:!1}})}),V(g,"handleMouseMove",function(b){b.persist(),g.throttleTriggeredAfterMouseMove(b)}),V(g,"handleMouseLeave",function(b){g.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};g.setState(_),g.triggerSyncEvent(_);var A=g.props.onMouseLeave;X(A)&&A(_,b)}),V(g,"handleOuterEvent",function(b){var _=Y1(b),A=Xe(g.props,"".concat(_));if(_&&X(A)){var P,j;/.*touch.*/i.test(_)?j=g.getMouseInfo(b.changedTouches[0]):j=g.getMouseInfo(b),A((P=j)!==null&&P!==void 0?P:{},b)}}),V(g,"handleClick",function(b){var _=g.getMouseInfo(b);if(_){var A=C(C({},_),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var P=g.props.onClick;X(P)&&P(A,b)}}),V(g,"handleMouseDown",function(b){var _=g.props.onMouseDown;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleMouseUp",function(b){var _=g.props.onMouseUp;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleTouchMove",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.throttleTriggeredAfterMouseMove(b.changedTouches[0])}),V(g,"handleTouchStart",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseDown(b.changedTouches[0])}),V(g,"handleTouchEnd",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&g.handleMouseUp(b.changedTouches[0])}),V(g,"handleDoubleClick",function(b){var _=g.props.onDoubleClick;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"handleContextMenu",function(b){var _=g.props.onContextMenu;if(X(_)){var A=g.getMouseInfo(b);_(A,b)}}),V(g,"triggerSyncEvent",function(b){g.props.syncId!==void 0&&Al.emit(Sl,g.props.syncId,b,g.eventEmitterSymbol)}),V(g,"applySyncEvent",function(b){var _=g.props,A=_.layout,P=_.syncMethod,j=g.state.updateId,T=b.dataStartIndex,E=b.dataEndIndex;if(b.dataStartIndex!==void 0||b.dataEndIndex!==void 0)g.setState(C({dataStartIndex:T,dataEndIndex:E},p({props:g.props,dataStartIndex:T,dataEndIndex:E,updateId:j},g.state)));else if(b.activeTooltipIndex!==void 0){var M=b.chartX,I=b.chartY,$=b.activeTooltipIndex,k=g.state,R=k.offset,L=k.tooltipTicks;if(!R)return;if(typeof P=="function")$=P(L,b);else if(P==="value"){$=-1;for(var B=0;B=0){var ee,D;if(M.dataKey&&!M.allowDuplicatedCategory){var ve=typeof M.dataKey=="function"?Q:"payload.".concat(M.dataKey.toString());ee=Bi(B,ve,$),D=z&&H&&Bi(H,ve,$)}else ee=B?.[I],D=z&&H&&H[I];if(De||me){var re=b.props.activeIndex!==void 0?b.props.activeIndex:I;return[N.cloneElement(b,C(C(C({},P.props),Ie),{},{activeIndex:re})),null,null]}if(!J(ee))return[F].concat(rn(g.renderActivePoints({item:P,activePoint:ee,basePoint:D,childIndex:I,isRange:z})))}else{var Y,ye=(Y=g.getItemByXY(g.state.activeCoordinate))!==null&&Y!==void 0?Y:{graphicalItem:F},Z=ye.graphicalItem,Ne=Z.item,We=Ne===void 0?b:Ne,gr=Z.childIndex,Ze=C(C(C({},P.props),Ie),{},{activeIndex:gr});return[N.cloneElement(We,Ze),null,null]}return z?[F,null,null]:[F,null]}),V(g,"renderCustomized",function(b,_,A){return N.cloneElement(b,C(C({key:"recharts-customized-".concat(A)},g.props),g.state))}),V(g,"renderMap",{CartesianGrid:{handler:qi,once:!0},ReferenceArea:{handler:g.renderReferenceElement},ReferenceLine:{handler:qi},ReferenceDot:{handler:g.renderReferenceElement},XAxis:{handler:qi},YAxis:{handler:qi},Brush:{handler:g.renderBrush,once:!0},Bar:{handler:g.renderGraphicChild},Line:{handler:g.renderGraphicChild},Area:{handler:g.renderGraphicChild},Radar:{handler:g.renderGraphicChild},RadialBar:{handler:g.renderGraphicChild},Scatter:{handler:g.renderGraphicChild},Pie:{handler:g.renderGraphicChild},Funnel:{handler:g.renderGraphicChild},Tooltip:{handler:g.renderCursor,once:!0},PolarGrid:{handler:g.renderPolarGrid,once:!0},PolarAngleAxis:{handler:g.renderPolarAxis},PolarRadiusAxis:{handler:g.renderPolarAxis},Customized:{handler:g.renderCustomized}}),g.clipPathId="".concat((w=x.id)!==null&&w!==void 0?w:un("recharts"),"-clip"),g.throttleTriggeredAfterMouseMove=_w(g.triggeredAfterMouseMove,(O=x.throttleDelay)!==null&&O!==void 0?O:1e3/60),g.state={},g}return iL(m,d),eL(m,[{key:"componentDidMount",value:function(){var w,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,O=w.children,g=w.data,b=w.height,_=w.layout,A=He(O,_t);if(A){var P=A.props.defaultIndex;if(!(typeof P!="number"||P<0||P>this.state.tooltipTicks.length-1)){var j=this.state.tooltipTicks[P]&&this.state.tooltipTicks[P].value,T=Ah(this.state,g,P,j),E=this.state.tooltipTicks[P].coordinate,M=(this.state.offset.top+b)/2,I=_==="horizontal",$=I?{x:E,y:M}:{y:E,x:M},k=this.state.formattedGraphicalItems.find(function(L){var B=L.item;return B.type.name==="Scatter"});k&&($=C(C({},$),k.props.points[P].tooltipPosition),T=k.props.points[P].tooltipPayload);var R={activeTooltipIndex:P,isTooltipActive:!0,activeLabel:j,activePayload:T,activeCoordinate:$};this.setState(R),this.renderCursor(A),this.accessibilityManager.setIndex(P)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var g,b;this.accessibilityManager.setDetails({offset:{left:(g=this.props.margin.left)!==null&&g!==void 0?g:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0}})}return null}},{key:"componentDidUpdate",value:function(w){af([He(w.children,_t)],[He(this.props.children,_t)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=He(this.props.children,_t);if(w&&typeof w.props.shared=="boolean"){var O=w.props.shared?"axis":"item";return u.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var O=this.container,g=O.getBoundingClientRect(),b=PT(g),_={chartX:Math.round(w.pageX-b.left),chartY:Math.round(w.pageY-b.top)},A=g.width/O.offsetWidth||1,P=this.inRange(_.chartX,_.chartY,A);if(!P)return null;var j=this.state,T=j.xAxisMap,E=j.yAxisMap,M=this.getTooltipEventType(),I=U0(this.state,this.props.data,this.props.layout,P);if(M!=="axis"&&T&&E){var $=qt(T).scale,k=qt(E).scale,R=$&&$.invert?$.invert(_.chartX):null,L=k&&k.invert?k.invert(_.chartY):null;return C(C({},_),{},{xValue:R,yValue:L},I)}return I?C(C({},_),I):null}},{key:"inRange",value:function(w,O){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,b=this.props.layout,_=w/g,A=O/g;if(b==="horizontal"||b==="vertical"){var P=this.state.offset,j=_>=P.left&&_<=P.left+P.width&&A>=P.top&&A<=P.top+P.height;return j?{x:_,y:A}:null}var T=this.state,E=T.angleAxisMap,M=T.radiusAxisMap;if(E&&M){var I=qt(E);return Wm({x:_,y:A},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,O=this.getTooltipEventType(),g=He(w,_t),b={};g&&O==="axis"&&(g.props.trigger==="click"?b={onClick:this.handleClick}:b={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=Fi(this.props,this.handleOuterEvent);return C(C({},_),b)}},{key:"addListener",value:function(){Al.on(Sl,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Al.removeListener(Sl,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,O,g){for(var b=this.state.formattedGraphicalItems,_=0,A=b.length;_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)},r=(...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:k,...h},p)=>s.createElement("svg",{ref:p,...v,width:a,height:a,stroke:t,strokeWidth:o?Number(c)*24/Number(a):c,className:r("lucide",y),...!n&&!m(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"}]],Y1=e("activity",u);const g=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],e2=e("arrow-left",g);const f=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],a2=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"}]],t2=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"}]],c2=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"}]],o2=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"}]],n2=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"}]],s2=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"}]],y2=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"}]],h2=e("chart-column",C);const j=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],d2=e("check",j);const V=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],r2=e("chevron-down",V);const A=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],k2=e("chevron-left",A);const H=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],p2=e("chevron-right",H);const L=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],i2=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"}]],l2=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"}]],_2=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"}]],M2=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"}]],v2=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"}]],x2=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"}]],u2=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"}]],g2=e("circle-x",E);const D=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],f2=e("circle",D);const F=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],$2=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"}]],N2=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"}]],w2=e("container",I);const K=[["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"}]],z2=e("copy",K);const W=[["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"}]],b2=e("database",W);const X=[["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"}]],q2=e("dollar-sign",X);const G=[["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"}]],C2=e("download",G);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"}]],j2=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"}]],V2=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"}]],A2=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"}]],H2=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"}]],L2=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"}]],S2=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"}]],P2=e("funnel",c1);const o1=[["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"}]],U2=e("grip-vertical",o1);const n1=[["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"}]],T2=e("hash",n1);const s1=[["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"}]],Z2=e("house",s1);const y1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],R2=e("info",y1);const h1=[["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"}]],B2=e("key",h1);const d1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],E2=e("loader-circle",d1);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"}]],D2=e("lock",r1);const k1=[["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"}]],F2=e("log-out",k1);const p1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],O2=e("menu",p1);const i1=[["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"}]],I2=e("message-square",i1);const l1=[["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"}]],K2=e("moon",l1);const _1=[["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"}]],W2=e("network",_1);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"}]],X2=e("package",M1);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"}]],G2=e("palette",m1);const v1=[["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"}]],Q2=e("panels-top-left",v1);const x1=[["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"}]],J2=e("pause",x1);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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Y2=e("pencil",u1);const g1=[["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"}]],e0=e("play",g1);const f1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],a0=e("plus",f1);const $1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],t0=e("power",$1);const N1=[["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"}]],c0=e("refresh-cw",N1);const w1=[["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"}]],o0=e("rotate-ccw",w1);const z1=[["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"}]],n0=e("rotate-cw",z1);const b1=[["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"}]],s0=e("save",b1);const q1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],y0=e("search",q1);const C1=[["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"}]],h0=e("server",C1);const j1=[["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"}]],d0=e("settings-2",j1);const V1=[["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"}]],r0=e("settings",V1);const A1=[["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"}]],k0=e("shield",A1);const H1=[["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"}]],p0=e("skip-forward",H1);const L1=[["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"}]],i0=e("sliders-vertical",L1);const S1=[["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"}]],l0=e("smile",S1);const P1=[["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",P1);const U1=[["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",U1);const T1=[["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"}]],m0=e("star",T1);const Z1=[["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"}]],v0=e("sun",Z1);const R1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],x0=e("terminal",R1);const B1=[["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"}]],u0=e("thumbs-up",B1);const E1=[["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"}]],g0=e("thumbs-down",E1);const D1=[["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"}]],f0=e("trash-2",D1);const F1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],$0=e("trending-up",F1);const O1=[["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"}]],N0=e("triangle-alert",O1);const I1=[["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"}]],w0=e("type",I1);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"}]],z0=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"}]],b0=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"}]],q0=e("users",X1);const G1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],C0=e("x",G1);const Q1=[["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"}]],j0=e("zap",Q1);export{_2 as $,Y1 as A,o2 as B,$2 as C,q2 as D,V2 as E,L2 as F,s0 as G,Z2 as H,R2 as I,t0 as J,B2 as K,D2 as L,I2 as M,a0 as N,f0 as O,G2 as P,H2 as Q,c0 as R,k0 as S,$0 as T,b0 as U,Y2 as V,l2 as W,C0 as X,k2 as Y,j0 as Z,p2 as _,b2 as a,M2 as a0,U2 as a1,w2 as a2,X2 as a3,z0 as a4,S2 as a5,C2 as a6,P2 as a7,M0 as a8,t2 as a9,T2 as aa,q0 as ab,W2 as ac,y2 as ad,J2 as ae,e0 as af,w0 as ag,m0 as ah,u0 as ai,g0 as aj,d0 as ak,h0 as al,n2 as am,u2 as an,h2 as ao,f2 as ap,i0 as aq,O2 as ar,c2 as as,F2 as at,n0 as au,s2 as av,r0 as b,N0 as c,d2 as d,z2 as e,A2 as f,v2 as g,g2 as h,o0 as i,v0 as j,K2 as k,m2 as l,x2 as m,x0 as n,j2 as o,E2 as p,_0 as q,l0 as r,p0 as s,a2 as t,y0 as u,e2 as v,r2 as w,i2 as x,Q2 as y,N2 as z}; diff --git a/webui/dist/assets/icons-DMlhlQyz.js b/webui/dist/assets/icons-DMlhlQyz.js new file mode 100644 index 00000000..79468026 --- /dev/null +++ b/webui/dist/assets/icons-DMlhlQyz.js @@ -0,0 +1 @@ +import{r as s}from"./router-SinpzM5S.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)},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/index--0Z4-njD.js b/webui/dist/assets/index--0Z4-njD.js new file mode 100644 index 00000000..f5e48ce0 --- /dev/null +++ b/webui/dist/assets/index--0Z4-njD.js @@ -0,0 +1,407 @@ +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)":-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: + - a positive number + - less than the value passed to \`max\` (or ${Fj} 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])=>` +${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. + +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. + +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. + +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:` + 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中的**每个动作**是否符合当下条件,如果动作使用条件符合聊天内容就使用 +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==` +`&&(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 \${}: + +`,{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]] +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(` + @keyframes joyride-beacon-inner { + 20% { + opacity: 0.9; + } + + 90% { + opacity: 0.7; + } + } + + @keyframes joyride-beacon-outer { + 0% { + transform: scale(1); + } + + 45% { + opacity: 0.7; + transform: scale(0.75); + } + + 100% { + opacity: 0.9; + 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:` + 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(;++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(;++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:` +`},{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&&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:` +`,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:` +`,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:` +`,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:` +`,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)+` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l`+e/2.075+" -"+e+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+e)+`H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},j5e=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+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+e)+`H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},N5e=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 +s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},C5e=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 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+e)+`H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+` +h400000v`+(40+e)+"h-400000z"},T5e=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)+` +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 +l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 + 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 + 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 +c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 + 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 + 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 +-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 +-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 +-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 +c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 + 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 + 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 + 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 +H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 +-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 +-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 + 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 +-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 +-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 + 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 +-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z +M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z +M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 +-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 +c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z +M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 +c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 +-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 +60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 +-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 + 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 + 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 +-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 + 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 + 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 +-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 +-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 + 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 +-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 + 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z +m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 + 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 +-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 +-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 + 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 + 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 + 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 +-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z +M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 +c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 + 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 + 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 + 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 +s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 +121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 +s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 +-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 +13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 +-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 +-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, +1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},R5e=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 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":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 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z +M367 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 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z +M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z +M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 +c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, +-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 +c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+` +c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 +c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 +c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-`+(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=`\\\\( +|[ \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.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=` +Error: ${t.name} +Message: ${t.message} + +Stack Trace: +${t.stack||"No stack trace available"} + +Component Stack: +${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,{})]})})})})})); diff --git a/webui/dist/assets/index-BwXMDuHV.css b/webui/dist/assets/index-BwXMDuHV.css deleted file mode 100644 index 7aed6d76..00000000 --- a/webui/dist/assets/index-BwXMDuHV.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-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-1\/4{width:25%}.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-3\/4{width:75%}.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-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-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\/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-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\/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-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}.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\/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-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\: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\: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-Bzl8QBn9.css b/webui/dist/assets/index-Bzl8QBn9.css new file mode 100644 index 00000000..f43286e9 --- /dev/null +++ b/webui/dist/assets/index-Bzl8QBn9.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-\[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-CrIP7TYI.js b/webui/dist/assets/index-CrIP7TYI.js deleted file mode 100644 index f8728c7b..00000000 --- a/webui/dist/assets/index-CrIP7TYI.js +++ /dev/null @@ -1,381 +0,0 @@ -import{r as b,j as l,u as Da,R as he,b as fu,d as lY,e as oY,L as cY,f as uY,g as cs,h as dY,k as hY,O as jD,l as fY}from"./router-SinpzM5S.js";import{a as mY,b as pY,g as Fk}from"./react-vendor-Dtc2IqVY.js";import{c as OD,R as gY,T as xY,L as vY,a as yY,C as Vg,X as Ug,Y as Wf,b as bY,B as nw,d as Wg,P as wY,e as SY,f as kY,_ as jY,g as OY,i as NY,h as zC,j as CY,k as PC,l as TY,m as EY,n as _Y,r as ND,o as MY,p as $k,q as CD,s as Fu,t as Qk,u as AY,v as RY,w as TD,x as ED,y as _D,z as Hk,A as Vk,D as Uk,E as DY,F as zY,G as PY,H as LY,I as IY,J as BY,K as qY,M as Wk,N as Ov,O as FY,Q as $Y,S as Gk,U as QY,V as HY,W as MD,Z as AD,$ as RD,a0 as DD,a1 as Nv,a2 as zD,a3 as PD,a4 as VY,a5 as UY,a6 as WY,a7 as GY,a8 as XY,a9 as YY,aa as KY,ab as ZY,ac as LD,ad as ID,ae as JY,af as eK,ag as tK,ah as nK,ai as rK,aj as sK,ak as iK,al as aK,am as lK,an as oK,ao as cK,ap as uK,aq as dK,ar as hK,as as fK,at as mK}from"./charts-BH1Uno6i.js";import{c as ha,a as Cv,u as _i,P as on,b as tt,d as Bn,e as D0,f as wo,g as Os,h as Fs,i as Xk,j as Yk,k as Kk,S as pK,l as BD,m as qD,R as FD,O as Tv,n as Zk,C as Ev,o as _v,T as Jk,D as e6,p as t6,q as $D,r as QD,W as gK,s as HD,I as xK,t as VD,v as UD,w as vK,x as WD,V as yK,L as GD,y as XD,z as bK,A as wK,B as YD,E as SK,F as kK,G as gc,H as Mv,J as Rh,K as KD,M as ZD,N as JD,Q as ez,U as n6,X as r6,Y as Av,Z as Rv,_ as s6,$ as tz,a0 as jK,a1 as nz,a2 as OK,a3 as NK,a4 as rz,a5 as CK}from"./ui-vendor-BLBhIcJ8.js";import{R as Ls,A as TK,D as EK,a as A3,Z as R3,C as Zd,M as z0,T as _K,X as P0,P as sz,S as MK,b as bu,I as ra,c as Oa,d as ol,e as O1,E as N1,f as oa,g as xc,h as AK,i as RK,j as D3,k as z3,L as LC,K as iz,l as Cu,m as Dv,n as DK,F as lo,o as Jd,p as vc,q as zK,B as PK,U as az,r as i6,s as LK,t as IK,u as ci,H as Fm,v as lz,w as Tu,x as $m,y as BK,z as qK,G as zv,J as a6,N as ws,O as fn,Q as C1,V as wu,W as L0,Y as $u,_ as Qu,$ as I0,a0 as l6,a1 as FK,a2 as $K,a3 as mh,a4 as IC,a5 as QK,a6 as Su,a7 as P3,a8 as Qm,a9 as HK,aa as L3,ab as VK,ac as oz,ad as BC,ae as UK,af as WK,ag as GK,ah as sc,ai as rw,aj as qC,ak as XK,al as cz,am as uz,an as dz,ao as YK,ap as KK,aq as FC,ar as ZK,as as JK,at as $C,au as eZ,av as tZ}from"./icons-Bom2zaMH.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 sw={exports:{}},Gf={},iw={exports:{}},aw={};var QC;function nZ(){return QC||(QC=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(F,J))Vs(te,F)?(B[G]=te,B[V]=J,G=V):(B[G]=F,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,o=a.now();t.unstable_now=function(){return a.now()-o}}var c=[],h=[],f=1,m=null,g=3,x=!1,y=!1,w=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function T(B){for(var X=n(h);X!==null;){if(X.callback===null)r(h);else if(X.startTime<=B)r(h),X.sortIndex=X.expirationTime,e(c,X);else break;X=n(h)}}function _(B){if(w=!1,T(B),!y)if(n(c)!==null)y=!0,E||(E=!0,U());else{var X=n(h);X!==null&&H(_,X.startTime-B)}}var E=!1,M=-1,L=5,P=-1;function I(){return S?!0:!(t.unstable_now()-PB&&I());){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 se=n(h);se!==null&&H(_,se.startTime-B),X=!1}}break e}finally{m=null,g=J,x=!1}X=void 0}}finally{X?U():E=!1}}}var U;if(typeof C=="function")U=function(){C(Q)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,z=ee.port2;ee.port1.onmessage=Q,U=function(){z.postMessage(null)}}else U=function(){k(Q,0)};function H(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(h,B),n(c)===null&&B===n(h)&&(w?(N(M),M=-1):w=!0,H(_,J-G))):(B.sortIndex=R,e(c,B),y||x||(y=!0,E||(E=!0,U()))),B},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(B){var X=g;return function(){var J=g;g=X;try{return B.apply(this,arguments)}finally{g=J}}}})(aw)),aw}var HC;function rZ(){return HC||(HC=1,iw.exports=nZ()),iw.exports}var VC;function sZ(){if(VC)return Gf;VC=1;var t=rZ(),e=mY(),n=pY();function r(u){var d="https://react.dev/errors/"+u;if(1R||(u.current=G[R],G[R]=null,R--)}function F(u,d){R++,G[R]=u.current,u.current=d}var V=se(null),te=se(null),ne=se(null),K=se(null);function ie(u,d){switch(F(ne,d),F(te,u),F(V,null),d.nodeType){case 9:case 11:u=(u=d.documentElement)&&(u=u.namespaceURI)?sC(u):0;break;default:if(u=d.tagName,d=d.namespaceURI)d=sC(d),u=iC(d,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}W(V),F(V,u)}function re(){W(V),W(te),W(ne)}function ae(u){u.memoizedState!==null&&F(K,u);var d=V.current,p=iC(d,u.type);d!==p&&(F(te,u),F(V,p))}function _e(u){te.current===u&&(W(V),W(te)),K.current===u&&(W(K),Qf._currentValue=J)}var Ue,Xe;function Ze(u){if(Ue===void 0)try{throw Error()}catch(p){var d=p.stack.trim().match(/\n( *(at )?)/);Ue=d&&d[1]||"",Xe=-1)":-1j||ce[v]!==we[j]){var Ee=` -`+ce[v].replace(" at new "," at ");return u.displayName&&Ee.includes("")&&(Ee=Ee.replace("",u.displayName)),Ee}while(1<=v&&0<=j);break}}}finally{Oe=!1,Error.prepareStackTrace=p}return(p=u?u.displayName||u.name:"")?Ze(p):""}function Ve(u,d){switch(u.tag){case 26:case 27:case 5:return Ze(u.type);case 16:return Ze("Lazy");case 13:return u.child!==d&&d!==null?Ze("Suspense Fallback"):Ze("Suspense");case 19:return Ze("SuspenseList");case 0:case 15:return He(u.type,!1);case 11:return He(u.type.render,!1);case 1:return He(u.type,!0);case 31:return Ze("Activity");default:return""}}function Be(u){try{var d="",p=null;do d+=Ve(u,p),p=u,u=u.return;while(u);return d}catch(v){return` -Error generating stack: `+v.message+` -`+v.stack}}var ut=Object.prototype.hasOwnProperty,rt=t.unstable_scheduleCallback,rn=t.unstable_cancelCallback,Rn=t.unstable_shouldYield,Tn=t.unstable_requestPaint,Mt=t.unstable_now,vt=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,Le=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,lt=t.unstable_LowPriority,jt=t.unstable_IdlePriority,Tt=t.log,ke=t.unstable_setDisableYieldValue,Te=null,qe=null;function Rt(u){if(typeof Tt=="function"&&ke(u),qe&&typeof qe.setStrictMode=="function")try{qe.setStrictMode(Te,u)}catch{}}var At=Math.clz32?Math.clz32:mn,vr=Math.log,ft=Math.LN2;function mn(u){return u>>>=0,u===0?32:31-(vr(u)/ft|0)|0}var gt=256,Nt=262144,Ot=4194304;function it(u){var d=u&42;if(d!==0)return d;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 Vn(u,d,p){var v=u.pendingLanes;if(v===0)return 0;var j=0,O=u.suspendedLanes,q=u.pingedLanes;u=u.warmLanes;var Y=v&134217727;return Y!==0?(v=Y&~O,v!==0?j=it(v):(q&=Y,q!==0?j=it(q):p||(p=Y&~u,p!==0&&(j=it(p))))):(Y=v&~O,Y!==0?j=it(Y):q!==0?j=it(q):p||(p=v&~u,p!==0&&(j=it(p)))),j===0?0:d!==0&&d!==j&&(d&O)===0&&(O=j&-j,p=d&-d,O>=p||O===32&&(p&4194048)!==0)?d:j}function jr(u,d){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&d)===0}function Or(u,d){switch(u){case 1:case 2:case 4:case 8:case 64:return d+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ge(){var u=Ot;return Ot<<=1,(Ot&62914560)===0&&(Ot=4194304),u}function ze(u){for(var d=[],p=0;31>p;p++)d.push(u);return d}function Et(u,d){u.pendingLanes|=d,d!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function Gt(u,d,p,v,j,O){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 Y=u.entanglements,ce=u.expirationTimes,we=u.hiddenUpdates;for(p=q&~p;0"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var tG=/[\n"\\]/g;function Ii(u){return u.replace(tG,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function Yy(u,d,p,v,j,O,q,Y){u.name="",q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?u.type=q:u.removeAttribute("type"),d!=null?q==="number"?(d===0&&u.value===""||u.value!=d)&&(u.value=""+Li(d)):u.value!==""+Li(d)&&(u.value=""+Li(d)):q!=="submit"&&q!=="reset"||u.removeAttribute("value"),d!=null?Ky(u,q,Li(d)):p!=null?Ky(u,q,Li(p)):v!=null&&u.removeAttribute("value"),j==null&&O!=null&&(u.defaultChecked=!!O),j!=null&&(u.checked=j&&typeof j!="function"&&typeof j!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?u.name=""+Li(Y):u.removeAttribute("name")}function ZO(u,d,p,v,j,O,q,Y){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(u.type=O),d!=null||p!=null){if(!(O!=="submit"&&O!=="reset"||d!=null)){Xy(u);return}p=p!=null?""+Li(p):"",d=d!=null?""+Li(d):p,Y||d===u.value||(u.value=d),u.defaultValue=d}v=v??j,v=typeof v!="function"&&typeof v!="symbol"&&!!v,u.checked=Y?u.checked:!!v,u.defaultChecked=!!v,q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"&&(u.name=q),Xy(u)}function Ky(u,d,p){d==="number"&&zp(u.ownerDocument)===u||u.defaultValue===""+p||(u.defaultValue=""+p)}function Xu(u,d,p,v){if(u=u.options,d){d={};for(var j=0;j"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nb=!1;if(El)try{var lf={};Object.defineProperty(lf,"passive",{get:function(){nb=!0}}),window.addEventListener("test",lf,lf),window.removeEventListener("test",lf,lf)}catch{nb=!1}var Eo=null,rb=null,Lp=null;function iN(){if(Lp)return Lp;var u,d=rb,p=d.length,v,j="value"in Eo?Eo.value:Eo.textContent,O=j.length;for(u=0;u=uf),dN=" ",hN=!1;function fN(u,d){switch(u){case"keyup":return EG.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mN(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var Ju=!1;function MG(u,d){switch(u){case"compositionend":return mN(d);case"keypress":return d.which!==32?null:(hN=!0,dN);case"textInput":return u=d.data,u===dN&&hN?null:u;default:return null}}function AG(u,d){if(Ju)return u==="compositionend"||!ob&&fN(u,d)?(u=iN(),Lp=rb=Eo=null,Ju=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:p,offset:d-u};u=v}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=SN(p)}}function jN(u,d){return u&&d?u===d?!0:u&&u.nodeType===3?!1:d&&d.nodeType===3?jN(u,d.parentNode):"contains"in u?u.contains(d):u.compareDocumentPosition?!!(u.compareDocumentPosition(d)&16):!1:!1}function ON(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var d=zp(u.document);d instanceof u.HTMLIFrameElement;){try{var p=typeof d.contentWindow.location.href=="string"}catch{p=!1}if(p)u=d.contentWindow;else break;d=zp(u.document)}return d}function db(u){var d=u&&u.nodeName&&u.nodeName.toLowerCase();return d&&(d==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||d==="textarea"||u.contentEditable==="true")}var qG=El&&"documentMode"in document&&11>=document.documentMode,ed=null,hb=null,mf=null,fb=!1;function NN(u,d,p){var v=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;fb||ed==null||ed!==zp(v)||(v=ed,"selectionStart"in v&&db(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}),mf&&ff(mf,v)||(mf=v,v=_g(hb,"onSelect"),0>=q,j-=q,qa=1<<32-At(d)+j|p<Vt?(an=dt,dt=null):an=dt.sibling;var _n=Se(pe,dt,ye[Vt],Me);if(_n===null){dt===null&&(dt=an);break}u&&dt&&_n.alternate===null&&d(pe,dt),fe=O(_n,fe,Vt),En===null?bt=_n:En.sibling=_n,En=_n,dt=an}if(Vt===ye.length)return p(pe,dt),cn&&Ml(pe,Vt),bt;if(dt===null){for(;VtVt?(an=dt,dt=null):an=dt.sibling;var Ko=Se(pe,dt,_n.value,Me);if(Ko===null){dt===null&&(dt=an);break}u&&dt&&Ko.alternate===null&&d(pe,dt),fe=O(Ko,fe,Vt),En===null?bt=Ko:En.sibling=Ko,En=Ko,dt=an}if(_n.done)return p(pe,dt),cn&&Ml(pe,Vt),bt;if(dt===null){for(;!_n.done;Vt++,_n=ye.next())_n=Re(pe,_n.value,Me),_n!==null&&(fe=O(_n,fe,Vt),En===null?bt=_n:En.sibling=_n,En=_n);return cn&&Ml(pe,Vt),bt}for(dt=v(dt);!_n.done;Vt++,_n=ye.next())_n=Ne(dt,pe,Vt,_n.value,Me),_n!==null&&(u&&_n.alternate!==null&&dt.delete(_n.key===null?Vt:_n.key),fe=O(_n,fe,Vt),En===null?bt=_n:En.sibling=_n,En=_n);return u&&dt.forEach(function(aY){return d(pe,aY)}),cn&&Ml(pe,Vt),bt}function $n(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 bt=ye.key;fe!==null;){if(fe.key===bt){if(bt=ye.type,bt===w){if(fe.tag===7){p(pe,fe.sibling),Me=j(fe,ye.props.children),Me.return=pe,pe=Me;break e}}else if(fe.elementType===bt||typeof bt=="object"&&bt!==null&&bt.$$typeof===L&&Yc(bt)===fe.type){p(pe,fe.sibling),Me=j(fe,ye.props),bf(Me,ye),Me.return=pe,pe=Me;break e}p(pe,fe);break}else d(pe,fe);fe=fe.sibling}ye.type===w?(Me=Vc(ye.props.children,pe.mode,Me,ye.key),Me.return=pe,pe=Me):(Me=Wp(ye.type,ye.key,ye.props,null,pe.mode,Me),bf(Me,ye),Me.return=pe,pe=Me)}return q(pe);case y:e:{for(bt=ye.key;fe!==null;){if(fe.key===bt)if(fe.tag===4&&fe.stateNode.containerInfo===ye.containerInfo&&fe.stateNode.implementation===ye.implementation){p(pe,fe.sibling),Me=j(fe,ye.children||[]),Me.return=pe,pe=Me;break e}else{p(pe,fe);break}else d(pe,fe);fe=fe.sibling}Me=bb(ye,pe.mode,Me),Me.return=pe,pe=Me}return q(pe);case L:return ye=Yc(ye),$n(pe,fe,ye,Me)}if(H(ye))return at(pe,fe,ye,Me);if(U(ye)){if(bt=U(ye),typeof bt!="function")throw Error(r(150));return ye=bt.call(ye),kt(pe,fe,ye,Me)}if(typeof ye.then=="function")return $n(pe,fe,eg(ye),Me);if(ye.$$typeof===C)return $n(pe,fe,Yp(pe,ye),Me);tg(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=j(fe,ye),Me.return=pe,pe=Me):(p(pe,fe),Me=yb(ye,pe.mode,Me),Me.return=pe,pe=Me),q(pe)):p(pe,fe)}return function(pe,fe,ye,Me){try{yf=0;var bt=$n(pe,fe,ye,Me);return dd=null,bt}catch(dt){if(dt===ud||dt===Zp)throw dt;var En=gi(29,dt,null,pe.mode);return En.lanes=Me,En.return=pe,En}finally{}}}var Zc=XN(!0),YN=XN(!1),Do=!1;function Ab(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rb(u,d){u=u.updateQueue,d.updateQueue===u&&(d.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function zo(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function Po(u,d,p){var v=u.updateQueue;if(v===null)return null;if(v=v.shared,(An&2)!==0){var j=v.pending;return j===null?d.next=d:(d.next=j.next,j.next=d),v.pending=d,d=Up(u),RN(u,null,p),d}return Vp(u,v,d,p),Up(u)}function wf(u,d,p){if(d=d.updateQueue,d!==null&&(d=d.shared,(p&4194048)!==0)){var v=d.lanes;v&=u.pendingLanes,p|=v,d.lanes=p,Wr(u,p)}}function Db(u,d){var p=u.updateQueue,v=u.alternate;if(v!==null&&(v=v.updateQueue,p===v)){var j=null,O=null;if(p=p.firstBaseUpdate,p!==null){do{var q={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};O===null?j=O=q:O=O.next=q,p=p.next}while(p!==null);O===null?j=O=d:O=O.next=d}else j=O=d;p={baseState:v.baseState,firstBaseUpdate:j,lastBaseUpdate:O,shared:v.shared,callbacks:v.callbacks},u.updateQueue=p;return}u=p.lastBaseUpdate,u===null?p.firstBaseUpdate=d:u.next=d,p.lastBaseUpdate=d}var zb=!1;function Sf(){if(zb){var u=cd;if(u!==null)throw u}}function kf(u,d,p,v){zb=!1;var j=u.updateQueue;Do=!1;var O=j.firstBaseUpdate,q=j.lastBaseUpdate,Y=j.shared.pending;if(Y!==null){j.shared.pending=null;var ce=Y,we=ce.next;ce.next=null,q===null?O=we:q.next=we,q=ce;var Ee=u.alternate;Ee!==null&&(Ee=Ee.updateQueue,Y=Ee.lastBaseUpdate,Y!==q&&(Y===null?Ee.firstBaseUpdate=we:Y.next=we,Ee.lastBaseUpdate=ce))}if(O!==null){var Re=j.baseState;q=0,Ee=we=ce=null,Y=O;do{var Se=Y.lane&-536870913,Ne=Se!==Y.lane;if(Ne?(sn&Se)===Se:(v&Se)===Se){Se!==0&&Se===od&&(zb=!0),Ee!==null&&(Ee=Ee.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var at=u,kt=Y;Se=d;var $n=p;switch(kt.tag){case 1:if(at=kt.payload,typeof at=="function"){Re=at.call($n,Re,Se);break e}Re=at;break e;case 3:at.flags=at.flags&-65537|128;case 0:if(at=kt.payload,Se=typeof at=="function"?at.call($n,Re,Se):at,Se==null)break e;Re=m({},Re,Se);break e;case 2:Do=!0}}Se=Y.callback,Se!==null&&(u.flags|=64,Ne&&(u.flags|=8192),Ne=j.callbacks,Ne===null?j.callbacks=[Se]:Ne.push(Se))}else Ne={lane:Se,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Ee===null?(we=Ee=Ne,ce=Re):Ee=Ee.next=Ne,q|=Se;if(Y=Y.next,Y===null){if(Y=j.shared.pending,Y===null)break;Ne=Y,Y=Ne.next,Ne.next=null,j.lastBaseUpdate=Ne,j.shared.pending=null}}while(!0);Ee===null&&(ce=Re),j.baseState=ce,j.firstBaseUpdate=we,j.lastBaseUpdate=Ee,O===null&&(j.shared.lanes=0),Fo|=q,u.lanes=q,u.memoizedState=Re}}function KN(u,d){if(typeof u!="function")throw Error(r(191,u));u.call(d)}function ZN(u,d){var p=u.callbacks;if(p!==null)for(u.callbacks=null,u=0;uO?O:8;var q=B.T,Y={};B.T=Y,e2(u,!1,d,p);try{var ce=j(),we=B.S;if(we!==null&&we(Y,ce),ce!==null&&typeof ce=="object"&&typeof ce.then=="function"){var Ee=XG(ce,v);Nf(u,d,Ee,wi(u))}else Nf(u,d,v,wi(u))}catch(Re){Nf(u,d,{then:function(){},status:"rejected",reason:Re},wi())}finally{X.p=O,q!==null&&Y.types!==null&&(q.types=Y.types),B.T=q}}function tX(){}function Zb(u,d,p,v){if(u.tag!==5)throw Error(r(476));var j=_7(u).queue;E7(u,j,d,J,p===null?tX:function(){return M7(u),p(v)})}function _7(u){var d=u.memoizedState;if(d!==null)return d;d={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:J},next:null};var p={};return d.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:p},next:null},u.memoizedState=d,u=u.alternate,u!==null&&(u.memoizedState=d),d}function M7(u){var d=_7(u);d.next===null&&(d=u.alternate.memoizedState),Nf(u,d.next.queue,{},wi())}function Jb(){return fs(Qf)}function A7(){return Cr().memoizedState}function R7(){return Cr().memoizedState}function nX(u){for(var d=u.return;d!==null;){switch(d.tag){case 24:case 3:var p=wi();u=zo(p);var v=Po(d,u,p);v!==null&&(Ys(v,d,p),wf(v,d,p)),d={cache:Tb()},u.payload=d;return}d=d.return}}function rX(u,d,p){var v=wi();p={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},dg(u)?z7(d,p):(p=xb(u,d,p,v),p!==null&&(Ys(p,u,v),P7(p,d,v)))}function D7(u,d,p){var v=wi();Nf(u,d,p,v)}function Nf(u,d,p,v){var j={lane:v,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(dg(u))z7(d,j);else{var O=u.alternate;if(u.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var q=d.lastRenderedState,Y=O(q,p);if(j.hasEagerState=!0,j.eagerState=Y,pi(Y,q))return Vp(u,d,j,0),Un===null&&Hp(),!1}catch{}finally{}if(p=xb(u,d,j,v),p!==null)return Ys(p,u,v),P7(p,d,v),!0}return!1}function e2(u,d,p,v){if(v={lane:2,revertLane:A2(),gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},dg(u)){if(d)throw Error(r(479))}else d=xb(u,p,v,2),d!==null&&Ys(d,u,2)}function dg(u){var d=u.alternate;return u===$t||d!==null&&d===$t}function z7(u,d){fd=sg=!0;var p=u.pending;p===null?d.next=d:(d.next=p.next,p.next=d),u.pending=d}function P7(u,d,p){if((p&4194048)!==0){var v=d.lanes;v&=u.pendingLanes,p|=v,d.lanes=p,Wr(u,p)}}var Cf={readContext:fs,use:lg,useCallback:yr,useContext:yr,useEffect:yr,useImperativeHandle:yr,useLayoutEffect:yr,useInsertionEffect:yr,useMemo:yr,useReducer:yr,useRef:yr,useState:yr,useDebugValue:yr,useDeferredValue:yr,useTransition:yr,useSyncExternalStore:yr,useId:yr,useHostTransitionStatus:yr,useFormState:yr,useActionState:yr,useOptimistic:yr,useMemoCache:yr,useCacheRefresh:yr};Cf.useEffectEvent=yr;var L7={readContext:fs,use:lg,useCallback:function(u,d){return As().memoizedState=[u,d===void 0?null:d],u},useContext:fs,useEffect:b7,useImperativeHandle:function(u,d,p){p=p!=null?p.concat([u]):null,cg(4194308,4,j7.bind(null,d,u),p)},useLayoutEffect:function(u,d){return cg(4194308,4,u,d)},useInsertionEffect:function(u,d){cg(4,2,u,d)},useMemo:function(u,d){var p=As();d=d===void 0?null:d;var v=u();if(Jc){Rt(!0);try{u()}finally{Rt(!1)}}return p.memoizedState=[v,d],v},useReducer:function(u,d,p){var v=As();if(p!==void 0){var j=p(d);if(Jc){Rt(!0);try{p(d)}finally{Rt(!1)}}}else j=d;return v.memoizedState=v.baseState=j,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:j},v.queue=u,u=u.dispatch=rX.bind(null,$t,u),[v.memoizedState,u]},useRef:function(u){var d=As();return u={current:u},d.memoizedState=u},useState:function(u){u=Wb(u);var d=u.queue,p=D7.bind(null,$t,d);return d.dispatch=p,[u.memoizedState,p]},useDebugValue:Yb,useDeferredValue:function(u,d){var p=As();return Kb(p,u,d)},useTransition:function(){var u=Wb(!1);return u=E7.bind(null,$t,u.queue,!0,!1),As().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,d,p){var v=$t,j=As();if(cn){if(p===void 0)throw Error(r(407));p=p()}else{if(p=d(),Un===null)throw Error(r(349));(sn&127)!==0||s7(v,d,p)}j.memoizedState=p;var O={value:p,getSnapshot:d};return j.queue=O,b7(a7.bind(null,v,O,u),[u]),v.flags|=2048,pd(9,{destroy:void 0},i7.bind(null,v,O,p,d),null),p},useId:function(){var u=As(),d=Un.identifierPrefix;if(cn){var p=Fa,v=qa;p=(v&~(1<<32-At(v)-1)).toString(32)+p,d="_"+d+"R_"+p,p=ig++,0<\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof v.is=="string"?q.createElement("select",{is:v.is}):q.createElement("select"),v.multiple?O.multiple=!0:v.size&&(O.size=v.size);break;default:O=typeof v.is=="string"?q.createElement(j,{is:v.is}):q.createElement(j)}}O[Gr]=d,O[ds]=v;e:for(q=d.child;q!==null;){if(q.tag===5||q.tag===6)O.appendChild(q.stateNode);else if(q.tag!==4&&q.tag!==27&&q.child!==null){q.child.return=q,q=q.child;continue}if(q===d)break e;for(;q.sibling===null;){if(q.return===null||q.return===d)break e;q=q.return}q.sibling.return=q.return,q=q.sibling}d.stateNode=O;e:switch(ps(O,j,v),j){case"button":case"input":case"select":case"textarea":v=!!v.autoFocus;break e;case"img":v=!0;break e;default:v=!1}v&&Ll(d)}}return nr(d),m2(d,d.type,u===null?null:u.memoizedProps,d.pendingProps,p),null;case 6:if(u&&d.stateNode!=null)u.memoizedProps!==v&&Ll(d);else{if(typeof v!="string"&&d.stateNode===null)throw Error(r(166));if(u=ne.current,ad(d)){if(u=d.stateNode,p=d.memoizedProps,v=null,j=hs,j!==null)switch(j.tag){case 27:case 5:v=j.memoizedProps}u[Gr]=d,u=!!(u.nodeValue===p||v!==null&&v.suppressHydrationWarning===!0||nC(u.nodeValue,p)),u||Ao(d,!0)}else u=Mg(u).createTextNode(v),u[Gr]=d,d.stateNode=u}return nr(d),null;case 31:if(p=d.memoizedState,u===null||u.memoizedState!==null){if(v=ad(d),p!==null){if(u===null){if(!v)throw Error(r(318));if(u=d.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(557));u[Gr]=d}else Uc(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;nr(d),u=!1}else p=jb(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=p),u=!0;if(!u)return d.flags&256?(vi(d),d):(vi(d),null);if((d.flags&128)!==0)throw Error(r(558))}return nr(d),null;case 13:if(v=d.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(j=ad(d),v!==null&&v.dehydrated!==null){if(u===null){if(!j)throw Error(r(318));if(j=d.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(r(317));j[Gr]=d}else Uc(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;nr(d),j=!1}else j=jb(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=j),j=!0;if(!j)return d.flags&256?(vi(d),d):(vi(d),null)}return vi(d),(d.flags&128)!==0?(d.lanes=p,d):(p=v!==null,u=u!==null&&u.memoizedState!==null,p&&(v=d.child,j=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(j=v.alternate.memoizedState.cachePool.pool),O=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(O=v.memoizedState.cachePool.pool),O!==j&&(v.flags|=2048)),p!==u&&p&&(d.child.flags|=8192),gg(d,d.updateQueue),nr(d),null);case 4:return re(),u===null&&P2(d.stateNode.containerInfo),nr(d),null;case 10:return Rl(d.type),nr(d),null;case 19:if(W(Nr),v=d.memoizedState,v===null)return nr(d),null;if(j=(d.flags&128)!==0,O=v.rendering,O===null)if(j)Ef(v,!1);else{if(br!==0||u!==null&&(u.flags&128)!==0)for(u=d.child;u!==null;){if(O=rg(u),O!==null){for(d.flags|=128,Ef(v,!1),u=O.updateQueue,d.updateQueue=u,gg(d,u),d.subtreeFlags=0,u=p,p=d.child;p!==null;)DN(p,u),p=p.sibling;return F(Nr,Nr.current&1|2),cn&&Ml(d,v.treeForkCount),d.child}u=u.sibling}v.tail!==null&&Mt()>wg&&(d.flags|=128,j=!0,Ef(v,!1),d.lanes=4194304)}else{if(!j)if(u=rg(O),u!==null){if(d.flags|=128,j=!0,u=u.updateQueue,d.updateQueue=u,gg(d,u),Ef(v,!0),v.tail===null&&v.tailMode==="hidden"&&!O.alternate&&!cn)return nr(d),null}else 2*Mt()-v.renderingStartTime>wg&&p!==536870912&&(d.flags|=128,j=!0,Ef(v,!1),d.lanes=4194304);v.isBackwards?(O.sibling=d.child,d.child=O):(u=v.last,u!==null?u.sibling=O:d.child=O,v.last=O)}return v.tail!==null?(u=v.tail,v.rendering=u,v.tail=u.sibling,v.renderingStartTime=Mt(),u.sibling=null,p=Nr.current,F(Nr,j?p&1|2:p&1),cn&&Ml(d,v.treeForkCount),u):(nr(d),null);case 22:case 23:return vi(d),Lb(),v=d.memoizedState!==null,u!==null?u.memoizedState!==null!==v&&(d.flags|=8192):v&&(d.flags|=8192),v?(p&536870912)!==0&&(d.flags&128)===0&&(nr(d),d.subtreeFlags&6&&(d.flags|=8192)):nr(d),p=d.updateQueue,p!==null&&gg(d,p.retryQueue),p=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(p=u.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048),u!==null&&W(Xc),null;case 24:return p=null,u!==null&&(p=u.memoizedState.cache),d.memoizedState.cache!==p&&(d.flags|=2048),Rl(zr),nr(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function oX(u,d){switch(Sb(d),d.tag){case 1:return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 3:return Rl(zr),re(),u=d.flags,(u&65536)!==0&&(u&128)===0?(d.flags=u&-65537|128,d):null;case 26:case 27:case 5:return _e(d),null;case 31:if(d.memoizedState!==null){if(vi(d),d.alternate===null)throw Error(r(340));Uc()}return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 13:if(vi(d),u=d.memoizedState,u!==null&&u.dehydrated!==null){if(d.alternate===null)throw Error(r(340));Uc()}return u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 19:return W(Nr),null;case 4:return re(),null;case 10:return Rl(d.type),null;case 22:case 23:return vi(d),Lb(),u!==null&&W(Xc),u=d.flags,u&65536?(d.flags=u&-65537|128,d):null;case 24:return Rl(zr),null;case 25:return null;default:return null}}function l8(u,d){switch(Sb(d),d.tag){case 3:Rl(zr),re();break;case 26:case 27:case 5:_e(d);break;case 4:re();break;case 31:d.memoizedState!==null&&vi(d);break;case 13:vi(d);break;case 19:W(Nr);break;case 10:Rl(d.type);break;case 22:case 23:vi(d),Lb(),u!==null&&W(Xc);break;case 24:Rl(zr)}}function _f(u,d){try{var p=d.updateQueue,v=p!==null?p.lastEffect:null;if(v!==null){var j=v.next;p=j;do{if((p.tag&u)===u){v=void 0;var O=p.create,q=p.inst;v=O(),q.destroy=v}p=p.next}while(p!==j)}}catch(Y){Pn(d,d.return,Y)}}function Bo(u,d,p){try{var v=d.updateQueue,j=v!==null?v.lastEffect:null;if(j!==null){var O=j.next;v=O;do{if((v.tag&u)===u){var q=v.inst,Y=q.destroy;if(Y!==void 0){q.destroy=void 0,j=d;var ce=p,we=Y;try{we()}catch(Ee){Pn(j,ce,Ee)}}}v=v.next}while(v!==O)}}catch(Ee){Pn(d,d.return,Ee)}}function o8(u){var d=u.updateQueue;if(d!==null){var p=u.stateNode;try{ZN(d,p)}catch(v){Pn(u,u.return,v)}}}function c8(u,d,p){p.props=eu(u.type,u.memoizedProps),p.state=u.memoizedState;try{p.componentWillUnmount()}catch(v){Pn(u,d,v)}}function Mf(u,d){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(j){Pn(u,d,j)}}function $a(u,d){var p=u.ref,v=u.refCleanup;if(p!==null)if(typeof v=="function")try{v()}catch(j){Pn(u,d,j)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(j){Pn(u,d,j)}else p.current=null}function u8(u){var d=u.type,p=u.memoizedProps,v=u.stateNode;try{e:switch(d){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(j){Pn(u,u.return,j)}}function p2(u,d,p){try{var v=u.stateNode;_X(v,u.type,p,d),v[ds]=d}catch(j){Pn(u,u.return,j)}}function d8(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&Uo(u.type)||u.tag===4}function g2(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||d8(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&&Uo(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 x2(u,d,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,d?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(u,d):(d=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,d.appendChild(u),p=p._reactRootContainer,p!=null||d.onclick!==null||(d.onclick=Tl));else if(v!==4&&(v===27&&Uo(u.type)&&(p=u.stateNode,d=null),u=u.child,u!==null))for(x2(u,d,p),u=u.sibling;u!==null;)x2(u,d,p),u=u.sibling}function xg(u,d,p){var v=u.tag;if(v===5||v===6)u=u.stateNode,d?p.insertBefore(u,d):p.appendChild(u);else if(v!==4&&(v===27&&Uo(u.type)&&(p=u.stateNode),u=u.child,u!==null))for(xg(u,d,p),u=u.sibling;u!==null;)xg(u,d,p),u=u.sibling}function h8(u){var d=u.stateNode,p=u.memoizedProps;try{for(var v=u.type,j=d.attributes;j.length;)d.removeAttributeNode(j[0]);ps(d,v,p),d[Gr]=u,d[ds]=p}catch(O){Pn(u,u.return,O)}}var Il=!1,Ir=!1,v2=!1,f8=typeof WeakSet=="function"?WeakSet:Set,rs=null;function cX(u,d){if(u=u.containerInfo,B2=Ig,u=ON(u),db(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 j=v.anchorOffset,O=v.focusNode;v=v.focusOffset;try{p.nodeType,O.nodeType}catch{p=null;break e}var q=0,Y=-1,ce=-1,we=0,Ee=0,Re=u,Se=null;t:for(;;){for(var Ne;Re!==p||j!==0&&Re.nodeType!==3||(Y=q+j),Re!==O||v!==0&&Re.nodeType!==3||(ce=q+v),Re.nodeType===3&&(q+=Re.nodeValue.length),(Ne=Re.firstChild)!==null;)Se=Re,Re=Ne;for(;;){if(Re===u)break t;if(Se===p&&++we===j&&(Y=q),Se===O&&++Ee===v&&(ce=q),(Ne=Re.nextSibling)!==null)break;Re=Se,Se=Re.parentNode}Re=Ne}p=Y===-1||ce===-1?null:{start:Y,end:ce}}else p=null}p=p||{start:0,end:0}}else p=null;for(q2={focusedElem:u,selectionRange:p},Ig=!1,rs=d;rs!==null;)if(d=rs,u=d.child,(d.subtreeFlags&1028)!==0&&u!==null)u.return=d,rs=u;else for(;rs!==null;){switch(d=rs,O=d.alternate,u=d.flags,d.tag){case 0:if((u&4)!==0&&(u=d.updateQueue,u=u!==null?u.events:null,u!==null))for(p=0;p title"))),ps(O,v,p),O[Gr]=u,Dr(O),v=O;break e;case"link":var q=yC("link","href",j).get(v+(p.href||""));if(q){for(var Y=0;Y$n&&(q=$n,$n=kt,kt=q);var pe=kN(Y,kt),fe=kN(Y,$n);if(pe&&fe&&(Ne.rangeCount!==1||Ne.anchorNode!==pe.node||Ne.anchorOffset!==pe.offset||Ne.focusNode!==fe.node||Ne.focusOffset!==fe.offset)){var ye=Re.createRange();ye.setStart(pe.node,pe.offset),Ne.removeAllRanges(),kt>$n?(Ne.addRange(ye),Ne.extend(fe.node,fe.offset)):(ye.setEnd(fe.node,fe.offset),Ne.addRange(ye))}}}}for(Re=[],Ne=Y;Ne=Ne.parentNode;)Ne.nodeType===1&&Re.push({element:Ne,left:Ne.scrollLeft,top:Ne.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Yp?32:p,B.T=null,p=O2,O2=null;var O=Qo,q=Ql;if(Xr=0,bd=Qo=null,Ql=0,(An&6)!==0)throw Error(r(331));var Y=An;if(An|=4,j8(O.current),w8(O,O.current,q,p),An=Y,Lf(0,!1),qe&&typeof qe.onPostCommitFiberRoot=="function")try{qe.onPostCommitFiberRoot(Te,O)}catch{}return!0}finally{X.p=j,B.T=v,$8(u,d)}}function H8(u,d,p){d=qi(p,d),d=s2(u.stateNode,d,2),u=Po(u,d,2),u!==null&&(Et(u,2),Qa(u))}function Pn(u,d,p){if(u.tag===3)H8(u,u,p);else for(;d!==null;){if(d.tag===3){H8(d,u,p);break}else if(d.tag===1){var v=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&($o===null||!$o.has(v))){u=qi(p,u),p=V7(2),v=Po(d,p,2),v!==null&&(U7(p,v,d,u),Et(v,2),Qa(v));break}}d=d.return}}function E2(u,d,p){var v=u.pingCache;if(v===null){v=u.pingCache=new hX;var j=new Set;v.set(d,j)}else j=v.get(d),j===void 0&&(j=new Set,v.set(d,j));j.has(p)||(w2=!0,j.add(p),u=xX.bind(null,u,d,p),d.then(u,u))}function xX(u,d,p){var v=u.pingCache;v!==null&&v.delete(d),u.pingedLanes|=u.suspendedLanes&p,u.warmLanes&=~p,Un===u&&(sn&p)===p&&(br===4||br===3&&(sn&62914560)===sn&&300>Mt()-bg?(An&2)===0&&wd(u,0):S2|=p,yd===sn&&(yd=0)),Qa(u)}function V8(u,d){d===0&&(d=ge()),u=Hc(u,d),u!==null&&(Et(u,d),Qa(u))}function vX(u){var d=u.memoizedState,p=0;d!==null&&(p=d.retryLane),V8(u,p)}function yX(u,d){var p=0;switch(u.tag){case 31:case 13:var v=u.stateNode,j=u.memoizedState;j!==null&&(p=j.retryLane);break;case 19:v=u.stateNode;break;case 22:v=u.stateNode._retryCache;break;default:throw Error(r(314))}v!==null&&v.delete(d),V8(u,p)}function bX(u,d){return rt(u,d)}var Cg=null,kd=null,_2=!1,Tg=!1,M2=!1,Vo=0;function Qa(u){u!==kd&&u.next===null&&(kd===null?Cg=kd=u:kd=kd.next=u),Tg=!0,_2||(_2=!0,SX())}function Lf(u,d){if(!M2&&Tg){M2=!0;do for(var p=!1,v=Cg;v!==null;){if(u!==0){var j=v.pendingLanes;if(j===0)var O=0;else{var q=v.suspendedLanes,Y=v.pingedLanes;O=(1<<31-At(42|u)+1)-1,O&=j&~(q&~Y),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(p=!0,X8(v,O))}else O=sn,O=Vn(v,v===Un?O:0,v.cancelPendingCommit!==null||v.timeoutHandle!==-1),(O&3)===0||jr(v,O)||(p=!0,X8(v,O));v=v.next}while(p);M2=!1}}function wX(){U8()}function U8(){Tg=_2=!1;var u=0;Vo!==0&&AX()&&(u=Vo);for(var d=Mt(),p=null,v=Cg;v!==null;){var j=v.next,O=W8(v,d);O===0?(v.next=null,p===null?Cg=j:p.next=j,j===null&&(kd=p)):(p=v,(u!==0||(O&3)!==0)&&(Tg=!0)),v=j}Xr!==0&&Xr!==5||Lf(u),Vo!==0&&(Vo=0)}function W8(u,d){for(var p=u.suspendedLanes,v=u.pingedLanes,j=u.expirationTimes,O=u.pendingLanes&-62914561;0Y)break;var Ee=ce.transferSize,Re=ce.initiatorType;Ee&&rC(Re)&&(ce=ce.responseEnd,q+=Ee*(ce"u"?null:document;function pC(u,d,p){var v=jd;if(v&&typeof d=="string"&&d){var j=Ii(d);j='link[rel="'+u+'"][href="'+j+'"]',typeof p=="string"&&(j+='[crossorigin="'+p+'"]'),mC.has(j)||(mC.add(j),u={rel:u,crossOrigin:p,href:d},v.querySelector(j)===null&&(d=v.createElement("link"),ps(d,"link",u),Dr(d),v.head.appendChild(d)))}}function FX(u){Hl.D(u),pC("dns-prefetch",u,null)}function $X(u,d){Hl.C(u,d),pC("preconnect",u,d)}function QX(u,d,p){Hl.L(u,d,p);var v=jd;if(v&&u&&d){var j='link[rel="preload"][as="'+Ii(d)+'"]';d==="image"&&p&&p.imageSrcSet?(j+='[imagesrcset="'+Ii(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(j+='[imagesizes="'+Ii(p.imageSizes)+'"]')):j+='[href="'+Ii(u)+'"]';var O=j;switch(d){case"style":O=Od(u);break;case"script":O=Nd(u)}Ui.has(O)||(u=m({rel:"preload",href:d==="image"&&p&&p.imageSrcSet?void 0:u,as:d},p),Ui.set(O,u),v.querySelector(j)!==null||d==="style"&&v.querySelector(Ff(O))||d==="script"&&v.querySelector($f(O))||(d=v.createElement("link"),ps(d,"link",u),Dr(d),v.head.appendChild(d)))}}function HX(u,d){Hl.m(u,d);var p=jd;if(p&&u){var v=d&&typeof d.as=="string"?d.as:"script",j='link[rel="modulepreload"][as="'+Ii(v)+'"][href="'+Ii(u)+'"]',O=j;switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=Nd(u)}if(!Ui.has(O)&&(u=m({rel:"modulepreload",href:u},d),Ui.set(O,u),p.querySelector(j)===null)){switch(v){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector($f(O)))return}v=p.createElement("link"),ps(v,"link",u),Dr(v),p.head.appendChild(v)}}}function VX(u,d,p){Hl.S(u,d,p);var v=jd;if(v&&u){var j=To(v).hoistableStyles,O=Od(u);d=d||"default";var q=j.get(O);if(!q){var Y={loading:0,preload:null};if(q=v.querySelector(Ff(O)))Y.loading=5;else{u=m({rel:"stylesheet",href:u,"data-precedence":d},p),(p=Ui.get(O))&&W2(u,p);var ce=q=v.createElement("link");Dr(ce),ps(ce,"link",u),ce._p=new Promise(function(we,Ee){ce.onload=we,ce.onerror=Ee}),ce.addEventListener("load",function(){Y.loading|=1}),ce.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,Rg(q,d,v)}q={type:"stylesheet",instance:q,count:1,state:Y},j.set(O,q)}}}function UX(u,d){Hl.X(u,d);var p=jd;if(p&&u){var v=To(p).hoistableScripts,j=Nd(u),O=v.get(j);O||(O=p.querySelector($f(j)),O||(u=m({src:u,async:!0},d),(d=Ui.get(j))&&G2(u,d),O=p.createElement("script"),Dr(O),ps(O,"link",u),p.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},v.set(j,O))}}function WX(u,d){Hl.M(u,d);var p=jd;if(p&&u){var v=To(p).hoistableScripts,j=Nd(u),O=v.get(j);O||(O=p.querySelector($f(j)),O||(u=m({src:u,async:!0,type:"module"},d),(d=Ui.get(j))&&G2(u,d),O=p.createElement("script"),Dr(O),ps(O,"link",u),p.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},v.set(j,O))}}function gC(u,d,p,v){var j=(j=ne.current)?Ag(j):null;if(!j)throw Error(r(446));switch(u){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(d=Od(p.href),p=To(j).hoistableStyles,v=p.get(d),v||(v={type:"style",instance:null,count:0,state:null},p.set(d,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=Od(p.href);var O=To(j).hoistableStyles,q=O.get(u);if(q||(j=j.ownerDocument||j,q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(u,q),(O=j.querySelector(Ff(u)))&&!O._p&&(q.instance=O,q.state.loading=5),Ui.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},Ui.set(u,p),O||GX(j,u,p,q.state))),d&&v===null)throw Error(r(528,""));return q}if(d&&v!==null)throw Error(r(529,""));return null;case"script":return d=p.async,p=p.src,typeof p=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=Nd(p),p=To(j).hoistableScripts,v=p.get(d),v||(v={type:"script",instance:null,count:0,state:null},p.set(d,v)),v):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,u))}}function Od(u){return'href="'+Ii(u)+'"'}function Ff(u){return'link[rel="stylesheet"]['+u+"]"}function xC(u){return m({},u,{"data-precedence":u.precedence,precedence:null})}function GX(u,d,p,v){u.querySelector('link[rel="preload"][as="style"]['+d+"]")?v.loading=1:(d=u.createElement("link"),v.preload=d,d.addEventListener("load",function(){return v.loading|=1}),d.addEventListener("error",function(){return v.loading|=2}),ps(d,"link",p),Dr(d),u.head.appendChild(d))}function Nd(u){return'[src="'+Ii(u)+'"]'}function $f(u){return"script[async]"+u}function vC(u,d,p){if(d.count++,d.instance===null)switch(d.type){case"style":var v=u.querySelector('style[data-href~="'+Ii(p.href)+'"]');if(v)return d.instance=v,Dr(v),v;var j=m({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return v=(u.ownerDocument||u).createElement("style"),Dr(v),ps(v,"style",j),Rg(v,p.precedence,u),d.instance=v;case"stylesheet":j=Od(p.href);var O=u.querySelector(Ff(j));if(O)return d.state.loading|=4,d.instance=O,Dr(O),O;v=xC(p),(j=Ui.get(j))&&W2(v,j),O=(u.ownerDocument||u).createElement("link"),Dr(O);var q=O;return q._p=new Promise(function(Y,ce){q.onload=Y,q.onerror=ce}),ps(O,"link",v),d.state.loading|=4,Rg(O,p.precedence,u),d.instance=O;case"script":return O=Nd(p.src),(j=u.querySelector($f(O)))?(d.instance=j,Dr(j),j):(v=p,(j=Ui.get(O))&&(v=m({},p),G2(v,j)),u=u.ownerDocument||u,j=u.createElement("script"),Dr(j),ps(j,"link",v),u.head.appendChild(j),d.instance=j);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(v=d.instance,d.state.loading|=4,Rg(v,p.precedence,u));return d.instance}function Rg(u,d,p){for(var v=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),j=v.length?v[v.length-1]:null,O=j,q=0;q title"):null)}function XX(u,d,p){if(p===1||d.itemProp!=null)return!1;switch(u){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return u=d.disabled,typeof d.precedence=="string"&&u==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function wC(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function YX(u,d,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 j=Od(v.href),O=d.querySelector(Ff(j));if(O){d=O._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(u.count++,u=zg.bind(u),d.then(u,u)),p.state.loading|=4,p.instance=O,Dr(O);return}O=d.ownerDocument||d,v=xC(v),(j=Ui.get(j))&&W2(v,j),O=O.createElement("link"),Dr(O);var q=O;q._p=new Promise(function(Y,ce){q.onload=Y,q.onerror=ce}),ps(O,"link",v),p.instance=O}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(p,d),(d=p.state.preload)&&(p.state.loading&3)===0&&(u.count++,p=zg.bind(u),d.addEventListener("load",p),d.addEventListener("error",p))}}var X2=0;function KX(u,d){return u.stylesheets&&u.count===0&&Lg(u,u.stylesheets),0X2?50:800)+d);return u.unsuspend=p,function(){u.unsuspend=null,clearTimeout(v),clearTimeout(j)}}:null}function zg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lg(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var Pg=null;function Lg(u,d){u.stylesheets=null,u.unsuspend!==null&&(u.count++,Pg=new Map,d.forEach(ZX,u),Pg=null,zg.call(u))}function ZX(u,d){if(!(d.state.loading&4)){var p=Pg.get(u);if(p)var v=p.get(null);else{p=new Map,Pg.set(u,p);for(var j=u.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),sw.exports=sZ(),sw.exports}var aZ=iZ();function hz(t,e){return function(){return t.apply(e,arguments)}}const{toString:lZ}=Object.prototype,{getPrototypeOf:o6}=Object,{iterator:Pv,toStringTag:fz}=Symbol,Lv=(t=>e=>{const n=lZ.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),za=t=>(t=t.toLowerCase(),e=>Lv(e)===t),Iv=t=>e=>typeof e===t,{isArray:Dh}=Array,ph=Iv("undefined");function B0(t){return t!==null&&!ph(t)&&t.constructor!==null&&!ph(t.constructor)&&si(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const mz=za("ArrayBuffer");function oZ(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&mz(t.buffer),e}const cZ=Iv("string"),si=Iv("function"),pz=Iv("number"),q0=t=>t!==null&&typeof t=="object",uZ=t=>t===!0||t===!1,Kx=t=>{if(Lv(t)!=="object")return!1;const e=o6(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(fz in t)&&!(Pv in t)},dZ=t=>{if(!q0(t)||B0(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},hZ=za("Date"),fZ=za("File"),mZ=za("Blob"),pZ=za("FileList"),gZ=t=>q0(t)&&si(t.pipe),xZ=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||si(t.append)&&((e=Lv(t))==="formdata"||e==="object"&&si(t.toString)&&t.toString()==="[object FormData]"))},vZ=za("URLSearchParams"),[yZ,bZ,wZ,SZ]=["ReadableStream","Request","Response","Headers"].map(za),kZ=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function F0(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),Dh(t))for(r=0,s=t.length;r0;)if(s=n[r],e===s.toLowerCase())return s;return null}const mu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xz=t=>!ph(t)&&t!==mu;function I3(){const{caseless:t,skipUndefined:e}=xz(this)&&this||{},n={},r=(s,i)=>{const a=t&&gz(n,i)||i;Kx(n[a])&&Kx(s)?n[a]=I3(n[a],s):Kx(s)?n[a]=I3({},s):Dh(s)?n[a]=s.slice():(!e||!ph(s))&&(n[a]=s)};for(let s=0,i=arguments.length;s(F0(e,(s,i)=>{n&&si(s)?t[i]=hz(s,n):t[i]=s},{allOwnKeys:r}),t),OZ=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),NZ=(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)},CZ=(t,e,n,r)=>{let s,i,a;const o={};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))&&!o[a]&&(e[a]=t[a],o[a]=!0);t=n!==!1&&o6(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},TZ=(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},EZ=t=>{if(!t)return null;if(Dh(t))return t;let e=t.length;if(!pz(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},_Z=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&o6(Uint8Array)),MZ=(t,e)=>{const r=(t&&t[Pv]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},AZ=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},RZ=za("HTMLFormElement"),DZ=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),WC=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),zZ=za("RegExp"),vz=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};F0(n,(s,i)=>{let a;(a=e(s,i,t))!==!1&&(r[i]=a||s)}),Object.defineProperties(t,r)},PZ=t=>{vz(t,(e,n)=>{if(si(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(si(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+"'")})}})},LZ=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Dh(t)?r(t):r(String(t).split(e)),n},IZ=()=>{},BZ=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function qZ(t){return!!(t&&si(t.append)&&t[fz]==="FormData"&&t[Pv])}const FZ=t=>{const e=new Array(10),n=(r,s)=>{if(q0(r)){if(e.indexOf(r)>=0)return;if(B0(r))return r;if(!("toJSON"in r)){e[s]=r;const i=Dh(r)?[]:{};return F0(r,(a,o)=>{const c=n(a,s+1);!ph(c)&&(i[o]=c)}),e[s]=void 0,i}}return r};return n(t,0)},$Z=za("AsyncFunction"),QZ=t=>t&&(q0(t)||si(t))&&si(t.then)&&si(t.catch),yz=((t,e)=>t?setImmediate:e?((n,r)=>(mu.addEventListener("message",({source:s,data:i})=>{s===mu&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),mu.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",si(mu.postMessage)),HZ=typeof queueMicrotask<"u"?queueMicrotask.bind(mu):typeof process<"u"&&process.nextTick||yz,VZ=t=>t!=null&&si(t[Pv]),je={isArray:Dh,isArrayBuffer:mz,isBuffer:B0,isFormData:xZ,isArrayBufferView:oZ,isString:cZ,isNumber:pz,isBoolean:uZ,isObject:q0,isPlainObject:Kx,isEmptyObject:dZ,isReadableStream:yZ,isRequest:bZ,isResponse:wZ,isHeaders:SZ,isUndefined:ph,isDate:hZ,isFile:fZ,isBlob:mZ,isRegExp:zZ,isFunction:si,isStream:gZ,isURLSearchParams:vZ,isTypedArray:_Z,isFileList:pZ,forEach:F0,merge:I3,extend:jZ,trim:kZ,stripBOM:OZ,inherits:NZ,toFlatObject:CZ,kindOf:Lv,kindOfTest:za,endsWith:TZ,toArray:EZ,forEachEntry:MZ,matchAll:AZ,isHTMLForm:RZ,hasOwnProperty:WC,hasOwnProp:WC,reduceDescriptors:vz,freezeMethods:PZ,toObjectSet:LZ,toCamelCase:DZ,noop:IZ,toFiniteNumber:BZ,findKey:gz,global:mu,isContextDefined:xz,isSpecCompliantForm:qZ,toJSONObject:FZ,isAsyncFn:$Z,isThenable:QZ,setImmediate:yz,asap:HZ,isIterable:VZ};function Ht(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(Ht,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 bz=Ht.prototype,wz={};["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=>{wz[t]={value:t}});Object.defineProperties(Ht,wz);Object.defineProperty(bz,"isAxiosError",{value:!0});Ht.from=(t,e,n,r,s,i)=>{const a=Object.create(bz);je.toFlatObject(t,a,function(f){return f!==Error.prototype},h=>h!=="isAxiosError");const o=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return Ht.call(a,o,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 UZ=null;function B3(t){return je.isPlainObject(t)||je.isArray(t)}function Sz(t){return je.endsWith(t,"[]")?t.slice(0,-2):t}function GC(t,e,n){return t?t.concat(e).map(function(s,i){return s=Sz(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function WZ(t){return je.isArray(t)&&!t.some(B3)}const GZ=je.toFlatObject(je,{},null,function(e){return/^is[A-Z]/.test(e)});function Bv(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||f,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 h(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 Ht("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 f(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)&&WZ(y)||(je.isFileList(y)||je.endsWith(w,"[]"))&&(k=je.toArray(y)))return w=Sz(w),k.forEach(function(C,T){!(je.isUndefined(C)||C===null)&&e.append(a===!0?GC([w],T,i):a===null?w:w+"[]",h(C))}),!1}return B3(y)?!0:(e.append(GC(S,w,i),h(y)),!1)}const m=[],g=Object.assign(GZ,{defaultVisitor:f,convertValue:h,isVisitable:B3});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,N){(!(je.isUndefined(k)||k===null)&&s.call(e,k,je.isString(N)?N.trim():N,w,g))===!0&&x(k,w?w.concat(N):[N])}),m.pop()}}if(!je.isObject(t))throw new TypeError("data must be an object");return x(t),e}function XC(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function c6(t,e){this._pairs=[],t&&Bv(t,this,e)}const kz=c6.prototype;kz.append=function(e,n){this._pairs.push([e,n])};kz.toString=function(e){const n=e?function(r){return e.call(this,r,XC)}:XC;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function XZ(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function jz(t,e,n){if(!e)return t;const r=n&&n.encode||XZ;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 c6(e,n).toString(r),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class YC{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 Oz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},YZ=typeof URLSearchParams<"u"?URLSearchParams:c6,KZ=typeof FormData<"u"?FormData:null,ZZ=typeof Blob<"u"?Blob:null,JZ={isBrowser:!0,classes:{URLSearchParams:YZ,FormData:KZ,Blob:ZZ},protocols:["http","https","file","blob","url","data"]},u6=typeof window<"u"&&typeof document<"u",q3=typeof navigator=="object"&&navigator||void 0,eJ=u6&&(!q3||["ReactNative","NativeScript","NS"].indexOf(q3.product)<0),tJ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",nJ=u6&&window.location.href||"http://localhost",rJ=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:u6,hasStandardBrowserEnv:eJ,hasStandardBrowserWebWorkerEnv:tJ,navigator:q3,origin:nJ},Symbol.toStringTag,{value:"Module"})),Ns={...rJ,...JZ};function sJ(t,e){return Bv(t,new Ns.classes.URLSearchParams,{visitor:function(n,r,s,i){return Ns.isNode&&je.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function iJ(t){return je.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function aJ(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,!o):((!s[a]||!je.isObject(s[a]))&&(s[a]=[]),e(n,r,s[a],i)&&je.isArray(s[a])&&(s[a]=aJ(s[a])),!o)}if(je.isFormData(t)&&je.isFunction(t.entries)){const n={};return je.forEachEntry(t,(r,s)=>{e(iJ(r),s,n,0)}),n}return null}function lJ(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 $0={transitional:Oz,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(Nz(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 o;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return sJ(e,this.formSerializer).toString();if((o=je.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Bv(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),lJ(e)):e}],transformResponse:[function(e){const n=this.transitional||$0.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(o){if(a)throw o.name==="SyntaxError"?Ht.from(o,Ht.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ns.classes.FormData,Blob:Ns.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=>{$0.headers[t]={}});const oJ=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"]),cJ=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]&&oJ[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},KC=Symbol("internals");function Xf(t){return t&&String(t).trim().toLowerCase()}function Zx(t){return t===!1||t==null?t:je.isArray(t)?t.map(Zx):String(t)}function uJ(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 dJ=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function lw(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 hJ(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function fJ(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 ii=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(o,c,h){const f=Xf(c);if(!f)throw new Error("header name must be a non-empty string");const m=je.findKey(s,f);(!m||s[m]===void 0||h===!0||h===void 0&&s[m]!==!1)&&(s[m||c]=Zx(o))}const a=(o,c)=>je.forEach(o,(h,f)=>i(h,f,c));if(je.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(je.isString(e)&&(e=e.trim())&&!dJ(e))a(cJ(e),n);else if(je.isObject(e)&&je.isIterable(e)){let o={},c,h;for(const f of e){if(!je.isArray(f))throw TypeError("Object iterator must return a key-value pair");o[h=f[0]]=(c=o[h])?je.isArray(c)?[...c,f[1]]:[c,f[1]]:f[1]}a(o,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=Xf(e),e){const r=je.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return uJ(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=Xf(e),e){const r=je.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||lw(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(a){if(a=Xf(a),a){const o=je.findKey(r,a);o&&(!n||lw(r,r[o],o,n))&&(delete r[o],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||lw(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]=Zx(s),delete n[i];return}const o=e?hJ(i):String(i).trim();o!==i&&delete n[i],n[o]=Zx(s),r[o]=!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[KC]=this[KC]={accessors:{}}).accessors,s=this.prototype;function i(a){const o=Xf(a);r[o]||(fJ(s,a),r[o]=!0)}return je.isArray(e)?e.forEach(i):i(e),this}};ii.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);je.reduceDescriptors(ii.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});je.freezeMethods(ii);function ow(t,e){const n=this||$0,r=e||n,s=ii.from(r.headers);let i=r.data;return je.forEach(t,function(o){i=o.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function Cz(t){return!!(t&&t.__CANCEL__)}function zh(t,e,n){Ht.call(this,t??"canceled",Ht.ERR_CANCELED,e,n),this.name="CanceledError"}je.inherits(zh,Ht,{__CANCEL__:!0});function Tz(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Ht("Request failed with status code "+n.status,[Ht.ERR_BAD_REQUEST,Ht.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function mJ(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function pJ(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 h=Date.now(),f=r[i];a||(a=h),n[s]=c,r[s]=h;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),h-a{n=f,s=null,i&&(clearTimeout(i),i=null),t(...h)};return[(...h)=>{const f=Date.now(),m=f-n;m>=r?a(h,f):(s=h,i||(i=setTimeout(()=>{i=null,a(s)},r-m)))},()=>s&&a(s)]}const T1=(t,e,n=3)=>{let r=0;const s=pJ(50,250);return gJ(i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,c=a-r,h=s(c),f=a<=o;r=a;const m={loaded:a,total:o,progress:o?a/o:void 0,bytes:c,rate:h||void 0,estimated:h&&o&&f?(o-a)/h:void 0,event:i,lengthComputable:o!=null,[e?"download":"upload"]:!0};t(m)},n)},ZC=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},JC=t=>(...e)=>je.asap(()=>t(...e)),xJ=Ns.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Ns.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Ns.origin),Ns.navigator&&/(msie|trident)/i.test(Ns.navigator.userAgent)):()=>!0,vJ=Ns.hasStandardBrowserEnv?{write(t,e,n,r,s,i,a){if(typeof document>"u")return;const o=[`${t}=${encodeURIComponent(e)}`];je.isNumber(n)&&o.push(`expires=${new Date(n).toUTCString()}`),je.isString(r)&&o.push(`path=${r}`),je.isString(s)&&o.push(`domain=${s}`),i===!0&&o.push("secure"),je.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.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 yJ(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function bJ(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ez(t,e,n){let r=!yJ(e);return t&&(r||n==!1)?bJ(t,e):e}const e9=t=>t instanceof ii?{...t}:t;function Eu(t,e){e=e||{};const n={};function r(h,f,m,g){return je.isPlainObject(h)&&je.isPlainObject(f)?je.merge.call({caseless:g},h,f):je.isPlainObject(f)?je.merge({},f):je.isArray(f)?f.slice():f}function s(h,f,m,g){if(je.isUndefined(f)){if(!je.isUndefined(h))return r(void 0,h,m,g)}else return r(h,f,m,g)}function i(h,f){if(!je.isUndefined(f))return r(void 0,f)}function a(h,f){if(je.isUndefined(f)){if(!je.isUndefined(h))return r(void 0,h)}else return r(void 0,f)}function o(h,f,m){if(m in e)return r(h,f);if(m in t)return r(void 0,h)}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:o,headers:(h,f,m)=>s(e9(h),e9(f),m,!0)};return je.forEach(Object.keys({...t,...e}),function(f){const m=c[f]||s,g=m(t[f],e[f],f);je.isUndefined(g)&&m!==o||(n[f]=g)}),n}const _z=t=>{const e=Eu({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:a,auth:o}=e;if(e.headers=a=ii.from(a),e.url=jz(Ez(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),je.isFormData(n)){if(Ns.hasStandardBrowserEnv||Ns.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(je.isFunction(n.getHeaders)){const c=n.getHeaders(),h=["content-type","content-length"];Object.entries(c).forEach(([f,m])=>{h.includes(f.toLowerCase())&&a.set(f,m)})}}if(Ns.hasStandardBrowserEnv&&(r&&je.isFunction(r)&&(r=r(e)),r||r!==!1&&xJ(e.url))){const c=s&&i&&vJ.read(i);c&&a.set(s,c)}return e},wJ=typeof XMLHttpRequest<"u",SJ=wJ&&function(t){return new Promise(function(n,r){const s=_z(t);let i=s.data;const a=ii.from(s.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:h}=s,f,m,g,x,y;function w(){x&&x(),y&&y(),s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let S=new XMLHttpRequest;S.open(s.method.toUpperCase(),s.url,!0),S.timeout=s.timeout;function k(){if(!S)return;const C=ii.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),_={data:!o||o==="text"||o==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:C,config:t,request:S};Tz(function(M){n(M),w()},function(M){r(M),w()},_),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 Ht("Request aborted",Ht.ECONNABORTED,t,S)),S=null)},S.onerror=function(T){const _=T&&T.message?T.message:"Network Error",E=new Ht(_,Ht.ERR_NETWORK,t,S);E.event=T||null,r(E),S=null},S.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||Oz;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new Ht(T,_.clarifyTimeoutError?Ht.ETIMEDOUT:Ht.ECONNABORTED,t,S)),S=null},i===void 0&&a.setContentType(null),"setRequestHeader"in S&&je.forEach(a.toJSON(),function(T,_){S.setRequestHeader(_,T)}),je.isUndefined(s.withCredentials)||(S.withCredentials=!!s.withCredentials),o&&o!=="json"&&(S.responseType=s.responseType),h&&([g,y]=T1(h,!0),S.addEventListener("progress",g)),c&&S.upload&&([m,x]=T1(c),S.upload.addEventListener("progress",m),S.upload.addEventListener("loadend",x)),(s.cancelToken||s.signal)&&(f=C=>{S&&(r(!C||C.type?new zh(null,t,S):C),S.abort(),S=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const N=mJ(s.url);if(N&&Ns.protocols.indexOf(N)===-1){r(new Ht("Unsupported protocol "+N+":",Ht.ERR_BAD_REQUEST,t));return}S.send(i||null)})},kJ=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(h){if(!s){s=!0,o();const f=h instanceof Error?h:this.reason;r.abort(f instanceof Ht?f:new zh(f instanceof Error?f.message:f))}};let a=e&&setTimeout(()=>{a=null,i(new Ht(`timeout ${e} of ms exceeded`,Ht.ETIMEDOUT))},e);const o=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(i):h.removeEventListener("abort",i)}),t=null)};t.forEach(h=>h.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>je.asap(o),c}},jJ=function*(t,e){let n=t.byteLength;if(n{const s=OJ(t,e);let i=0,a,o=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:h,value:f}=await s.next();if(h){o(),c.close();return}let m=f.byteLength;if(n){let g=i+=m;n(g)}c.enqueue(new Uint8Array(f))}catch(h){throw o(h),h}},cancel(c){return o(c),s.return()}},{highWaterMark:2})},n9=64*1024,{isFunction:Gg}=je,CJ=(({Request:t,Response:e})=>({Request:t,Response:e}))(je.global),{ReadableStream:r9,TextEncoder:s9}=je.global,i9=(t,...e)=>{try{return!!t(...e)}catch{return!1}},TJ=t=>{t=je.merge.call({skipUndefined:!0},CJ,t);const{fetch:e,Request:n,Response:r}=t,s=e?Gg(e):typeof fetch=="function",i=Gg(n),a=Gg(r);if(!s)return!1;const o=s&&Gg(r9),c=s&&(typeof s9=="function"?(y=>w=>y.encode(w))(new s9):async y=>new Uint8Array(await new n(y).arrayBuffer())),h=i&&o&&i9(()=>{let y=!1;const w=new n(Ns.origin,{body:new r9,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return y&&!w}),f=a&&o&&i9(()=>je.isReadableStream(new r("").body)),m={stream:f&&(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 Ht(`Response type '${y}' is not supported`,Ht.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(Ns.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:N,cancelToken:C,timeout:T,onDownloadProgress:_,onUploadProgress:E,responseType:M,headers:L,withCredentials:P="same-origin",fetchOptions:I}=_z(y),Q=e||fetch;M=M?(M+"").toLowerCase():"text";let U=kJ([N,C&&C.toAbortSignal()],T),ee=null;const z=U&&U.unsubscribe&&(()=>{U.unsubscribe()});let H;try{if(E&&h&&S!=="get"&&S!=="head"&&(H=await x(L,k))!==0){let se=new n(w,{method:"POST",body:k,duplex:"half"}),W;if(je.isFormData(k)&&(W=se.headers.get("content-type"))&&L.setContentType(W),se.body){const[F,V]=ZC(H,T1(JC(E)));k=t9(se.body,n9,F,V)}}je.isString(P)||(P=P?"include":"omit");const B=i&&"credentials"in n.prototype,X={...I,signal:U,method:S.toUpperCase(),headers:L.normalize().toJSON(),body:k,duplex:"half",credentials:B?P:void 0};ee=i&&new n(w,X);let J=await(i?Q(ee,I):Q(w,X));const G=f&&(M==="stream"||M==="response");if(f&&(_||G&&z)){const se={};["status","statusText","headers"].forEach(te=>{se[te]=J[te]});const W=je.toFiniteNumber(J.headers.get("content-length")),[F,V]=_&&ZC(W,T1(JC(_),!0))||[];J=new r(t9(J.body,n9,F,()=>{V&&V(),z&&z()}),se)}M=M||"text";let R=await m[je.findKey(m,M)||"text"](J,y);return!G&&z&&z(),await new Promise((se,W)=>{Tz(se,W,{data:R,headers:ii.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 Ht("Network Error",Ht.ERR_NETWORK,y,ee),{cause:B.cause||B}):Ht.from(B,B&&B.code,y,ee)}}},EJ=new Map,Mz=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:s}=e,i=[r,s,n];let a=i.length,o=a,c,h,f=EJ;for(;o--;)c=i[o],h=f.get(c),h===void 0&&f.set(c,h=o?new Map:TJ(e)),f=h;return h};Mz();const d6={http:UZ,xhr:SJ,fetch:{get:Mz}};je.forEach(d6,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const a9=t=>`- ${t}`,_J=t=>je.isFunction(t)||t===null||t===!1;function MJ(t,e){t=je.isArray(t)?t:[t];const{length:n}=t;let r,s;const i={};for(let a=0;a`adapter ${c} `+(h===!1?"is not supported by the environment":"is not available in the build"));let o=n?a.length>1?`since : -`+a.map(a9).join(` -`):" "+a9(a[0]):"as no adapter specified";throw new Ht("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s}const Az={getAdapter:MJ,adapters:d6};function cw(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new zh(null,t)}function l9(t){return cw(t),t.headers=ii.from(t.headers),t.data=ow.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Az.getAdapter(t.adapter||$0.adapter,t)(t).then(function(r){return cw(t),r.data=ow.call(t,t.transformResponse,r),r.headers=ii.from(r.headers),r},function(r){return Cz(r)||(cw(t),r&&r.response&&(r.response.data=ow.call(t,t.transformResponse,r.response),r.response.headers=ii.from(r.response.headers))),Promise.reject(r)})}const Rz="1.13.2",qv={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{qv[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const o9={};qv.transitional=function(e,n,r){function s(i,a){return"[Axios v"+Rz+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,o)=>{if(e===!1)throw new Ht(s(a," has been removed"+(n?" in "+n:"")),Ht.ERR_DEPRECATED);return n&&!o9[a]&&(o9[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,a,o):!0}};qv.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function AJ(t,e,n){if(typeof t!="object")throw new Ht("options must be an object",Ht.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 o=t[i],c=o===void 0||a(o,i,t);if(c!==!0)throw new Ht("option "+i+" must be "+c,Ht.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ht("Unknown option "+i,Ht.ERR_BAD_OPTION)}}const Jx={assertOptions:AJ,validators:qv},Ha=Jx.validators;let ku=class{constructor(e){this.defaults=e||{},this.interceptors={request:new YC,response:new YC}}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=Eu(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Jx.assertOptions(r,{silentJSONParsing:Ha.transitional(Ha.boolean),forcedJSONParsing:Ha.transitional(Ha.boolean),clarifyTimeoutError:Ha.transitional(Ha.boolean)},!1),s!=null&&(je.isFunction(s)?n.paramsSerializer={serialize:s}:Jx.assertOptions(s,{encode:Ha.function,serialize:Ha.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Jx.assertOptions(n,{baseUrl:Ha.spelling("baseURL"),withXsrfToken:Ha.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=ii.concat(a,i);const o=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(c=c&&w.synchronous,o.unshift(w.fulfilled,w.rejected))});const h=[];this.interceptors.response.forEach(function(w){h.push(w.fulfilled,w.rejected)});let f,m=0,g;if(!c){const y=[l9.bind(this),void 0];for(y.unshift(...o),y.push(...h),g=y.length,f=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(o=>{r.subscribe(o),i=o}).then(s);return a.cancel=function(){r.unsubscribe(i)},a},e(function(i,a,o){r.reason||(r.reason=new zh(i,a,o),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 Dz(function(s){e=s}),cancel:e}}};function DJ(t){return function(n){return t.apply(null,n)}}function zJ(t){return je.isObject(t)&&t.isAxiosError===!0}const F3={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(F3).forEach(([t,e])=>{F3[e]=t});function zz(t){const e=new ku(t),n=hz(ku.prototype.request,e);return je.extend(n,ku.prototype,e,{allOwnKeys:!0}),je.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return zz(Eu(t,s))},n}const kr=zz($0);kr.Axios=ku;kr.CanceledError=zh;kr.CancelToken=RJ;kr.isCancel=Cz;kr.VERSION=Rz;kr.toFormData=Bv;kr.AxiosError=Ht;kr.Cancel=kr.CanceledError;kr.all=function(e){return Promise.all(e)};kr.spread=DJ;kr.isAxiosError=zJ;kr.mergeConfig=Eu;kr.AxiosHeaders=ii;kr.formToJSON=t=>Nz(je.isHTMLForm(t)?new FormData(t):t);kr.getAdapter=Az.getAdapter;kr.HttpStatusCode=F3;kr.default=kr;const{Axios:YTe,AxiosError:KTe,CanceledError:ZTe,isCancel:JTe,CancelToken:eEe,VERSION:tEe,all:nEe,Cancel:rEe,isAxiosError:sEe,spread:iEe,toFormData:aEe,AxiosHeaders:lEe,HttpStatusCode:oEe,formToJSON:cEe,getAdapter:uEe,mergeConfig:dEe}=kr,PJ=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r({classGroupId:t,validator:e}),Pz=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),E1="-",c9=[],IJ="arbitrary..",BJ=t=>{const e=FJ(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return qJ(a);const o=a.split(E1),c=o[0]===""&&o.length>1?1:0;return Lz(o,c,e)},getConflictingClassGroupIds:(a,o)=>{if(o){const c=r[a],h=n[a];return c?h?PJ(h,c):c:h||c9}return n[a]||c9}}},Lz=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const s=t[e],i=n.nextPart.get(s);if(i){const h=Lz(t,e+1,i);if(h)return h}const a=n.validators;if(a===null)return;const o=e===0?t.join(E1):t.slice(e).join(E1),c=a.length;for(let h=0;ht.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?IJ+r:void 0})(),FJ=t=>{const{theme:e,classGroups:n}=t;return $J(n,e)},$J=(t,e)=>{const n=Pz();for(const r in t){const s=t[r];h6(s,n,r,e)}return n},h6=(t,e,n,r)=>{const s=t.length;for(let i=0;i{if(typeof t=="string"){HJ(t,e,n);return}if(typeof t=="function"){VJ(t,e,n,r);return}UJ(t,e,n,r)},HJ=(t,e,n)=>{const r=t===""?e:Iz(e,t);r.classGroupId=n},VJ=(t,e,n,r)=>{if(WJ(t)){h6(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(LJ(n,t))},UJ=(t,e,n,r)=>{const s=Object.entries(t),i=s.length;for(let a=0;a{let n=t;const r=e.split(E1),s=r.length;for(let i=0;i"isThemeGetter"in t&&t.isThemeGetter===!0,GJ=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)}}},$3="!",u9=":",XJ=[],d9=(t,e,n,r,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),YJ=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=s=>{const i=[];let a=0,o=0,c=0,h;const f=s.length;for(let w=0;wc?h-c:void 0;return d9(i,x,g,y)};if(e){const s=e+u9,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):d9(XJ,!1,a,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},KJ=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}},ZJ=t=>({cache:GJ(t.cacheSize),parseClassName:YJ(t),sortModifiers:KJ(t),...BJ(t)}),JJ=/\s+/,eee=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=e,a=[],o=t.trim().split(JJ);let c="";for(let h=o.length-1;h>=0;h-=1){const f=o[h],{isExternal:m,modifiers:g,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:w}=n(f);if(m){c=f+(c.length>0?" "+c:c);continue}let S=!!w,k=r(S?y.substring(0,w):y);if(!k){if(!S){c=f+(c.length>0?" "+c:c);continue}if(k=r(y),!k){c=f+(c.length>0?" "+c:c);continue}S=!1}const N=g.length===0?"":g.length===1?g[0]:i(g).join(":"),C=x?N+$3:N,T=C+k;if(a.indexOf(T)>-1)continue;a.push(T);const _=s(k,S);for(let E=0;E<_.length;++E){const M=_[E];a.push(C+M)}c=f+(c.length>0?" "+c:c)}return c},tee=(...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 h=e.reduce((f,m)=>m(f),t());return n=ZJ(h),r=n.cache.get,s=n.cache.set,i=o,o(c)},o=c=>{const h=r(c);if(h)return h;const f=eee(c,n);return s(c,f),f};return i=a,(...c)=>i(tee(...c))},ree=[],Yr=t=>{const e=n=>n[t]||ree;return e.isThemeGetter=!0,e},qz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,see=/^\d+\/\d+$/,iee=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aee=/\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$/,lee=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oee=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cee=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Td=t=>see.test(t),Xt=t=>!!t&&!Number.isNaN(Number(t)),Zo=t=>!!t&&Number.isInteger(Number(t)),uw=t=>t.endsWith("%")&&Xt(t.slice(0,-1)),Vl=t=>iee.test(t),uee=()=>!0,dee=t=>aee.test(t)&&!lee.test(t),$z=()=>!1,hee=t=>oee.test(t),fee=t=>cee.test(t),mee=t=>!ot(t)&&!ct(t),pee=t=>Ph(t,Vz,$z),ot=t=>qz.test(t),ru=t=>Ph(t,Uz,dee),dw=t=>Ph(t,bee,Xt),h9=t=>Ph(t,Qz,$z),gee=t=>Ph(t,Hz,fee),Xg=t=>Ph(t,Wz,hee),ct=t=>Fz.test(t),Yf=t=>Lh(t,Uz),xee=t=>Lh(t,wee),f9=t=>Lh(t,Qz),vee=t=>Lh(t,Vz),yee=t=>Lh(t,Hz),Yg=t=>Lh(t,Wz,!0),Ph=(t,e,n)=>{const r=qz.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Lh=(t,e,n=!1)=>{const r=Fz.exec(t);return r?r[1]?e(r[1]):n:!1},Qz=t=>t==="position"||t==="percentage",Hz=t=>t==="image"||t==="url",Vz=t=>t==="length"||t==="size"||t==="bg-size",Uz=t=>t==="length",bee=t=>t==="number",wee=t=>t==="family-name",Wz=t=>t==="shadow",See=()=>{const t=Yr("color"),e=Yr("font"),n=Yr("text"),r=Yr("font-weight"),s=Yr("tracking"),i=Yr("leading"),a=Yr("breakpoint"),o=Yr("container"),c=Yr("spacing"),h=Yr("radius"),f=Yr("shadow"),m=Yr("inset-shadow"),g=Yr("text-shadow"),x=Yr("drop-shadow"),y=Yr("blur"),w=Yr("perspective"),S=Yr("aspect"),k=Yr("ease"),N=Yr("animate"),C=()=>["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"],_=()=>[...T(),ct,ot],E=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],L=()=>[ct,ot,c],P=()=>[Td,"full","auto",...L()],I=()=>[Zo,"none","subgrid",ct,ot],Q=()=>["auto",{span:["full",Zo,ct,ot]},Zo,ct,ot],U=()=>[Zo,"auto",ct,ot],ee=()=>["auto","min","max","fr",ct,ot],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...L()],X=()=>[Td,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],J=()=>[t,ct,ot],G=()=>[...T(),f9,h9,{position:[ct,ot]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],se=()=>["auto","cover","contain",vee,pee,{size:[ct,ot]}],W=()=>[uw,Yf,ru],F=()=>["","none","full",h,ct,ot],V=()=>["",Xt,Yf,ru],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=()=>[Xt,uw,f9,h9],ie=()=>["","none",y,ct,ot],re=()=>["none",Xt,ct,ot],ae=()=>["none",Xt,ct,ot],_e=()=>[Xt,ct,ot],Ue=()=>[Td,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vl],breakpoint:[Vl],color:[uee],container:[Vl],"drop-shadow":[Vl],ease:["in","out","in-out"],font:[mee],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vl],shadow:[Vl],spacing:["px",Xt],text:[Vl],"text-shadow":[Vl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Td,ot,ct,S]}],container:["container"],columns:[{columns:[Xt,ot,ct,o]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:_()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],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:[Zo,"auto",ct,ot]}],basis:[{basis:[Td,"full","auto",o,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xt,Td,"auto","initial","none",ot]}],grow:[{grow:["",Xt,ct,ot]}],shrink:[{shrink:["",Xt,ct,ot]}],order:[{order:[Zo,"first","last","none",ct,ot]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:Q()}],"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:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],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: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":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"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,Yf,ru]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ct,dw]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",uw,ot]}],"font-family":[{font:[xee,ot,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,ct,ot]}],"line-clamp":[{"line-clamp":[Xt,"none",ct,dw]}],leading:[{leading:[i,...L()]}],"list-image":[{"list-image":["none",ct,ot]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ct,ot]}],"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:[Xt,"from-font","auto",ct,ru]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[Xt,"auto",ct,ot]}],"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",ct,ot]}],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",ct,ot]}],"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:se()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zo,ct,ot],radial:["",ct,ot],conic:[Zo,ct,ot]},yee,gee]}],"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:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"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":[Xt,ct,ot]}],"outline-w":[{outline:["",Xt,Yf,ru]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",f,Yg,Xg]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",m,Yg,Xg]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[Xt,ru]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",g,Yg,Xg]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[Xt,ct,ot]}],"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":[Xt]}],"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":[ct,ot]}],"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":[Xt]}],"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:se()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ct,ot]}],filter:[{filter:["","none",ct,ot]}],blur:[{blur:ie()}],brightness:[{brightness:[Xt,ct,ot]}],contrast:[{contrast:[Xt,ct,ot]}],"drop-shadow":[{"drop-shadow":["","none",x,Yg,Xg]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",Xt,ct,ot]}],"hue-rotate":[{"hue-rotate":[Xt,ct,ot]}],invert:[{invert:["",Xt,ct,ot]}],saturate:[{saturate:[Xt,ct,ot]}],sepia:[{sepia:["",Xt,ct,ot]}],"backdrop-filter":[{"backdrop-filter":["","none",ct,ot]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Xt,ct,ot]}],"backdrop-contrast":[{"backdrop-contrast":[Xt,ct,ot]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xt,ct,ot]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xt,ct,ot]}],"backdrop-invert":[{"backdrop-invert":["",Xt,ct,ot]}],"backdrop-opacity":[{"backdrop-opacity":[Xt,ct,ot]}],"backdrop-saturate":[{"backdrop-saturate":[Xt,ct,ot]}],"backdrop-sepia":[{"backdrop-sepia":["",Xt,ct,ot]}],"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",ct,ot]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xt,"initial",ct,ot]}],ease:[{ease:["linear","initial",k,ct,ot]}],delay:[{delay:[Xt,ct,ot]}],animate:[{animate:["none",N,ct,ot]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ct,ot]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[ct,ot,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ue()}],"translate-x":[{"translate-x":Ue()}],"translate-y":[{"translate-y":Ue()}],"translate-z":[{"translate-z":Ue()}],"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",ct,ot]}],"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",ct,ot]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[Xt,Yf,ru,dw]}],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"]}},kee=nee(See);function ve(...t){return kee(OD(t))}const Dt=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ve("rounded-xl border bg-card text-card-foreground shadow",t),...e}));Dt.displayName="Card";const kn=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ve("flex flex-col space-y-1.5 p-6",t),...e}));kn.displayName="CardHeader";const jn=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ve("font-semibold leading-none tracking-tight",t),...e}));jn.displayName="CardTitle";const Fr=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ve("text-sm text-muted-foreground",t),...e}));Fr.displayName="CardDescription";const Dn=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ve("p-6 pt-0",t),...e}));Dn.displayName="CardContent";const Gz=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ve("flex items-center p-6 pt-0",t),...e}));Gz.displayName="CardFooter";var hw="rovingFocusGroup.onEntryFocus",jee={bubbles:!1,cancelable:!0},Q0="RovingFocusGroup",[Q3,Xz,Oee]=Cv(Q0),[Nee,Fv]=ha(Q0,[Oee]),[Cee,Tee]=Nee(Q0),Yz=b.forwardRef((t,e)=>l.jsx(Q3.Provider,{scope:t.__scopeRovingFocusGroup,children:l.jsx(Q3.Slot,{scope:t.__scopeRovingFocusGroup,children:l.jsx(Eee,{...t,ref:e})})}));Yz.displayName=Q0;var Eee=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:h,preventScrollOnEntryFocus:f=!1,...m}=t,g=b.useRef(null),x=Bn(e,g),y=D0(i),[w,S]=wo({prop:a,defaultProp:o??null,onChange:c,caller:Q0}),[k,N]=b.useState(!1),C=Os(h),T=Xz(n),_=b.useRef(!1),[E,M]=b.useState(0);return b.useEffect(()=>{const L=g.current;if(L)return L.addEventListener(hw,C),()=>L.removeEventListener(hw,C)},[C]),l.jsx(Cee,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:w,onItemFocus:b.useCallback(L=>S(L),[S]),onItemShiftTab:b.useCallback(()=>N(!0),[]),onFocusableItemAdd:b.useCallback(()=>M(L=>L+1),[]),onFocusableItemRemove:b.useCallback(()=>M(L=>L-1),[]),children:l.jsx(on.div,{tabIndex:k||E===0?-1:0,"data-orientation":r,...m,ref:x,style:{outline:"none",...t.style},onMouseDown:tt(t.onMouseDown,()=>{_.current=!0}),onFocus:tt(t.onFocus,L=>{const P=!_.current;if(L.target===L.currentTarget&&P&&!k){const I=new CustomEvent(hw,jee);if(L.currentTarget.dispatchEvent(I),!I.defaultPrevented){const Q=T().filter(B=>B.focusable),U=Q.find(B=>B.active),ee=Q.find(B=>B.id===w),H=[U,ee,...Q].filter(Boolean).map(B=>B.ref.current);Jz(H,f)}}_.current=!1}),onBlur:tt(t.onBlur,()=>N(!1))})})}),Kz="RovingFocusGroupItem",Zz=b.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...o}=t,c=_i(),h=i||c,f=Tee(Kz,n),m=f.currentTabStopId===h,g=Xz(n),{onFocusableItemAdd:x,onFocusableItemRemove:y,currentTabStopId:w}=f;return b.useEffect(()=>{if(r)return x(),()=>y()},[r,x,y]),l.jsx(Q3.ItemSlot,{scope:n,id:h,focusable:r,active:s,children:l.jsx(on.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...o,ref:e,onMouseDown:tt(t.onMouseDown,S=>{r?f.onItemFocus(h):S.preventDefault()}),onFocus:tt(t.onFocus,()=>f.onItemFocus(h)),onKeyDown:tt(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){f.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const k=Aee(S,f.orientation,f.dir);if(k!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let C=g().filter(T=>T.focusable).map(T=>T.ref.current);if(k==="last")C.reverse();else if(k==="prev"||k==="next"){k==="prev"&&C.reverse();const T=C.indexOf(S.currentTarget);C=f.loop?Ree(C,T+1):C.slice(T+1)}setTimeout(()=>Jz(C))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:w!=null}):a})})});Zz.displayName=Kz;var _ee={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Mee(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Aee(t,e,n){const r=Mee(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _ee[r]}function Jz(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Ree(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var eP=Yz,tP=Zz,$v="Tabs",[Dee]=ha($v,[Fv]),nP=Fv(),[zee,f6]=Dee($v),rP=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:o,activationMode:c="automatic",...h}=t,f=D0(o),[m,g]=wo({prop:r,onChange:s,defaultProp:i??"",caller:$v});return l.jsx(zee,{scope:n,baseId:_i(),value:m,onValueChange:g,orientation:a,dir:f,activationMode:c,children:l.jsx(on.div,{dir:f,"data-orientation":a,...h,ref:e})})});rP.displayName=$v;var sP="TabsList",iP=b.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=f6(sP,n),a=nP(n);return l.jsx(eP,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:l.jsx(on.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});iP.displayName=sP;var aP="TabsTrigger",lP=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=f6(aP,n),o=nP(n),c=uP(a.baseId,r),h=dP(a.baseId,r),f=r===a.value;return l.jsx(tP,{asChild:!0,...o,focusable:!s,active:f,children:l.jsx(on.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":h,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:tt(t.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?a.onValueChange(r):m.preventDefault()}),onKeyDown:tt(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&a.onValueChange(r)}),onFocus:tt(t.onFocus,()=>{const m=a.activationMode!=="manual";!f&&!s&&m&&a.onValueChange(r)})})})});lP.displayName=aP;var oP="TabsContent",cP=b.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,o=f6(oP,n),c=uP(o.baseId,r),h=dP(o.baseId,r),f=r===o.value,m=b.useRef(f);return b.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),l.jsx(Fs,{present:s||f,children:({present:g})=>l.jsx(on.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!g,id:h,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:m.current?"0s":void 0},children:g&&i})})});cP.displayName=oP;function uP(t,e){return`${t}-trigger-${e}`}function dP(t,e){return`${t}-content-${e}`}var Pee=rP,hP=iP,fP=lP,mP=cP;const sa=Pee,Mi=b.forwardRef(({className:t,...e},n)=>l.jsx(hP,{ref:n,className:ve("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...e}));Mi.displayName=hP.displayName;const zt=b.forwardRef(({className:t,...e},n)=>l.jsx(fP,{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}));zt.displayName=fP.displayName;const tn=b.forwardRef(({className:t,...e},n)=>l.jsx(mP,{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}));tn.displayName=mP.displayName;function Lee(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var m6="ScrollArea",[pP]=ha(m6),[Iee,fa]=pP(m6),gP=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=t,[o,c]=b.useState(null),[h,f]=b.useState(null),[m,g]=b.useState(null),[x,y]=b.useState(null),[w,S]=b.useState(null),[k,N]=b.useState(0),[C,T]=b.useState(0),[_,E]=b.useState(!1),[M,L]=b.useState(!1),P=Bn(e,Q=>c(Q)),I=D0(s);return l.jsx(Iee,{scope:n,type:r,dir:I,scrollHideDelay:i,scrollArea:o,viewport:h,onViewportChange:f,content:m,onContentChange:g,scrollbarX:x,onScrollbarXChange:y,scrollbarXEnabled:_,onScrollbarXEnabledChange:E,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:M,onScrollbarYEnabledChange:L,onCornerWidthChange:N,onCornerHeightChange:T,children:l.jsx(on.div,{dir:I,...a,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":C+"px",...t.style}})})});gP.displayName=m6;var xP="ScrollAreaViewport",vP=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=fa(xP,n),o=b.useRef(null),c=Bn(e,o,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.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}),l.jsx(on.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:l.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});vP.displayName=xP;var ml="ScrollAreaScrollbar",p6=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=fa(ml,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,o=t.orientation==="horizontal";return b.useEffect(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),s.type==="hover"?l.jsx(Bee,{...r,ref:e,forceMount:n}):s.type==="scroll"?l.jsx(qee,{...r,ref:e,forceMount:n}):s.type==="auto"?l.jsx(yP,{...r,ref:e,forceMount:n}):s.type==="always"?l.jsx(g6,{...r,ref:e}):null});p6.displayName=ml;var Bee=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=fa(ml,t.__scopeScrollArea),[i,a]=b.useState(!1);return b.useEffect(()=>{const o=s.scrollArea;let c=0;if(o){const h=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return o.addEventListener("pointerenter",h),o.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",h),o.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),l.jsx(Fs,{present:n||i,children:l.jsx(yP,{"data-state":i?"visible":"hidden",...r,ref:e})})}),qee=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=fa(ml,t.__scopeScrollArea),i=t.orientation==="horizontal",a=Hv(()=>c("SCROLL_END"),100),[o,c]=Lee("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(o==="idle"){const h=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(h)}},[o,s.scrollHideDelay,c]),b.useEffect(()=>{const h=s.viewport,f=i?"scrollLeft":"scrollTop";if(h){let m=h[f];const g=()=>{const x=h[f];m!==x&&(c("SCROLL"),a()),m=x};return h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[s.viewport,i,c,a]),l.jsx(Fs,{present:n||o!=="hidden",children:l.jsx(g6,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:tt(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:tt(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),yP=b.forwardRef((t,e)=>{const n=fa(ml,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=b.useState(!1),o=t.orientation==="horizontal",c=Hv(()=>{if(n.viewport){const h=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,s=fa(ml,t.__scopeScrollArea),i=b.useRef(null),a=b.useRef(0),[o,c]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=jP(o.viewport,o.content),f={...r,sizes:o,onSizesChange:c,hasThumb:h>0&&h<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:g=>a.current=g};function m(g,x){return Uee(g,a.current,o,x)}return n==="horizontal"?l.jsx(Fee,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollLeft,x=m9(g,o,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"?l.jsx($ee,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const g=s.viewport.scrollTop,x=m9(g,o);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}),Fee=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=fa(ml,t.__scopeScrollArea),[a,o]=b.useState(),c=b.useRef(null),h=Bn(e,c,i.onScrollbarXChange);return b.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx(wP,{"data-orientation":"horizontal",...s,ref:h,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":Qv(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,m)=>{if(i.viewport){const g=i.viewport.scrollLeft+f.deltaX;t.onWheelScroll(g),NP(g,m)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:M1(a.paddingLeft),paddingEnd:M1(a.paddingRight)}})}})}),$ee=b.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=fa(ml,t.__scopeScrollArea),[a,o]=b.useState(),c=b.useRef(null),h=Bn(e,c,i.onScrollbarYChange);return b.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx(wP,{"data-orientation":"vertical",...s,ref:h,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":Qv(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,m)=>{if(i.viewport){const g=i.viewport.scrollTop+f.deltaY;t.onWheelScroll(g),NP(g,m)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:M1(a.paddingTop),paddingEnd:M1(a.paddingBottom)}})}})}),[Qee,bP]=pP(ml),wP=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:h,onWheelScroll:f,onResize:m,...g}=t,x=fa(ml,n),[y,w]=b.useState(null),S=Bn(e,P=>w(P)),k=b.useRef(null),N=b.useRef(""),C=x.viewport,T=r.content-r.viewport,_=Os(f),E=Os(c),M=Hv(m,10);function L(P){if(k.current){const I=P.clientX-k.current.left,Q=P.clientY-k.current.top;h({x:I,y:Q})}}return b.useEffect(()=>{const P=I=>{const Q=I.target;y?.contains(Q)&&_(I,T)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[C,y,T,_]),b.useEffect(E,[r,E]),gh(y,M),gh(x.content,M),l.jsx(Qee,{scope:n,scrollbar:y,hasThumb:s,onThumbChange:Os(i),onThumbPointerUp:Os(a),onThumbPositionChange:E,onThumbPointerDown:Os(o),children:l.jsx(on.div,{...g,ref:S,style:{position:"absolute",...g.style},onPointerDown:tt(t.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),k.current=y.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),L(P))}),onPointerMove:tt(t.onPointerMove,L),onPointerUp:tt(t.onPointerUp,P=>{const I=P.target;I.hasPointerCapture(P.pointerId)&&I.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=N.current,x.viewport&&(x.viewport.style.scrollBehavior=""),k.current=null})})})}),_1="ScrollAreaThumb",SP=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=bP(_1,t.__scopeScrollArea);return l.jsx(Fs,{present:n||s.hasThumb,children:l.jsx(Hee,{ref:e,...r})})}),Hee=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=fa(_1,n),a=bP(_1,n),{onThumbPositionChange:o}=a,c=Bn(e,m=>a.onThumbChange(m)),h=b.useRef(void 0),f=Hv(()=>{h.current&&(h.current(),h.current=void 0)},100);return b.useEffect(()=>{const m=i.viewport;if(m){const g=()=>{if(f(),!h.current){const x=Wee(m,o);h.current=x,o()}};return o(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,f,o]),l.jsx(on.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:tt(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:tt(t.onPointerUp,a.onThumbPointerUp)})});SP.displayName=_1;var x6="ScrollAreaCorner",kP=b.forwardRef((t,e)=>{const n=fa(x6,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(Vee,{...t,ref:e}):null});kP.displayName=x6;var Vee=b.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=fa(x6,n),[i,a]=b.useState(0),[o,c]=b.useState(0),h=!!(i&&o);return gh(s.scrollbarX,()=>{const f=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(f),c(f)}),gh(s.scrollbarY,()=>{const f=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(f),a(f)}),h?l.jsx(on.div,{...r,ref:e,style:{width:i,height:o,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function M1(t){return t?parseInt(t,10):0}function jP(t,e){const n=t/e;return isNaN(n)?0:n}function Qv(t){const e=jP(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function Uee(t,e,n,r="ltr"){const s=Qv(n),i=s/2,a=e||i,o=s-a,c=n.scrollbar.paddingStart+a,h=n.scrollbar.size-n.scrollbar.paddingEnd-o,f=n.content-n.viewport,m=r==="ltr"?[0,f]:[f*-1,0];return OP([c,h],m)(t)}function m9(t,e,n="ltr"){const r=Qv(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,a=e.content-e.viewport,o=i-r,c=n==="ltr"?[0,a]:[a*-1,0],h=Yk(t,c);return OP([0,a],[0,o])(h)}function OP(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 NP(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,o=n.top!==i.top;(a||o)&&e(),n=i,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Hv(t,e){const n=Os(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=Os(e);Xk(()=>{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 CP=gP,Gee=vP,Xee=kP;const hn=b.forwardRef(({className:t,children:e,viewportRef:n,...r},s)=>l.jsxs(CP,{ref:s,className:ve("relative overflow-hidden",t),...r,children:[l.jsx(Gee,{ref:n,className:"h-full w-full rounded-[inherit]",children:e}),l.jsx(H3,{}),l.jsx(H3,{orientation:"horizontal"}),l.jsx(Xee,{})]}));hn.displayName=CP.displayName;const H3=b.forwardRef(({className:t,orientation:e="vertical",...n},r)=>l.jsx(p6,{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:l.jsx(SP,{className:"relative flex-1 rounded-full bg-border"})}));H3.displayName=p6.displayName;function p9({className:t,...e}){return l.jsx("div",{className:ve("animate-pulse rounded-md bg-primary/10",t),...e})}function Yee(t,e=[]){let n=[];function r(i,a){const o=b.createContext(a);o.displayName=i+"Context";const c=n.length;n=[...n,a];const h=m=>{const{scope:g,children:x,...y}=m,w=g?.[t]?.[c]||o,S=b.useMemo(()=>y,Object.values(y));return l.jsx(w.Provider,{value:S,children:x})};h.displayName=i+"Provider";function f(m,g){const x=g?.[t]?.[c]||o,y=b.useContext(x);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[h,f]}const s=()=>{const i=n.map(a=>b.createContext(a));return function(o){const c=o?.[t]||i;return b.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,Kee(s,...e)]}function Kee(...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((o,{useScope:c,scopeName:h})=>{const m=c(i)[`__scope${h}`];return{...o,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var Zee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],TP=Zee.reduce((t,e)=>{const n=Kk(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...o}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),v6="Progress",y6=100,[Jee]=Yee(v6),[ete,tte]=Jee(v6),EP=b.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=nte,...a}=t;(s||s===0)&&!g9(s)&&console.error(rte(`${s}`,"Progress"));const o=g9(s)?s:y6;r!==null&&!x9(r,o)&&console.error(ste(`${r}`,"Progress"));const c=x9(r,o)?r:null,h=A1(c)?i(c,o):void 0;return l.jsx(ete,{scope:n,value:c,max:o,children:l.jsx(TP.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":A1(c)?c:void 0,"aria-valuetext":h,role:"progressbar","data-state":AP(c,o),"data-value":c??void 0,"data-max":o,...a,ref:e})})});EP.displayName=v6;var _P="ProgressIndicator",MP=b.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=tte(_P,n);return l.jsx(TP.div,{"data-state":AP(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});MP.displayName=_P;function nte(t,e){return`${Math.round(t/e*100)}%`}function AP(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function A1(t){return typeof t=="number"}function g9(t){return A1(t)&&!isNaN(t)&&t>0}function x9(t,e){return A1(t)&&!isNaN(t)&&t<=e&&t>=0}function rte(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${y6}\`.`}function ste(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 ${y6} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var RP=EP,ite=MP;const H0=b.forwardRef(({className:t,value:e,...n},r)=>l.jsx(RP,{ref:r,className:ve("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...n,children:l.jsx(ite,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));H0.displayName=RP.displayName;const ate={light:"",dark:".dark"},DP=b.createContext(null);function zP(){const t=b.useContext(DP);if(!t)throw new Error("useChart must be used within a ");return t}const Id=b.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const a=b.useId(),o=`chart-${t||a.replace(/:/g,"")}`;return l.jsx(DP.Provider,{value:{config:r},children:l.jsxs("div",{"data-chart":o,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:[l.jsx(lte,{id:o,config:r}),l.jsx(gY,{children:n})]})})});Id.displayName="Chart";const lte=({id:t,config:e})=>{const n=Object.entries(e).filter(([,r])=>r.theme||r.color);return n.length?l.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(ate).map(([r,s])=>` -${s} [data-chart=${t}] { -${n.map(([i,a])=>{const o=a.theme?.[r]||a.color;return o?` --color-${i}: ${o};`:null}).join(` -`)} -} -`).join(` -`)}}):null},Kf=xY,Bd=b.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:a,labelFormatter:o,labelClassName:c,formatter:h,color:f,nameKey:m,labelKey:g},x)=>{const{config:y}=zP(),w=b.useMemo(()=>{if(s||!e?.length)return null;const[k]=e,N=`${g||k?.dataKey||k?.name||"value"}`,C=V3(y,k,N),T=!g&&typeof a=="string"?y[a]?.label||a:C?.label;return o?l.jsx("div",{className:ve("font-medium",c),children:o(T,e)}):T?l.jsx("div",{className:ve("font-medium",c),children:T}):null},[a,o,e,s,c,y,g]);if(!t||!e?.length)return null;const S=e.length===1&&r!=="dot";return l.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,l.jsx("div",{className:"grid gap-1.5",children:e.filter(k=>k.type!=="none").map((k,N)=>{const C=`${m||k.name||k.dataKey||"value"}`,T=V3(y,k,C),_=f||k.payload.fill||k.color;return l.jsx("div",{className:ve("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:h&&k?.value!==void 0&&k.name?h(k.value,k.name,k,N,k.payload):l.jsxs(l.Fragment,{children:[T?.icon?l.jsx(T.icon,{}):!i&&l.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":_,"--color-border":_}}),l.jsxs("div",{className:ve("flex flex-1 justify-between leading-none",S?"items-end":"items-center"),children:[l.jsxs("div",{className:"grid gap-1.5",children:[S?w:null,l.jsx("span",{className:"text-muted-foreground",children:T?.label||k.name})]}),k.value&&l.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:k.value.toLocaleString()})]})]})},k.dataKey)})})]})});Bd.displayName="ChartTooltip";const ote=vY,PP=b.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=zP();return n?.length?l.jsx("div",{ref:i,className:ve("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.filter(o=>o.type!=="none").map(o=>{const c=`${s||o.dataKey||"value"}`,h=V3(a,o,c);return l.jsxs("div",{className:ve("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[h?.icon&&!e?l.jsx(h.icon,{}):l.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:o.color}}),h?.label]},o.value)})}):null});PP.displayName="ChartLegend";function V3(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 v9=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,y9=OD,Ih=(t,e)=>n=>{var r;if(e?.variants==null)return y9(t,n?.class,n?.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(h=>{const f=n?.[h],m=i?.[h];if(f===null)return null;const g=v9(f)||v9(m);return s[h][g]}),o=n&&Object.entries(n).reduce((h,f)=>{let[m,g]=f;return g===void 0||(h[m]=g),h},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((h,f)=>{let{class:m,className:g,...x}=f;return Object.entries(x).every(y=>{let[w,S]=y;return Array.isArray(S)?S.includes({...i,...o}[w]):{...i,...o}[w]===S})?[...h,m,g]:h},[]);return y9(t,a,c,n?.class,n?.className)},Hm=Ih("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?pK:"button";return l.jsx(a,{className:ve(Hm({variant:e,size:n,className:t})),ref:i,...s})});de.displayName="Button";function cte(){const[t,e]=b.useState(null),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,o]=b.useState(24),[c,h]=b.useState(!0),[f,m]=b.useState(null),[g,x]=b.useState(!0),y=b.useCallback(async()=>{try{x(!0);const P=await kr.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"),I=await kr.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${P}`}});e(I.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),I=setTimeout(()=>i(30),800),Q=setTimeout(()=>i(45),2e3),U=setTimeout(()=>i(60),4e3),ee=setTimeout(()=>i(75),6500),z=setTimeout(()=>i(85),9e3),H=setTimeout(()=>i(92),11e3);return()=>{clearTimeout(P),clearTimeout(I),clearTimeout(Q),clearTimeout(U),clearTimeout(ee),clearTimeout(z),clearTimeout(H)}},[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 l.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:l.jsxs("div",{className:"text-center space-y-6 w-full max-w-md px-4",children:[l.jsx(Ls,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-lg font-medium",children:"加载统计数据中..."}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"正在获取麦麦运行数据"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(H0,{value:s,className:"h-2"}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[s,"%"]})]})]})});const{summary:S,model_stats:k,hourly_data:N,daily_data:C,recent_activity:T}=t,_=P=>{const I=Math.floor(P/3600),Q=Math.floor(P%3600/60);return`${I}小时${Q}分钟`},E=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}))`})),L={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return l.jsx(hn,{className:"h-full",children:l.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(sa,{value:a.toString(),onValueChange:P=>o(Number(P)),children:l.jsxs(Mi,{className:"grid grid-cols-3 w-full sm:w-auto",children:[l.jsx(zt,{value:"24",children:"24小时"}),l.jsx(zt,{value:"168",children:"7天"}),l.jsx(zt,{value:"720",children:"30天"})]})}),l.jsxs(de,{variant:c?"default":"outline",size:"sm",onClick:()=>h(!c),className:"gap-2",children:[l.jsx(Ls,{className:`h-4 w-4 ${c?"animate-spin":""}`}),l.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),l.jsx(de,{variant:"outline",size:"sm",onClick:w,children:l.jsx(Ls,{className:"h-4 w-4"})})]})]}),l.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"总请求数"}),l.jsx(TK,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(Dn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:S.total_requests.toLocaleString()}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"总花费"}),l.jsx(EK,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(Dn,{children:[l.jsxs("div",{className:"text-2xl font-bold",children:["¥",S.total_cost.toFixed(2)]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.cost_per_hour>0?`¥${S.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"Token消耗"}),l.jsx(A3,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(Dn,{children:[l.jsxs("div",{className:"text-2xl font-bold",children:[(S.total_tokens/1e3).toFixed(1),"K"]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:S.tokens_per_hour>0?`${(S.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"平均响应"}),l.jsx(R3,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(Dn,{children:[l.jsxs("div",{className:"text-2xl font-bold",children:[S.avg_response_time.toFixed(2),"s"]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),l.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"在线时长"}),l.jsx(Zd,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsx(Dn,{children:l.jsx("div",{className:"text-xl font-bold",children:_(S.online_time)})})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"消息处理"}),l.jsx(z0,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(Dn,{children:[l.jsx("div",{className:"text-xl font-bold",children:S.total_messages.toLocaleString()}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",S.total_replies.toLocaleString()," 条"]})]})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"成本效率"}),l.jsx(_K,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(Dn,{children:[l.jsx("div",{className:"text-xl font-bold",children:S.total_messages>0?`¥${(S.total_cost/S.total_messages*100).toFixed(2)}`:"¥0.00"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),l.jsxs(sa,{defaultValue:"trends",className:"space-y-4",children:[l.jsxs(Mi,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[l.jsx(zt,{value:"trends",children:"趋势"}),l.jsx(zt,{value:"models",children:"模型"}),l.jsx(zt,{value:"activity",children:"活动"}),l.jsx(zt,{value:"daily",children:"日统计"})]}),l.jsxs(tn,{value:"trends",className:"space-y-4",children:[l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"请求趋势"}),l.jsxs(Fr,{children:["最近",a,"小时的请求量变化"]})]}),l.jsx(Dn,{children:l.jsx(Id,{config:L,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:l.jsxs(yY,{data:N,children:[l.jsx(Vg,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),l.jsx(Ug,{dataKey:"timestamp",tickFormatter:P=>E(P),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),l.jsx(Wf,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),l.jsx(Kf,{content:l.jsx(Bd,{labelFormatter:P=>E(P)})}),l.jsx(bY,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),l.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"花费趋势"}),l.jsx(Fr,{children:"API调用成本变化"})]}),l.jsx(Dn,{children:l.jsx(Id,{config:L,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:l.jsxs(nw,{data:N,children:[l.jsx(Vg,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),l.jsx(Ug,{dataKey:"timestamp",tickFormatter:P=>E(P),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),l.jsx(Wf,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),l.jsx(Kf,{content:l.jsx(Bd,{labelFormatter:P=>E(P)})}),l.jsx(Wg,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"Token消耗"}),l.jsx(Fr,{children:"Token使用量变化"})]}),l.jsx(Dn,{children:l.jsx(Id,{config:L,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:l.jsxs(nw,{data:N,children:[l.jsx(Vg,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),l.jsx(Ug,{dataKey:"timestamp",tickFormatter:P=>E(P),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),l.jsx(Wf,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),l.jsx(Kf,{content:l.jsx(Bd,{labelFormatter:P=>E(P)})}),l.jsx(Wg,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),l.jsx(tn,{value:"models",className:"space-y-4",children:l.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"模型请求分布"}),l.jsx(Fr,{children:"各模型使用占比"})]}),l.jsx(Dn,{children:l.jsx(Id,{config:Object.fromEntries(k.slice(0,6).map((P,I)=>[P.model_name,{label:P.model_name,color:`hsl(var(--chart-${I%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:l.jsxs(wY,{children:[l.jsx(Kf,{content:l.jsx(Bd,{})}),l.jsx(SY,{data:M,cx:"50%",cy:"50%",labelLine:!1,label:({name:P,percent:I})=>`${P} ${I?(I*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:M.map((P,I)=>l.jsx(kY,{fill:P.fill},`cell-${I}`))})]})})})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"模型详细统计"}),l.jsx(Fr,{children:"请求数、花费和性能"})]}),l.jsx(Dn,{children:l.jsx(hn,{className:"h-[300px] sm:h-[400px]",children:l.jsx("div",{className:"space-y-3",children:k.map((P,I)=>l.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:P.model_name}),l.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${I%5+1}))`}})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),l.jsx("span",{className:"ml-1 font-medium",children:P.request_count.toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"花费:"}),l.jsxs("span",{className:"ml-1 font-medium",children:["¥",P.total_cost.toFixed(2)]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),l.jsxs("span",{className:"ml-1 font-medium",children:[(P.total_tokens/1e3).toFixed(1),"K"]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),l.jsxs("span",{className:"ml-1 font-medium",children:[P.avg_response_time.toFixed(2),"s"]})]})]})]},I))})})})]})]})}),l.jsx(tn,{value:"activity",children:l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"最近活动"}),l.jsx(Fr,{children:"最新的API调用记录"})]}),l.jsx(Dn,{children:l.jsx(hn,{className:"h-[400px] sm:h-[500px]",children:l.jsx("div",{className:"space-y-2",children:T.map((P,I)=>l.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"font-medium text-sm truncate",children:P.model}),l.jsx("div",{className:"text-xs text-muted-foreground",children:P.request_type})]}),l.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:E(P.timestamp)})]}),l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),l.jsx("span",{className:"ml-1",children:P.tokens})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"花费:"}),l.jsxs("span",{className:"ml-1",children:["¥",P.cost.toFixed(4)]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),l.jsxs("span",{className:"ml-1",children:[P.time_cost.toFixed(2),"s"]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"状态:"}),l.jsx("span",{className:`ml-1 ${P.status==="success"?"text-green-600":"text-red-600"}`,children:P.status})]})]})]},I))})})})]})}),l.jsx(tn,{value:"daily",children:l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"每日统计"}),l.jsx(Fr,{children:"最近7天的数据汇总"})]}),l.jsx(Dn,{children:l.jsx(Id,{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:l.jsxs(nw,{data:C,children:[l.jsx(Vg,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),l.jsx(Ug,{dataKey:"timestamp",tickFormatter:P=>{const I=new Date(P);return`${I.getMonth()+1}/${I.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),l.jsx(Wf,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),l.jsx(Wf,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),l.jsx(Kf,{content:l.jsx(Bd,{labelFormatter:P=>new Date(P).toLocaleDateString("zh-CN")})}),l.jsx(ote,{content:l.jsx(PP,{})}),l.jsx(Wg,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),l.jsx(Wg,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]}),l.jsxs(Dt,{className:"border-2 border-primary/20",children:[l.jsx(kn,{className:"pb-3",children:l.jsx(jn,{className:"text-lg",children:"每日一言"})}),l.jsx(Dn,{children:g?l.jsxs("div",{className:"space-y-2",children:[l.jsx(p9,{className:"h-6 w-3/4"}),l.jsx(p9,{className:"h-4 w-1/4"})]}):f?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"text-lg font-medium leading-relaxed italic",children:['"',f.hitokoto,'"']}),l.jsxs("p",{className:"text-sm text-muted-foreground text-right",children:["—— ",f.from]})]}):null})]})]})})}const ute={theme:"system",setTheme:()=>null},LP=b.createContext(ute),b6=()=>{const t=b.useContext(LP);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t},dte=(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)"})})},IP=b.createContext(void 0),BP=()=>{const t=b.useContext(IP);if(t===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return t};var Vv="Switch",[hte]=ha(Vv),[fte,mte]=hte(Vv),qP=b.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:c="on",onCheckedChange:h,form:f,...m}=t,[g,x]=b.useState(null),y=Bn(e,C=>x(C)),w=b.useRef(!1),S=g?f||!!g.closest("form"):!0,[k,N]=wo({prop:s,defaultProp:i??!1,onChange:h,caller:Vv});return l.jsxs(fte,{scope:n,checked:k,disabled:o,children:[l.jsx(on.button,{type:"button",role:"switch","aria-checked":k,"aria-required":a,"data-state":HP(k),"data-disabled":o?"":void 0,disabled:o,value:c,...m,ref:y,onClick:tt(t.onClick,C=>{N(T=>!T),S&&(w.current=C.isPropagationStopped(),w.current||C.stopPropagation())})}),S&&l.jsx(QP,{control:g,bubbles:!w.current,name:r,value:c,checked:k,required:a,disabled:o,form:f,style:{transform:"translateX(-100%)"}})]})});qP.displayName=Vv;var FP="SwitchThumb",$P=b.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=mte(FP,n);return l.jsx(on.span,{"data-state":HP(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});$P.displayName=FP;var pte="SwitchBubbleInput",QP=b.forwardRef(({__scopeSwitch:t,control:e,checked:n,bubbles:r=!0,...s},i)=>{const a=b.useRef(null),o=Bn(a,i),c=BD(n),h=qD(e);return b.useEffect(()=>{const f=a.current;if(!f)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(f,n),f.dispatchEvent(y)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:o,style:{...s.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});QP.displayName=pte;function HP(t){return t?"checked":"unchecked"}var VP=qP,gte=$P;const Pt=b.forwardRef(({className:t,...e},n)=>l.jsx(VP,{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:l.jsx(gte,{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")})}));Pt.displayName=VP.displayName;const xte=Ih("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ue=b.forwardRef(({className:t,...e},n)=>l.jsx(FD,{ref:n,className:ve(xte(),t),...e}));ue.displayName=FD.displayName;const Pe=b.forwardRef(({className:t,type:e,...n},r)=>l.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}));Pe.displayName="Input";const vte=5,yte=5e3;let fw=0;function bte(){return fw=(fw+1)%Number.MAX_SAFE_INTEGER,fw.toString()}const mw=new Map,b9=t=>{if(mw.has(t))return;const e=setTimeout(()=>{mw.delete(t),Nm({type:"REMOVE_TOAST",toastId:t})},yte);mw.set(t,e)},wte=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,vte)};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?b9(n):t.toasts.forEach(r=>{b9(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)}}},e1=[];let t1={toasts:[]};function Nm(t){t1=wte(t1,t),e1.forEach(e=>{e(t1)})}function Ste({...t}){const e=bte(),n=s=>Nm({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>Nm({type:"DISMISS_TOAST",toastId:e});return Nm({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function ts(){const[t,e]=b.useState(t1);return b.useEffect(()=>(e1.push(e),()=>{const n=e1.indexOf(e);n>-1&&e1.splice(n,1)}),[t]),{...t,toast:Ste,dismiss:n=>Nm({type:"DISMISS_TOAST",toastId:n})}}const kte=[{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 jte(t){const e=kte.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 w6="0.11.5",S6="MaiBot Dashboard",Ote=`${S6} v${w6}`,Nte=(t="v")=>`${t}${w6}`,xr=t6,Bh=$D,Cte=Zk,k6=_v,UP=b.forwardRef(({className:t,...e},n)=>l.jsx(Tv,{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}));UP.displayName=Tv.displayName;const lr=b.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(Cte,{children:[l.jsx(UP,{}),l.jsxs(Ev,{ref:r,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,l.jsxs(_v,{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:[l.jsx(P0,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));lr.displayName=Ev.displayName;const or=({className:t,...e})=>l.jsx("div",{className:ve("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});or.displayName="DialogHeader";const as=({className:t,...e})=>l.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});as.displayName="DialogFooter";const cr=b.forwardRef(({className:t,...e},n)=>l.jsx(Jk,{ref:n,className:ve("text-lg font-semibold leading-none tracking-tight",t),...e}));cr.displayName=Jk.displayName;const Hr=b.forwardRef(({className:t,...e},n)=>l.jsx(e6,{ref:n,className:ve("text-sm text-muted-foreground",t),...e}));Hr.displayName=e6.displayName;var Tte=Symbol("radix.slottable");function Ete(t){const e=({children:n})=>l.jsx(l.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=Tte,e}var WP="AlertDialog",[_te]=ha(WP,[QD]),So=QD(),GP=t=>{const{__scopeAlertDialog:e,...n}=t,r=So(e);return l.jsx(t6,{...r,...n,modal:!0})};GP.displayName=WP;var Mte="AlertDialogTrigger",XP=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=So(n);return l.jsx($D,{...s,...r,ref:e})});XP.displayName=Mte;var Ate="AlertDialogPortal",YP=t=>{const{__scopeAlertDialog:e,...n}=t,r=So(e);return l.jsx(Zk,{...r,...n})};YP.displayName=Ate;var Rte="AlertDialogOverlay",KP=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=So(n);return l.jsx(Tv,{...s,...r,ref:e})});KP.displayName=Rte;var eh="AlertDialogContent",[Dte,zte]=_te(eh),Pte=Ete("AlertDialogContent"),ZP=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=So(n),a=b.useRef(null),o=Bn(e,a),c=b.useRef(null);return l.jsx(gK,{contentName:eh,titleName:JP,docsSlug:"alert-dialog",children:l.jsx(Dte,{scope:n,cancelRef:c,children:l.jsxs(Ev,{role:"alertdialog",...i,...s,ref:o,onOpenAutoFocus:tt(s.onOpenAutoFocus,h=>{h.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[l.jsx(Pte,{children:r}),l.jsx(Ite,{contentRef:a})]})})})});ZP.displayName=eh;var JP="AlertDialogTitle",eL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=So(n);return l.jsx(Jk,{...s,...r,ref:e})});eL.displayName=JP;var tL="AlertDialogDescription",nL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=So(n);return l.jsx(e6,{...s,...r,ref:e})});nL.displayName=tL;var Lte="AlertDialogAction",rL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=So(n);return l.jsx(_v,{...s,...r,ref:e})});rL.displayName=Lte;var sL="AlertDialogCancel",iL=b.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=zte(sL,n),i=So(n),a=Bn(e,s);return l.jsx(_v,{...i,...r,ref:a})});iL.displayName=sL;var Ite=({contentRef:t})=>{const e=`\`${eh}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${eh}\` by passing a \`${tL}\` 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 \`${eh}\`. 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},Bte=GP,qte=XP,Fte=YP,aL=KP,lL=ZP,oL=rL,cL=iL,uL=eL,dL=nL;const Nn=Bte,Qr=qte,$te=Fte,hL=b.forwardRef(({className:t,...e},n)=>l.jsx(aL,{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}));hL.displayName=aL.displayName;const gn=b.forwardRef(({className:t,...e},n)=>l.jsxs($te,{children:[l.jsx(hL,{}),l.jsx(lL,{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})]}));gn.displayName=lL.displayName;const xn=({className:t,...e})=>l.jsx("div",{className:ve("flex flex-col space-y-2 text-center sm:text-left",t),...e});xn.displayName="AlertDialogHeader";const vn=({className:t,...e})=>l.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});vn.displayName="AlertDialogFooter";const yn=b.forwardRef(({className:t,...e},n)=>l.jsx(uL,{ref:n,className:ve("text-lg font-semibold",t),...e}));yn.displayName=uL.displayName;const bn=b.forwardRef(({className:t,...e},n)=>l.jsx(dL,{ref:n,className:ve("text-sm text-muted-foreground",t),...e}));bn.displayName=dL.displayName;const wn=b.forwardRef(({className:t,...e},n)=>l.jsx(oL,{ref:n,className:ve(Hm(),t),...e}));wn.displayName=oL.displayName;const Sn=b.forwardRef(({className:t,...e},n)=>l.jsx(cL,{ref:n,className:ve(Hm({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));Sn.displayName=cL.displayName;function Qte(){return l.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[l.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),l.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),l.jsxs(sa,{defaultValue:"appearance",className:"w-full",children:[l.jsxs(Mi,{className:"grid w-full grid-cols-2 sm:grid-cols-4 gap-0.5 sm:gap-1 h-auto p-1",children:[l.jsxs(zt,{value:"appearance",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[l.jsx(sz,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),l.jsx("span",{children:"外观"})]}),l.jsxs(zt,{value:"security",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[l.jsx(MK,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),l.jsx("span",{children:"安全"})]}),l.jsxs(zt,{value:"other",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[l.jsx(bu,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),l.jsx("span",{children:"其他"})]}),l.jsxs(zt,{value:"about",className:"gap-1 sm:gap-2 text-xs sm:text-sm px-2 sm:px-3 py-2",children:[l.jsx(ra,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4",strokeWidth:2,fill:"none"}),l.jsx("span",{children:"关于"})]})]}),l.jsxs(hn,{className:"h-[calc(100vh-240px)] sm:h-[calc(100vh-280px)] mt-4 sm:mt-6",children:[l.jsx(tn,{value:"appearance",className:"mt-0",children:l.jsx(Hte,{})}),l.jsx(tn,{value:"security",className:"mt-0",children:l.jsx(Vte,{})}),l.jsx(tn,{value:"other",className:"mt-0",children:l.jsx(Ute,{})}),l.jsx(tn,{value:"about",className:"mt-0",children:l.jsx(Wte,{})})]})]})]})}function w9(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,o=parseInt(i.substring(2,4),16)/255,c=parseInt(i.substring(4,6),16)/255,h=Math.max(a,o,c),f=Math.min(a,o,c);let m=0,g=0;const x=(h+f)/2;if(h!==f){const y=h-f;switch(g=x>.5?y/(2-h-f):y/(h+f),h){case a:m=((o-c)/y+(olocalStorage.getItem("accent-color")||"blue");b.useEffect(()=>{const h=localStorage.getItem("accent-color")||"blue";w9(h)},[]);const c=h=>{o(h),localStorage.setItem("accent-color",h),w9(h)};return l.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题模式"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4",children:[l.jsx(pw,{value:"light",current:t,onChange:e,label:"浅色",description:"始终使用浅色主题"}),l.jsx(pw,{value:"dark",current:t,onChange:e,label:"深色",description:"始终使用深色主题"}),l.jsx(pw,{value:"system",current:t,onChange:e,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"主题色"}),l.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"单色"}),l.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[l.jsx(Wi,{value:"blue",current:a,onChange:c,label:"蓝色",colorClass:"bg-blue-500"}),l.jsx(Wi,{value:"purple",current:a,onChange:c,label:"紫色",colorClass:"bg-purple-500"}),l.jsx(Wi,{value:"green",current:a,onChange:c,label:"绿色",colorClass:"bg-green-500"}),l.jsx(Wi,{value:"orange",current:a,onChange:c,label:"橙色",colorClass:"bg-orange-500"}),l.jsx(Wi,{value:"pink",current:a,onChange:c,label:"粉色",colorClass:"bg-pink-500"}),l.jsx(Wi,{value:"red",current:a,onChange:c,label:"红色",colorClass:"bg-red-500"})]})]}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"渐变色"}),l.jsxs("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 sm:gap-3",children:[l.jsx(Wi,{value:"gradient-sunset",current:a,onChange:c,label:"日落",colorClass:"bg-gradient-to-r from-orange-500 to-pink-500"}),l.jsx(Wi,{value:"gradient-ocean",current:a,onChange:c,label:"海洋",colorClass:"bg-gradient-to-r from-blue-500 to-cyan-500"}),l.jsx(Wi,{value:"gradient-forest",current:a,onChange:c,label:"森林",colorClass:"bg-gradient-to-r from-green-500 to-emerald-500"}),l.jsx(Wi,{value:"gradient-aurora",current:a,onChange:c,label:"极光",colorClass:"bg-gradient-to-r from-purple-500 to-pink-500"}),l.jsx(Wi,{value:"gradient-fire",current:a,onChange:c,label:"烈焰",colorClass:"bg-gradient-to-r from-red-500 to-orange-500"}),l.jsx(Wi,{value:"gradient-twilight",current:a,onChange:c,label:"暮光",colorClass:"bg-gradient-to-r from-indigo-500 to-purple-500"})]})]}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-xs sm:text-sm font-medium mb-2 sm:mb-3",children:"自定义颜色"}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[l.jsx("div",{className:"flex-1",children:l.jsx("input",{type:"color",value:a.startsWith("#")?a:"#3b82f6",onChange:h=>c(h.target.value),className:"h-10 sm:h-12 w-full rounded-lg border-2 border-border cursor-pointer",title:"选择自定义颜色"})}),l.jsx("div",{className:"flex-1",children:l.jsx(Pe,{type:"text",value:a,onChange:h=>c(h.target.value),placeholder:"#3b82f6",className:"font-mono text-sm"})})]}),l.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground mt-2",children:"点击色块选择颜色,或手动输入 HEX 颜色代码"})]})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"动画效果"}),l.jsxs("div",{className:"space-y-2 sm:space-y-3",children:[l.jsx("div",{className:"rounded-lg border bg-card p-3 sm:p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5 flex-1",children:[l.jsx(ue,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),l.jsx(Pt,{id:"animations",checked:n,onCheckedChange:r})]})}),l.jsx("div",{className:"rounded-lg border bg-card p-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5 flex-1",children:[l.jsx(ue,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),l.jsx(Pt,{id:"waves-background",checked:s,onCheckedChange:i})]})})]})]})]})}function Vte(){const t=Da(),[e,n]=b.useState(""),[r,s]=b.useState(""),[i,a]=b.useState(!1),[o,c]=b.useState(!1),[h,f]=b.useState(!1),[m,g]=b.useState(!1),[x,y]=b.useState(!1),[w,S]=b.useState(!1),[k,N]=b.useState(""),[C,T]=b.useState(!1),{toast:_}=ts(),E=b.useMemo(()=>jte(r),[r]),M=()=>localStorage.getItem("access-token")||"",L=async z=>{try{await navigator.clipboard.writeText(z),y(!0),_({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>y(!1),2e3)}catch{_({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},P=async()=>{if(!r.trim()){_({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!E.isValid){const z=E.rules.filter(H=>!H.passed).map(H=>H.label).join(", ");_({title:"格式错误",description:`Token 不符合要求: ${z}`,variant:"destructive"});return}f(!0);try{const z=M(),H=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 H.json();H.ok&&B.success?(localStorage.setItem("access-token",r.trim()),s(""),e&&n(r.trim()),_({title:"更新成功",description:"Access Token 已更新,即将跳转到登录页"}),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},1500)):_({title:"更新失败",description:B.message||"无法更新 Token",variant:"destructive"})}catch(z){console.error("更新 Token 错误:",z),_({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{f(!1)}},I=async()=>{g(!0);try{const z=M(),H=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${z}`}}),B=await H.json();H.ok&&B.success?(localStorage.setItem("access-token",B.token),n(B.token),N(B.token),S(!0),T(!1),_({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):_({title:"生成失败",description:B.message||"无法生成新 Token",variant:"destructive"})}catch(z){console.error("生成 Token 错误:",z),_({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{g(!1)}},Q=async()=>{try{await navigator.clipboard.writeText(k),T(!0),_({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{_({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},U=()=>{S(!1),setTimeout(()=>{N(""),T(!1)},300),setTimeout(()=>{localStorage.removeItem("access-token"),t({to:"/auth"})},500)},ee=z=>{z||U()};return l.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[l.jsx(xr,{open:w,onOpenChange:ee,children:l.jsxs(lr,{className:"sm:max-w-md",children:[l.jsxs(or,{children:[l.jsxs(cr,{className:"flex items-center gap-2",children:[l.jsx(Oa,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),l.jsx(Hr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将跳转到登录页面。"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[l.jsx(ue,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),l.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:k})]}),l.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Oa,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),l.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[l.jsx("p",{className:"font-semibold",children:"重要提示"}),l.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[l.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),l.jsx("li",{children:"请立即复制并保存到安全的位置"}),l.jsx("li",{children:"关闭窗口后将自动跳转到登录页面"}),l.jsx("li",{children:"请使用新 Token 重新登录系统"})]})]})]})})]}),l.jsxs(as,{className:"gap-2 sm:gap-0",children:[l.jsx(de,{variant:"outline",onClick:Q,className:"gap-2",children:C?l.jsxs(l.Fragment,{children:[l.jsx(ol,{className:"h-4 w-4 text-green-500"}),"已复制"]}):l.jsxs(l.Fragment,{children:[l.jsx(O1,{className:"h-4 w-4"}),"复制 Token"]})}),l.jsx(de,{onClick:U,children:"我已保存,关闭"})]})]})}),l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"当前 Access Token"}),l.jsx("div",{className:"space-y-3 sm:space-y-4",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"current-token",className:"text-sm",children:"您的访问令牌"}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(Pe,{id:"current-token",type:i?"text":"password",value:e||M(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),l.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?l.jsx(N1,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(oa,{className:"h-4 w-4 text-muted-foreground"})})]}),l.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[l.jsx(de,{variant:"outline",size:"icon",onClick:()=>L(M()),title:"复制到剪贴板",className:"flex-shrink-0",children:x?l.jsx(ol,{className:"h-4 w-4 text-green-500"}):l.jsx(O1,{className:"h-4 w-4"})}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsxs(de,{variant:"outline",disabled:m,className:"gap-2 flex-1 sm:flex-none",children:[l.jsx(Ls,{className:ve("h-4 w-4",m&&"animate-spin")}),l.jsx("span",{className:"hidden sm:inline",children:"重新生成"}),l.jsx("span",{className:"sm:hidden",children:"生成"})]})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认重新生成 Token"}),l.jsx(bn,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:I,children:"确认生成"})]})]})]})]})]}),l.jsx("p",{className:"text-[10px] sm:text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"自定义 Access Token"}),l.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"new-token",className:"text-sm",children:"新的访问令牌"}),l.jsxs("div",{className:"relative",children:[l.jsx(Pe,{id:"new-token",type:o?"text":"password",value:r,onChange:z=>s(z.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),l.jsx("button",{onClick:()=>c(!o),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:o?"隐藏":"显示",children:o?l.jsx(N1,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(oa,{className:"h-4 w-4 text-muted-foreground"})})]}),r&&l.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),l.jsx("div",{className:"space-y-1.5",children:E.rules.map(z=>l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[z.passed?l.jsx(xc,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):l.jsx(AK,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),l.jsx("span",{className:ve(z.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:z.label})]},z.id))}),E.isValid&&l.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:l.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[l.jsx(ol,{className:"h-4 w-4"}),l.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),l.jsx(de,{onClick:P,disabled:h||!E.isValid||!r,className:"w-full sm:w-auto",children:h?"更新中...":"更新自定义 Token"})]})]}),l.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:[l.jsx("h4",{className:"text-sm sm:text-base font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),l.jsxs("ul",{className:"text-xs sm:text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[l.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),l.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),l.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),l.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),l.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),l.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function Ute(){const t=Da(),{toast:e}=ts(),[n,r]=b.useState(!1),[s,i]=b.useState(!1);if(s)throw new Error("这是一个手动触发的测试错误,用于验证错误边界组件是否正常工作。");const a=async()=>{r(!0);try{const o=localStorage.getItem("access-token"),c=await fetch("/api/webui/setup/reset",{method:"POST",headers:{Authorization:`Bearer ${o}`}}),h=await c.json();c.ok&&h.success?(e({title:"重置成功",description:"即将进入初次配置向导"}),setTimeout(()=>{t({to:"/setup"})},1e3)):e({title:"重置失败",description:h.message||"无法重置配置状态",variant:"destructive"})}catch(o){console.error("重置配置状态错误:",o),e({title:"重置失败",description:"连接服务器失败",variant:"destructive"})}finally{r(!1)}};return l.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"配置向导"}),l.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[l.jsx("div",{className:"space-y-2",children:l.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"重新进行初次配置向导,可以帮助您重新设置系统的基础配置。"})}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsxs(de,{variant:"outline",disabled:n,className:"gap-2",children:[l.jsx(RK,{className:ve("h-4 w-4",n&&"animate-spin")}),"重新进行初次配置"]})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认重新配置"}),l.jsx(bn,{children:"这将带您重新进入初次配置向导。您可以重新设置系统的基础配置项。确定要继续吗?"})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:a,children:"确认重置"})]})]})]})]})]}),l.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/50 bg-yellow-500/5 p-4 sm:p-6",children:[l.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4 flex items-center gap-2",children:[l.jsx(Oa,{className:"h-5 w-5 text-yellow-500"}),"开发者工具"]}),l.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[l.jsx("div",{className:"space-y-2",children:l.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"以下功能仅供开发调试使用,可能会导致页面崩溃或异常。"})}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsxs(de,{variant:"destructive",className:"gap-2",children:[l.jsx(Oa,{className:"h-4 w-4"}),"触发测试错误"]})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认触发错误"}),l.jsx(bn,{children:"这将手动触发一个 React 错误,用于测试错误边界组件的显示效果。 页面将显示错误界面,您可以通过刷新页面或点击返回首页来恢复。"})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>i(!0),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认触发"})]})]})]})]})]})]})}function Wte(){return l.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[l.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:l.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[l.jsx("div",{className:"flex-shrink-0 rounded-lg bg-primary/10 p-2 sm:p-3",children:l.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:l.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"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground mb-2",children:"开源项目"}),l.jsx("p",{className:"text-sm sm:text-base text-muted-foreground mb-3",children:"本项目在 GitHub 开源,欢迎 Star ⭐ 支持!"}),l.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:[l.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:l.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",l.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})]})]})]})}),l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[l.jsxs("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:["关于 ",S6]}),l.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-muted-foreground",children:[l.jsxs("p",{children:["版本: ",w6]}),l.jsx("p",{children:"麦麦(MaiBot)的现代化 Web 管理界面"})]})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"作者"}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium",children:"MaiBot 核心"}),l.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Mai-with-u"})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium",children:"WebUI"}),l.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground",children:["Mai-with-u ",l.jsx("a",{href:"https://github.com/DrSmoothl",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"@MotricSeven"})]})]})]})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"技术栈"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs sm:text-sm text-muted-foreground",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("p",{className:"font-medium text-foreground",children:"前端框架"}),l.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[l.jsx("li",{children:"React 19.2.0"}),l.jsx("li",{children:"TypeScript 5.7.2"}),l.jsx("li",{children:"Vite 6.0.7"}),l.jsx("li",{children:"TanStack Router 1.94.2"})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("p",{className:"font-medium text-foreground",children:"UI 组件"}),l.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[l.jsx("li",{children:"shadcn/ui"}),l.jsx("li",{children:"Radix UI"}),l.jsx("li",{children:"Tailwind CSS 3.4.17"}),l.jsx("li",{children:"Lucide Icons"})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("p",{className:"font-medium text-foreground",children:"后端"}),l.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[l.jsx("li",{children:"Python 3.12+"}),l.jsx("li",{children:"FastAPI"}),l.jsx("li",{children:"Uvicorn"}),l.jsx("li",{children:"WebSocket"})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("p",{className:"font-medium text-foreground",children:"构建工具"}),l.jsxs("ul",{className:"space-y-0.5 list-disc list-inside",children:[l.jsx("li",{children:"Bun / npm"}),l.jsx("li",{children:"ESLint 9.17.0"}),l.jsx("li",{children:"PostCSS"})]})]})]})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源库感谢"}),l.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mb-3",children:"本项目使用了以下优秀的开源库,感谢他们的贡献:"}),l.jsx(hn,{className:"h-[300px] sm:h-[400px]",children:l.jsxs("div",{className:"space-y-4 pr-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"UI 框架与组件"}),l.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[l.jsx(hr,{name:"React",description:"用户界面构建库",license:"MIT"}),l.jsx(hr,{name:"shadcn/ui",description:"优雅的 React 组件库",license:"MIT"}),l.jsx(hr,{name:"Radix UI",description:"无样式的可访问组件库",license:"MIT"}),l.jsx(hr,{name:"Tailwind CSS",description:"实用优先的 CSS 框架",license:"MIT"}),l.jsx(hr,{name:"Lucide React",description:"精美的图标库",license:"ISC"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"路由与状态管理"}),l.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[l.jsx(hr,{name:"TanStack Router",description:"类型安全的路由库",license:"MIT"}),l.jsx(hr,{name:"Zustand",description:"轻量级状态管理",license:"MIT"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"表单处理"}),l.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[l.jsx(hr,{name:"React Hook Form",description:"高性能表单库",license:"MIT"}),l.jsx(hr,{name:"Zod",description:"TypeScript 优先的 schema 验证",license:"MIT"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"工具库"}),l.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[l.jsx(hr,{name:"clsx",description:"条件 className 构建工具",license:"MIT"}),l.jsx(hr,{name:"tailwind-merge",description:"Tailwind 类名合并工具",license:"MIT"}),l.jsx(hr,{name:"class-variance-authority",description:"组件变体管理",license:"Apache-2.0"}),l.jsx(hr,{name:"date-fns",description:"现代化日期处理库",license:"MIT"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"动画效果"}),l.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[l.jsx(hr,{name:"Framer Motion",description:"React 动画库",license:"MIT"}),l.jsx(hr,{name:"vaul",description:"抽屉组件动画",license:"MIT"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"后端框架"}),l.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[l.jsx(hr,{name:"FastAPI",description:"现代化 Python Web 框架",license:"MIT"}),l.jsx(hr,{name:"Uvicorn",description:"ASGI 服务器",license:"BSD-3-Clause"}),l.jsx(hr,{name:"Pydantic",description:"数据验证库",license:"MIT"}),l.jsx(hr,{name:"python-multipart",description:"文件上传支持",license:"Apache-2.0"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:"开发工具"}),l.jsxs("div",{className:"grid gap-2 text-xs sm:text-sm",children:[l.jsx(hr,{name:"TypeScript",description:"JavaScript 的超集",license:"Apache-2.0"}),l.jsx(hr,{name:"Vite",description:"下一代前端构建工具",license:"MIT"}),l.jsx(hr,{name:"ESLint",description:"JavaScript 代码检查工具",license:"MIT"}),l.jsx(hr,{name:"PostCSS",description:"CSS 转换工具",license:"MIT"})]})]})]})})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6",children:[l.jsx("h3",{className:"text-base sm:text-lg font-semibold mb-3 sm:mb-4",children:"开源许可"}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"rounded-lg bg-primary/5 border border-primary/20 p-3 sm:p-4",children:l.jsxs("div",{className:"flex items-start gap-2 sm:gap-3",children:[l.jsx("div",{className:"flex-shrink-0 mt-0.5",children:l.jsx("div",{className:"rounded-md bg-primary/10 px-2 py-1",children:l.jsx("span",{className:"text-xs sm:text-sm font-bold text-primary",children:"GPLv3"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm sm:text-base font-semibold text-foreground mb-1",children:"MaiBot WebUI"}),l.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目采用 GNU General Public License v3.0 开源许可证。 您可以自由地使用、修改和分发本软件,但必须保持相同的开源许可。"})]})]})}),l.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"本项目依赖的所有开源库均遵循各自的开源许可证(MIT、Apache-2.0、BSD 等)。 感谢所有开源贡献者的无私奉献。"})]})]})]})}function hr({name:t,description:e,license:n}){return l.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-lg border bg-muted/30 p-2.5 sm:p-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"font-medium text-foreground truncate",children:t}),l.jsx("p",{className:"text-muted-foreground text-xs mt-0.5",children:e})]}),l.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 pw({value:t,current:e,onChange:n,label:r,description:s}){const i=e===t;return l.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&&l.jsx("div",{className:"absolute top-2 right-2 sm:top-3 sm:right-3 h-2 w-2 rounded-full bg-primary"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"text-sm sm:text-base font-medium",children:r}),l.jsx("div",{className:"text-[10px] sm:text-xs text-muted-foreground",children:s})]}),l.jsxs("div",{className:"mt-2 sm:mt-3 flex gap-1",children:[t==="light"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),l.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),l.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),t==="dark"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),l.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),l.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),t==="system"&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),l.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),l.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function Wi({value:t,current:e,onChange:n,label:r,colorClass:s}){const i=e===t;return l.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&&l.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"}),l.jsxs("div",{className:"flex flex-col items-center gap-1.5 sm:gap-2",children:[l.jsx("div",{className:ve("h-8 w-8 sm:h-10 sm:w-10 rounded-full",s)}),l.jsx("div",{className:"text-[10px] sm:text-xs font-medium text-center",children:r})]})]})}class Gte{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),o=this.perm[r]+s,c=this.perm[o],h=this.perm[o+1],f=this.perm[r+1]+s,m=this.perm[f],g=this.perm[f+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[h%12],e,n-1),this.dot(this.grad3[g%12],e-1,n-1),i),a)}}function Xte(){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 Gte(Math.random()),bounding:null});return b.useEffect(()=>{const s=e.current,i=t.current;if(!s||!i)return;const a=r.current,o=()=>{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,N=32,C=w+200,T=S+30,_=Math.ceil(C/k),E=Math.ceil(T/N),M=(w-k*_)/2,L=(S-N*E)/2;for(let P=0;P<=_;P++){const I=[];for(let U=0;U<=E;U++){const ee={x:M+k*P,y:L+N*U,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};I.push(ee)}const Q=document.createElementNS("http://www.w3.org/2000/svg","path");i.appendChild(Q),a.paths.push(Q),a.lines.push(I)}},h=w=>{const{lines:S,mouse:k,noise:N}=a;S.forEach(C=>{C.forEach(T=>{const _=N.perlin2((T.x+w*.0125)*.002,(T.y+w*.005)*.0015)*12;T.wave.x=Math.cos(_)*32,T.wave.y=Math.sin(_)*16;const E=T.x-k.sx,M=T.y-k.sy,L=Math.hypot(E,M),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,N)=>{let C=f(k[0],!1),T=`M ${C.x} ${C.y}`;k.forEach((_,E)=>{const M=E===k.length-1;C=f(_,!M),T+=`L ${C.x} ${C.y}`}),S[N].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,N=S.y-S.ly,C=Math.hypot(k,N);S.v=C,S.vs+=(C-S.vs)*.1,S.vs=Math.min(100,S.vs),S.lx=S.x,S.ly=S.y,S.a=Math.atan2(N,k),s&&(s.style.setProperty("--x",`${S.sx}px`),s.style.setProperty("--y",`${S.sy}px`)),h(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=()=>{o(),c()};return o(),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)}},[]),l.jsxs("div",{ref:e,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[l.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"}}),l.jsx("svg",{ref:t,style:{display:"block",width:"100%",height:"100%"},children:l.jsx("style",{children:` - path { - fill: none; - stroke: hsl(var(--primary) / 0.20); - stroke-width: 1px; - } - `})})]})}function Yte(){const t=Da();b.useEffect(()=>{localStorage.getItem("access-token")||t({to:"/auth"})},[t])}function fL(){return!!localStorage.getItem("access-token")}function Kte(){const[t,e]=b.useState(""),[n,r]=b.useState(!1),[s,i]=b.useState(""),a=Da(),{enableWavesBackground:o,setEnableWavesBackground:c}=BP(),{theme:h,setTheme:f}=b6();b.useEffect(()=>{fL()&&a({to:"/"})},[a]);const g=h==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h,x=()=>{f(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 N=await fetch("/api/webui/setup/status",{method:"GET",headers:{Authorization:`Bearer ${t.trim()}`}}),C=await N.json();N.ok&&C.is_first_setup?a({to:"/setup"}):a({to:"/"})}else i(k.message||"Token 验证失败,请检查后重试")}catch(S){console.error("Token 验证错误:",S),i("连接服务器失败,请检查网络连接")}finally{r(!1)}};return l.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[o&&l.jsx(Xte,{}),l.jsxs(Dt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[l.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"?l.jsx(D3,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):l.jsx(z3,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),l.jsxs(kn,{className:"space-y-4 text-center",children:[l.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:l.jsx(LC,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(jn,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),l.jsx(Fr,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),l.jsx(Dn,{children:l.jsxs("form",{onSubmit:y,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),l.jsxs("div",{className:"relative",children:[l.jsx(iz,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),l.jsx(Pe,{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&&l.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:[l.jsx(Cu,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),l.jsx("span",{children:s})]}),l.jsx(de,{type:"submit",className:"w-full",disabled:n,children:n?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),l.jsxs(xr,{children:[l.jsx(Bh,{asChild:!0,children:l.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:[l.jsx(Dv,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),l.jsxs(lr,{className:"sm:max-w-md",children:[l.jsxs(or,{children:[l.jsxs(cr,{className:"flex items-center gap-2",children:[l.jsx(LC,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),l.jsx(Hr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(DK,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),l.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[l.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),l.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),l.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(lo,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),l.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:l.jsx("code",{className:"text-primary",children:"data/webui.json"})}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",l.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),l.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Cu,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),l.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[l.jsx("p",{className:"font-semibold",children:"安全提示"}),l.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[l.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),l.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.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:[l.jsx(R3,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsxs(yn,{className:"flex items-center gap-2",children:[l.jsx(R3,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),l.jsx(bn,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),l.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>c(!1),children:"关闭动画"})]})]})]})]})})]}),l.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:l.jsx("p",{children:Ote})})]})}const pr=b.forwardRef(({className:t,...e},n)=>l.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}));pr.displayName="Textarea";var Zte=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jte=Zte.reduce((t,e)=>{const n=Kk(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...o}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),ene="Separator",S9="horizontal",tne=["horizontal","vertical"],mL=b.forwardRef((t,e)=>{const{decorative:n,orientation:r=S9,...s}=t,i=nne(r)?r:S9,o=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return l.jsx(Jte.div,{"data-orientation":i,...o,...s,ref:e})});mL.displayName=ene;function nne(t){return tne.includes(t)}var pL=mL;const Vm=b.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>l.jsx(pL,{ref:s,decorative:n,orientation:e,className:ve("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));Vm.displayName=pL.displayName;const rne=Ih("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 In({className:t,variant:e,...n}){return l.jsx("div",{className:ve(rne({variant:e}),t),...n})}function sne({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 l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"qq_account",children:"QQ账号 *"}),l.jsx(Pe,{id:"qq_account",type:"number",placeholder:"请输入机器人的QQ账号",value:t.qq_account||"",onChange:s=>e({...t,qq_account:Number(s.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人登录使用的QQ账号"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"nickname",children:"昵称 *"}),l.jsx(Pe,{id:"nickname",placeholder:"请输入机器人的昵称",value:t.nickname,onChange:s=>e({...t,nickname:s.target.value})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的主要称呼名称"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{children:"别名"}),l.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:t.alias_names.map((s,i)=>l.jsxs(In,{variant:"secondary",className:"gap-1",children:[s,l.jsx("button",{type:"button",onClick:()=>r(i),className:"ml-1 hover:text-destructive",children:l.jsx(P0,{className:"h-3 w-3"})})]},i))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Pe,{id:"alias_input",placeholder:"输入别名后按回车添加",onKeyPress:s=>{s.key==="Enter"&&(n(s.target.value),s.target.value="")}}),l.jsx(de,{type:"button",variant:"outline",onClick:()=>{const s=document.getElementById("alias_input");s&&(n(s.value),s.value="")},children:"添加"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人的其他称呼,可以添加多个"})]})]})}function ine({config:t,onChange:e}){return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"personality",children:"人格特征 *"}),l.jsx(pr,{id:"personality",placeholder:"描述机器人的人格特质和身份特征(建议120字以内)",value:t.personality,onChange:n=>e({...t,personality:n.target.value}),rows:3}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:是一个女大学生,现在在读大二,会刷贴吧"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"reply_style",children:"表达风格 *"}),l.jsx(pr,{id:"reply_style",placeholder:"描述机器人说话的表达风格、表达习惯",value:t.reply_style,onChange:n=>e({...t,reply_style:n.target.value}),rows:3}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"例如:回复平淡一些,简短一些,说中文,参考贴吧、知乎和微博的回复风格"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"interest",children:"兴趣 *"}),l.jsx(pr,{id:"interest",placeholder:"描述机器人感兴趣的话题",value:t.interest,onChange:n=>e({...t,interest:n.target.value}),rows:2}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"会影响机器人对什么话题进行回复"})]}),l.jsx(Vm,{}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"plan_style",children:"群聊说话规则 *"}),l.jsx(pr,{id:"plan_style",placeholder:"机器人在群聊中的行为风格和规则",value:t.plan_style,onChange:n=>e({...t,plan_style:n.target.value}),rows:4}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在群聊中如何行动,例如回复频率、条件等"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"private_plan_style",children:"私聊说话规则 *"}),l.jsx(pr,{id:"private_plan_style",placeholder:"机器人在私聊中的行为风格和规则",value:t.private_plan_style,onChange:n=>e({...t,private_plan_style:n.target.value}),rows:3}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"定义机器人在私聊中的行为方式"})]})]})}function ane({config:t,onChange:e}){return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ue,{htmlFor:"emoji_chance",children:"表情包激活概率"}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:[(t.emoji_chance*100).toFixed(0),"%"]})]}),l.jsx(Pe,{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)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人发送表情包的概率"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"max_reg_num",children:"最大表情包数量"}),l.jsx(Pe,{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)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"机器人最多保存的表情包数量"})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(ue,{htmlFor:"do_replace",children:"达到最大数量时替换"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"开启后会删除旧表情包,关闭则不再收集新表情包"})]}),l.jsx(Pt,{id:"do_replace",checked:t.do_replace,onCheckedChange:n=>e({...t,do_replace:n})})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),l.jsx(Pe,{id:"check_interval",type:"number",min:"1",max:"120",value:t.check_interval,onChange:n=>e({...t,check_interval:Number(n.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包注册、破损、删除的时间间隔"})]}),l.jsx(Vm,{}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(ue,{htmlFor:"steal_emoji",children:"偷取表情包"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人将一些表情包据为己有"})]}),l.jsx(Pt,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:n=>e({...t,steal_emoji:n})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(ue,{htmlFor:"content_filtration",children:"启用表情包过滤"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"只保存符合要求的表情包"})]}),l.jsx(Pt,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:n=>e({...t,content_filtration:n})})]}),t.content_filtration&&l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"filtration_prompt",children:"过滤要求"}),l.jsx(Pe,{id:"filtration_prompt",placeholder:"例如:符合公序良俗",value:t.filtration_prompt,onChange:n=>e({...t,filtration_prompt:n.target.value})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"描述表情包应该符合的要求"})]})]})}function lne({config:t,onChange:e}){return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(ue,{htmlFor:"enable_tool",children:"启用工具系统"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人使用各种工具增强功能"})]}),l.jsx(Pt,{id:"enable_tool",checked:t.enable_tool,onCheckedChange:n=>e({...t,enable_tool:n})})]}),l.jsx(Vm,{}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(ue,{htmlFor:"enable_mood",children:"启用情绪系统"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"让机器人具有情绪变化能力"})]}),l.jsx(Pt,{id:"enable_mood",checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})})]}),t.enable_mood&&l.jsxs("div",{className:"ml-6 space-y-6 border-l-2 border-primary/20 pl-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"mood_update_threshold",children:"情绪更新阈值"}),l.jsx(Pe,{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)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"值越高,情绪更新越慢"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"emotion_style",children:"情感特征"}),l.jsx(pr,{id:"emotion_style",placeholder:"描述情绪的变化情况,例如:情绪较为稳定,但遭遇特定事件时起伏较大",value:t.emotion_style||"",onChange:n=>e({...t,emotion_style:n.target.value}),rows:2}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"影响机器人的情绪变化方式"})]})]}),l.jsx(Vm,{}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(ue,{htmlFor:"all_global",children:"启用全局黑话模式"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"允许机器人学习和使用群组黑话"})]}),l.jsx(Pt,{id:"all_global",checked:t.all_global,onCheckedChange:n=>e({...t,all_global:n})})]})]})}function one({config:t,onChange:e}){const[n,r]=b.useState(!1);return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"rounded-lg bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-4",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"mt-0.5",children:l.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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"})})}),l.jsxs("div",{className:"flex-1 text-sm",children:[l.jsx("p",{className:"font-medium text-blue-900 dark:text-blue-100 mb-1",children:"关于硅基流动 (SiliconFlow)"}),l.jsx("p",{className:"text-blue-700 dark:text-blue-300 mb-2",children:"硅基流动提供了完整的模型覆盖,包括 DeepSeek V3、Qwen、视觉模型、语音识别和嵌入模型。 只需一个 API Key 即可使用麦麦的所有功能!"}),l.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",l.jsx(Jd,{className:"h-3 w-3"})]})]})]})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(ue,{htmlFor:"siliconflow_api_key",children:"SiliconFlow API Key *"}),l.jsxs("div",{className:"relative",children:[l.jsx(Pe,{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"}),l.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?l.jsx(N1,{className:"h-4 w-4 text-muted-foreground"}):l.jsx(oa,{className:"h-4 w-4 text-muted-foreground"})})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"请输入您的硅基流动 API 密钥。获取后,麦麦将自动配置所有必需的模型。"})]}),l.jsxs("div",{className:"rounded-lg bg-muted/50 p-4 text-sm space-y-2",children:[l.jsx("p",{className:"font-medium",children:"将自动配置以下模型:"}),l.jsxs("ul",{className:"list-disc list-inside space-y-1 text-muted-foreground ml-2",children:[l.jsx("li",{children:"DeepSeek V3 - 主要对话和工具模型"}),l.jsx("li",{children:"Qwen3 30B - 高频小任务和工具调用"}),l.jsx("li",{children:"Qwen3 VL 30B - 图像识别"}),l.jsx("li",{children:"SenseVoice - 语音识别"}),l.jsx("li",{children:"BGE-M3 - 文本嵌入"}),l.jsx("li",{children:"知识库相关模型 (LPMM)"})]})]}),l.jsx("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-950/30 p-4",children:l.jsxs("p",{className:"text-sm text-amber-900 dark:text-amber-100",children:[l.jsx("span",{className:"font-medium",children:"💡 提示:"}),'完成向导后,您可以在"系统设置 → 模型配置"中添加更多 API 提供商和模型。']})})]})}async function pt(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 Ct(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function cne(){const t=await pt("/api/webui/config/bot",{method:"GET",headers:Ct()});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 une(){const t=await pt("/api/webui/config/bot",{method:"GET",headers:Ct()});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 dne(){const t=await pt("/api/webui/config/bot",{method:"GET",headers:Ct()});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 hne(){const t=await pt("/api/webui/config/bot",{method:"GET",headers:Ct()});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 fne(){const t=await pt("/api/webui/config/model",{method:"GET",headers:Ct()});if(!t.ok)throw new Error("读取模型配置失败");return{api_key:((await t.json()).config.api_providers||[]).find(i=>i.name==="SiliconFlow")?.api_key||""}}async function mne(t){const e=await pt("/api/webui/config/bot/section/bot",{method:"POST",headers:Ct(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存Bot基础配置失败")}return await e.json()}async function pne(t){const e=await pt("/api/webui/config/bot/section/personality",{method:"POST",headers:Ct(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存人格配置失败")}return await e.json()}async function gne(t){const e=await pt("/api/webui/config/bot/section/emoji",{method:"POST",headers:Ct(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"保存表情包配置失败")}return await e.json()}async function xne(t){const e=[];e.push(pt("/api/webui/config/bot/section/tool",{method:"POST",headers:Ct(),body:JSON.stringify({enable_tool:t.enable_tool})})),e.push(pt("/api/webui/config/bot/section/jargon",{method:"POST",headers:Ct(),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(pt("/api/webui/config/bot/section/mood",{method:"POST",headers:Ct(),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 vne(t){const e=await pt("/api/webui/config/model",{method:"GET",headers:Ct()});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},o=await pt("/api/webui/config/model",{method:"POST",headers:Ct(),body:JSON.stringify(a)});if(!o.ok){const c=await o.json();throw new Error(c.detail||"保存模型配置失败")}return await o.json()}async function k9(){const t=localStorage.getItem("access-token"),e=await pt("/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 Uv(){const t=await pt("/api/webui/system/restart",{method:"POST",headers:Ct()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"重启失败")}return await t.json()}async function yne(){const t=await pt("/api/webui/system/status",{method:"GET",headers:Ct()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取状态失败")}return await t.json()}function bne(){const t=Da(),{toast:e}=ts(),[n,r]=b.useState(0),[s,i]=b.useState(!1),[a,o]=b.useState(!1),[c,h]=b.useState(!0),[f,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}),[N,C]=b.useState({api_key:""}),[T,_]=b.useState(!1),[E,M]=b.useState(""),L=[{id:"bot-basic",title:"Bot基础",description:"配置机器人的基本信息",icon:PK},{id:"personality",title:"人格配置",description:"定义机器人的性格和说话风格",icon:az},{id:"emoji",title:"表情包",description:"配置表情包相关设置",icon:i6},{id:"other",title:"其他设置",description:"工具、情绪系统等配置",icon:bu},{id:"siliconflow",title:"API配置",description:"配置硅基流动API密钥",icon:iz}],P=(n+1)/L.length*100;b.useEffect(()=>{(async()=>{try{h(!0);const[X,J,G,R,se]=await Promise.all([cne(),une(),dne(),hne(),fne()]);m(X),x(J),w(G),k(R),C(se)}catch(X){e({title:"加载配置失败",description:X instanceof Error?X.message:"无法加载现有配置,将使用默认值",variant:"destructive"})}finally{h(!1)}})()},[e]);const I=async()=>{o(!0);try{switch(n){case 0:await mne(f);break;case 1:await pne(g);break;case 2:await gne(y);break;case 3:await xne(S);break;case 4:await vne(N);break}return e({title:"保存成功",description:`${L[n].title}配置已保存`}),!0}catch(B){return e({title:"保存失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"}),!1}finally{o(!1)}},Q=async()=>{await I()&&n{n>0&&r(n-1)},ee=async()=>{i(!0),_(!0);try{if(M("正在保存API配置..."),!await I()){i(!1),_(!1);return}M("正在完成初始化..."),await k9(),M("正在重启麦麦..."),await Uv(),e({title:"配置完成",description:"麦麦正在重启以应用新配置..."}),M("等待麦麦重启完成...");const X=60;let J=0,G=!1;for(;JsetTimeout(R,1e3));try{(await yne()).running&&(G=!0,M("重启成功!正在跳转..."))}catch{J++}}if(!G)throw new Error("重启超时,请手动检查麦麦状态");setTimeout(()=>{t({to:"/"})},1e3)}catch(B){_(!1),e({title:"配置失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}finally{i(!1)}},z=async()=>{try{await k9(),t({to:"/"})}catch(B){e({title:"跳过失败",description:B instanceof Error?B.message:"未知错误",variant:"destructive"})}},H=()=>{switch(n){case 0:return l.jsx(sne,{config:f,onChange:m});case 1:return l.jsx(ine,{config:g,onChange:x});case 2:return l.jsx(ane,{config:y,onChange:w});case 3:return l.jsx(lne,{config:S,onChange:k});case 4:return l.jsx(one,{config:N,onChange:C});default:return null}};return l.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&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:l.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:[l.jsx("div",{className:"flex h-20 w-20 items-center justify-center rounded-full bg-primary/10",children:l.jsx(vc,{className:"h-10 w-10 animate-spin text-primary"})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),l.jsx("p",{className:"text-muted-foreground",children:E})]}),l.jsx("div",{className:"w-full",children:l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:l.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"}})})}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"请稍候,这可能需要一分钟..."})]})}),l.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",children:[l.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"}),l.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?l.jsxs("div",{className:"relative z-10 text-center",children:[l.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center",children:l.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent"})}),l.jsx("p",{className:"text-lg font-medium",children:"加载配置中..."}),l.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"正在读取现有配置"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative z-10 w-full max-w-4xl",children:[l.jsxs("div",{className:"mb-6 md:mb-8 text-center",children:[l.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:l.jsx(zK,{className:"h-6 w-6 md:h-8 md:w-8 text-primary",strokeWidth:2,fill:"none"})}),l.jsx("h1",{className:"mb-2 text-2xl md:text-3xl font-bold",children:"首次配置向导"}),l.jsxs("p",{className:"text-sm md:text-base text-muted-foreground",children:["让我们一起完成 ",S6," 的初始配置"]})]}),l.jsxs("div",{className:"mb-6 md:mb-8",children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs md:text-sm",children:[l.jsxs("span",{className:"text-muted-foreground",children:["步骤 ",n+1," / ",L.length]}),l.jsxs("span",{className:"font-medium text-primary",children:[Math.round(P),"%"]})]}),l.jsx(H0,{value:P,className:"h-2"})]}),l.jsx("div",{className:"mb-6 md:mb-8 flex justify-between",children:L.map((B,X)=>{const J=B.icon;return l.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:[l.jsx(Fm,{className:"h-4 w-4"}),"返回首页"]}),l.jsxs(de,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[l.jsx(lz,{className:"h-4 w-4"}),"返回上一页"]})]}),l.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:l.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}var xL=["PageUp","PageDown"],vL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],yL={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},qh="Slider",[U3,wne,Sne]=Cv(qh),[bL]=ha(qh,[Sne]),[kne,Wv]=bL(qh),wL=b.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:c=0,defaultValue:h=[r],value:f,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:x=!1,form:y,...w}=t,S=b.useRef(new Set),k=b.useRef(0),C=a==="horizontal"?jne:One,[T=[],_]=wo({prop:f,defaultProp:h,onChange:Q=>{[...S.current][k.current]?.focus(),m(Q)}}),E=b.useRef(T);function M(Q){const U=_ne(T,Q);I(Q,U)}function L(Q){I(Q,k.current)}function P(){const Q=E.current[k.current];T[k.current]!==Q&&g(T)}function I(Q,U,{commit:ee}={commit:!1}){const z=Dne(i),H=zne(Math.round((Q-r)/i)*i+r,z),B=Yk(H,[r,s]);_((X=[])=>{const J=Tne(X,B,U);if(Rne(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 l.jsx(kne,{scope:t.__scopeSlider,name:n,disabled:o,min:r,max:s,valueIndexToChangeRef:k,thumbs:S.current,values:T,orientation:a,form:y,children:l.jsx(U3.Provider,{scope:t.__scopeSlider,children:l.jsx(U3.Slot,{scope:t.__scopeSlider,children:l.jsx(C,{"aria-disabled":o,"data-disabled":o?"":void 0,...w,ref:e,onPointerDown:tt(w.onPointerDown,()=>{o||(E.current=T)}),min:r,max:s,inverted:x,onSlideStart:o?void 0:M,onSlideMove:o?void 0:L,onSlideEnd:o?void 0:P,onHomeKeyDown:()=>!o&&I(r,0,{commit:!0}),onEndKeyDown:()=>!o&&I(s,T.length-1,{commit:!0}),onStepKeyDown:({event:Q,direction:U})=>{if(!o){const H=xL.includes(Q.key)||Q.shiftKey&&vL.includes(Q.key)?10:1,B=k.current,X=T[B],J=i*H*U;I(X+J,B,{commit:!0})}}})})})})});wL.displayName=qh;var[SL,kL]=bL(qh,{startEdge:"left",endEdge:"right",size:"width",direction:1}),jne=b.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:c,onStepKeyDown:h,...f}=t,[m,g]=b.useState(null),x=Bn(e,C=>g(C)),y=b.useRef(void 0),w=D0(s),S=w==="ltr",k=S&&!i||!S&&i;function N(C){const T=y.current||m.getBoundingClientRect(),_=[0,T.width],M=j6(_,k?[n,r]:[r,n]);return y.current=T,M(C-T.left)}return l.jsx(SL,{scope:t.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:l.jsx(jL,{dir:w,"data-orientation":"horizontal",...f,ref:x,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const T=N(C.clientX);a?.(T)},onSlideMove:C=>{const T=N(C.clientX);o?.(T)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:C=>{const _=yL[k?"from-left":"from-right"].includes(C.key);h?.({event:C,direction:_?-1:1})}})})}),One=b.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onStepKeyDown:c,...h}=t,f=b.useRef(null),m=Bn(e,f),g=b.useRef(void 0),x=!s;function y(w){const S=g.current||f.current.getBoundingClientRect(),k=[0,S.height],C=j6(k,x?[r,n]:[n,r]);return g.current=S,C(w-S.top)}return l.jsx(SL,{scope:t.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:l.jsx(jL,{"data-orientation":"vertical",...h,ref:m,style:{...h.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,o?.()},onStepKeyDown:w=>{const k=yL[x?"from-bottom":"from-top"].includes(w.key);c?.({event:w,direction:k?-1:1})}})})}),jL=b.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:c,...h}=t,f=Wv(qh,n);return l.jsx(on.span,{...h,ref:e,onKeyDown:tt(t.onKeyDown,m=>{m.key==="Home"?(a(m),m.preventDefault()):m.key==="End"?(o(m),m.preventDefault()):xL.concat(vL).includes(m.key)&&(c(m),m.preventDefault())}),onPointerDown:tt(t.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),f.thumbs.has(g)?g.focus():r(m)}),onPointerMove:tt(t.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&s(m)}),onPointerUp:tt(t.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),i(m))})})}),OL="SliderTrack",NL=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=Wv(OL,n);return l.jsx(on.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});NL.displayName=OL;var W3="SliderRange",CL=b.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=Wv(W3,n),i=kL(W3,n),a=b.useRef(null),o=Bn(e,a),c=s.values.length,h=s.values.map(g=>_L(g,s.min,s.max)),f=c>1?Math.min(...h):0,m=100-Math.max(...h);return l.jsx(on.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:o,style:{...t.style,[i.startEdge]:f+"%",[i.endEdge]:m+"%"}})});CL.displayName=W3;var G3="SliderThumb",TL=b.forwardRef((t,e)=>{const n=wne(t.__scopeSlider),[r,s]=b.useState(null),i=Bn(e,o=>s(o)),a=b.useMemo(()=>r?n().findIndex(o=>o.ref.current===r):-1,[n,r]);return l.jsx(Nne,{...t,ref:i,index:a})}),Nne=b.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=Wv(G3,n),o=kL(G3,n),[c,h]=b.useState(null),f=Bn(e,N=>h(N)),m=c?a.form||!!c.closest("form"):!0,g=qD(c),x=a.values[r],y=x===void 0?0:_L(x,a.min,a.max),w=Ene(r,a.values.length),S=g?.[o.size],k=S?Mne(S,y,o.direction):0;return b.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${y}% + ${k}px)`},children:[l.jsx(U3.ItemSlot,{scope:t.__scopeSlider,children:l.jsx(on.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:f,style:x===void 0?{display:"none"}:t.style,onFocus:tt(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),m&&l.jsx(EL,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:x},r)]})});TL.displayName=G3;var Cne="RadioBubbleInput",EL=b.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const s=b.useRef(null),i=Bn(s,r),a=BD(e);return b.useEffect(()=>{const o=s.current;if(!o)return;const c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==e&&f){const m=new Event("input",{bubbles:!0});f.call(o,e),o.dispatchEvent(m)}},[a,e]),l.jsx(on.input,{style:{display:"none"},...n,ref:i,defaultValue:e})});EL.displayName=Cne;function Tne(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function _L(t,e,n){const i=100/(n-e)*(t-e);return Yk(i,[0,100])}function Ene(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function _ne(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 Mne(t,e,n){const r=t/2,i=j6([0,50],[0,r]);return(r-i(e)*n)*n}function Ane(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function Rne(t,e){if(e>0){const n=Ane(t);return Math.min(...n)>=e}return!0}function j6(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 Dne(t){return(String(t).split(".")[1]||"").length}function zne(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var ML=wL,Pne=NL,Lne=CL,Ine=TL;const V0=b.forwardRef(({className:t,...e},n)=>l.jsxs(ML,{ref:n,className:ve("relative flex w-full touch-none select-none items-center",t),...e,children:[l.jsx(Pne,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:l.jsx(Lne,{className:"absolute h-full bg-primary"})}),l.jsx(Ine,{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"})]}));V0.displayName=ML.displayName;const qt=SK,Ft=kK,It=b.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(HD,{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,l.jsx(xK,{asChild:!0,children:l.jsx(Tu,{className:"h-4 w-4 opacity-50"})})]}));It.displayName=HD.displayName;const AL=b.forwardRef(({className:t,...e},n)=>l.jsx(VD,{ref:n,className:ve("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx($m,{className:"h-4 w-4"})}));AL.displayName=VD.displayName;const RL=b.forwardRef(({className:t,...e},n)=>l.jsx(UD,{ref:n,className:ve("flex cursor-default items-center justify-center py-1",t),...e,children:l.jsx(Tu,{className:"h-4 w-4"})}));RL.displayName=UD.displayName;const Bt=b.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>l.jsx(vK,{children:l.jsxs(WD,{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:[l.jsx(AL,{}),l.jsx(yK,{className:ve("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),l.jsx(RL,{})]})}));Bt.displayName=WD.displayName;const Bne=b.forwardRef(({className:t,...e},n)=>l.jsx(GD,{ref:n,className:ve("px-2 py-1.5 text-sm font-semibold",t),...e}));Bne.displayName=GD.displayName;const De=b.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(XD,{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:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(bK,{children:l.jsx(ol,{className:"h-4 w-4"})})}),l.jsx(wK,{children:e})]}));De.displayName=XD.displayName;const qne=b.forwardRef(({className:t,...e},n)=>l.jsx(YD,{ref:n,className:ve("-mx-1 my-1 h-px bg-muted",t),...e}));qne.displayName=YD.displayName;function Fne(t){const e=$ne(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,o=b.Children.toArray(i),c=o.find(Hne);if(c){const h=c.props.children,f=o.map(m=>m===c?b.Children.count(h)>1?b.Children.only(null):b.isValidElement(h)?h.props.children:null:m);return l.jsx(e,{...a,ref:s,children:b.isValidElement(h)?b.cloneElement(h,void 0,f):null})}return l.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function $ne(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=Une(s),o=Vne(i,s.props);return s.type!==b.Fragment&&(o.ref=r?gc(r,a):a),b.cloneElement(s,o)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Qne=Symbol("radix.slottable");function Hne(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Qne}function Vne(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]=(...o)=>{const c=i(...o);return s(...o),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function Une(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 Gv="Popover",[DL]=ha(Gv,[Rh]),U0=Rh(),[Wne,_c]=DL(Gv),zL=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,o=U0(e),c=b.useRef(null),[h,f]=b.useState(!1),[m,g]=wo({prop:r,defaultProp:s??!1,onChange:i,caller:Gv});return l.jsx(Av,{...o,children:l.jsx(Wne,{scope:e,contentId:_i(),triggerRef:c,open:m,onOpenChange:g,onOpenToggle:b.useCallback(()=>g(x=>!x),[g]),hasCustomAnchor:h,onCustomAnchorAdd:b.useCallback(()=>f(!0),[]),onCustomAnchorRemove:b.useCallback(()=>f(!1),[]),modal:a,children:n})})};zL.displayName=Gv;var PL="PopoverAnchor",Gne=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=_c(PL,n),i=U0(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=s;return b.useEffect(()=>(a(),()=>o()),[a,o]),l.jsx(Rv,{...i,...r,ref:e})});Gne.displayName=PL;var LL="PopoverTrigger",IL=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=_c(LL,n),i=U0(n),a=Bn(e,s.triggerRef),o=l.jsx(on.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":QL(s.open),...r,ref:a,onClick:tt(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:l.jsx(Rv,{asChild:!0,...i,children:o})});IL.displayName=LL;var O6="PopoverPortal",[Xne,Yne]=DL(O6,{forceMount:void 0}),BL=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=_c(O6,e);return l.jsx(Xne,{scope:e,forceMount:n,children:l.jsx(Fs,{present:n||i.open,children:l.jsx(Mv,{asChild:!0,container:s,children:r})})})};BL.displayName=O6;var xh="PopoverContent",qL=b.forwardRef((t,e)=>{const n=Yne(xh,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=_c(xh,t.__scopePopover);return l.jsx(Fs,{present:r||i.open,children:i.modal?l.jsx(Zne,{...s,ref:e}):l.jsx(Jne,{...s,ref:e})})});qL.displayName=xh;var Kne=Fne("PopoverContent.RemoveScroll"),Zne=b.forwardRef((t,e)=>{const n=_c(xh,t.__scopePopover),r=b.useRef(null),s=Bn(e,r),i=b.useRef(!1);return b.useEffect(()=>{const a=r.current;if(a)return KD(a)},[]),l.jsx(ZD,{as:Kne,allowPinchZoom:!0,children:l.jsx(FL,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tt(t.onCloseAutoFocus,a=>{a.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:tt(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,h=o.button===2||c;i.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:tt(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Jne=b.forwardRef((t,e)=>{const n=_c(xh,t.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return l.jsx(FL,{...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()}})}),FL=b.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:h,onInteractOutside:f,...m}=t,g=_c(xh,n),x=U0(n);return JD(),l.jsx(ez,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:l.jsx(n6,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:h,onDismiss:()=>g.onOpenChange(!1),children:l.jsx(r6,{"data-state":QL(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)"}})})})}),$L="PopoverClose",ere=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=_c($L,n);return l.jsx(on.button,{type:"button",...r,ref:e,onClick:tt(t.onClick,()=>s.onOpenChange(!1))})});ere.displayName=$L;var tre="PopoverArrow",nre=b.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=U0(n);return l.jsx(s6,{...s,...r,ref:e})});nre.displayName=tre;function QL(t){return t?"open":"closed"}var rre=zL,sre=IL,ire=BL,HL=qL;const ul=rre,dl=sre,Ea=b.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>l.jsx(ire,{children:l.jsx(HL,{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})}));Ea.displayName=HL.displayName;const Mc="/api/webui/config";async function j9(){const e=await(await pt(`${Mc}/bot`)).json();if(!e.success)throw new Error("获取配置数据失败");return e.config}async function th(){const e=await(await pt(`${Mc}/model`)).json();if(!e.success)throw new Error("获取模型配置数据失败");return e.config}async function O9(t){const n=await(await pt(`${Mc}/bot`,{method:"POST",headers:Ct(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function are(){const e=await(await pt(`${Mc}/bot/raw`)).json();if(!e.success)throw new Error("获取配置源代码失败");return e.content}async function lre(t){const n=await(await pt(`${Mc}/bot/raw`,{method:"POST",headers:Ct(),body:JSON.stringify({raw_content:t})})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function R1(t){const n=await(await pt(`${Mc}/model`,{method:"POST",headers:Ct(),body:JSON.stringify(t)})).json();if(!n.success)throw new Error(n.message||"保存配置失败")}async function ore(t,e){const r=await(await pt(`${Mc}/bot/section/${t}`,{method:"POST",headers:Ct(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function X3(t,e){const r=await(await pt(`${Mc}/model/section/${t}`,{method:"POST",headers:Ct(),body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||`保存配置节 ${t} 失败`)}async function cre(t,e="openai",n="/models"){const r=new URLSearchParams({provider_name:t,parser:e,endpoint:n}),s=await pt(`/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 ure=Ih("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"}}),Na=b.forwardRef(({className:t,variant:e,...n},r)=>l.jsx("div",{ref:r,role:"alert",className:ve(ure({variant:e}),t),...n}));Na.displayName="Alert";const dre=b.forwardRef(({className:t,...e},n)=>l.jsx("h5",{ref:n,className:ve("mb-1 font-medium leading-none tracking-tight",t),...e}));dre.displayName="AlertTitle";const Ca=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{ref:n,className:ve("text-sm [&_p]:leading-relaxed",t),...e}));Ca.displayName="AlertDescription";function N6({onRestartComplete:t,onRestartFailed:e}){const[n,r]=b.useState(0),[s,i]=b.useState("restarting"),[a,o]=b.useState(0),[c,h]=b.useState(0);b.useEffect(()=>{const g=setInterval(()=>{r(w=>w>=90?w:w+1)},200),x=setInterval(()=>{o(w=>w+1)},1e3),y=setTimeout(()=>{i("checking"),f()},3e3);return()=>{clearInterval(g),clearInterval(x),clearTimeout(y)}},[]);const f=()=>{const x=async()=>{try{if(h(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 l.jsx("div",{className:"fixed inset-0 bg-background/95 backdrop-blur-sm z-50 flex items-center justify-center",children:l.jsxs("div",{className:"max-w-md w-full mx-4 space-y-8",children:[l.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[s==="restarting"&&l.jsxs(l.Fragment,{children:[l.jsx(vc,{className:"h-16 w-16 text-primary animate-spin"}),l.jsx("h2",{className:"text-2xl font-bold",children:"正在重启麦麦"}),l.jsx("p",{className:"text-muted-foreground text-center",children:"请稍候,麦麦正在重启中..."})]}),s==="checking"&&l.jsxs(l.Fragment,{children:[l.jsx(vc,{className:"h-16 w-16 text-primary animate-spin"}),l.jsx("h2",{className:"text-2xl font-bold",children:"检查服务状态"}),l.jsxs("p",{className:"text-muted-foreground text-center",children:["等待服务恢复... (尝试 ",c,"/60)"]})]}),s==="success"&&l.jsxs(l.Fragment,{children:[l.jsx(xc,{className:"h-16 w-16 text-green-500"}),l.jsx("h2",{className:"text-2xl font-bold",children:"重启成功"}),l.jsx("p",{className:"text-muted-foreground text-center",children:"正在跳转到登录页面..."})]}),s==="failed"&&l.jsxs(l.Fragment,{children:[l.jsx(Cu,{className:"h-16 w-16 text-destructive"}),l.jsx("h2",{className:"text-2xl font-bold",children:"重启超时"}),l.jsx("p",{className:"text-muted-foreground text-center",children:"服务未能在预期时间内恢复,请手动检查或刷新页面"})]})]}),s!=="failed"&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(H0,{value:n,className:"h-2"}),l.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground",children:[l.jsxs("span",{children:[n,"%"]}),l.jsxs("span",{children:["已用时: ",m(a)]})]})]}),l.jsx("div",{className:"bg-muted/50 rounded-lg p-4 space-y-2",children:l.jsxs("p",{className:"text-sm text-muted-foreground",children:[s==="restarting"&&"🔄 配置已保存,正在重启主程序...",s==="checking"&&"⏳ 正在等待服务恢复,请勿关闭页面...",s==="success"&&"✅ 配置已生效,服务运行正常",s==="failed"&&"⚠️ 如果长时间无响应,请尝试手动重启"]})}),l.jsx("div",{className:"bg-yellow-500/10 border border-yellow-500/50 rounded-lg p-4",children:l.jsxs("p",{className:"text-sm text-yellow-900 dark:text-yellow-100",children:[l.jsx("strong",{children:"⚠️ 重要提示:"})," 由于技术原因,使用重启功能后,将无法再使用 ",l.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。如需结束程序,请使用脚本目录下的进程管理脚本。"]})}),s==="failed"&&l.jsxs("div",{className:"flex gap-2",children:[l.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:"刷新页面"}),l.jsx("button",{onClick:()=>{i("checking"),h(0),f()},className:"flex-1 px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/90",children:"重试检测"})]})]})})}let Y3=[],VL=[];(()=>{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=VL[r])e=r+1;else return!0;if(e==n)return!1}}function N9(t){return t>=127462&&t<=127487}const C9=8205;function fre(t,e,n=!0,r=!0){return(n?UL:mre)(t,e,r)}function UL(t,e,n){if(e==t.length)return e;e&&WL(t.charCodeAt(e))&&GL(t.charCodeAt(e-1))&&e--;let r=gw(t,e);for(e+=T9(r);e=0&&N9(gw(t,a));)i++,a-=2;if(i%2==0)break;e+=2}else break}return e}function mre(t,e,n){for(;e>0;){let r=UL(t,e-2,n);if(r=56320&&t<57344}function GL(t){return t>=55296&&t<56320}function T9(t){return t<65536?1:2}class pn{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]=vh(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),n1.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]=vh(this,e,n);let r=[];return this.decompose(e,n,r,0),n1.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 Cm(this),i=new Cm(e);for(let a=n,o=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(o+=s.value.length,s.done||o>=r)return!0}}iter(e=1){return new Cm(this,e)}iterRange(e,n=this.length){return new XL(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 YL(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]?pn.empty:e.length<=32?new Tr(e):n1.from(Tr.split(e,[]))}}class Tr extends pn{constructor(e,n=pre(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],o=s+a.length;if((n?r:o)>=e)return new gre(s,o,r,a);s=o+1,r++}}decompose(e,n,r,s){let i=e<=0&&n>=this.length?this:new Tr(E9(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(s&1){let a=r.pop(),o=r1(i.text,a.text.slice(),0,i.length);if(o.length<=32)r.push(new Tr(o,a.length+i.length));else{let c=o.length>>1;r.push(new Tr(o.slice(0,c)),new Tr(o.slice(c)))}}else r.push(i)}replace(e,n,r){if(!(r instanceof Tr))return super.replace(e,n,r);[e,n]=vh(this,e,n);let s=r1(this.text,r1(r.text,E9(this.text,0,e)),n),i=this.length+r.length-(n-e);return s.length<=32?new Tr(s,i):n1.from(Tr.split(s,[]),i)}sliceString(e,n=this.length,r=` -`){[e,n]=vh(this,e,n);let s="";for(let i=0,a=0;i<=n&&ae&&a&&(s+=r),ei&&(s+=o.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 Tr(r,s)),r=[],s=-1);return s>-1&&n.push(new Tr(r,s)),n}}let n1=class qd extends pn{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],o=s+a.length,c=r+a.lines-1;if((n?c:o)>=e)return a.lineInner(e,n,r,s);s=o+1,r=c+1}}decompose(e,n,r,s){for(let i=0,a=0;a<=n&&i=a){let h=s&((a<=e?1:0)|(c>=n?2:0));a>=e&&c<=n&&!h?r.push(o):o.decompose(e-a,n-a,r,h)}a=c+1}}replace(e,n,r){if([e,n]=vh(this,e,n),r.lines=i&&n<=o){let c=a.replace(e-i,n-i,r),h=this.lines-a.lines+c.lines;if(c.lines>4&&c.lines>h>>6){let f=this.children.slice();return f[s]=c,new qd(f,this.length-(n-e)+r.length)}return super.replace(i,o,c)}i=o+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=` -`){[e,n]=vh(this,e,n);let s="";for(let i=0,a=0;ie&&i&&(s+=r),ea&&(s+=o.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 qd))return 0;let r=0,[s,i,a,o]=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==o)return r;let c=this.children[s],h=e.children[i];if(c!=h)return r+c.scanIdentical(h,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 Tr(x,n)}let s=Math.max(32,r>>5),i=s<<1,a=s>>1,o=[],c=0,h=-1,f=[];function m(x){let y;if(x.lines>i&&x instanceof qd)for(let w of x.children)m(w);else x.lines>a&&(c>a||!c)?(g(),o.push(x)):x instanceof Tr&&c&&(y=f[f.length-1])instanceof Tr&&x.lines+y.lines<=32?(c+=x.lines,h+=x.length+1,f[f.length-1]=new Tr(y.text.concat(x.text),y.length+1+x.length)):(c+x.lines>s&&g(),c+=x.lines,h+=x.length+1,f.push(x))}function g(){c!=0&&(o.push(f.length==1?f[0]:qd.from(f,h)),h=-1,c=f.length=0)}for(let x of e)m(x);return g(),o.length==1?o[0]:new qd(o,n)}};pn.empty=new Tr([""],0);function pre(t){let e=-1;for(let n of t)e+=n.length+1;return e}function r1(t,e,n=0,r=1e9){for(let s=0,i=0,a=!0;i=n&&(c>r&&(o=o.slice(0,r-s)),s0?1:(e instanceof Tr?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,o=s instanceof Tr?s.text.length:s.children.length;if(a==(n>0?o: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 Tr){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 Tr?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 XL{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new Cm(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 YL{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"&&(pn.prototype[Symbol.iterator]=function(){return this.iter()},Cm.prototype[Symbol.iterator]=XL.prototype[Symbol.iterator]=YL.prototype[Symbol.iterator]=function(){return this});class gre{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 vh(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function ys(t,e,n=!0,r=!0){return fre(t,e,n,r)}function xre(t){return t>=56320&&t<57344}function vre(t){return t>=55296&&t<56320}function ei(t,e){let n=t.charCodeAt(e);if(!vre(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return xre(r)?(n-55296<<10)+(r-56320)+65536:n}function C6(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Za(t){return t<65536?1:2}const K3=/\r\n?|\n/;var vs=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(vs||(vs={}));class cl{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return i+(e-s);i+=o}else{if(r!=vs.Simple&&h>=e&&(r==vs.TrackDel&&se||r==vs.TrackBefore&&se))return null;if(h>e||h==e&&n<0&&!o)return e==s||n<0?i:i+c;i+=c}s=h}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&&o>=e)return sn?"cover":!0;s=o}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 cl(e)}static create(e){return new cl(e)}}class Kr extends cl{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 Z3(this,(n,r,s,i,a)=>e=e.replace(s,s+(r-n),a),!1),e}mapDesc(e,n=!1){return J3(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let s=0,i=0;s=0){n[s]=o,n[s+1]=a;let c=s>>1;for(;r.length0&&dc(r,n,i.text),i.forward(f),o+=f}let h=e[a++];for(;o>1].toJSON()))}return e}static of(e,n,r){let s=[],i=[],a=0,o=null;function c(f=!1){if(!f&&!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"?pn.of(x.split(r||K3)):x:pn.empty,w=y.length;if(m==g&&w==0)return;ma&&js(s,m-a,-1),js(s,g-m,w),dc(i,s,y),a=g}}return h(e),c(!o),o}static empty(e){return new Kr(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;so&&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 dc(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);)o=t.sections[a++],c=t.sections[a++];e(s,h,i,f,m),s=h,i=f}}}function J3(t,e,n,r=!1){let s=[],i=r?[]:null,a=new Um(t),o=new Um(e);for(let c=-1;;){if(a.done&&o.len||o.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&o.ins==-1){let h=Math.min(a.len,o.len);js(s,h,-1),a.forward(h),o.forward(h)}else if(o.ins>=0&&(a.ins<0||c==a.i||a.off==0&&(o.len=0&&c=0){let h=0,f=a.len;for(;f;)if(o.ins==-1){let m=Math.min(f,o.len);h+=m,f-=m,o.forward(m)}else if(o.ins==0&&o.lenc||a.ins>=0&&a.len>c)&&(o||r.length>h),i.forward2(c),a.forward(c)}}}}class Um{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?pn.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?pn.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 pu{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 pu(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 pu(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=>pu.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,o):Ae.range(o,c))}}return new Ae(e,n)}}function ZL(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let T6=0;class nt{constructor(e,n,r,s,i){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=s,this.id=T6++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new nt(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 s1([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new s1(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new s1(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 s1{constructor(e,n,r,s){this.dependencies=e,this.facet=n,this.type=r,this.value=s,this.id=T6++}dynamicSlot(e){var n;let r=this.value,s=this.facet.compareInput,i=this.id,a=e[i]>>1,o=this.type==2,c=!1,h=!1,f=[];for(let m of this.dependencies)m=="doc"?c=!0:m=="selection"?h=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&f.push(e[m.id]);return{create(m){return m.values[a]=r(m),1},update(m,g){if(c&&g.docChanged||h&&(g.docChanged||g.selection)||eS(m,f)){let x=r(m);if(o?!_9(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=z1(g,y);if(this.dependencies.every(S=>S instanceof nt?g.facet(S)===m.facet(S):S instanceof us?g.field(S,!1)==m.field(S,!1):!0)||(o?_9(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 _9(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 o(c){let h=[];for(let f=0;fr===s),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Kg).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(Kg),a=s.facet(Kg),o;return(o=i.find(c=>c.field==this))&&o!=a.find(c=>c.field==this)?(r.values[n]=o.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,Kg.of({field:this,create:e})]}get extension(){return this}}const du={lowest:4,low:3,default:2,high:1,highest:0};function Zf(t){return e=>new JL(e,t)}const Ac={highest:Zf(du.highest),high:Zf(du.high),default:Zf(du.default),low:Zf(du.low),lowest:Zf(du.lowest)};class JL{constructor(e,n){this.inner=e,this.prec=n}}class Xv{of(e){return new tS(this,e)}reconfigure(e){return Xv.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class tS{constructor(e,n){this.compartment=e,this.inner=n}}class D1{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 bre(e,n,a))g instanceof us?s.push(g):(i[g.facet.id]||(i[g.facet.id]=[])).push(g);let o=Object.create(null),c=[],h=[];for(let g of s)o[g.id]=h.length<<1,h.push(x=>g.slot(x));let f=r?.config.facets;for(let g in i){let x=i[g],y=x[0].facet,w=f&&f[g]||[];if(x.every(S=>S.type==0))if(o[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?(o[S.id]=c.length<<1|1,c.push(S.value)):(o[S.id]=h.length<<1,h.push(k=>S.dynamicSlot(k)));o[y.id]=h.length<<1,h.push(S=>yre(S,y,x))}}let m=h.map(g=>g(o));return new D1(e,a,m,o,c,i)}}function bre(t,e,n){let r=[[],[],[],[],[]],s=new Map;function i(a,o){let c=s.get(a);if(c!=null){if(c<=o)return;let h=r[c].indexOf(a);h>-1&&r[c].splice(h,1),a instanceof tS&&n.delete(a.compartment)}if(s.set(a,o),Array.isArray(a))for(let h of a)i(h,o);else if(a instanceof tS){if(n.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(a.compartment)||a.inner;n.set(a.compartment,h),i(h,o)}else if(a instanceof JL)i(a.inner,a.prec);else if(a instanceof us)r[o].push(a),a.provides&&i(a.provides,o);else if(a instanceof s1)r[o].push(a),a.facet.extensions&&i(a.facet.extensions,du.default);else{let h=a.extension;if(!h)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(h,o)}}return i(t,du.default),r.reduce((a,o)=>a.concat(o))}function Tm(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 z1(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const eI=nt.define(),nS=nt.define({combine:t=>t.some(e=>e),static:!0}),tI=nt.define({combine:t=>t.length?t[0]:void 0,static:!0}),nI=nt.define(),rI=nt.define(),sI=nt.define(),iI=nt.define({combine:t=>t.length?t[0]:!1});class pl{constructor(e,n){this.type=e,this.value=n}static define(){return new wre}}class wre{of(e){return new pl(this,e)}}class Sre{constructor(e){this.map=e}of(e){return new Lt(this,e)}}class Lt{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 Lt(this.type,n)}is(e){return this.type==e}static define(e={}){return new Sre(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}}Lt.reconfigure=Lt.define();Lt.appendConfig=Lt.define();class $r{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&&ZL(r,n.newLength),i.some(o=>o.type==$r.time)||(this.annotations=i.concat($r.time.of(Date.now())))}static create(e,n,r,s,i,a){return new $r(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($r.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}$r.time=pl.define();$r.userEvent=pl.define();$r.addToHistory=pl.define();$r.remote=pl.define();function kre(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 $r?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof $r?t=i[0]:t=lI(e,nh(i),!1)}return t}function Ore(t){let e=t.startState,n=e.facet(sI),r=t;for(let s=n.length-1;s>=0;s--){let i=n[s](t);i&&Object.keys(i).length&&(r=aI(r,rS(e,i,t.changes.newLength),!0))}return r==t?t:$r.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const Nre=[];function nh(t){return t==null?Nre:Array.isArray(t)?t:[t]}var ar=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(ar||(ar={}));const Cre=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let sS;try{sS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Tre(t){if(sS)return sS.test(t);for(let e=0;e"€"&&(n.toUpperCase()!=n.toLowerCase()||Cre.test(n)))return!0}return!1}function Ere(t){return e=>{if(!/\S/.test(e))return ar.Space;if(Tre(e))return ar.Word;for(let n=0;n-1)return ar.Word;return ar.Other}}class dn{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 o=0;os.set(h,c)),n=null),s.set(o.value.compartment,o.value.extension)):o.is(Lt.reconfigure)?(n=null,r=o.value):o.is(Lt.appendConfig)&&(n=null,r=nh(r).concat(o.value));let i;n?i=e.startState.values.slice():(n=D1.resolve(r,s,this),i=new dn(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,h)=>h.reconfigure(c,this),null).values);let a=e.startState.facet(nS)?e.newSelection:e.newSelection.asSingle();new dn(n,e.newDoc,a,i,(o,c)=>c.update(o,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=nh(r.effects);for(let o=1;oa.spec.fromJSON(o,c)))}}return dn.create({doc:e.doc,selection:Ae.fromJSON(e.selection),extensions:n.extensions?s.concat([n.extensions]):s})}static create(e={}){let n=D1.resolve(e.extensions||[],new Map),r=e.doc instanceof pn?e.doc:pn.of((e.doc||"").split(n.staticFacet(dn.lineSeparator)||K3)),s=e.selection?e.selection instanceof Ae?e.selection:Ae.single(e.selection.anchor,e.selection.head):Ae.single(0);return ZL(s,r.length),n.staticFacet(nS)||(s=s.asSingle()),new dn(n,r,s,n.dynamicSlots.map(()=>null),(i,a)=>a.create(i),null)}get tabSize(){return this.facet(dn.tabSize)}get lineBreak(){return this.facet(dn.lineSeparator)||` -`}get readOnly(){return this.facet(iI)}phrase(e,...n){for(let r of this.facet(dn.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(eI))for(let a of i(this,n,r))Object.prototype.hasOwnProperty.call(a,e)&&s.push(a[e]);return s}charCategorizer(e){return Ere(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,o=e-r;for(;a>0;){let c=ys(n,a,!1);if(i(n.slice(c,a))!=ar.Word)break;a=c}for(;ot.length?t[0]:4});dn.lineSeparator=tI;dn.readOnly=iI;dn.phrases=nt.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])}});dn.languageData=eI;dn.changeFilter=nI;dn.transactionFilter=rI;dn.transactionExtender=sI;Xv.reconfigure=Lt.define();function gl(t,e,n={}){let r={};for(let s of t)for(let i of Object.keys(s)){let a=s[i],o=r[i];if(o===void 0)r[i]=a;else if(!(o===a||a===void 0))if(Object.hasOwnProperty.call(n,i))r[i]=n[i](o,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 _u{eq(e){return this==e}range(e,n=e){return iS.create(e,n,this)}}_u.prototype.startSide=_u.prototype.endSide=0;_u.prototype.point=!1;_u.prototype.mapMode=vs.TrackDel;let iS=class oI{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new oI(e,n,r)}};function aS(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class _6{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,o=i.length;;){if(a==o)return a;let c=a+o>>1,h=i[c]-e||(r?this.value[c].endSide:this.value[c].startSide)-n;if(c==a)return h>=0?a:o;h>=0?o=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&&h.startSide>0&&h.endSide<=0)continue;(x-g||h.endSide-h.startSide)<0||(a<0&&(a=g),h.point&&(o=Math.max(o,x-g)),r.push(h),s.push(g-a),i.push(x-a))}return{mapped:r.length?new _6(s,i,r,o):null,pos:a}}}class On{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 On(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(aS)),this.isEmpty)return n.length?On.of(n):this;let o=new cI(this,null,-1).goto(0),c=0,h=[],f=new fo;for(;o.value||c=0){let m=n[c++];f.addInner(m.from,m.to,m.value)||h.push(m)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||io.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 Wm.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Wm.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),o=n.filter(m=>m.maxPoint>0||!m.isEmpty&&m.maxPoint>=i),c=M9(a,o,r),h=new Jf(a,c,i),f=new Jf(o,c,i);r.iterGaps((m,g,x)=>A9(h,m,f,g,x,s)),r.empty&&r.length==0&&A9(h,0,f,0,0,s)}static eq(e,n,r=0,s){s==null&&(s=999999999);let i=e.filter(f=>!f.isEmpty&&n.indexOf(f)<0),a=n.filter(f=>!f.isEmpty&&e.indexOf(f)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=M9(i,a),c=new Jf(i,o,0).goto(r),h=new Jf(a,o,0).goto(r);for(;;){if(c.to!=h.to||!lS(c.active,h.active)||c.point&&(!h.point||!c.point.eq(h.point)))return!1;if(c.to>s)return!0;c.next(),h.next()}}static spans(e,n,r,s,i=-1){let a=new Jf(e,null,i).goto(n),o=n,c=a.openStart;for(;;){let h=Math.min(a.to,r);if(a.point){let f=a.activeForPoint(a.to),m=a.pointFromo&&(s.span(o,h,a.active,c),c=a.openEnd(h));if(a.to>r)return c+(a.point&&a.to>r?1:0);o=a.to,a.next()}}static of(e,n=!1){let r=new fo;for(let s of e instanceof iS?[e]:n?_re(e):e)r.add(s.from,s.to,s.value);return r.finish()}static join(e){if(!e.length)return On.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let s=e[r];s!=On.empty;s=s.nextLayer)n=new On(s.chunkPos,s.chunk,n,Math.max(s.maxPoint,n.maxPoint));return n}}On.empty=new On([],[],null,-1);function _re(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(aS);e=r}return t}On.empty.nextLayer=On.empty;class fo{finishChunk(e){this.chunks.push(new _6(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 fo)).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(On.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=On.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function M9(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 cI(a,n,r,i));return s.length==1?s[0]:new Wm(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--)xw(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--)xw(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(),xw(this.heap,0)}}}function xw(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 Jf{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=Wm.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){Zg(this.active,e),Zg(this.activeTo,e),Zg(this.activeRank,e),this.minActive=R9(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:s,rank:i}=this.cursor;for(;n0;)n++;Jg(this.active,n,r),Jg(this.activeTo,n,s),Jg(this.activeRank,n,i),e&&Jg(e,n,this.cursor.from),this.minActive=R9(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&&Zg(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 A9(t,e,n,r,s,i){t.goto(e),n.goto(r);let a=r+s,o=r,c=r-e;for(;;){let h=t.to+c-n.to,f=h||t.endSide-n.endSide,m=f<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))&&lS(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(o,g,t.point,n.point):g>o&&!lS(t.active,n.active)&&i.compareRange(o,g,t.active,n.active),m>a)break;(h||t.openEnd!=n.openEnd)&&i.boundChange&&i.boundChange(m),o=m,f<=0&&t.next(),f>=0&&n.next()}}function lS(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 R9(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=ys(t,s)}return r===!0?-1:t.length}const cS="ͼ",D9=typeof Symbol>"u"?"__"+cS:Symbol.for(cS),uS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),z9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class yc{constructor(e,n){this.rules=[];let{finish:r}=n||{};function s(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function i(a,o,c,h){let f=[],m=/^@(\w+)\b/.exec(a[0]),g=m&&m[1]=="keyframes";if(m&&o==null)return c.push(a[0]+";");for(let x in o){let y=o[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,f,g)}else y!=null&&f.push(x.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+y+";")}(f.length||g)&&c.push((r&&!m&&!h?a.map(r):a).join(", ")+" {"+f.join(" ")+"}")}for(let a in e)i(s(a),e[a],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=z9[D9]||1;return z9[D9]=e+1,cS+e.toString(36)}static mount(e,n,r){let s=e[uS],i=r&&r.nonce;s?i&&s.setNonce(i):s=new Mre(e,i),s.mount(Array.isArray(n)?n:[n],e)}}let P9=new Map;class Mre{constructor(e,n){let r=e.ownerDocument||e,s=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let i=P9.get(r);if(i)return e[uS]=i;this.sheet=new s.CSSStyleSheet,P9.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[uS]=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,o),r)for(let h=0;h",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Are=typeof navigator<"u"&&/Mac/.test(navigator.platform),Rre=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var xs=0;xs<10;xs++)bc[48+xs]=bc[96+xs]=String(xs);for(var xs=1;xs<=24;xs++)bc[xs+111]="F"+xs;for(var xs=65;xs<=90;xs++)bc[xs]=String.fromCharCode(xs+32),Gm[xs]=String.fromCharCode(xs);for(var vw in bc)Gm.hasOwnProperty(vw)||(Gm[vw]=bc[vw]);function Dre(t){var e=Are&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Rre&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Gm:bc)[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 Wn(){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 Je={mac:I9||/Mac/.test(Ds.platform),windows:/Win/.test(Ds.platform),linux:/Linux|X11/.test(Ds.platform),ie:Yv,ie_version:dI?dS.documentMode||6:fS?+fS[1]:hS?+hS[1]:0,gecko:L9,gecko_version:L9?+(/Firefox\/(\d+)/.exec(Ds.userAgent)||[0,0])[1]:0,chrome:!!yw,chrome_version:yw?+yw[1]:0,ios:I9,android:/Android\b/.test(Ds.userAgent),webkit_version:zre?+(/\bAppleWebKit\/(\d+)/.exec(Ds.userAgent)||[0,0])[1]:0,safari:mS,safari_version:mS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Ds.userAgent)||[0,0])[1]:0,tabSize:dS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Xm(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function pS(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function i1(t,e){if(!e.anchorNode)return!1;try{return pS(t,e.anchorNode)}catch{return!1}}function yh(t){return t.nodeType==3?Au(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Em(t,e,n,r){return n?B9(t,e,n,r,-1)||B9(t,e,n,r,1):!1}function Mu(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function P1(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function B9(t,e,n,r,s){for(;;){if(t==n&&e==r)return!0;if(e==(s<0?0:hl(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=Mu(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?hl(t):0}else return!1}}function hl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function W0(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Pre(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 hI(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 Lre(t,e,n,r,s,i,a,o){let c=t.ownerDocument,h=c.defaultView||window;for(let f=t,m=!1;f&&!m;)if(f.nodeType==1){let g,x=f==c.body,y=1,w=1;if(x)g=Pre(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(f).position)&&(m=!0),f.scrollHeight<=f.clientHeight&&f.scrollWidth<=f.clientWidth){f=f.assignedSlot||f.parentNode;continue}let N=f.getBoundingClientRect();({scaleX:y,scaleY:w}=hI(f,N)),g={left:N.left,right:N.left+f.clientWidth*y,top:N.top,bottom:N.top+f.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)}),f=f.assignedSlot||f.parentNode}else if(f.nodeType==11)f=f.host;else break}function Ire(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 Bre{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?hl(n):0),r,Math.min(e.focusOffset,r?hl(r):0))}set(e,n,r,s){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=s}}let ou=null;Je.safari&&Je.safari_version>=26&&(ou=!1);function fI(t){if(t.setActive)return t.setActive();if(ou)return t.focus(ou);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ou==null?{get preventScroll(){return ou={preventScroll:!0},!0}}:void 0),!ou){ou=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function gI(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=hl(n)}else if(n.parentNode&&!P1(n))r=Mu(n),n=n.parentNode;else return null}}function xI(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return m.domBoundsAround(e,n,h);if(g>=e&&s==-1&&(s=c,i=h),h>n&&m.dom.parentNode==this.dom){a=c,o=f;break}f=g,h=g+m.breakAfter}return{from:i,to:o<0?r+this.length:o,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=M6){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 yI(t,e,n,r,s,i,a,o,c){let{children:h}=t,f=h.length?h[e]:null,m=i.length?i[i.length-1]:null,g=m?m.breakAfter:a;if(!(e==r&&f&&!a&&!g&&i.length<2&&f.merge(n,s,i.length?m:null,n==0,o,c))){if(r0&&(!a&&i.length&&f.merge(n,f.length,i[0],!1,o,0)?f.breakAfter=i.shift().breakAfter:(n$re||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 _a(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 Cs(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 Qre(this.dom,e,n)}}class mo extends Qn{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(mI(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 mo&&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 mo(this.mark,n,a)}domAtPos(e){return wI(this,e)}coordsAt(e,n){return kI(this,e,n)}}function Qre(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?Je.chrome||Je.gecko||(e?(s--,a=1):i=0)?0:o.length-1];return Je.safari&&!a&&c.width==0&&(c=Array.prototype.find.call(o,h=>h.width)||c),a?W0(c,a<0):c||null}class ro extends Qn{static create(e,n,r){return new ro(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=ro.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 ro)||!this.widget.compare(r.widget)||e>0&&i<=0||n0)?Cs.before(this.dom):Cs.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 o=a?s.length-1:0;i=s[o],!(e>0?o==0:o==s.length-1||i.top0?Cs.before(this.dom):Cs.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return pn.empty}get isHidden(){return!0}}_a.prototype.children=ro.prototype.children=bh.prototype.children=M6;function wI(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 mo&&s.length&&(r=s[s.length-1])instanceof mo&&r.mark.eq(e.mark)?SI(r,e.children[0],n-1):(s.push(e),e.setParent(t)),t.length+=e.length}function kI(t,e,n){let r=null,s=-1,i=null,a=-1;function o(h,f){for(let m=0,g=0;m=f&&(x.children.length?o(x,f-g):(!i||i.isHidden&&(n>0||Vre(i,x)))&&(y>f||g==y&&x.getSide()>0)?(i=x,a=f-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 xS(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 Ure(t){let e=Object.create(null);for(let n=0;n0?3e8:-4e8:n>0?1e8:-1e8,new wc(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}=jI(e,n);r=(i?n?-3e8:-1:5e8)-1,s=(a?n?2e8:1:-6e8)+1}return new wc(e,r,s,n,e.widget||null,!0)}static line(e){return new X0(e)}static set(e,n=!1){return On.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}xt.none=On.empty;class G0 extends xt{constructor(e){let{start:n,end:r}=jI(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 G0&&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))&&L1(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)}}G0.prototype.point=!1;class X0 extends xt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof X0&&this.spec.class==e.spec.class&&L1(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)}}X0.prototype.mapMode=vs.TrackBefore;X0.prototype.point=!0;class wc extends xt{constructor(e,n,r,s,i,a){super(n,r,i,e),this.block=s,this.isReplace=a,this.mapMode=s?n<=0?vs.TrackBefore:vs.TrackAfter:vs.TrackDel}get type(){return this.startSide!=this.endSide?Is.WidgetRange:this.startSide<=0?Is.WidgetBefore:Is.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof wc&&Wre(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)}}wc.prototype.point=!0;function jI(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 Wre(t,e){return t==e||!!(t&&e&&t.compare(e))}function a1(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 qr extends Qn{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 qr))return!1;this.dom||r.transferDOM(this)}return s&&this.setDeco(r?r.attrs:null),bI(this,e,n,r?r.children.slice():[],i,a),!0}split(e){let n=new qr;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){L1(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){SI(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=gS(n,this.attrs||{})),r&&(this.attrs=gS({class:r},this.attrs||{}))}domAtPos(e){return wI(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(mI(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&&(xS(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&&Qn.get(s)instanceof mo;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((r=Qn.get(s))===null||r===void 0?void 0:r.isEditable)==!1&&(!Je.ios||!this.children.some(i=>i instanceof _a))){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 _a)||/[^ -~]/.test(r.text))return null;let s=yh(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=kI(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 qr)return i;if(a>n)break}s=a+i.breakAfter}return null}}class oo extends Qn{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 oo)||!this.widget.compare(r.widget)||e>0&&i<=0||n0}}class vS extends xl{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 _m{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 oo&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new qr),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(ex(new bh(-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 oo)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:a,lineBreak:o,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(o){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(ex(new _a(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 wc){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 o=n-e;if(r instanceof wc)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new oo(r.widget||wh.block,o,r));else{let c=ro.create(r.widget||wh.inline,o,o?0:r.startSide),h=this.atCursorPos&&!c.isEditable&&i<=s.length&&(e0),f=!c.isEditable&&(es.length||r.startSide<=0),m=this.getLine();this.pendingBuffer==2&&!h&&!c.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(m.append(ex(new bh(1),s),i),i=s.length+Math.max(0,i-s.length)),m.append(ex(c,s),i),this.atCursorPos=f,this.pendingBuffer=f?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(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 _m(e,n,r,i);return a.openEnd=On.spans(s,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}function ex(t,e){for(let n of e)t=new mo(n,[t],t.length);return t}class wh extends xl{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}}wh.inline=new wh("span");wh.block=new wh("div");var sr=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(sr||(sr={}));const Ru=sr.LTR,A6=sr.RTL;function OI(t){let e=[];for(let n=0;n=n){if(o.level==r)return a;(i<0||(s!=0?s<0?o.fromn:e[i].level>o.level))&&(i=a)}}if(i<0)throw new RangeError("Index out of range");return i}}function CI(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;w-=3)if(Va[w+1]==-x){let S=Va[w+2],k=S&2?s:S&4?S&1?i:s:0;k&&(Gn[m]=Gn[Va[w]]=k),o=w;break}}else{if(Va.length==189)break;Va[o++]=m,Va[o++]=g,Va[o++]=c}else if((y=Gn[m])==2||y==1){let w=y==s;c=w?0:1;for(let S=o-3;S>=0;S-=3){let k=Va[S+2];if(k&2)break;if(w)Va[S+2]|=2;else{if(k&4)break;Va[S+2]|=4}}}}}function Jre(t,e,n,r){for(let s=0,i=r;s<=n.length;s++){let a=s?n[s-1].to:t,o=sc;)y==S&&(y=n[--w].from,S=w?n[w-1].to:t),Gn[--y]=x;c=f}else i=h,c++}}}function bS(t,e,n,r,s,i,a){let o=r%2?2:1;if(r%2==s%2)for(let c=e,h=0;cc&&a.push(new hc(c,w.from,x));let S=w.direction==Ru!=!(x%2);wS(t,S?r+1:r,s,w.inner,w.from,w.to,a),c=w.to}y=w.to}else{if(y==n||(f?Gn[y]!=o:Gn[y]==o))break;y++}g?bS(t,c,y,r+1,s,g,a):ce;){let f=!0,m=!1;if(!h||c>i[h-1].to){let w=Gn[c-1];w!=o&&(f=!1,m=w==16)}let g=!f&&o==1?[]:null,x=f?r:r+1,y=c;e:for(;;)if(h&&y==i[h-1].to){if(m)break e;let w=i[--h];if(!f)for(let S=w.from,k=h;;){if(S==e)break e;if(k&&i[k-1].to==S)S=i[--k].from;else{if(Gn[S-1]==o)break e;break}}if(g)g.push(w);else{w.toGn.length;)Gn[Gn.length]=256;let r=[],s=e==Ru?0:1;return wS(t,s,s,n,0,t.length,r),r}function TI(t){return[new hc(0,t,0)]}let EI="";function tse(t,e,n,r,s){var i;let a=r.head-t.from,o=hc.find(e,a,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),c=e[o],h=c.side(s,n);if(a==h){let g=o+=s?1:-1;if(g<0||g>=e.length)return null;c=e[o=g],a=c.side(!s,n),h=c.side(s,n)}let f=ys(t.text,a,c.forward(s,n));(fc.to)&&(f=h),EI=t.text.slice(Math.min(a,f),Math.max(a,f));let m=o==(s?e.length-1:0)?null:e[o+(s?1:-1)];return m&&f==h&&m.level+(s?0:1)t.some(e=>e)}),LI=nt.define({combine:t=>t.some(e=>e)}),II=nt.define();class sh{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 sh(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 sh(Ae.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const tx=Lt.define({map:(t,e)=>t.map(e)}),BI=Lt.define();function ni(t,e,n){let r=t.facet(RI);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 no=nt.define({combine:t=>t.length?t[0]:!0});let rse=0;const Gd=nt.define({combine(t){return t.filter((e,n)=>{for(let r=0;r{let c=[];return a&&c.push(Ym.of(h=>{let f=h.plugin(o);return f?a(f):xt.none})),i&&c.push(i(o)),c})}static fromClass(e,n){return _r.define((r,s)=>new e(r,s),n)}}class bw{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(ni(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){ni(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){ni(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const qI=nt.define(),z6=nt.define(),Ym=nt.define(),FI=nt.define(),Y0=nt.define(),$I=nt.define();function Q9(t,e){let n=t.state.facet($I);if(!n.length)return n;let r=n.map(i=>i instanceof Function?i(t):i),s=[];return On.spans(r,e.from,e.to,{point(){},span(i,a,o,c){let h=i-e.from,f=a-e.from,m=s;for(let g=o.length-1;g>=0;g--,c--){let x=o[g].spec.bidiIsolate,y;if(x==null&&(x=nse(e.text,h,f)),c>0&&m.length&&(y=m[m.length-1]).to==h&&y.direction==x)y.to=f,m=y.inner;else{let w={from:h,to:f,direction:x,inner:[]};m.push(w),m=w.inner}}}}),s}const QI=nt.define();function P6(t){let e=0,n=0,r=0,s=0;for(let i of t.state.facet(QI)){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 mm=nt.define();class ia{constructor(e,n,r,s){this.fromA=e,this.toA=n,this.fromB=r,this.toB=s}join(e){return new ia(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.toAf)break;i+=2}if(!c)return r;new ia(c.fromA,c.toA,c.fromB,c.toB).addToSet(r),a=c.toA,o=c.toB}}}class I1{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Kr.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let s=[];this.changes.iterChangedRanges((i,a,o,c)=>s.push(new ia(i,a,o,c))),this.changedRanges=s}static create(e,n,r){return new I1(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 H9 extends Qn{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=xt.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 qr],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ia(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:h,toA:f})=>fthis.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:!use(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let i=s>-1?ise(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:f}=this.hasComposition;r=new ia(h,f,e.changes.mapPos(h,-1),e.changes.mapPos(f,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(Je.ie||Je.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,o=this.updateDeco(),c=ose(a,o,e.changes);return r=ia.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=Je.chrome||Je.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(!o)break;let{fromA:c,toA:h,fromB:f,toB:m}=o,g,x,y,w;if(r&&r.range.fromBf){let T=_m.build(this.view.state.doc,f,r.range.fromB,this.decorations,this.dynamicDecorationMap),_=_m.build(this.view.state.doc,r.range.toB,m,this.decorations,this.dynamicDecorationMap);x=T.breakAtStart,y=T.openStart,w=_.openEnd;let E=this.compositionView(r);_.breakAtStart?E.breakAfter=1:_.content.length&&E.merge(E.length,E.length,_.content[0],!1,_.openStart,0)&&(E.breakAfter=_.content[0].breakAfter,_.content.shift()),T.content.length&&E.merge(0,0,T.content[T.content.length-1],!0,0,T.openEnd)&&T.content.pop(),g=T.content.concat(E).concat(_.content)}else({content:g,breakAtStart:x,openStart:y,openEnd:w}=_m.build(this.view.state.doc,f,m,this.decorations,this.dynamicDecorationMap));let{i:S,off:k}=i.findPos(h,1),{i:N,off:C}=i.findPos(c,-1);yI(this,N,C,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(BI)&&(this.editContextFormatting=r.value)}compositionView(e){let n=new _a(e.text.nodeValue);n.flags|=8;for(let{deco:s}of e.marks)n=new mo(s,[n],n.length);let r=new qr;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 o=Qn.get(i);o&&o!=a&&(o.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(no)||this.dom.tabIndex>-1)&&i1(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(s||n||i))return;let a=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,c=this.moveToLine(this.domAtPos(o.anchor)),h=o.empty?c:this.moveToLine(this.domAtPos(o.head));if(Je.gecko&&o.empty&&!this.hasComposition&&sse(c)){let m=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(m,c.node.childNodes[c.offset]||null)),c=h=new Cs(m,0),a=!0}let f=this.view.observer.selectionRange;(a||!f.focusNode||(!Em(c.node,c.offset,f.anchorNode,f.anchorOffset)||!Em(h.node,h.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,o))&&(this.view.observer.ignore(()=>{Je.android&&Je.chrome&&this.dom.contains(f.focusNode)&&cse(f.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let m=Xm(this.view.root);if(m)if(o.empty){if(Je.gecko){let g=ase(c.node,c.offset);if(g&&g!=3){let x=(g==1?gI:xI)(c.node,c.offset);x&&(c=new Cs(x.node,x.offset))}}m.collapse(c.node,c.offset),o.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=o.bidiLevel)}else if(m.extend){m.collapse(c.node,c.offset);try{m.extend(h.node,h.offset)}catch{}}else{let g=document.createRange();o.anchor>o.head&&([c,h]=[h,c]),g.setEnd(h.node,h.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,h)),this.impreciseAnchor=c.precise?null:new Cs(f.anchorNode,f.anchorOffset),this.impreciseHead=h.precise?null:new Cs(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Em(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=Xm(e.root),{anchorNode:s,anchorOffset:i}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let a=qr.find(this,n.head);if(!a)return;let o=a.posAtStart;if(n.head==o||n.head==o+a.length)return;let c=this.coordsAt(n.head,-1),h=this.coordsAt(n.head,1);if(!c||!h||c.bottom>h.top)return;let f=this.domAtPos(n.head+n.assoc);r.collapse(f.node,f.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=Qn.get(n.childNodes[s]);i instanceof qr&&(r=i.domAtPos(i.length))}return r?new Cs(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Qn.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 o=this.children[a],c=i-o.breakAfter,h=c-o.length;if(ce||o.covers(1))&&(!r||o instanceof qr&&!(r instanceof qr&&n>=0)))r=o,s=h;else if(r&&h==e&&c==e&&o instanceof oo&&Math.abs(n)<2){if(o.deco.startSide<0)break;a&&(r=null)}i=h}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 qr))return null;for(;s.children.length;){let{i:o,off:c}=s.childPos(r,1);for(;;o++){if(o==s.children.length)return null;if((s=s.children[o]).length)break}r=c}if(!(s instanceof _a))return null;let i=ys(s.text,r);if(i==r)return null;let a=Au(s.dom,r,i).getClientRects();for(let o=0;oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,c=this.view.textDirection==sr.LTR;for(let h=0,f=0;fs)break;if(h>=r){let x=m.dom.getBoundingClientRect();if(n.push(x.height),a){let y=m.dom.lastChild,w=y?yh(y):[];if(w.length){let S=w[w.length-1],k=c?S.right-x.left:x.right-S.left;k>o&&(o=k,this.minWidth=i,this.minWidthFrom=h,this.minWidthTo=g)}}}h=g+m.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?sr.RTL:sr.LTR}measureTextSize(){for(let i of this.children)if(i instanceof qr){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=yh(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 vI(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 o=(n.lineBlockAt(a).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(xt.replace({widget:new vS(o),block:!0,inclusive:!0,isBlockGap:!0}).range(r,a))}if(!i)break;r=i.to+1}return xt.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Ym).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,s=this.view.state.facet(FI).map((i,a)=>{let o=typeof i=="function";return o&&(r=!0),o?i(this.view):i});for(s.length&&(this.dynamicDecorationMap[e++]=r,n.push(On.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=P6(this.view),a={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:o,offsetHeight:c}=this.view.scrollDOM;Lre(this.view.scrollDOM,a,n.heads instanceof ro||s.children.some(r);return r(this.children[n])}}function sse(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 HI(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=gI(n.focusNode,n.focusOffset),s=xI(n.focusNode,n.focusOffset),i=r||s;if(s&&r&&s.node!=r.node){let o=Qn.get(s.node);if(!o||o instanceof _a&&o.text!=s.node.nodeValue)i=s;else if(t.docView.lastCompositionAfterCursor){let c=Qn.get(r.node);!c||c instanceof _a&&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 ise(t,e,n){let r=HI(t,n);if(!r)return null;let{node:s,from:i,to:a}=r,o=s.nodeValue;if(/[\n\r]/.test(o)||t.state.doc.sliceString(r.from,r.to)!=o)return null;let c=e.invertedDesc,h=new ia(c.mapPos(i),c.mapPos(a),i,a),f=[];for(let m=s.parentNode;;m=m.parentNode){let g=Qn.get(m);if(g instanceof mo)f.push({node:m,deco:g.mark});else{if(g instanceof qr||m.nodeName=="DIV"&&m.parentNode==t.contentDOM)return{range:h,text:s,marks:f,line:m};if(m!=t.contentDOM)f.push({node:m,deco:new G0({inclusive:!0,attributes:Ure(m),tagName:m.tagName.toLowerCase()})});else return null}}}function ase(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{re.from&&(n=!0)}),n}function dse(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,o=i;n<0?a=ys(s.text,i,!1):o=ys(s.text,i);let c=r(s.text.slice(a,o));for(;a>0;){let h=ys(s.text,a,!1);if(r(s.text.slice(h,a))!=c)break;a=h}for(;ot?e.left-t:Math.max(0,t-e.right)}function fse(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function ww(t,e){return t.tope.top+1}function V9(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function kS(t,e,n){let r,s,i,a,o=!1,c,h,f,m;for(let y=t.firstChild;y;y=y.nextSibling){let w=yh(y);for(let S=0;SC||a==C&&i>N)&&(r=y,s=k,i=N,a=C,o=N?e0:Sk.bottom&&(!f||f.bottomk.top)&&(h=y,m=k):f&&ww(f,k)?f=U9(f,k.bottom):m&&ww(m,k)&&(m=V9(m,k.top))}}if(f&&f.bottom>=n?(r=c,s=f):m&&m.top<=n&&(r=h,s=m),!r)return{node:t,offset:0};let g=Math.max(s.left,Math.min(s.right,e));if(r.nodeType==3)return W9(r,g,n);if(o&&r.contentEditable!="false")return kS(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 W9(t,e,n){let r=t.nodeValue.length,s=-1,i=1e9,a=0;for(let o=0;on?f.top-n:n-f.bottom)-1;if(f.left-1<=e&&f.right+1>=e&&m=(f.left+f.right)/2,x=g;if(Je.chrome||Je.gecko){let y=Au(t,o).getBoundingClientRect();Math.abs(y.left-f.right)<.1&&(x=!g)}if(m<=0)return{node:t,offset:o+(x?1:0)};s=o+(x?1:0),i=m}}}return{node:t,offset:s>-1?s:a>0?t.nodeValue.length:0}}function VI(t,e,n,r=-1){var s,i;let a=t.contentDOM.getBoundingClientRect(),o=a.top+t.viewState.paddingTop,c,{docHeight:h}=t.viewState,{x:f,y:m}=e,g=m-o;if(g<0)return 0;if(g>h)return t.state.doc.length;for(let T=t.viewState.heightOracle.textHeight/2,_=!1;c=t.elementAtHeight(g),c.type!=Is.Text;)for(;g=r>0?c.bottom+T:c.top-T,!(g>=0&&g<=h);){if(_)return n?null:0;_=!0,r=-r}m=o+g;let x=c.from;if(xt.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:G9(t,a,c,f,m);let y=t.dom.ownerDocument,w=t.root.elementFromPoint?t.root:y,S=w.elementFromPoint(f,m);S&&!t.contentDOM.contains(S)&&(S=null),S||(f=Math.max(a.left+1,Math.min(a.right-1,f)),S=w.elementFromPoint(f,m),S&&!t.contentDOM.contains(S)&&(S=null));let k,N=-1;if(S&&((s=t.docView.nearest(S))===null||s===void 0?void 0:s.isEditable)!=!1){if(y.caretPositionFromPoint){let T=y.caretPositionFromPoint(f,m);T&&({offsetNode:k,offset:N}=T)}else if(y.caretRangeFromPoint){let T=y.caretRangeFromPoint(f,m);T&&({startContainer:k,startOffset:N}=T)}k&&(!t.contentDOM.contains(k)||Je.safari&&mse(k,N,f)||Je.chrome&&pse(k,N,f))&&(k=void 0),k&&(N=Math.min(hl(k),N))}if(!k||!t.docView.dom.contains(k)){let T=qr.find(t.docView,x);if(!T)return g>c.top+c.height/2?c.to:c.from;({node:k,offset:N}=kS(T.dom,f,m))}let C=t.docView.nearest(k);if(!C)return null;if(C.isWidget&&((i=C.dom)===null||i===void 0?void 0:i.nodeType)==1){let T=C.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let o=t.viewState.heightOracle.textHeight,c=Math.floor((s-n.top-(t.defaultLineHeight-o)*.5)/o);i+=c*t.viewState.heightOracle.lineLength}let a=t.state.sliceDoc(n.from,n.to);return n.from+oS(a,i,t.state.tabSize)}function UI(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 Au(t,r-1,r).getBoundingClientRect().right>n}function mse(t,e,n){return UI(t,e,n)}function pse(t,e,n){if(e!=0)return UI(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():Au(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function jS(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==Is.Text&&(s.type!=i.type||(n<0?i.frome)))&&(s=i)}}return s||r}return r}function gse(t,e,n,r){let s=jS(t,e.head,e.assoc||-1),i=!r||s.type!=Is.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(),o=t.textDirectionAt(s.from),c=t.posAtCoords({x:n==(o==sr.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 X9(t,e,n,r){let s=t.state.doc.lineAt(e.head),i=t.bidiSpans(s),a=t.textDirectionAt(s.from);for(let o=e,c=null;;){let h=tse(s,i,a,o,n),f=EI;if(!h){if(s.number==(n?t.state.doc.lines:1))return o;f=` -`,s=t.state.doc.line(s.number+(n?1:-1)),i=t.bidiSpans(s),h=t.visualLineSide(s,!n)}if(c){if(!c(f))return o}else{if(!r)return h;c=r(f)}o=h}}function xse(t,e,n){let r=t.state.charCategorizer(e),s=r(n);return i=>{let a=r(i);return s==ar.Space&&(s=a),s==a}}function vse(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,o,c=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(s,e.assoc||-1),f=t.documentTop;if(h)a==null&&(a=h.left-c.left),o=i<0?h.top:h.bottom;else{let x=t.viewState.lineBlockAt(s);a==null&&(a=Math.min(c.right-c.left,t.defaultCharacterWidth*(s-x.from))),o=(i<0?x.top:x.bottom)+f}let m=c.left+a,g=r??t.viewState.heightOracle.textHeight>>1;for(let x=0;;x+=10){let y=o+(g+x)*i,w=VI(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)&&!wse(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,o;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,r),a=this.lineSeparator.length):(o=s.exec(n))&&(i=o.index,a=o[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=Qn.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+(bse(e,r.node,r.offset)?n:0))}}function bse(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 o=i||a?[]:jse(e),c=new yse(o,e.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=Ose(o,this.bounds.from)}else{let o=e.observer.selectionRange,c=i&&i.node==o.focusNode&&i.offset==o.focusOffset||!pS(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),h=a&&a.node==o.anchorNode&&a.offset==o.anchorOffset||!pS(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset),f=e.viewport;if((Je.ios||Je.chrome)&&e.state.selection.main.empty&&c!=h&&(f.from>0||f.to-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Ae.range(h,c)):this.newSel=Ae.single(h,c)}}}function GI(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:o}=e.bounds,c=s.from,h=null;(i===8||Je.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)}:Je.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:pn.of([" "])}),n)return L6(t,n,r,i);if(r&&!r.main.eq(s)){let a=!1,o="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),o=t.inputState.lastSelectionOrigin,o=="select.pointer"&&(r=WI(t.state.facet(Y0).map(c=>c(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:o}),!0}else return!1}function L6(t,e,n,r=-1){if(Je.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(Je.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&&rh(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||r==8&&e.insert.lengths.head)&&rh(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&rh(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a,o=()=>a||(a=kse(t,e,n));return t.state.facet(DI).some(c=>c(t,e.from,e.to,i,o))||t.dispatch(o()),!0}function kse(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)),h,c);e.from==f&&(a=f)}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)+h))}else{let c=s.changes(e),h=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 f=t.state.sliceDoc(e.from,e.to),m,g=n&&HI(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:h||y.map(c)};let w=y.to-x,S=w-f.length;if(t.state.sliceDoc(S,w)!=f||w>=m.from&&S<=m.to)return{range:y};let k=s.changes({from:S,to:w,insert:e.insert}),N=y.to-i.to;return{changes:k,range:h?Ae.range(Math.max(0,h.anchor+N),Math.max(0,h.head+N)):y.map(k)}})}else r={changes:c,selection:h&&s.selection.replaceRange(h)}}let o="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1)),s.update(r,{userEvent:o,scrollIntoView:!0})}function XI(t,e,n,r){let s=Math.min(t.length,e.length),i=0;for(;i0&&o>0&&t.charCodeAt(a-1)==e.charCodeAt(o-1);)a--,o--;if(r=="end"){let c=Math.max(0,i-Math.min(a,o));n-=a+c-i}if(a=a?i-n:0;i-=c,o=i+(o-a),a=i}else if(o=o?i-n:0;i-=c,a=i+(a-o),o=i}return{from:i,toA:a,toB:o}}function jse(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 Y9(n,r)),(s!=n||i!=r)&&e.push(new Y9(s,i))),e}function Ose(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 Nse{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,Je.safari&&e.contentDOM.addEventListener("input",()=>null),Je.gecko&&$se(e.contentDOM.ownerDocument)}handleEvent(e){!Dse(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=Cse(e),r=this.handlers,s=this.view.contentDOM;for(let i in n)if(i!="scroll"){let a=!n[i].handlers.length,o=r[i];o&&a!=!o.handlers.length&&(s.removeEventListener(i,this.handleEvent),o=null),o||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&&KI.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Je.android&&Je.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return Je.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=YI.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Tse.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:Je.safari&&!Je.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 K9(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(s){ni(n.state,s)}}}function Cse(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 o in i){let c=i[o];c&&n(o).handlers.push(K9(r.value,c))}if(a)for(let o in a){let c=a[o];c&&n(o).observers.push(K9(r.value,c))}}for(let r in Ma)n(r).handlers.push(Ma[r]);for(let r in ca)n(r).observers.push(ca[r]);return e}const YI=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Tse="dthko",KI=[16,17,18,20,91,92,224,225],nx=6;function rx(t){return Math.max(0,t)*.7+8}function Ese(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class _se{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=Ire(e.contentDOM),this.atoms=e.state.facet(Y0).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(dn.allowMultipleSelections)&&Mse(e,n),this.dragging=Rse(e,n)&&eB(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&&Ese(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,s=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let c=P6(this.view);e.clientX-c.left<=s+nx?n=-rx(s-e.clientX):e.clientX+c.right>=a-nx&&(n=rx(e.clientX-a)),e.clientY-c.top<=i+nx?r=-rx(i-e.clientY):e.clientY+c.bottom>=o-nx&&(r=rx(e.clientY-o)),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=WI(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 Mse(t,e){let n=t.state.facet(_I);return n.length?n[0](e):Je.mac?e.metaKey:e.ctrlKey}function Ase(t,e){let n=t.state.facet(MI);return n.length?n[0](e):Je.mac?!e.altKey:!e.ctrlKey}function Rse(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Xm(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 Dse(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=Qn.get(n))&&r.ignoreEvent(e))return!1;return!0}const Ma=Object.create(null),ca=Object.create(null),ZI=Je.ie&&Je.ie_version<15||Je.ios&&Je.webkit_version<604;function zse(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(),JI(t,n.value)},50)}function Kv(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function JI(t,e){e=Kv(t.state,R6,e);let{state:n}=t,r,s=1,i=n.toText(e),a=i.lines==n.selection.ranges.length;if(OS!=null&&n.selection.ranges.every(c=>c.empty)&&OS==i.toString()){let c=-1;r=n.changeByRange(h=>{let f=n.doc.lineAt(h.from);if(f.from==c)return{range:h};c=f.from;let m=n.toText((a?i.line(s++).text:e)+n.lineBreak);return{changes:{from:f.from,insert:m},range:Ae.cursor(h.from+m.length)}})}else a?r=n.changeByRange(c=>{let h=i.line(s++);return{changes:{from:c.from,to:c.to,insert:h.text},range:Ae.cursor(c.from+h.length)}}):r=n.replaceSelection(i);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}ca.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Ma.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);ca.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};ca.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Ma.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(AI))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=Ise(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new _se(t,e,n,r)),r&&t.observer.ignore(()=>{fI(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 Z9(t,e,n,r){if(r==1)return Ae.cursor(e,n);if(r==2)return dse(t.state,e,n);{let s=qr.find(t.docView,e),i=t.state.doc.lineAt(s?s.posAtEnd:e),a=s?s.posAtStart:i.from,o=s?s.posAtEnd:i.to;return oe>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right;function Pse(t,e,n,r){let s=qr.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&&J9(n,r,a))return-1;let o=s.coordsAt(i,1);return o&&J9(n,r,o)?1:a&&a.bottom>=r?-1:1}function eT(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:Pse(t,n,e.clientX,e.clientY)}}const Lse=Je.ie&&Je.ie_version<=11;let tT=null,nT=0,rT=0;function eB(t){if(!Lse)return t.detail;let e=tT,n=rT;return tT=t,rT=Date.now(),nT=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(nT+1)%3:1}function Ise(t,e){let n=eT(t,e),r=eB(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,o){let c=eT(t,i),h,f=Z9(t,c.pos,c.bias,r);if(n.pos!=c.pos&&!a){let m=Z9(t,n.pos,n.bias,r),g=Math.min(m.from,f.from),x=Math.max(m.to,f.to);f=g1&&(h=Bse(s,c.pos))?h:o?s.addRange(f):Ae.create([f])}}}function Bse(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}Ma.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",Kv(t.state,D6,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ma.dragend=t=>(t.inputState.draggedContent=null,!1);function sT(t,e,n,r){if(n=Kv(t.state,R6,n),!n)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,a=r&&i&&Ase(t,e)?{from:i.from,to:i.to}:null,o={from:s,insert:n},c=t.state.changes(a?[a,o]:o);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}Ma.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&&sT(t,e,r.filter(a=>a!=null).join(t.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(r[a]=o.result),i()},o.readAsText(n[a])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return sT(t,e,r,!0),!0}return!1};Ma.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=ZI?null:e.clipboardData;return n?(JI(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(zse(t),!1)};function qse(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 Fse(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:Kv(t,D6,e.join(t.lineBreak)),ranges:n,linewise:r}}let OS=null;Ma.copy=Ma.cut=(t,e)=>{let{text:n,ranges:r,linewise:s}=Fse(t.state);if(!n&&!s)return!1;OS=s?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=ZI?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(qse(t,n),!1)};const tB=pl.define();function nB(t,e){let n=[];for(let r of t.facet(zI)){let s=r(t,e);s&&n.push(s)}return n.length?t.update({effects:n,annotations:tB.of(!0)}):null}function rB(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=nB(t.state,e);n?t.dispatch(n):t.update([])}},10)}ca.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),rB(t)};ca.blur=t=>{t.observer.clearSelectionRange(),rB(t)};ca.compositionstart=ca.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};ca.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,Je.chrome&&Je.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};ca.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Ma.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 o=a[0],c=t.posAtDOM(o.startContainer,o.startOffset),h=t.posAtDOM(o.endContainer,o.endOffset);return L6(t,{from:c,to:h,insert:t.state.toText(i)},null),!0}}let s;if(Je.chrome&&Je.android&&(s=YI.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 Je.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),Je.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>ca.compositionend(t,e),20),!1};const iT=new Set;function $se(t){iT.has(t)||(iT.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const aT=["pre-wrap","normal","pre-line","break-spaces"];let Sh=!1;function lT(){Sh=!1}class Qse{constructor(e){this.lineWrapping=e,this.doc=pn.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 aT.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!=o;if(this.lineWrapping=o,this.lineHeight=n,this.charWidth=r,this.textHeight=s,this.lineLength=i,c){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>l1&&(Sh=!0),this.height=e)}replace(e,n,r){return Bs.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 o=s.length-1;o>=0;o--){let{fromA:c,toA:h,fromB:f,toB:m}=s[o],g=i.lineAt(c,rr.ByPosNoHeight,r.setDoc(n),0,0),x=g.to>=h?g:i.lineAt(h,rr.ByPosNoHeight,r,0,0);for(m+=x.to-h,h=x.to;o>0&&g.from<=s[o-1].toA;)c=s[o-1].fromA,f=s[o-1].fromB,o--,ci*2){let o=e[n-1];o.break?e.splice(--n,1,o.left,null,o.right):e.splice(--n,1,o.left,o.right),r+=1+o.break,s-=o.size}else if(i>s*2){let o=e[r];o.break?e.splice(r,1,o.left,null,o.right):e.splice(r,1,o.left,o.right),r+=2+o.break,i-=o.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 Ni extends sB{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,s){return new Ja(s,this.length,r,this.height,this.breaks)}replace(e,n,r){let s=r[0];return r.length==1&&(s instanceof Ni||s instanceof gs&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof gs?s=new Ni(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):Bs.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 gs extends Bs{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,o=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*i);a=c/i,this.length>i+1&&(o=(this.height-c)/(this.length-i-1))}else a=this.height/i;return{firstLine:r,lastLine:s,perLine:a,perChar:o}}blockAt(e,n,r,s){let{firstLine:i,lastLine:a,perLine:o,perChar:c}=this.heightMetrics(n,s);if(n.lineWrapping){let h=s+(e0){let i=r[r.length-1];i instanceof gs?r[r.length-1]=new gs(i.length+s):r.push(null,new gs(s-1))}if(e>0){let i=r[0];i instanceof gs?r[0]=new gs(e+i.length):r.unshift(new gs(e-1),null)}return Bs.of(r)}decomposeLeft(e,n){n.push(new gs(e-1),null)}decomposeRight(e,n){n.push(null,new gs(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=[],o=Math.max(n,s.from),c=-1;for(s.from>n&&a.push(new gs(s.from-n-1).updateHeight(e,n));o<=i&&s.more;){let f=e.doc.lineAt(o).length;a.length&&a.push(null);let m=s.heights[s.index++];c==-1?c=m:Math.abs(m-c)>=l1&&(c=-2);let g=new Ni(f,m);g.outdated=!1,a.push(g),o+=f+1}o<=i&&a.push(null,new gs(i-o).updateHeight(e,o));let h=Bs.of(a);return(c<0||Math.abs(h.height-this.height)>=l1||Math.abs(c-this.heightMetrics(e,n).perLine)>=l1)&&(Sh=!0),B1(this,h)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Vse extends Bs{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 eo))return h;let f=n==rr.ByPosNoHeight?rr.ByPosNoHeight:rr.ByPos;return c?h.join(this.right.lineAt(o,f,r,a,o)):this.left.lineAt(o,f,r,s,i).join(h)}forEachLine(e,n,r,s,i,a){let o=s+this.left.height,c=i+this.left.length+this.break;if(this.break)e=c&&this.right.forEachLine(e,n,r,o,c,a);else{let h=this.lineAt(c,rr.ByPos,r,s,i);e=e&&h.from<=n&&a(h),n>h.to&&this.right.forEachLine(h.to+1,n,r,o,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 o of r)i.push(o);if(e>0&&oT(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?Bs.of(this.break?[e,null,n]:[e,n]):(this.left=B1(this.left,e),this.right=B1(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,o=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<=o+a.length&&s.more?c=a=a.updateHeight(e,o,r,s):a.updateHeight(e,o,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 oT(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof gs&&(r=t[e+1])instanceof gs&&t.splice(e-1,3,new gs(n.length+1+r.length))}const Use=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 Ni?s.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Ni(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=Use)&&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 Ni(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new gs(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 Ni)return e;let n=new Ni(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 Ni)&&!this.isCovered?this.nodes.push(new Ni(0,-1)):(this.writtenTof.clientHeight||f.scrollWidth>f.clientWidth)&&m.overflow!="visible"){let g=f.getBoundingClientRect();i=Math.max(i,g.left),a=Math.min(a,g.right),o=Math.max(o,g.top),c=Math.min(h==t.parentNode?s.innerHeight:c,g.bottom)}h=m.position=="absolute"||m.position=="fixed"?f.offsetParent:f.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:i-n.left,right:Math.max(i,a)-n.left,top:o-(n.top+e),bottom:Math.max(o,c)-(n.top+e)}}function Yse(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function Kse(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class kw{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 Qse(n),this.stateDeco=e.facet(Ym).filter(r=>typeof r!="function"),this.heightMap=Bs.empty().applyChanges(this.stateDeco,pn.empty,this.heightOracle.setDoc(e.doc),[new ia(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=xt.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 sx(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?uT:new B6(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(gm(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Ym).filter(f=>typeof f!="function");let s=e.changedRanges,i=ia.extendWithRanges(s,Wse(r,this.stateDeco,e?e.changes:Kr.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);lT(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||Sh)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.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 h=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(LI)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),s=this.heightOracle,i=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?sr.RTL:sr.LTR;let a=this.heightOracle.mustRefreshForWrapping(i),o=n.getBoundingClientRect(),c=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let h=0,f=0;if(o.width&&o.height){let{scaleX:T,scaleY:_}=hI(n,o);(T>.005&&Math.abs(this.scaleX-T)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=T,this.scaleY=_,h|=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,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let x=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=x&&(this.scrollAnchorHeight=-1,this.scrollTop=x),this.scrolledToBottom=pI(e.scrollDOM);let y=(this.printing?Kse:Xse)(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&&!Yse(e.dom))return 0;let N=o.width;if((this.contentDOMWidth!=N||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),c){let T=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(T)&&(a=!0),a||s.lineWrapping&&Math.abs(N-this.contentDOMWidth)>s.charWidth){let{lineHeight:_,charWidth:E,textHeight:M}=e.docView.measureTextSize();a=_>0&&s.refresh(i,_,E,M,Math.max(5,N/E),T),a&&(e.docView.minWidth=0,h|=16)}w>0&&S>0?f=Math.max(w,S):w<0&&S<0&&(f=Math.min(w,S)),lT();for(let _ of this.viewports){let E=_.from==this.viewport.from?T:e.docView.measureVisibleLineHeights(_);this.heightMap=(a?Bs.empty().applyChanges(this.stateDeco,pn.empty,this.heightOracle,[new ia(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,a,new Hse(_.from,E))}Sh&&(h|=2)}let C=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return C&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(f,this.scrollTarget),h|=this.updateForViewport()),(h&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,c=new sx(s.lineAt(a-r*1e3,rr.ByHeight,i,0,0).from,s.lineAt(o+(1-r)*1e3,rr.ByHeight,i,0,0).to);if(n){let{head:h}=n.range;if(hc.to){let f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),m=s.lineAt(h,rr.ByPos,i,0,0),g;n.y=="center"?g=(m.top+m.bottom)/2-f/2:n.y=="start"||n.y=="nearest"&&h=o+Math.max(10,Math.min(r,250)))&&s>a-2*1e3&&i>1,a=s<<1;if(this.defaultTextDirection!=sr.LTR&&!r)return[];let o=[],c=(f,m,g,x)=>{if(m-ff&&kk.from>=g.from&&k.to<=g.to&&Math.abs(k.from-f)k.fromN));if(!S){if(mC.from<=m&&C.to>=m)){let C=n.moveToLineBoundary(Ae.cursor(m),!1,!0).head;C>f&&(m=C)}let k=this.gapSize(g,f,m,x),N=r||k<2e6?k:2e6;S=new kw(f,m,k,N)}o.push(S)},h=f=>{if(f.length2e6)for(let E of e)E.from>=f.from&&E.fromf.from&&c(f.from,x,f,m),yn.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];On.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)||gm(this.heightMap.lineAt(e,rr.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)||gm(this.heightMap.lineAt(this.scaler.fromDOM(e),rr.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 gm(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 sx=class{constructor(e,n){this.from=e,this.to=n}};function Jse(t,e,n){let r=[],s=t,i=0;return On.spans(n,t,e,{span(){},point(a,o){a>s&&(r.push({from:s,to:a}),i+=a-s),s=o}},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],o=a-i;if(r<=o)return i+r;r-=o}}function ax(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 eie(t,e){for(let n of t)if(e(n))return n}const uT={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class B6{constructor(e,n,r){let s=0,i=0,a=0;this.viewports=r.map(({from:o,to:c})=>{let h=n.lineAt(o,rr.ByPos,e,0,0).top,f=n.lineAt(c,rr.ByPos,e,0,0).bottom;return s+=f-h,{from:o,to:c,top:h,bottom:f,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(n.height-s);for(let o of this.viewports)o.domTop=a+(o.top-i)*this.scale,a=o.domBottom=o.domTop+(o.bottom-o.top),i=o.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 gm(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Ja(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(s=>gm(s,e)):t._content)}const lx=nt.define({combine:t=>t.join(" ")}),NS=nt.define({combine:t=>t.indexOf(!0)>-1}),CS=yc.newName(),iB=yc.newName(),aB=yc.newName(),lB={"&light":"."+iB,"&dark":"."+aB};function TS(t,e,n){return new yc(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 tie=TS("."+CS,{"&":{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"}},lB),nie={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jw=Je.ie&&Je.ie_version<=11;class rie{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Bre,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);(Je.ie&&Je.ie_version<=11||Je.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&&Je.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Je.chrome&&Je.chrome_version<126)&&(this.editContext=new iie(e),e.state.facet(no)&&(e.contentDOM.editContext=this.editContext.editContext)),jw&&(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(no)?r.root.activeElement!=this.dom:!i1(this.dom,s))return;let i=s.anchorNode&&r.docView.nearest(s.anchorNode);if(i&&i.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(Je.ie&&Je.ie_version<=11||Je.android&&Je.chrome)&&!r.state.selection.main.empty&&s.focusNode&&Em(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Xm(e.root);if(!n)return!1;let r=Je.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&sie(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let s=i1(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&&rh(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&&i1(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 Sse(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=GI(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=dT(n,e.previousSibling||e.target.previousSibling,-1),s=dT(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(no)!=e.state.facet(no)&&(e.view.contentDOM.editContext=e.state.facet(no)?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 dT(t,e,n){for(;e;){let r=Qn.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 hT(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 Em(a.node,a.offset,s,i)&&([n,r,s,i]=[s,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:i}}function sie(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return hT(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?hT(t,n):null}class iie{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,o=this.toEditorPos(r.updateRangeStart),c=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:o,drifted:!1});let h=c-o>r.text.length;o==this.from&&ithis.to&&(c=i);let f=XI(e.state.sliceDoc(o,c),r.text,(h?s.from:s.to)-o,h?"end":null);if(!f){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:f.from+o,to:f.toA+o,insert:pn.of(r.text.slice(f.from,f.toB).split(` -`))};if((Je.mac||Je.android)&&m.from==a-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(m={from:o,to:c,insert:pn.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,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),o=this.toEditorPos(r.rangeEnd);a{let s=[];for(let i of r.getTextFormats()){let a=i.underlineStyle,o=i.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(o)){let c=this.toEditorPos(i.rangeStart),h=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=Xm(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,o,c,h)=>{if(r)return;let f=h.length-(a-i);if(s&&a>=s.to)if(s.from==i&&s.to==a&&s.insert.eq(h)){s=this.pendingContextChange=null,n+=f,this.to+=f;return}else s=null,this.revertPending(e.state);if(i+=n,a+=n,a<=this.from)this.from+=f,this.to+=f;else if(ithis.to||this.to-this.from+h.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),h.toString()),this.to+=f}n+=f}),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 Ke{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||qre(e.parent)||document,this.viewState=new cT(e.state||dn.create(e)),e.scrollTo&&e.scrollTo.is(tx)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Gd).map(s=>new bw(s));for(let s of this.plugins)s.update(this);this.observer=new rie(this),this.inputState=new Nse(this),this.inputState.ensureHandlers(this.plugins),this.docView=new H9(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 $r?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,o=0,c=null;e.some(g=>g.annotation(tB))?(this.inputState.notifiedFocused=a,o=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,c=nB(i,a),c||(o=1));let h=this.observer.delayedAndroidKey,f=null;if(h?(this.observer.clearDelayedAndroidKey(),f=this.observer.readChange(),(f&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(f=null)):this.observer.clear(),i.facet(dn.phrases)!=this.state.facet(dn.phrases))return this.setState(i);s=I1.create(this,i,e),s.flags|=o;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 sh(x.empty?x:Ae.cursor(x.head,x.head>x.anchor?-1:1))}for(let x of g.effects)x.is(tx)&&(m=x.value.clip(this.state))}this.viewState.update(s,m),this.bidiCache=q1.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),n=this.docView.update(s),this.state.facet(mm)!=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(lx)!=s.state.facet(lx)&&(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(SS))try{g(s)}catch(x){ni(this.state,x,"update listener")}(c||f)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),f&&!GI(this,f)&&h.force&&rh(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new cT(e),this.plugins=e.facet(Gd).map(r=>new bw(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new H9(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(Gd),r=e.state.facet(Gd);if(n!=r){let s=[];for(let i of r){let a=n.indexOf(i);if(a<0)s.push(new bw(i));else{let o=this.plugins[a];o.mustUpdate=e,s.push(o)}}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 o=0;;o++){if(a<0)if(pI(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(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];c&4||([this.measureRequests,h]=[h,this.measureRequests]);let f=h.map(x=>{try{return x.read(this)}catch(y){return ni(this.state,y),fT}}),m=I1.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 o of this.state.facet(SS))o(n)}get themeClasses(){return CS+" "+(this.state.facet(NS)?aB:iB)+" "+this.state.facet(lx)}updateAttrs(){let e=mT(this,qI,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(no)?"true":"false",class:"cm-content",style:`${Je.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),mT(this,z6,n);let r=this.observer.ignore(()=>{let s=xS(this.contentDOM,this.contentAttrs,n),i=xS(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(Ke.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(mm);let e=this.state.facet(Ke.cspNonce);yc.mount(this.root,this.styleModules.concat(tie).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 Sw(this,e,X9(this,e,n,r))}moveByGroup(e,n){return Sw(this,e,X9(this,e,n,r=>xse(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 gse(this,e,n,r)}moveVertically(e,n,r){return Sw(this,e,vse(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(),VI(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[hc.find(i,e-s.from,-1,n)];return W0(r,a.dir==sr.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(PI)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>aie)return TI(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||CI(i.isolates,r=Q9(this,e))))return i.order;r||(r=Q9(this,e));let s=ese(e.text,n,r);return this.bidiCache.push(new q1(e.from,e.to,n,r,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Je.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{fI(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 tx.of(new sh(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 tx.of(new sh(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 _r.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return _r.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=yc.newName(),s=[lx.of(r),mm.of(TS(`.${r}`,e))];return n&&n.dark&&s.push(NS.of(!0)),s}static baseTheme(e){return Ac.lowest(mm.of(TS("."+CS,e,lB)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),s=r&&Qn.get(r)||Qn.get(e);return((n=s?.rootView)===null||n===void 0?void 0:n.view)||null}}Ke.styleModule=mm;Ke.inputHandler=DI;Ke.clipboardInputFilter=R6;Ke.clipboardOutputFilter=D6;Ke.scrollHandler=II;Ke.focusChangeEffect=zI;Ke.perLineTextDirection=PI;Ke.exceptionSink=RI;Ke.updateListener=SS;Ke.editable=no;Ke.mouseSelectionStyle=AI;Ke.dragMovesSelection=MI;Ke.clickAddsSelectionRange=_I;Ke.decorations=Ym;Ke.outerDecorations=FI;Ke.atomicRanges=Y0;Ke.bidiIsolatedRanges=$I;Ke.scrollMargins=QI;Ke.darkTheme=NS;Ke.cspNonce=nt.define({combine:t=>t.length?t[0]:""});Ke.contentAttributes=z6;Ke.editorAttributes=qI;Ke.lineWrapping=Ke.contentAttributes.of({class:"cm-lineWrapping"});Ke.announce=Lt.define();const aie=4096,fT={};class q1{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:sr.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&&gS(a,n)}return n}const lie=Je.mac?"mac":Je.windows?"win":Je.linux?"linux":"key";function oie(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let s,i,a,o;for(let c=0;cr.concat(s),[]))),n}function uie(t,e,n){return cB(oB(t.state),e,t,n)}let cc=null;const die=4e3;function hie(t,e=lie){let n=Object.create(null),r=Object.create(null),s=(a,o)=>{let c=r[a];if(c==null)r[a]=o;else if(c!=o)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},i=(a,o,c,h,f)=>{var m,g;let x=n[a]||(n[a]=Object.create(null)),y=o.split(/ (?!$)/).map(k=>oie(k,e));for(let k=1;k{let T=cc={view:C,prefix:N,scope:a};return setTimeout(()=>{cc==T&&(cc=null)},die),!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),h&&(S.preventDefault=!0),f&&(S.stopPropagation=!0)};for(let a of t){let o=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let h of o){let f=n[h]||(n[h]=Object.create(null));f._any||(f._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:m}=a;for(let g in f)f[g].run.push(x=>m(x,ES))}let c=a[e]||a.key;if(c)for(let h of o)i(h,c,a.run,a.preventDefault,a.stopPropagation),a.shift&&i(h,"Shift-"+c,a.shift,a.preventDefault,a.stopPropagation)}return n}let ES=null;function cB(t,e,n,r){ES=e;let s=Dre(e),i=ei(s,0),a=Za(i)==s.length&&s!=" ",o="",c=!1,h=!1,f=!1;cc&&cc.view==n&&cc.scope==r&&(o=cc.prefix+" ",KI.indexOf(e.keyCode)<0&&(h=!0,cc=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&&(f=!0),!0;S.preventDefault&&(S.stopPropagation&&(f=!0),h=!0)}return!1},x=t[r],y,w;return x&&(g(x[o+ox(s,e,!a)])?c=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Je.windows&&e.ctrlKey&&e.altKey)&&!(Je.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(y=bc[e.keyCode])&&y!=s?(g(x[o+ox(y,e,!0)])||e.shiftKey&&(w=Gm[e.keyCode])!=s&&w!=y&&g(x[o+ox(w,e,!1)]))&&(c=!0):a&&e.shiftKey&&g(x[o+ox(s,e,!0)])&&(c=!0),!c&&g(x._any)&&(c=!0)),h&&(c=!0),c&&f&&e.stopPropagation(),ES=null,c}class Z0{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=uB(e);return[new Z0(n,s.left-i.left,s.top-i.top,null,s.bottom-s.top)]}else return fie(e,n,r)}}function uB(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==sr.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function gT(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,o=t.posAtCoords({x:i.left+1,y:a}),c=t.posAtCoords({x:i.right-1,y:a});return o==null||c==null?r:{from:Math.max(r.from,Math.min(o,c)),to:Math.min(r.to,Math.max(o,c))}}function fie(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==sr.LTR,a=t.contentDOM,o=a.getBoundingClientRect(),c=uB(t),h=a.querySelector(".cm-line"),f=h&&window.getComputedStyle(h),m=o.left+(f?parseInt(f.paddingLeft)+Math.min(0,parseInt(f.textIndent)):0),g=o.right-(f?parseInt(f.paddingRight):0),x=jS(t,r,1),y=jS(t,s,-1),w=x.type==Is.Text?x:null,S=y.type==Is.Text?y:null;if(w&&(t.lineWrapping||x.widgetLineBreaks)&&(w=gT(t,r,1,w)),S&&(t.lineWrapping||y.widgetLineBreaks)&&(S=gT(t,s,-1,S)),w&&S&&w.from==S.from&&w.to==S.to)return N(C(n.from,n.to,w));{let _=w?C(n.from,null,w):T(x,!1),E=S?C(null,n.to,S):T(y,!0),M=[];return(w||x).to<(S||y).from-(w&&S?1:0)||x.widgetLineBreaks>1&&_.bottom+t.defaultLineHeight/2U&&z.from=B)break;R>H&&Q(Math.max(G,H),_==null&&G<=U,Math.min(R,B),E==null&&R>=ee,J.dir)}if(H=X.to+1,H>=B)break}return I.length==0&&Q(U,_==null,ee,E==null,t.textDirection),{top:L,bottom:P,horizontal:I}}function T(_,E){let M=o.top+(E?_.top:_.bottom);return{top:M,bottom:M,horizontal:[]}}}function mie(t,e){return t.constructor==e.constructor&&t.eq(e)}class pie{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(o1)!=e.state.facet(o1)&&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(o1);for(;n!mie(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,Je.safari&&Je.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 o1=nt.define();function dB(t){return[_r.define(e=>new pie(e,t)),o1.of(t)]}const Km=nt.define({combine(t){return gl(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function gie(t={}){return[Km.of(t),xie,vie,yie,LI.of(!0)]}function hB(t){return t.startState.facet(Km)!=t.state.facet(Km)}const xie=dB({above:!0,markers(t){let{state:e}=t,n=e.facet(Km),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",o=s.empty?s:Ae.cursor(s.head,s.head>s.anchor?-1:1);for(let c of Z0.forRange(t,a,o))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=hB(t);return n&&xT(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){xT(e.state,t)},class:"cm-cursorLayer"});function xT(t,e){e.style.animationDuration=t.facet(Km).cursorBlinkRate+"ms"}const vie=dB({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:Z0.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||hB(t)},class:"cm-selectionLayer"}),yie=Ac.highest(Ke.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"}}}})),fB=Lt.define({map(t,e){return t==null?null:e.mapPos(t)}}),xm=us.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(fB)?r.value:n,t)}}),bie=_r.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(xm);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(xm)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(xm),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(xm)!=t&&this.view.dispatch({effects:fB.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 wie(){return[xm,bie]}function vT(t,e,n,r,s){e.lastIndex=0;for(let i=t.iterRange(n,r),a=n,o;!i.next().done;a+=i.value.length)if(!i.lineBreak)for(;o=e.exec(i.value);)s(a+o.index,o)}function Sie(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 kie{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=(o,c,h,f)=>s(f,h,h+o[0].length,o,c);else if(typeof r=="function")this.addMatch=(o,c,h,f)=>{let m=r(o,c,h);m&&f(h,h+o[0].length,m)};else if(r)this.addMatch=(o,c,h,f)=>f(h,h+o[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 fo,r=n.add.bind(n);for(let{from:s,to:i}of Sie(e,this.maxLength))vT(e.state.doc,this.regexp,s,i,(a,o)=>this.addMatch(o,e,a,r));return n.finish()}updateDeco(e,n){let r=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((i,a,o,c)=>{c>=e.view.viewport.from&&o<=e.view.viewport.to&&(r=Math.min(o,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),o=Math.min(i.to,s);if(o>=a){let c=e.state.doc.lineAt(a),h=c.toc.from;a--)if(this.boundary.test(c.text[a-1-c.from])){f=a;break}for(;og.push(k.range(w,S));if(c==h)for(this.regexp.lastIndex=f-c.from;(x=this.regexp.exec(c.text))&&x.indexthis.addMatch(S,e,w,y));n=n.update({filterFrom:f,filterTo:m,filter:(w,S)=>wm,add:g})}}return n}}const _S=/x/.unicode!=null?"gu":"g",jie=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,_S),Oie={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 Ow=null;function Nie(){var t;if(Ow==null&&typeof document<"u"&&document.body){let e=document.body.style;Ow=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Ow||!1}const c1=nt.define({combine(t){let e=gl(t,{render:null,specialChars:jie,addSpecialChars:null});return(e.replaceTabs=!Nie())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,_S)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,_S)),e}});function Cie(t={}){return[c1.of(t),Tie()]}let yT=null;function Tie(){return yT||(yT=_r.fromClass(class{constructor(t){this.view=t,this.decorations=xt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(c1)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new kie({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:s}=n.state,i=ei(e[0],0);if(i==9){let a=s.lineAt(r),o=n.state.tabSize,c=Fh(a.text,o,r-a.from);return xt.replace({widget:new Aie((o-c%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=xt.replace({widget:new Mie(t,i)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(c1);t.startState.facet(c1)!=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 Eie="•";function _ie(t){return t>=32?Eie:t==10?"␤":String.fromCharCode(9216+t)}class Mie extends xl{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=_ie(this.code),r=e.state.phrase("Control character")+" "+(Oie[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 Aie extends xl{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 Rie(){return zie}const Die=xt.line({class:"cm-activeLine"}),zie=_r.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(Die.range(s.from)),e=s.from)}return xt.set(n)}},{decorations:t=>t.decorations});class Pie extends xl{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?yh(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),s=W0(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 Lie(t){let e=_r.fromClass(class{constructor(n){this.view=n,this.placeholder=t?xt.set([xt.widget({widget:new Pie(t),side:1}).range(0)]):xt.none}get decorations(){return this.view.state.doc.length?xt.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,Ke.contentAttributes.of({"aria-placeholder":t})]:e}const MS=2e3;function Iie(t,e,n){let r=Math.min(e.line,n.line),s=Math.max(e.line,n.line),i=[];if(e.off>MS||n.off>MS||e.col<0||n.col<0){let a=Math.min(e.off,n.off),o=Math.max(e.off,n.off);for(let c=r;c<=s;c++){let h=t.doc.line(c);h.length<=o&&i.push(Ae.range(h.from+a,h.to+o))}}else{let a=Math.min(e.col,n.col),o=Math.max(e.col,n.col);for(let c=r;c<=s;c++){let h=t.doc.line(c),f=oS(h.text,a,t.tabSize,!0);if(f<0)i.push(Ae.cursor(h.to));else{let m=oS(h.text,o,t.tabSize);i.push(Ae.range(h.from+f,h.from+m))}}}return i}function Bie(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function bT(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>MS?-1:s==r.length?Bie(t,e.clientX):Fh(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:i,off:s}}function qie(t,e){let n=bT(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 o=bT(t,s);if(!o)return r;let c=Iie(t.state,n,o);return c.length?a?Ae.create(c.concat(r.ranges)):Ae.create(c):r}}:null}function Fie(t){let e=(n=>n.altKey&&n.button==0);return Ke.mouseSelectionStyle.of((n,r)=>e(r)?qie(n,r):null)}const $ie={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},Qie={style:"cursor: crosshair"};function Hie(t={}){let[e,n]=$ie[t.key||"Alt"],r=_r.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,Ke.contentAttributes.of(s=>{var i;return!((i=s.plugin(r))===null||i===void 0)&&i.isDown?Qie:null})]}const cx="-10000px";class mB{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=[],o=n?[]:null;for(let c=0;cn[h]=c),n.length=o.length),this.input=s,this.tooltips=i,this.tooltipViews=a,!0}}function Vie(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Nw=nt.define({combine:t=>{var e,n,r;return{position:Je.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)||Vie}}}),wT=new WeakMap,q6=_r.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(Nw);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 mB(t,F6,(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(Nw);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=cx,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(Je.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=P6(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 o=this.manager.tooltipViews[a];return o.getCoords?o.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(Nw).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:n,space:r,scaleX:s,scaleY:i}=t,a=[];for(let o=0;o=Math.min(n.bottom,r.bottom)||m.rightMath.min(n.right,r.right)+.1)){f.style.top=cx;continue}let x=c.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,y=x?7:0,w=g.right-g.left,S=(e=wT.get(h))!==null&&e!==void 0?e:g.bottom-g.top,k=h.offset||Wie,N=this.view.textDirection==sr.LTR,C=g.width>r.right-r.left?N?r.left:r.right-g.width:N?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[o];!c.strictSide&&(T?m.top-S-y-k.yr.bottom)&&T==r.bottom-m.bottom>m.top-r.top&&(T=this.above[o]=!T);let _=(T?m.top-r.top:r.bottom-m.bottom)-y;if(_C&&L.topE&&(E=T?L.top-S-2-y:L.bottom+y+2);if(this.position=="absolute"?(f.style.top=(E-t.parent.top)/i+"px",ST(f,(C-t.parent.left)/s)):(f.style.top=E/i+"px",ST(f,C/s)),x){let L=m.left+(N?k.x:-k.x)-(C+14-7);x.style.left=L/s+"px"}h.overlap!==!0&&a.push({left:C,top:E,right:M,bottom:E+S}),f.classList.toggle("cm-tooltip-above",T),f.classList.toggle("cm-tooltip-below",!T),h.positioned&&h.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=cx}},{eventObservers:{scroll(){this.maybeMeasure()}}});function ST(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const Uie=Ke.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"}}}),Wie={x:0,y:0},F6=nt.define({enables:[q6,Uie]}),F1=nt.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class Zv{static create(e){return new Zv(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new mB(e,F1,(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 Gie=F6.compute([F1],t=>{let e=t.facet(F1);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:Zv.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class Xie{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;eo.bottom||n.xo.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(s)).find(f=>f.from<=s&&f.to>=s),h=c&&c.dir==sr.RTL?-1:1;i=n.x{this.pending==o&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>ni(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(q6),n=e?e.manager.tooltips.findIndex(r=>r.create==Zv.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&&!Yie(i.dom,e)||this.pending){let{pos:a}=s[0]||this.pending,o=(r=(n=s[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:a;(a==o?this.view.posAtCoords(this.lastMove)!=a:!Kie(this.view,a,o,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 ux=4;function Yie(t,e){let{left:n,right:r,top:s,bottom:i}=t.getBoundingClientRect(),a;if(a=t.querySelector(".cm-tooltip-arrow")){let o=a.getBoundingClientRect();s=Math.min(o.top,s),i=Math.max(o.bottom,i)}return e.clientX>=n-ux&&e.clientX<=r+ux&&e.clientY>=s-ux&&e.clientY<=i+ux}function Kie(t,e,n,r,s,i){let a=t.scrollDOM.getBoundingClientRect(),o=t.documentTop+t.documentPadding.top+t.contentHeight;if(a.left>r||a.rights||Math.min(a.bottom,o)=e&&c<=n}function Zie(t,e={}){let n=Lt.define(),r=us.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 o of s){let c=i.changes.mapPos(o.pos,-1,vs.TrackDel);if(c!=null){let h=Object.assign(Object.create(null),o);h.pos=c,h.end!=null&&(h.end=i.changes.mapPos(h.end)),a.push(h)}}s=a}for(let a of i.effects)a.is(n)&&(s=a.value),a.is(Jie)&&(s=[]);return s},provide:s=>F1.from(s)});return{active:r,extension:[r,_r.define(s=>new Xie(s,t,r,n,e.hoverTime||300)),Gie]}}function pB(t,e){let n=t.plugin(q6);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const Jie=Lt.define(),kT=nt.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 Zm(t,e){let n=t.plugin(gB),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const gB=_r.fromClass(class{constructor(t){this.input=t.state.facet(Jm),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(kT);this.top=new dx(t,!0,e.topContainer),this.bottom=new dx(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(kT);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new dx(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new dx(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Jm);if(n!=this.input){let r=n.filter(c=>c),s=[],i=[],a=[],o=[];for(let c of r){let h=this.specs.indexOf(c),f;h<0?(f=c(t.view),o.push(f)):(f=this.panels[h],f.update&&f.update(t)),s.push(f),(f.top?i:a).push(f)}this.specs=r,this.panels=s,this.top.sync(i),this.bottom.sync(a);for(let c of o)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=>Ke.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class dx{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=jT(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=jT(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 jT(t){let e=t.nextSibling;return t.remove(),e}const Jm=nt.define({enables:gB});class po extends _u{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}po.prototype.elementClass="";po.prototype.toDOM=void 0;po.prototype.mapMode=vs.TrackBefore;po.prototype.startSide=po.prototype.endSide=-1;po.prototype.point=!0;const u1=nt.define(),eae=nt.define(),tae={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>On.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Am=nt.define();function nae(t){return[xB(),Am.of({...tae,...t})]}const OT=nt.define({combine:t=>t.some(e=>e)});function xB(t){return[rae]}const rae=_r.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(Am).map(e=>new CT(t,e)),this.fixed=!t.state.facet(OT);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(OT)!=!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=On.iter(this.view.state.facet(u1),this.view.viewport.from),r=[],s=this.gutters.map(i=>new sae(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 o of i.type)if(o.type==Is.Text&&a){AS(n,r,o.from);for(let c of s)c.line(this.view,o,r);a=!1}else if(o.widget)for(let c of s)c.widget(this.view,o)}else if(i.type==Is.Text){AS(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(Am),n=t.state.facet(Am),r=t.docChanged||t.heightChanged||t.viewportChanged||!On.eq(t.startState.facet(u1),t.state.facet(u1),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 CT(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=>Ke.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==sr.LTR?{left:r,right:s}:{right:r,left:s}})});function NT(t){return Array.isArray(t)?t:[t]}function AS(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class sae{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=On.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 o=new vB(e,a,i,r);s.elements.push(o),s.dom.appendChild(o.dom)}else s.elements[this.i].update(e,a,i,r);this.height=n.bottom,this.i++}line(e,n,r){let s=[];AS(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(eae)){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 CT{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 o=e.lineBlockAtHeight(a-e.documentTop);n.domEventHandlers[r](e,o,s)&&s.preventDefault()});this.markers=NT(n.markers(e)),n.initialSpacer&&(this.spacer=new vB(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=NT(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!On.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 vB{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":""),iae(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 o=a,c=ii(o,c,h)||a(o,c,h):a}return r}})}});class Cw extends po{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Tw(t,e){return t.state.facet(Xd).formatNumber(e,t.state)}const oae=Am.compute([Xd],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(aae)},lineMarker(e,n,r){return r.some(s=>s.toDOM)?null:new Cw(Tw(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let s of e.state.facet(lae)){let i=s(e,n,r);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(Xd)!=e.state.facet(Xd),initialSpacer(e){return new Cw(Tw(e,TT(e.state.doc.lines)))},updateSpacer(e,n){let r=Tw(n.view,TT(n.view.state.doc.lines));return r==e.number?e:new Cw(r)},domEventHandlers:t.facet(Xd).domEventHandlers,side:"before"}));function cae(t={}){return[Xd.of(t),xB(),oae]}function TT(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(uae.range(s)))}return On.of(e)});function hae(){return dae}const yB=1024;let fae=0;class Ew{constructor(e,n){this.from=e,this.to=n}}class Yt{constructor(e={}){this.id=fae++,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=qs.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Yt.closedBy=new Yt({deserialize:t=>t.split(" ")});Yt.openedBy=new Yt({deserialize:t=>t.split(" ")});Yt.group=new Yt({deserialize:t=>t.split(" ")});Yt.isolate=new Yt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Yt.contextHash=new Yt({perNode:!0});Yt.lookAhead=new Yt({perNode:!0});Yt.mounted=new Yt({perNode:!0});class $1{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[Yt.mounted.id]}}const mae=Object.create(null);class qs{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):mae,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new qs(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(Yt.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(Yt.group),i=-1;i<(s?s.length:0);i++){let a=n[i<0?r.name:s[i]];if(a)return a}}}}qs.none=new qs("",Object.create(null),0,8);class Jv{constructor(e){this.types=e;for(let n=0;n0;for(let c=this.cursor(a|Jr.IncludeAnonymous);;){let h=!1;if(c.from<=i&&c.to>=s&&(!o&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;h=!0}for(;h&&r&&(o||!c.type.isAnonymous)&&r(c),!c.nextSibling();){if(!c.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:H6(qs.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,s)=>new Xn(this.type,n,r,s,this.propValues),e.makeTree||((n,r,s)=>new Xn(qs.none,n,r,s)))}static build(e){return vae(e)}}Xn.empty=new Xn(qs.none,[],[],0);class $6{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 $6(this.buffer,this.index)}}class Sc{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return qs.none}toString(){let e=[];for(let n=0;n0));c=a[c+3]);return o}slice(e,n,r){let s=this.buffer,i=new Uint16Array(n-e),a=0;for(let o=e,c=0;o=e&&ne;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function e0(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?o.length:-1;e!=h;e+=n){let f=o[e],m=c[e]+a.from;if(bB(s,r,m,m+f.length)){if(f instanceof Sc){if(i&Jr.ExcludeBuffers)continue;let g=f.findChild(0,f.buffer.length,n,r-m,s);if(g>-1)return new nl(new pae(a,f,e,m),null,g)}else if(i&Jr.IncludeAnonymous||!f.type.isAnonymous||Q6(f)){let g;if(!(i&Jr.IgnoreMounts)&&(g=$1.get(f))&&!g.overlay)return new ai(g.tree,m,e,a);let x=new ai(f,m,e,a);return i&Jr.IncludeAnonymous||!x.type.isAnonymous?x:x.nextChild(n<0?f.children.length-1:0,n,r,s)}}}if(i&Jr.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&Jr.IgnoreOverlays)&&(s=$1.get(this._tree))&&s.overlay){let i=e-this.from;for(let{from:a,to:o}of s.overlay)if((n>0?a<=i:a=i:o>i))return new ai(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 _T(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 RS(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 pae{constructor(e,n,r,s){this.parent=e,this.buffer=n,this.index=r,this.start=s}}class nl extends wB{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 nl(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&Jr.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 nl(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 nl(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 nl(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 Xn(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function SB(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;in.from||a.to=e){let o=new ai(a.tree,a.overlay[0].from+i.from,-1,i);(s||(s=[r])).push(e0(o,e,n,!1))}}return s?SB(s):r}class DS{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 ai)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 ai?(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&Jr.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Jr.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Jr.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 o=r._tree.children[i];if(this.mode&Jr.IncludeAnonymous||o instanceof Sc||!o.type.isAnonymous||Q6(o))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 RS(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 Q6(t){return t.children.some(e=>e instanceof Sc||!e.type.isAnonymous||Q6(e))}function vae(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:s=yB,reused:i=[],minRepeatType:a=r.types.length}=t,o=Array.isArray(n)?new $6(n,n.length):n,c=r.types,h=0,f=0;function m(_,E,M,L,P,I){let{id:Q,start:U,end:ee,size:z}=o,H=f,B=h;if(z<0)if(o.next(),z==-1){let se=i[Q];M.push(se),L.push(U-_);return}else if(z==-3){h=Q;return}else if(z==-4){f=Q;return}else throw new RangeError(`Unrecognized record size: ${z}`);let X=c[Q],J,G,R=U-_;if(ee-U<=s&&(G=S(o.pos-E,P))){let se=new Uint16Array(G.size-G.skip),W=o.pos-G.size,F=se.length;for(;o.pos>W;)F=k(G.start,se,F);J=new Sc(se,ee-G.start,r),R=G.start-_}else{let se=o.pos-z;o.next();let W=[],F=[],V=Q>=a?Q:-1,te=0,ne=ee;for(;o.pos>se;)V>=0&&o.id==V&&o.size>=0?(o.end<=ne-s&&(y(W,F,U,te,o.end,ne,V,H,B),te=W.length,ne=o.end),o.next()):I>2500?g(U,se,W,F):m(U,se,W,F,V,I+1);if(V>=0&&te>0&&te-1&&te>0){let K=x(X,B);J=H6(X,W,F,0,W.length,0,ee-U,K,K)}else J=w(X,W,F,ee-U,H-ee,B)}M.push(J),L.push(R)}function g(_,E,M,L){let P=[],I=0,Q=-1;for(;o.pos>E;){let{id:U,start:ee,end:z,size:H}=o;if(H>4)o.next();else{if(Q>-1&&ee=0;z-=3)U[H++]=P[z],U[H++]=P[z+1]-ee,U[H++]=P[z+2]-ee,U[H++]=H;M.push(new Sc(U,P[2]-ee,r)),L.push(ee-_)}}function x(_,E){return(M,L,P)=>{let I=0,Q=M.length-1,U,ee;if(Q>=0&&(U=M[Q])instanceof Xn){if(!Q&&U.type==_&&U.length==P)return U;(ee=U.prop(Yt.lookAhead))&&(I=L[Q]+U.length+ee)}return w(_,M,L,P,I,E)}}function y(_,E,M,L,P,I,Q,U,ee){let z=[],H=[];for(;_.length>L;)z.push(_.pop()),H.push(E.pop()+M-P);_.push(w(r.types[Q],z,H,I-P,U-I,ee)),E.push(P-M)}function w(_,E,M,L,P,I,Q){if(I){let U=[Yt.contextHash,I];Q=Q?[U].concat(Q):[U]}if(P>25){let U=[Yt.lookAhead,P];Q=Q?[U].concat(Q):[U]}return new Xn(_,E,M,L,Q)}function S(_,E){let M=o.fork(),L=0,P=0,I=0,Q=M.end-s,U={size:0,start:0,skip:0};e:for(let ee=M.pos-_;M.pos>ee;){let z=M.size;if(M.id==E&&z>=0){U.size=L,U.start=P,U.skip=I,I+=4,L+=4,M.next();continue}let H=M.pos-z;if(z<0||H=a?4:0,X=M.start;for(M.next();M.pos>H;){if(M.size<0)if(M.size==-3)B+=4;else break e;else M.id>=a&&(B+=4);M.next()}P=X,L+=z,I+=B}return(E<0||L==_)&&(U.size=L,U.start=P,U.skip=I),U.size>4?U:void 0}function k(_,E,M){let{id:L,start:P,end:I,size:Q}=o;if(o.next(),Q>=0&&L4){let ee=o.pos-(Q-4);for(;o.pos>ee;)M=k(_,E,M)}E[--M]=U,E[--M]=I-_,E[--M]=P-_,E[--M]=L}else Q==-3?h=L:Q==-4&&(f=L);return M}let N=[],C=[];for(;o.pos>0;)m(t.start||0,t.bufferStart||0,N,C,-1,0);let T=(e=t.length)!==null&&e!==void 0?e:N.length?C[0]+N[0].length:0;return new Xn(c[t.topID],N.reverse(),C.reverse(),T)}const MT=new WeakMap;function d1(t,e){if(!t.isAnonymous||e instanceof Sc||e.type!=t)return 1;let n=MT.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Xn)){n=1;break}n+=d1(t,r)}MT.set(e,n)}return n}function H6(t,e,n,r,s,i,a,o,c){let h=0;for(let y=r;y=f)break;E+=M}if(C==T+1){if(E>f){let M=y[T];x(M.children,M.positions,0,M.children.length,w[T]+N);continue}m.push(y[T])}else{let M=w[C-1]+y[C-1].length-_;m.push(H6(t,y,w,T,C,_,M,null,c))}g.push(_+N-i)}}return x(e,n,r,s,0),(o||c)(m,g,a)}class yae{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 nl?this.setBuffer(e.context.buffer,e.index,n):e instanceof ai&&this.map.set(e.tree,n)}get(e){return e instanceof nl?this.getBuffer(e.context.buffer,e.index):e instanceof ai?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 o=0,c=0,h=0;;o++){let f=o=r)for(;a&&a.from=g.from||m<=g.to||h){let x=Math.max(g.from,c)-h,y=Math.min(g.to,m)-h;g=x>=y?null:new ju(x,y,g.tree,g.offset+h,o>0,!!f)}if(g&&s.push(g),a.to>m)break;a=inew Ew(s.from,s.to)):[new Ew(0,0)]:[new Ew(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 bae{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 Yt({perNode:!0});let wae=0;class Xi{constructor(e,n,r,s){this.name=e,this.set=n,this.base=r,this.modified=s,this.id=wae++}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 Xi&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let s=new Xi(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 Q1(e);return r=>r.modified.indexOf(n)>-1?r:Q1.get(r.base||r,r.modified.concat(n).sort((s,i)=>s.id-i.id))}}let Sae=0;class Q1{constructor(e){this.name=e,this.instances=[],this.id=Sae++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(o=>o.base==e&&kae(n,o.modified));if(r)return r;let s=[],i=new Xi(e.name,s,e,n);for(let o of n)o.instances.push(i);let a=jae(n);for(let o of e.set)if(!o.modified.length)for(let c of a)s.push(Q1.get(o,c));return i}}function kae(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function jae(t){let e=[[]];for(let n=0;nr.length-n.length)}function U6(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,o=s;for(let m=0;;){if(o=="..."&&m>0&&m+3==s.length){a=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);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);o=s.slice(m)}let c=i.length-1,h=i[c];if(!h)throw new RangeError("Invalid path: "+s);let f=new t0(r,a,c>0?i.slice(0,c):null);e[h]=f.sort(e[h])}}return kB.add(e)}const kB=new Yt({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 t0(s.tags,s.mode,s.context);n?n.next=i:r=i,n=i}return r}});class t0{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 o of i)for(let c of o.set){let h=n[c.id];if(h){a=a?a+" "+h:h;break}}return a},scope:r}}function Oae(t,e){let n=null;for(let r of t){let s=r.style(e);s&&(n=n?n+" "+s:s)}return n}function Nae(t,e,n,r=0,s=t.length){let i=new Cae(r,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),r,s,"",i.highlighters),i.flush(s)}class Cae{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:o,to:c}=e;if(o>=r||c<=n)return;a.isTop&&(i=this.highlighters.filter(x=>!x.scope||x.scope(a)));let h=s,f=Tae(e)||t0.empty,m=Oae(i,f.tags);if(m&&(h&&(h+=" "),h+=m,f.mode==1&&(s+=(s?" ":"")+m)),this.startSpan(Math.max(n,o),h),f.opaque)return;let g=e.tree&&e.tree.prop(Yt.mounted);if(g&&g.overlay){let x=e.node.enter(g.overlay[0].from+o,1),y=this.highlighters.filter(S=>!S.scope||S.scope(g.tree.type)),w=e.firstChild();for(let S=0,k=o;;S++){let N=S=C||!e.nextSibling())););if(!N||C>r)break;k=N.to+o,k>n&&(this.highlightRange(x.cursor(),Math.max(n,N.from+o),Math.min(r,k),"",y),this.startSpan(Math.min(r,k),h))}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),h)}while(e.nextSibling());e.parent()}}}function Tae(t){let e=t.type.prop(kB);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ye=Xi.define,fx=Ye(),ic=Ye(),AT=Ye(ic),RT=Ye(ic),ac=Ye(),mx=Ye(ac),_w=Ye(ac),Ga=Ye(),su=Ye(Ga),Ua=Ye(),Wa=Ye(),zS=Ye(),em=Ye(zS),px=Ye(),xe={comment:fx,lineComment:Ye(fx),blockComment:Ye(fx),docComment:Ye(fx),name:ic,variableName:Ye(ic),typeName:AT,tagName:Ye(AT),propertyName:RT,attributeName:Ye(RT),className:Ye(ic),labelName:Ye(ic),namespace:Ye(ic),macroName:Ye(ic),literal:ac,string:mx,docString:Ye(mx),character:Ye(mx),attributeValue:Ye(mx),number:_w,integer:Ye(_w),float:Ye(_w),bool:Ye(ac),regexp:Ye(ac),escape:Ye(ac),color:Ye(ac),url:Ye(ac),keyword:Ua,self:Ye(Ua),null:Ye(Ua),atom:Ye(Ua),unit:Ye(Ua),modifier:Ye(Ua),operatorKeyword:Ye(Ua),controlKeyword:Ye(Ua),definitionKeyword:Ye(Ua),moduleKeyword:Ye(Ua),operator:Wa,derefOperator:Ye(Wa),arithmeticOperator:Ye(Wa),logicOperator:Ye(Wa),bitwiseOperator:Ye(Wa),compareOperator:Ye(Wa),updateOperator:Ye(Wa),definitionOperator:Ye(Wa),typeOperator:Ye(Wa),controlOperator:Ye(Wa),punctuation:zS,separator:Ye(zS),bracket:em,angleBracket:Ye(em),squareBracket:Ye(em),paren:Ye(em),brace:Ye(em),content:Ga,heading:su,heading1:Ye(su),heading2:Ye(su),heading3:Ye(su),heading4:Ye(su),heading5:Ye(su),heading6:Ye(su),contentSeparator:Ye(Ga),list:Ye(Ga),quote:Ye(Ga),emphasis:Ye(Ga),strong:Ye(Ga),link:Ye(Ga),monospace:Ye(Ga),strikethrough:Ye(Ga),inserted:Ye(),deleted:Ye(),changed:Ye(),invalid:Ye(),meta:px,documentMeta:Ye(px),annotation:Ye(px),processingInstruction:Ye(px),definition:Xi.defineModifier("definition"),constant:Xi.defineModifier("constant"),function:Xi.defineModifier("function"),standard:Xi.defineModifier("standard"),local:Xi.defineModifier("local"),special:Xi.defineModifier("special")};for(let t in xe){let e=xe[t];e instanceof Xi&&(e.name=t)}jB([{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 Mw;const gu=new Yt;function OB(t){return nt.define({combine:t?e=>e.concat(t):void 0})}const Eae=new Yt;class Zi{constructor(e,n,r=[],s=""){this.data=e,this.name=s,dn.prototype.hasOwnProperty("tree")||Object.defineProperty(dn.prototype,"tree",{get(){return ls(this)}}),this.parser=n,this.extension=[kc.of(this),dn.languageData.of((i,a,o)=>{let c=DT(i,a,o),h=c.type.prop(gu);if(!h)return[];let f=i.facet(h),m=c.type.prop(Eae);if(m){let g=c.resolve(a-c.from,o);for(let x of m)if(x.test(g,i)){let y=i.facet(x.facet);return x.type=="replace"?y:y.concat(f)}}return f})].concat(r)}isActiveAt(e,n,r=-1){return DT(e,n,r).type.prop(gu)==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(gu)==this.data){r.push({from:a,to:a+i.length});return}let o=i.prop(Yt.mounted);if(o){if(o.tree.prop(gu)==this.data){if(o.overlay)for(let c of o.overlay)r.push({from:c.from+a,to:c.to+a});else r.push({from:a,to:a+i.length});return}else if(o.overlay){let c=r.length;if(s(o.tree,o.overlay[0].from+a),r.length>c)return}}for(let c=0;cr.isTop?n:void 0)]}),e.name)}configure(e,n){return new n0(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ls(t){let e=t.field(Zi.state,!1);return e?e.tree:Xn.empty}class _ae{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 tm=null;class kh{constructor(e,n,r=[],s,i,a,o,c){this.parser=e,this.state=n,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new kh(e,n,[],Xn.empty,0,r,[],null)}startParse(){return this.parser.startParse(new _ae(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Xn.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=tm;tm=this;try{return e()}finally{tm=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=zT(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:s,treeLen:i,viewport:a,skipped:o}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((h,f,m,g)=>c.push({fromA:h,toA:f,fromB:m,toB:g})),r=ju.applyChanges(r,c),s=Xn.empty,i=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let f=e.mapPos(h.from,1),m=e.mapPos(h.to,-1);fe.from&&(this.fragments=zT(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 V6{createParse(n,r,s){let i=s[0].from,a=s[s.length-1].to;return{parsedPos:i,advance(){let c=tm;if(c){for(let h of s)c.tempSkipped.push(h);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=a,new Xn(qs.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 tm}}function zT(t,e,n){return ju.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class jh{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 jh(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=kh.create(e.facet(kc).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new jh(r)}}Zi.state=us.define({create:jh.init,update(t,e){for(let n of e.effects)if(n.is(Zi.setState))return n.value;return e.startState.facet(kc)!=e.state.facet(kc)?jh.init(e.state):t.apply(e)}});let NB=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(NB=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Aw=typeof navigator<"u"&&(!((Mw=navigator.scheduling)===null||Mw===void 0)&&Mw.isInputPending)?()=>navigator.scheduling.isInputPending():null,Mae=_r.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(Zi.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(Zi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=NB(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnds+1e3,c=i.context.work(()=>Aw&&Aw()||Date.now()>a,s+(o?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:Zi.setState.of(new jh(i.context))})),this.chunkBudget>0&&!(c&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>ni(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=nt.define({combine(t){return t.length?t[0]:null},enables:t=>[Zi.state,Mae,Ke.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class CB{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Aae=nt.define(),J0=nt.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 Du(t){let e=t.facet(J0);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function r0(t,e){let n="",r=t.tabSize,s=t.facet(J0)[0];if(s==" "){for(;e>=r;)n+=" ",e-=r;s=" "}for(let i=0;i=e?Rae(t,n,e):null}class ey{constructor(e,n={}){this.state=e,this.options=n,this.unit=Du(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 Fh(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 ty=new Yt;function Rae(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 TB(r,t,n)}function TB(t,e,n){for(let r=t;r;r=r.next){let s=zae(r.node);if(s)return s(G6.create(e,n,r))}return 0}function Dae(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function zae(t){let e=t.type.prop(ty);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Yt.closedBy))){let s=t.lastChild,i=s&&r.indexOf(s.name)>-1;return a=>EB(a,!0,1,void 0,i&&!Dae(a)?s.from:void 0)}return t.parent==null?Pae:null}function Pae(){return 0}class G6 extends ey{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 G6(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(Lae(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return TB(this.context.next,this.base,this.pos)}}function Lae(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Iae(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 o=n.to;;){let c=e.childAfter(o);if(!c||c==r)return null;if(!c.type.isSkipped){if(c.from>=a)return null;let h=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+h}}o=c.to}}function Rw({closing:t,align:e=!0,units:n=1}){return r=>EB(r,e,n,t)}function EB(t,e,n,r,s){let i=t.textAfter,a=i.match(/^\s*/)[0].length,o=r&&i.slice(a,a+r.length)==r||s==t.pos+a,c=e?Iae(t):null;return c?o?t.column(c.from):t.column(c.to):t.baseIndent+(o?0:t.unit*n)}function PT({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const Bae=200;function qae(){return dn.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+Bae)return t;let i=n.sliceString(s.from,r);if(!e.some(h=>h.test(i)))return t;let{state:a}=t,o=-1,c=[];for(let{head:h}of a.selection.ranges){let f=a.doc.lineAt(h);if(f.from==o)continue;o=f.from;let m=W6(a,f.from);if(m==null)continue;let g=/^\s*/.exec(f.text)[0],x=r0(a,m);g!=x&&c.push({from:f.from,to:f.from+g.length,insert:x})}return c.length?[t,{changes:c,sequential:!0}]:t})}const Fae=nt.define(),X6=new Yt;function _B(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(i&&o.from=e&&h.to>n&&(i=h)}}return i}function Qae(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function H1(t,e,n){for(let r of t.facet(Fae)){let s=r(t,e,n);if(s)return s}return $ae(t,e,n)}function MB(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 ny=Lt.define({map:MB}),ep=Lt.define({map:MB});function AB(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 zu=us.define({create(){return xt.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((n,r)=>t=LT(t,n,r)),t=t.map(e.changes);for(let n of e.effects)if(n.is(ny)&&!Hae(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(zB),s=r?xt.replace({widget:new Kae(r(e.state,n.value))}):IT;t=t.update({add:[s.range(n.value.from,n.value.to)]})}else n.is(ep)&&(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=LT(t,e.selection.main.head)),t},provide:t=>Ke.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 V1(t,e,n){var r;let s=null;return(r=t.field(zu,!1))===null||r===void 0||r.between(e,n,(i,a)=>{(!s||s.from>i)&&(s={from:i,to:a})}),s}function Hae(t,e,n){let r=!1;return t.between(e,e,(s,i)=>{s==e&&i==n&&(r=!0)}),r}function RB(t,e){return t.field(zu,!1)?e:e.concat(Lt.appendConfig.of(PB()))}const Vae=t=>{for(let e of AB(t)){let n=H1(t.state,e.from,e.to);if(n)return t.dispatch({effects:RB(t.state,[ny.of(n),DB(t,n)])}),!0}return!1},Uae=t=>{if(!t.state.field(zu,!1))return!1;let e=[];for(let n of AB(t)){let r=V1(t.state,n.from,n.to);r&&e.push(ep.of(r),DB(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function DB(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return Ke.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${s}.`)}const Wae=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(zu,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,s)=>{n.push(ep.of({from:r,to:s}))}),t.dispatch({effects:n}),!0},Xae=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Vae},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Uae},{key:"Ctrl-Alt-[",run:Wae},{key:"Ctrl-Alt-]",run:Gae}],Yae={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},zB=nt.define({combine(t){return gl(t,Yae)}});function PB(t){return[zu,ele]}function LB(t,e){let{state:n}=t,r=n.facet(zB),s=a=>{let o=t.lineBlockAt(t.posAtDOM(a.target)),c=V1(t.state,o.from,o.to);c&&t.dispatch({effects:ep.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 IT=xt.replace({widget:new class extends xl{toDOM(t){return LB(t,null)}}});class Kae extends xl{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return LB(e,this.value)}}const Zae={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Dw extends po{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 Jae(t={}){let e={...Zae,...t},n=new Dw(e,!0),r=new Dw(e,!1),s=_r.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(zu,!1)!=a.state.field(zu,!1)||ls(a.startState)!=ls(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let o=new fo;for(let c of a.viewportLineBlocks){let h=V1(a.state,c.from,c.to)?r:H1(a.state,c.from,c.to)?n:null;h&&o.add(c.from,c.from,h)}return o.finish()}}),{domEventHandlers:i}=e;return[s,nae({class:"cm-foldGutter",markers(a){var o;return((o=a.plugin(s))===null||o===void 0?void 0:o.markers)||On.empty},initialSpacer(){return new Dw(e,!1)},domEventHandlers:{...i,click:(a,o,c)=>{if(i.click&&i.click(a,o,c))return!0;let h=V1(a.state,o.from,o.to);if(h)return a.dispatch({effects:ep.of(h)}),!0;let f=H1(a.state,o.from,o.to);return f?(a.dispatch({effects:ny.of(f)}),!0):!1}}}),PB()]}const ele=Ke.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 tp{constructor(e,n){this.specs=e;let r;function s(o){let c=yc.newName();return(r||(r=Object.create(null)))["."+c]=o,c}const i=typeof n.all=="string"?n.all:n.all?s(n.all):void 0,a=n.scope;this.scope=a instanceof Zi?o=>o.prop(gu)==a.data:a?o=>o==a:void 0,this.style=jB(e.map(o=>({tag:o.tag,class:o.class||s(Object.assign({},o,{tag:null}))})),{all:i}).style,this.module=r?new yc(r):null,this.themeType=n.themeType}static define(e,n){return new tp(e,n||{})}}const PS=nt.define(),IB=nt.define({combine(t){return t.length?[t[0]]:null}});function zw(t){let e=t.facet(PS);return e.length?e:t.facet(IB)}function BB(t,e){let n=[nle],r;return t instanceof tp&&(t.module&&n.push(Ke.styleModule.of(t.module)),r=t.themeType),e?.fallback?n.push(IB.of(t)):r?n.push(PS.computeN([Ke.darkTheme],s=>s.facet(Ke.darkTheme)==(r=="dark")?[t]:[])):n.push(PS.of(t)),n}class tle{constructor(e){this.markCache=Object.create(null),this.tree=ls(e.state),this.decorations=this.buildDeco(e,zw(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ls(e.state),r=zw(e.state),s=r!=zw(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 xt.none;let r=new fo;for(let{from:s,to:i}of e.visibleRanges)Nae(this.tree,n,(a,o,c)=>{r.add(a,o,this.markCache[c]||(this.markCache[c]=xt.mark({class:c})))},s,i);return r.finish()}}const nle=Ac.high(_r.fromClass(tle,{decorations:t=>t.decorations})),rle=tp.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"}]),sle=Ke.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),qB=1e4,FB="()[]{}",$B=nt.define({combine(t){return gl(t,{afterCursor:!0,brackets:FB,maxScanDistance:qB,renderMatch:lle})}}),ile=xt.mark({class:"cm-matchingBracket"}),ale=xt.mark({class:"cm-nonmatchingBracket"});function lle(t){let e=[],n=t.matched?ile:ale;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 ole=us.define({create(){return xt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet($B);for(let s of e.state.selection.ranges){if(!s.empty)continue;let i=rl(e.state,s.head,-1,r)||s.head>0&&rl(e.state,s.head-1,1,r)||r.afterCursor&&(rl(e.state,s.head,1,r)||s.headKe.decorations.from(t)}),cle=[ole,sle];function ule(t={}){return[$B.of(t),cle]}const dle=new Yt;function LS(t,e,n){let r=t.prop(e<0?Yt.openedBy:Yt.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 IS(t){let e=t.type.prop(dle);return e?e(t.node):t}function rl(t,e,n,r={}){let s=r.maxScanDistance||qB,i=r.brackets||FB,a=ls(t),o=a.resolveInner(e,n);for(let c=o;c;c=c.parent){let h=LS(c.type,n,i);if(h&&c.from0?e>=f.from&&ef.from&&e<=f.to))return hle(t,e,n,c,f,h,i)}}return fle(t,e,n,a,o.type,s,i)}function hle(t,e,n,r,s,i,a){let o=r.parent,c={from:s.from,to:s.to},h=0,f=o?.cursor();if(f&&(n<0?f.childBefore(r.from):f.childAfter(r.to)))do if(n<0?f.to<=r.from:f.from>=r.to){if(h==0&&i.indexOf(f.type.name)>-1&&f.from0)return null;let h={from:n<0?e-1:e,to:n>0?e+1:e},f=t.doc.iterRange(e,n>0?t.doc.length:0),m=0;for(let g=0;!f.next().done&&g<=i;){let x=f.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:h,end:{from:y+w,to:y+w+1},matched:k>>1==c>>1};m--}}n>0&&(g+=x.length)}return f.done?{start:h,matched:!1}:null}function BT(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 mle(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||ple,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||Z6,mergeTokens:t.mergeTokens!==!1}}function ple(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 qT=new WeakMap;class Y6 extends Zi{constructor(e){let n=OB(e.languageData),r=mle(e),s,i=new class extends V6{createParse(a,o,c){return new xle(s,a,o,c)}};super(n,i,[],e.name),this.topNode=ble(n,this),s=this,this.streamParser=r,this.stateAfter=new Yt({perNode:!0}),this.tokenTable=e.tokenTable?new WB(r.tokenTable):yle}static define(e){return new Y6(e)}getIndent(e){let n,{overrideIndentation:r}=e.options;r&&(n=qT.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 o=e.children[a],c=n+e.positions[a],h=o instanceof Xn&&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],o=e.children[i],c;if(an&&K6(t,i.tree,0-i.offset,n,o),h;if(c&&c.pos<=r&&(h=HB(t,i.tree,n+i.offset,c.pos+i.offset,!1)))return{state:c.state,tree:h}}return{state:t.streamParser.startState(s?Du(s):4),tree:Xn.empty}}let xle=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=kh.get(),a=s[0].from,{state:o,tree:c}=gle(e,r,a,this.to,i?.state);this.state=o,this.parsedPos=this.chunkStart=a+c.length;for(let h=0;hh.from<=i.viewport.from&&h.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(Du(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=kh.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,o=this.lineAfter(a);n+=o,r=a+o.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 o=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-o}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 QB(n,e?e.state.tabSize:4,e?Du(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let o=VB(i.token,a,this.state);if(o&&(s=this.emitToken(this.lang.tokenTable.resolve(o),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 Z6=Object.create(null),s0=[qs.none],vle=new Jv(s0),FT=[],$T=Object.create(null),UB=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"]])UB[t]=GB(Z6,e);class WB{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),UB)}resolve(e){return e?this.table[e]||(this.table[e]=GB(this.extra,e)):0}}const yle=new WB(Z6);function Pw(t,e){FT.indexOf(t)>-1||(FT.push(t),console.warn(e))}function GB(t,e){let n=[];for(let o of e.split(" ")){let c=[];for(let h of o.split(".")){let f=t[h]||xe[h];f?typeof f=="function"?c.length?c=c.map(f):Pw(h,`Modifier ${h} used at start of tag`):c.length?Pw(h,`Tag ${h} used as modifier`):c=Array.isArray(f)?f:[f]:Pw(h,`Unknown highlighting tag ${h}`)}for(let h of c)n.push(h)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),s=r+" "+n.map(o=>o.id),i=$T[s];if(i)return i.id;let a=$T[s]=qs.define({id:s0.length,name:r,props:[U6({[r]:n})]});return s0.push(a),a.id}function ble(t,e){let n=qs.define({id:s0.length,name:"Document",props:[gu.add(()=>t),ty.add(()=>r=>e.getIndent(r))],top:!0});return s0.push(n),n}sr.RTL,sr.LTR;const wle=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=ej(t.state,n.from);return r.line?Sle(t):r.block?jle(t):!1};function J6(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 Sle=J6(Cle,0),kle=J6(XB,0),jle=J6((t,e)=>XB(t,e,Nle(e)),0);function ej(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const nm=50;function Ole(t,{open:e,close:n},r,s){let i=t.sliceDoc(r-nm,r),a=t.sliceDoc(s,s+nm),o=/\s*$/.exec(i)[0].length,c=/^\s*/.exec(a)[0].length,h=i.length-o;if(i.slice(h-e.length,h)==e&&a.slice(c,c+n.length)==n)return{open:{pos:r-o,margin:o&&1},close:{pos:s+c,margin:c&&1}};let f,m;s-r<=2*nm?f=m=t.sliceDoc(r,s):(f=t.sliceDoc(r,r+nm),m=t.sliceDoc(s-nm,s));let g=/^\s*/.exec(f)[0].length,x=/\s*$/.exec(m)[0].length,y=m.length-x-n.length;return f.slice(g,g+e.length)==e&&m.slice(y,y+n.length)==n?{open:{pos:r+g+e.length,margin:/\s/.test(f.charAt(g+e.length))?1:0},close:{pos:s-x-n.length,margin:/\s/.test(m.charAt(y-1))?1:0}}:null}function Nle(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 XB(t,e,n=e.selection.ranges){let r=n.map(i=>ej(e,i.from).block);if(!r.every(i=>i))return null;let s=n.map((i,a)=>Ole(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,o;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+h.length)==h?g:-1;gi.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:o,token:c,indent:h,empty:f,single:m}of r)(m||!f)&&i.push({from:o.from+h,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:o,token:c}of r)if(o>=0){let h=a.from+o,f=h+c.length;a.text[f-a.from]==" "&&f++,i.push({from:h,to:f})}return{changes:i}}return null}const BS=pl.define(),Tle=pl.define(),Ele=nt.define(),YB=nt.define({combine(t){return gl(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)})}}),KB=us.define({create(){return sl.empty},update(t,e){let n=e.state.facet(YB),r=e.annotation(BS);if(r){let c=ri.fromTransaction(e,r.selection),h=r.side,f=h==0?t.undone:t.done;return c?f=U1(f,f.length,n.minDepth,c):f=eq(f,e.startState.selection),new sl(h==0?r.rest:f,h==0?f:r.rest)}let s=e.annotation(Tle);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation($r.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=ri.fromTransaction(e),a=e.annotation($r.time),o=e.annotation($r.userEvent);return i?t=t.addChanges(i,a,o,n,e):e.selection&&(t=t.addSelection(e.startState.selection,a,o,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 sl(t.done.map(ri.fromJSON),t.undone.map(ri.fromJSON))}});function _le(t={}){return[KB,YB.of(t),Ke.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?ZB:e.inputType=="historyRedo"?qS:null;return r?(e.preventDefault(),r(n)):!1}})]}function ry(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let s=n.field(KB,!1);if(!s)return!1;let i=s.pop(t,n,e);return i?(r(i),!0):!1}}const ZB=ry(0,!1),qS=ry(1,!1),Mle=ry(0,!0),Ale=ry(1,!0);class ri{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 ri(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 ri(e.changes&&Kr.fromJSON(e.changes),[],e.mapped&&cl.fromJSON(e.mapped),e.startSelection&&Ae.fromJSON(e.startSelection),e.selectionsAfter.map(Ae.fromJSON))}static fromTransaction(e,n){let r=Ji;for(let s of e.startState.facet(Ele)){let i=s(e);i.length&&(r=r.concat(i))}return!r.length&&e.changes.empty?null:new ri(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,Ji)}static selection(e){return new ri(void 0,Ji,void 0,void 0,e)}}function U1(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 Rle(t,e){let n=[],r=!1;return t.iterChangedRanges((s,i)=>n.push(s,i)),e.iterChangedRanges((s,i,a,o)=>{for(let c=0;c=h&&a<=f&&(r=!0)}}),r}function Dle(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function JB(t,e){return t.length?e.length?t.concat(e):t:e}const Ji=[],zle=200;function eq(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-zle));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),U1(t,t.length-1,1e9,n.setSelAfter(r)))}else return[ri.selection([e])]}function Ple(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 Lw(t,e){if(!t.length)return t;let n=t.length,r=Ji;for(;n;){let s=Lle(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?[ri.selection(r)]:Ji}function Lle(t,e,n){let r=JB(t.selectionsAfter.length?t.selectionsAfter.map(o=>o.map(e)):Ji,n);if(!t.changes)return ri.selection(r);let s=t.changes.map(e),i=e.mapDesc(t.changes,!0),a=t.mapped?t.mapped.composeDesc(i):i;return new ri(s,Lt.mapEffects(t.effects,e),a,t.startSelection.map(i),r)}const Ile=/^(input\.type|delete)($|\.)/;class sl{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 sl(this.done,this.undone):this}addChanges(e,n,r,s,i){let a=this.done,o=a[a.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!r||Ile.test(r))&&(!o.selectionsAfter.length&&n-this.prevTime0&&n-this.prevTimen.empty?t.moveByChar(n,e):sy(n,e))}function Es(t){return t.textDirectionAt(t.state.selection.main.head)==sr.LTR}const nq=t=>tq(t,!Es(t)),rq=t=>tq(t,Es(t));function sq(t,e){return La(t,n=>n.empty?t.moveByGroup(n,e):sy(n,e))}const qle=t=>sq(t,!Es(t)),Fle=t=>sq(t,Es(t));function $le(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 iy(t,e,n){let r=ls(t).resolveInner(e.head),s=n?Yt.closedBy:Yt.openedBy;for(let c=e.head;;){let h=n?r.childAfter(c):r.childBefore(c);if(!h)break;$le(t,h,s)?r=h:c=n?h.to:h.from}let i=r.type.prop(s),a,o;return i&&(a=n?rl(t,r.from,1):rl(t,r.to,-1))&&a.matched?o=n?a.end.to:a.end.from:o=n?r.to:r.from,Ae.cursor(o,n?-1:1)}const Qle=t=>La(t,e=>iy(t.state,e,!Es(t))),Hle=t=>La(t,e=>iy(t.state,e,Es(t)));function iq(t,e){return La(t,n=>{if(!n.empty)return sy(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const aq=t=>iq(t,!1),lq=t=>iq(t,!0);function oq(t){let e=t.scrollDOM.clientHeighta.empty?t.moveVertically(a,e,n.height):sy(a,e));if(s.eq(r.selection))return!1;let i;if(n.selfScroll){let a=t.coordsAtPos(r.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),c=o.top+n.marginTop,h=o.bottom-n.marginBottom;a&&a.top>c&&a.bottomcq(t,!1),FS=t=>cq(t,!0);function Rc(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 Vle=t=>La(t,e=>Rc(t,e,!0)),Ule=t=>La(t,e=>Rc(t,e,!1)),Wle=t=>La(t,e=>Rc(t,e,!Es(t))),Gle=t=>La(t,e=>Rc(t,e,Es(t))),Xle=t=>La(t,e=>Ae.cursor(t.lineBlockAt(e.head).from,1)),Yle=t=>La(t,e=>Ae.cursor(t.lineBlockAt(e.head).to,-1));function Kle(t,e,n){let r=!1,s=$h(t.selection,i=>{let a=rl(t,i.head,-1)||rl(t,i.head,1)||i.head>0&&rl(t,i.head-1,1)||i.headKle(t,e);function ma(t,e){let n=$h(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(Pa(t.state,n)),!0)}function uq(t,e){return ma(t,n=>t.moveByChar(n,e))}const dq=t=>uq(t,!Es(t)),hq=t=>uq(t,Es(t));function fq(t,e){return ma(t,n=>t.moveByGroup(n,e))}const Jle=t=>fq(t,!Es(t)),eoe=t=>fq(t,Es(t)),toe=t=>ma(t,e=>iy(t.state,e,!Es(t))),noe=t=>ma(t,e=>iy(t.state,e,Es(t)));function mq(t,e){return ma(t,n=>t.moveVertically(n,e))}const pq=t=>mq(t,!1),gq=t=>mq(t,!0);function xq(t,e){return ma(t,n=>t.moveVertically(n,e,oq(t).height))}const HT=t=>xq(t,!1),VT=t=>xq(t,!0),roe=t=>ma(t,e=>Rc(t,e,!0)),soe=t=>ma(t,e=>Rc(t,e,!1)),ioe=t=>ma(t,e=>Rc(t,e,!Es(t))),aoe=t=>ma(t,e=>Rc(t,e,Es(t))),loe=t=>ma(t,e=>Ae.cursor(t.lineBlockAt(e.head).from)),ooe=t=>ma(t,e=>Ae.cursor(t.lineBlockAt(e.head).to)),UT=({state:t,dispatch:e})=>(e(Pa(t,{anchor:0})),!0),WT=({state:t,dispatch:e})=>(e(Pa(t,{anchor:t.doc.length})),!0),GT=({state:t,dispatch:e})=>(e(Pa(t,{anchor:t.selection.main.anchor,head:0})),!0),XT=({state:t,dispatch:e})=>(e(Pa(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),coe=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),uoe=({state:t,dispatch:e})=>{let n=ay(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},doe=({state:t,dispatch:e})=>{let n=$h(t.selection,r=>{let s=ls(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:o}=a;if((o.from=r.to||o.to>r.to&&o.from<=r.from)&&a.next)return Ae.range(o.to,o.from)}return r});return n.eq(t.selection)?!1:(e(Pa(t,n)),!0)};function vq(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 o=i;;){let c=t.moveVertically(o,e);if(c.heada.to){s.some(h=>h.head==c.head)||s.push(c);break}else{if(c.head==o.head)break;o=c}}}return s.length==r.ranges.length?!1:(t.dispatch(Pa(n,Ae.create(s,s.length-1))),!0)}const hoe=t=>vq(t,!1),foe=t=>vq(t,!0),moe=({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(Pa(t,r)),!0):!1};function np(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,s=r.changeByRange(i=>{let{from:a,to:o}=i;if(a==o){let c=e(i);ca&&(n="delete.forward",c=gx(t,c,!0)),a=Math.min(a,c),o=Math.max(o,c)}else a=gx(t,a,!1),o=gx(t,o,!0);return a==o?{range:i}:{changes:{from:a,to:o},range:Ae.cursor(a,as(t)))r.between(e,e,(s,i)=>{se&&(e=n?i:s)});return e}const yq=(t,e,n)=>np(t,r=>{let s=r.from,{state:i}=t,a=i.doc.lineAt(s),o,c;if(n&&!e&&s>a.from&&syq(t,!1,!0),bq=t=>yq(t,!0,!1),wq=(t,e)=>np(t,n=>{let r=n.head,{state:s}=t,i=s.doc.lineAt(r),a=s.charCategorizer(r);for(let o=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=ys(i.text,r-i.from,e)+i.from,h=i.text.slice(Math.min(r,c)-i.from,Math.max(r,c)-i.from),f=a(h);if(o!=null&&f!=o)break;(h!=" "||r!=n.head)&&(o=f),r=c}return r}),Sq=t=>wq(t,!1),poe=t=>wq(t,!0),goe=t=>np(t,e=>{let n=t.lineBlockAt(e.head).to;return e.headnp(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),voe=t=>np(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:pn.of(["",""])},range:Ae.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},boe=({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:ys(i.text,s-i.from,!1)+i.from,o=s==i.to?s+1:ys(i.text,s-i.from,!0)+i.from;return{changes:{from:a,to:o,insert:t.doc.slice(s,o).append(t.doc.slice(a,s))},range:Ae.cursor(o)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ay(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 kq(t,e,n){if(t.readOnly)return!1;let r=[],s=[];for(let i of ay(t)){if(n?i.to==t.doc.length:i.from==0)continue;let a=t.doc.lineAt(n?i.to+1:i.from-1),o=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+o),Math.min(t.doc.length,c.head+o)))}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-o,c.head-o))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:Ae.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const woe=({state:t,dispatch:e})=>kq(t,e,!1),Soe=({state:t,dispatch:e})=>kq(t,e,!0);function jq(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of ay(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 koe=({state:t,dispatch:e})=>jq(t,e,!1),joe=({state:t,dispatch:e})=>jq(t,e,!0),Ooe=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(ay(e).map(({from:s,to:i})=>(s>0?s--:i{let i;if(t.lineWrapping){let a=t.lineBlockAt(s.head),o=t.coordsAtPos(s.head,s.assoc||1);o&&(i=a.bottom+t.documentTop-o.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 Noe(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ls(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(Yt.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 YT=Oq(!1),Coe=Oq(!0);function Oq(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(s=>{let{from:i,to:a}=s,o=e.doc.lineAt(i),c=!t&&i==a&&Noe(e,i);t&&(i=a=(a<=o.to?o:e.doc.lineAt(a)).to);let h=new ey(e,{simulateBreak:i,simulateDoubleBreak:!!c}),f=W6(h,i);for(f==null&&(f=Fh(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));ao.from&&i{let s=[];for(let a=r.from;a<=r.to;){let o=t.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(e(o,s,r),n=o.number),a=o.to+1}let i=t.changes(s);return{changes:s,range:Ae.range(i.mapPos(r.anchor,1),i.mapPos(r.head,1))}})}const Toe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new ey(t,{overrideIndentation:i=>{let a=n[i];return a??-1}}),s=tj(t,(i,a,o)=>{let c=W6(r,i.from);if(c==null)return;/\S/.test(i.text)||(c=0);let h=/^\s*/.exec(i.text)[0],f=r0(t,c);(h!=f||o.fromt.readOnly?!1:(e(t.update(tj(t,(n,r)=>{r.push({from:n.from,insert:t.facet(J0)})}),{userEvent:"input.indent"})),!0),Cq=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(tj(t,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(!s)return;let i=Fh(s,t.tabSize),a=0,o=r0(t,Math.max(0,i-Du(t)));for(;a(t.setTabFocusMode(),!0),_oe=[{key:"Ctrl-b",run:nq,shift:dq,preventDefault:!0},{key:"Ctrl-f",run:rq,shift:hq},{key:"Ctrl-p",run:aq,shift:pq},{key:"Ctrl-n",run:lq,shift:gq},{key:"Ctrl-a",run:Xle,shift:loe},{key:"Ctrl-e",run:Yle,shift:ooe},{key:"Ctrl-d",run:bq},{key:"Ctrl-h",run:$S},{key:"Ctrl-k",run:goe},{key:"Ctrl-Alt-h",run:Sq},{key:"Ctrl-o",run:yoe},{key:"Ctrl-t",run:boe},{key:"Ctrl-v",run:FS}],Moe=[{key:"ArrowLeft",run:nq,shift:dq,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:qle,shift:Jle,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Wle,shift:ioe,preventDefault:!0},{key:"ArrowRight",run:rq,shift:hq,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Fle,shift:eoe,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Gle,shift:aoe,preventDefault:!0},{key:"ArrowUp",run:aq,shift:pq,preventDefault:!0},{mac:"Cmd-ArrowUp",run:UT,shift:GT},{mac:"Ctrl-ArrowUp",run:QT,shift:HT},{key:"ArrowDown",run:lq,shift:gq,preventDefault:!0},{mac:"Cmd-ArrowDown",run:WT,shift:XT},{mac:"Ctrl-ArrowDown",run:FS,shift:VT},{key:"PageUp",run:QT,shift:HT},{key:"PageDown",run:FS,shift:VT},{key:"Home",run:Ule,shift:soe,preventDefault:!0},{key:"Mod-Home",run:UT,shift:GT},{key:"End",run:Vle,shift:roe,preventDefault:!0},{key:"Mod-End",run:WT,shift:XT},{key:"Enter",run:YT,shift:YT},{key:"Mod-a",run:coe},{key:"Backspace",run:$S,shift:$S,preventDefault:!0},{key:"Delete",run:bq,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Sq,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:poe,preventDefault:!0},{mac:"Mod-Backspace",run:xoe,preventDefault:!0},{mac:"Mod-Delete",run:voe,preventDefault:!0}].concat(_oe.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Aoe=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Qle,shift:toe},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Hle,shift:noe},{key:"Alt-ArrowUp",run:woe},{key:"Shift-Alt-ArrowUp",run:koe},{key:"Alt-ArrowDown",run:Soe},{key:"Shift-Alt-ArrowDown",run:joe},{key:"Mod-Alt-ArrowUp",run:hoe},{key:"Mod-Alt-ArrowDown",run:foe},{key:"Escape",run:moe},{key:"Mod-Enter",run:Coe},{key:"Alt-l",mac:"Ctrl-l",run:uoe},{key:"Mod-i",run:doe,preventDefault:!0},{key:"Mod-[",run:Cq},{key:"Mod-]",run:Nq},{key:"Mod-Alt-\\",run:Toe},{key:"Shift-Mod-k",run:Ooe},{key:"Shift-Mod-\\",run:Zle},{key:"Mod-/",run:wle},{key:"Alt-A",run:kle},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Eoe}].concat(Moe),Roe={key:"Tab",run:Nq,shift:Cq},KT=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Oh{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?o=>i(KT(o)):KT,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 ei(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=C6(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Za(e);let s=this.normalize(n);if(s.length)for(let i=0,a=r;;i++){let o=s.charCodeAt(i),c=this.match(o,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=W1(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 o=new ih(n,e.sliceString(n,r));return Iw.set(e,o),o}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=W1(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"&&(Eq.prototype[Symbol.iterator]=_q.prototype[Symbol.iterator]=function(){return this});function Doe(t){try{return new RegExp(t,nj),!0}catch{return!1}}function W1(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e=56320&&r<57344;)e++;return e}function QS(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=Wn("input",{class:"cm-textfield",name:"line",value:e}),r=Wn("form",{class:"cm-gotoLine",onkeydown:i=>{i.keyCode==27?(i.preventDefault(),t.dispatch({effects:Rm.of(!1)}),t.focus()):i.keyCode==13&&(i.preventDefault(),s())},onsubmit:i=>{i.preventDefault(),s()}},Wn("label",t.state.phrase("Go to line"),": ",n)," ",Wn("button",{class:"cm-button",type:"submit"},t.state.phrase("go")),Wn("button",{name:"close",onclick:()=>{t.dispatch({effects:Rm.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,o=a.doc.lineAt(a.selection.main.head),[,c,h,f,m]=i,g=f?+f.slice(1):0,x=h?+h:o.number;if(h&&m){let S=x/100;c&&(S=S*(c=="-"?-1:1)+o.number/a.doc.lines),x=Math.round(a.doc.lines*S)}else h&&c&&(x=x*(c=="-"?-1:1)+o.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:[Rm.of(!1),Ke.scrollIntoView(w.from,{y:"center"})],selection:w}),t.focus()}return{dom:r}}const Rm=Lt.define(),ZT=us.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(Rm)&&(t=n.value);return t},provide:t=>Jm.from(t,e=>e?QS:null)}),zoe=t=>{let e=Zm(t,QS);if(!e){let n=[Rm.of(!0)];t.state.field(ZT,!1)==null&&n.push(Lt.appendConfig.of([ZT,Poe])),t.dispatch({effects:n}),e=Zm(t,QS)}return e&&e.dom.querySelector("input").select(),!0},Poe=Ke.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"}}}),Loe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ioe=nt.define({combine(t){return gl(t,Loe,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Boe(t){return[Hoe,Qoe]}const qoe=xt.mark({class:"cm-selectionMatch"}),Foe=xt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function JT(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=ar.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=ar.Word)}function $oe(t,e,n,r){return t(e.sliceDoc(n,n+1))==ar.Word&&t(e.sliceDoc(r-1,r))==ar.Word}const Qoe=_r.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(Ioe),{state:n}=t,r=n.selection;if(r.ranges.length>1)return xt.none;let s=r.main,i,a=null;if(s.empty){if(!e.highlightWordAroundCursor)return xt.none;let c=n.wordAt(s.head);if(!c)return xt.none;a=n.charCategorizer(s.head),i=n.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c200)return xt.none;if(e.wholeWords){if(i=n.sliceDoc(s.from,s.to),a=n.charCategorizer(s.head),!(JT(a,n,s.from,s.to)&&$oe(a,n,s.from,s.to)))return xt.none}else if(i=n.sliceDoc(s.from,s.to),!i)return xt.none}let o=[];for(let c of t.visibleRanges){let h=new Oh(n.doc,i,c.from,c.to);for(;!h.next().done;){let{from:f,to:m}=h.value;if((!a||JT(a,n,f,m))&&(s.empty&&f<=s.from&&m>=s.to?o.push(Foe.range(f,m)):(f>=s.to||m<=s.from)&&o.push(qoe.range(f,m)),o.length>e.maxMatches))return xt.none}}return xt.set(o)}},{decorations:t=>t.decorations}),Hoe=Ke.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Voe=({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 Uoe(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,o=new Oh(t.doc,e,r[r.length-1].to);;)if(o.next(),o.done){if(a)return null;o=new Oh(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),a=!0}else{if(a&&r.some(c=>c.from==o.value.from))continue;if(i){let c=t.wordAt(o.value.from);if(!c||c.from!=o.value.from||c.to!=o.value.to)continue}return o.value}}const Woe=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(i=>i.from===i.to))return Voe({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=Uoe(t,r);return s?(e(t.update({selection:t.selection.addRange(Ae.range(s.from,s.to),!1),effects:Ke.scrollIntoView(s.to)})),!0):!1},Qh=nt.define({combine(t){return gl(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ice(e),scrollToMatch:e=>Ke.scrollIntoView(e)})}});class Mq{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||Doe(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 Koe(this):new Xoe(this)}getCursor(e,n=0,r){let s=e.doc?e:dn.create({doc:e});return r==null&&(r=s.doc.length),this.regexp?$d(this,s,n,r):Fd(this,s,n,r)}}class Aq{constructor(e){this.spec=e}}function Fd(t,e,n,r){return new Oh(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),t.wholeWord?Goe(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Goe(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=Fd(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 $d(t,e,n,r){return new Eq(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?Yoe(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function G1(t,e){return t.slice(ys(t,e,!1),e)}function X1(t,e){return t.slice(e,ys(t,e))}function Yoe(t){return(e,n,r)=>!r[0].length||(t(G1(r.input,r.index))!=ar.Word||t(X1(r.input,r.index))!=ar.Word)&&(t(X1(r.input,r.index+r[0].length))!=ar.Word||t(G1(r.input,r.index+r[0].length))!=ar.Word)}class Koe extends Aq{nextMatch(e,n,r){let s=$d(this.spec,e,r,e.doc.length).next();return s.done&&(s=$d(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=$d(this.spec,e,i,r),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==n||o.from>i+10))return o;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=$d(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 i0=Lt.define(),rj=Lt.define(),mc=us.define({create(t){return new Bw(HS(t).create(),null)},update(t,e){for(let n of e.effects)n.is(i0)?t=new Bw(n.value.create(),t.panel):n.is(rj)&&(t=new Bw(t.query,n.value?sj:null));return t},provide:t=>Jm.from(t,e=>e.panel)});class Bw{constructor(e,n){this.query=e,this.panel=n}}const Zoe=xt.mark({class:"cm-searchMatch"}),Joe=xt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ece=_r.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(mc))}update(t){let e=t.state.field(mc);(e!=t.startState.field(mc)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return xt.none;let{view:n}=this,r=new fo;for(let s=0,i=n.visibleRanges,a=i.length;si[s+1].from-500;)c=i[++s].to;t.highlight(n.state,o,c,(h,f)=>{let m=n.state.selection.ranges.some(g=>g.from==h&&g.to==f);r.add(h,f,m?Joe:Zoe)})}return r.finish()}},{decorations:t=>t.decorations});function rp(t){return e=>{let n=e.state.field(mc,!1);return n&&n.query.spec.valid?t(e,n):zq(e)}}const Y1=rp((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(Qh);return t.dispatch({selection:s,effects:[ij(t,r),i.scrollToMatch(s.main,t)],userEvent:"select.search"}),Dq(t),!0}),K1=rp((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(Qh);return t.dispatch({selection:i,effects:[ij(t,s),a.scrollToMatch(i.main,t)],userEvent:"select.search"}),Dq(t),!0}),tce=rp((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)}),nce=({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 o=new Oh(t.doc,t.sliceDoc(r,s));!o.next().done;){if(i.length>1e3)return!1;o.value.from==r&&(a=i.length),i.push(Ae.range(o.value.from,o.value.to))}return e(t.update({selection:Ae.create(i,a),userEvent:"select.search.matches"})),!0},eE=rp((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,o=[],c,h,f=[];a.from==r&&a.to==s&&(h=n.toText(e.getReplacement(a)),o.push({from:a.from,to:a.to,insert:h}),a=e.nextMatch(n,a.from,a.to),f.push(Ke.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let m=t.state.changes(o);return a&&(c=Ae.single(a.from,a.to).map(m),f.push(ij(t,a)),f.push(n.facet(Qh).scrollToMatch(c.main,t))),t.dispatch({changes:m,selection:c,effects:f,userEvent:"input.replace"}),!0}),rce=rp((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:Ke.announce.of(r),userEvent:"input.replace.all"}),!0});function sj(t){return t.state.facet(Qh).createPanel(t)}function HS(t,e){var n,r,s,i,a;let o=t.selection.main,c=o.empty||o.to>o.from+100?"":t.sliceDoc(o.from,o.to);if(e&&!c)return e;let h=t.facet(Qh);return new Mq({search:((n=e?.literal)!==null&&n!==void 0?n:h.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:h.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:h.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:h.regexp,wholeWord:(a=e?.wholeWord)!==null&&a!==void 0?a:h.wholeWord})}function Rq(t){let e=Zm(t,sj);return e&&e.dom.querySelector("[main-field]")}function Dq(t){let e=Rq(t);e&&e==t.root.activeElement&&e.select()}const zq=t=>{let e=t.state.field(mc,!1);if(e&&e.panel){let n=Rq(t);if(n&&n!=t.root.activeElement){let r=HS(t.state,e.query.spec);r.valid&&t.dispatch({effects:i0.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[rj.of(!0),e?i0.of(HS(t.state,e.query.spec)):Lt.appendConfig.of(lce)]});return!0},Pq=t=>{let e=t.state.field(mc,!1);if(!e||!e.panel)return!1;let n=Zm(t,sj);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:rj.of(!1)}),!0},sce=[{key:"Mod-f",run:zq,scope:"editor search-panel"},{key:"F3",run:Y1,shift:K1,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Y1,shift:K1,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Pq,scope:"editor search-panel"},{key:"Mod-Shift-l",run:nce},{key:"Mod-Alt-g",run:zoe},{key:"Mod-d",run:Woe,preventDefault:!0}];class ice{constructor(e){this.view=e;let n=this.query=e.state.field(mc).query.spec;this.commit=this.commit.bind(this),this.searchField=Wn("input",{value:n.search,placeholder:Si(e,"Find"),"aria-label":Si(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Wn("input",{value:n.replace,placeholder:Si(e,"Replace"),"aria-label":Si(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Wn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Wn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Wn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(s,i,a){return Wn("button",{class:"cm-button",name:s,onclick:i,type:"button"},a)}this.dom=Wn("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,r("next",()=>Y1(e),[Si(e,"next")]),r("prev",()=>K1(e),[Si(e,"previous")]),r("select",()=>tce(e),[Si(e,"all")]),Wn("label",null,[this.caseField,Si(e,"match case")]),Wn("label",null,[this.reField,Si(e,"regexp")]),Wn("label",null,[this.wordField,Si(e,"by word")]),...e.state.readOnly?[]:[Wn("br"),this.replaceField,r("replace",()=>eE(e),[Si(e,"replace")]),r("replaceAll",()=>rce(e),[Si(e,"replace all")])],Wn("button",{name:"close",onclick:()=>Pq(e),"aria-label":Si(e,"close"),type:"button"},["×"])])}commit(){let e=new Mq({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:i0.of(e)}))}keydown(e){uie(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?K1:Y1)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),eE(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(i0)&&!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(Qh).top}}function Si(t,e){return t.state.phrase(e)}const xx=30,vx=/[\s\.,:;?!]/;function ij(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-xx),a=Math.min(s,n+xx),o=t.state.sliceDoc(i,a);if(i!=r.from){for(let c=0;co.length-xx;c--)if(!vx.test(o[c-1])&&vx.test(o[c])){o=o.slice(0,c);break}}return Ke.announce.of(`${t.state.phrase("current match")}. ${o} ${t.state.phrase("on line")} ${r.number}.`)}const ace=Ke.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"}}),lce=[mc,Ac.low(ece),ace];class Lq{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=ls(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(Bq(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 tE(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 oce(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+$/]:oce(e);return s=>{let i=s.matchBefore(r);return i||s.explicit?{from:i?i.from:s.pos,options:e,validFor:n}:null}}function cce(t,e){return n=>{for(let r=ls(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 nE=class{constructor(e,n,r,s){this.completion=e,this.source=n,this.match=r,this.score=s}};function Ou(t){return t.selection.main.from}function Bq(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 aj=pl.define();function uce(t,e,n,r){let{main:s}=t.selection,i=n-s.from,a=r-s.from;return{...t.changeByRange(o=>{if(o!=s&&n!=r&&t.sliceDoc(o.from+i,o.from+a)!=t.sliceDoc(n,r))return{range:o};let c=t.toText(e);return{changes:{from:o.from+i,to:r==s.from?o.to:o.from+a,insert:c},range:Ae.cursor(o.from+i+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const rE=new WeakMap;function dce(t){if(!Array.isArray(t))return t;let e=rE.get(t);return e||rE.set(t,e=Iq(t)),e}const Z1=Lt.define(),a0=Lt.define();class hce{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&&_<=57||_>=97&&_<=122?2:_>=65&&_<=90?1:0:(E=C6(_))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!N||M==1&&S||T==0&&M!=0)&&(n[m]==_||r[m]==_&&(g=!0)?a[m++]=N:a.length&&(k=!1)),T=M,N+=Za(_)}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]):o>-1?this.ret(-700-e.length,[o,o+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 o=a+(this.astral?Za(ei(r,a)):1);i&&s[i-1]==a?s[i-1]=o:(s[i++]=a,s[i++]=o)}return this.ret(e-r.length,s)}}class fce{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:mce,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=>sE(e(r),n(r)),optionClass:(e,n)=>r=>sE(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function sE(t,e){return t?e?t+" "+e:t:e}function mce(t,e,n,r,s,i){let a=t.textDirection==sr.RTL,o=a,c=!1,h="top",f,m,g=e.left-s.left,x=s.right-e.right,y=r.right-r.left,w=r.bottom-r.top;if(o&&g=w||N>e.top?f=n.bottom-e.top:(h="bottom",f=e.bottom-n.top)}let S=(e.bottom-e.top)/i.offsetHeight,k=(e.right-e.left)/i.offsetWidth;return{style:`${h}: ${f/S}px; max-width: ${m/k}px`,class:"cm-completionInfo-"+(c?a?"left-narrow":"right-narrow":o?"left":"right")}}function pce(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 o=n.displayLabel||n.label,c=0;for(let h=0;hc&&a.appendChild(document.createTextNode(o.slice(c,f)));let g=a.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(o.slice(f,m))),g.className="cm-completionMatchedText",c=m}return cn.position-r.position).map(n=>n.render)}function qw(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 gce{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,o=e.state.facet(is);this.optionContent=pce(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=qw(i.length,a,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:h}=e.state.field(n).open;for(let f=c.target,m;f&&f!=this.dom;f=f.parentNode)if(f.nodeName=="LI"&&(m=/-(\d+)$/.exec(f.id))&&+m[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(is).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:a0.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:o}=r.open;(!s.open||s.open.options!=i)&&(this.range=qw(i.length,a,e.state.facet(is).maxRenderedOptions),this.showOptions(i,r.id)),this.updateSel(),o!=((n=s.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}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=qw(n.options.length,n.selected,this.view.state.facet(is).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(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,s)}).catch(o=>ni(this.view.state,o,"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&&vce(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 h!="string"&&h.header)s.appendChild(h.header(h));else{let x=s.appendChild(document.createElement("completion-section"));x.textContent=g}}const f=s.appendChild(document.createElement("li"));f.id=n+"-"+a,f.setAttribute("role","option");let m=this.optionClass(o);m&&(f.className=m);for(let g of this.optionContent){let x=g(o,this.view.state,this.view,c);x&&f.appendChild(x)}}return r.from&&s.classList.add("cm-completionListIncompleteTop"),r.tonew gce(n,t,e)}function vce(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 iE(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function yce(t,e){let n=[],r=null,s=null,i=f=>{n.push(f);let{section:m}=f.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(is);for(let f of t)if(f.hasResult()){let m=f.result.getMatch;if(f.result.filter===!1)for(let g of f.result.options)i(new nE(g,f.source,m?m(g):[],1e9-n.length));else{let g=e.sliceDoc(f.from,f.to),x,y=a.filterStrict?new fce(g):new hce(g);for(let w of f.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 nE(w,f.source,S,k)),typeof w.section=="object"&&w.section.rank==="dynamic"){let{name:N}=w.section;s||(s=Object.create(null)),s[N]=Math.max(k,s[N]||-1e9)}}}}if(r){let f=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||h(m.completion,g.completion))){let m=f.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?o.push(f):iE(f.completion)>iE(c)&&(o[o.length-1]=f),c=f.completion}return o}class Yd{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 Yd(this.options,aE(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,s,i,a){if(s&&!a&&e.some(h=>h.isPending))return s.setDisabled();let o=yce(e,n);if(!o.length)return s&&e.some(h=>h.isPending)?s.setDisabled():null;let c=n.facet(is).selectOnOpen?0:-1;if(s&&s.selected!=c&&s.selected!=-1){let h=s.options[s.selected].completion;for(let f=0;ff.hasResult()?Math.min(h,f.from):h,1e8),create:Oce,above:i.aboveCursor},s?s.timestamp:Date.now(),c,!1)}map(e){return new Yd(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Yd(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class J1{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new J1(kce,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(is),i=(r.override||n.languageDataAt("autocomplete",Ou(n)).map(dce)).map(c=>(this.active.find(f=>f.source==c)||new ea(c,this.active.some(f=>f.state!=0)?1:0)).update(e,r));i.length==this.active.length&&i.every((c,h)=>c==this.active[h])&&(i=this.active);let a=this.open,o=e.effects.some(c=>c.is(lj));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||i.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!bce(i,this.active)||o?a=Yd.build(i,n,this.id,a,r,o):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 ea(c.source,0):c));for(let c of e.effects)c.is(Fq)&&(a=a&&a.setSelected(c.value,this.id));return i==this.active&&a==this.open?this:new J1(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?wce:Sce}}function bce(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n-1&&(n["aria-activedescendant"]=t+"-"+e),n}const kce=[];function qq(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(aj);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 ea{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=qq(e,n),s=this;(r&8||r&16&&this.touches(e))&&(s=new ea(s.source,0)),r&4&&s.state==0&&(s=new ea(this.source,1)),s=s.updateFor(e,r);for(let i of e.effects)if(i.is(Z1))s=new ea(s.source,1,i.value);else if(i.is(a0))s=new ea(s.source,0);else if(i.is(lj))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(Ou(e.state))}}class ah extends ea{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),o=Ou(e.state);if(o>a||!s||n&2&&(Ou(e.startState)==this.from||on.map(e))}}),Fq=Lt.define(),ti=us.define({create(){return J1.start()},update(t,e){return t.update(e)},provide:t=>[F6.from(t,e=>e.tooltip),Ke.contentAttributes.from(t,e=>e.attrs)]});function oj(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(ti).active.find(s=>s.source==e.source);return r instanceof ah?(typeof n=="string"?t.dispatch({...uce(t.state,n,r.from,r.to),annotations:aj.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const Oce=xce(ti,oj);function yx(t,e="option"){return n=>{let r=n.state.field(ti,!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 o<0?o=e=="page"?0:a-1:o>=a&&(o=e=="page"?a-1:0),n.dispatch({effects:Fq.of(o)}),!0}}const Nce=t=>{let e=t.state.field(ti,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(ti,!1)?(t.dispatch({effects:Z1.of(!0)}),!0):!1,Cce=t=>{let e=t.state.field(ti,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:a0.of(null)}),!0)};class Tce{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const Ece=50,_ce=1e3,Mce=_r.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(ti).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(ti),n=t.state.facet(is);if(!t.selectionSet&&!t.docChanged&&t.startState.field(ti)==e)return;let r=t.transactions.some(i=>{let a=qq(i,n);return a&8||(i.selection||i.docChanged)&&!(a&3)});for(let i=0;iEce&&Date.now()-a.time>_ce){for(let o of a.context.abortListeners)try{o()}catch(c){ni(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(Z1)))&&(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(ti);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(is).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=Ou(e),r=new Lq(e,n,t.explicit,this.view),s=new Tce(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:a0.of(null)}),ni(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(is).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(is),r=this.view.state.field(ti);for(let s=0;so.source==i.active.source);if(a&&a.isPending)if(i.done==null){let o=new ea(i.active.source,0);for(let c of i.updates)o=o.update(c,n);o.isPending||e.push(o)}else this.startQuery(a)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:lj.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(ti,!1);if(e&&e.tooltip&&this.view.state.facet(is).closeOnBlur){let n=e.open&&pB(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:a0.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Z1.of(!1)}),20),this.composing=0}}}),Ace=typeof navigator=="object"&&/Win/.test(navigator.platform),Rce=Ac.highest(Ke.domEventHandlers({keydown(t,e){let n=e.state.field(ti,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(Ace&&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&&oj(e,r),!1}})),$q=Ke.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 Dce{constructor(e,n,r,s){this.field=e,this.line=n,this.from=r,this.to=s}}class cj{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,vs.TrackDel),r=e.mapPos(this.to,1,vs.TrackDel);return n==null||r==null?null:new cj(this.field,n,r)}}class uj{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 h=a,f=/^\t*/.exec(c)[0].length;for(let m=0;mnew cj(c.field,s[c.line]+c.from,s[c.line]+c.to));return{text:r,ranges:o}}static parse(e){let n=[],r=[],s=[],i;for(let a of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(a);){let o=i[1]?+i[1]:null,c=i[2]||i[3]||"",h=-1,f=c.replace(/\\[{}]/g,m=>m[1]);for(let m=0;m=h&&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 Dce(h,r.length,i.index,i.index+f.length)),a=a.slice(0,i.index)+c+a.slice(i.index+i[0].length)}a=a.replace(/\\([{}])/g,(o,c,h)=>{for(let f of s)f.line==r.length&&f.from>h&&(f.from--,f.to--);return c}),r.push(a)}return new uj(r,s)}}let zce=xt.widget({widget:new class extends xl{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Pce=xt.mark({class:"cm-snippetField"});class Hh{constructor(e,n){this.ranges=e,this.active=n,this.deco=xt.set(e.map(r=>(r.from==r.to?zce:Pce).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 Hh(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 sp=Lt.define({map(t,e){return t&&t.map(e)}}),Lce=Lt.define(),l0=us.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(sp))return n.value;if(n.is(Lce)&&t)return new Hh(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=>Ke.decorations.from(t,e=>e?e.deco:xt.none)});function dj(t,e){return Ae.create(t.filter(n=>n.field==e).map(n=>Ae.range(n.from,n.to)))}function Ice(t){let e=uj.parse(t);return(n,r,s,i)=>{let{text:a,ranges:o}=e.instantiate(n.state,s),{main:c}=n.state.selection,h={changes:{from:s,to:i==c.from?c.to:i,insert:pn.of(a)},scrollIntoView:!0,annotations:r?[aj.of(r),$r.userEvent.of("input.complete")]:void 0};if(o.length&&(h.selection=dj(o,0)),o.some(f=>f.field>0)){let f=new Hh(o,0),m=h.effects=[sp.of(f)];n.state.field(l0,!1)===void 0&&m.push(Lt.appendConfig.of([l0,Qce,Hce,$q]))}n.dispatch(n.state.update(h))}}function Qq(t){return({state:e,dispatch:n})=>{let r=e.field(l0,!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:dj(r.ranges,s),effects:sp.of(i?null:new Hh(r.ranges,s)),scrollIntoView:!0})),!0}}const Bce=({state:t,dispatch:e})=>t.field(l0,!1)?(e(t.update({effects:sp.of(null)})),!0):!1,qce=Qq(1),Fce=Qq(-1),$ce=[{key:"Tab",run:qce,shift:Fce},{key:"Escape",run:Bce}],lE=nt.define({combine(t){return t.length?t[0]:$ce}}),Qce=Ac.highest(K0.compute([lE],t=>t.facet(lE)));function Ul(t,e){return{...e,apply:Ice(t)}}const Hce=Ke.domEventHandlers({mousedown(t,e){let n=e.state.field(l0,!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:dj(n.ranges,s.field),effects:sp.of(n.ranges.some(i=>i.field>s.field)?new Hh(n.ranges,s.field):null),scrollIntoView:!0}),!0)}}),o0={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},xu=Lt.define({map(t,e){let n=e.mapPos(t,-1,vs.TrackAfter);return n??void 0}}),hj=new class extends _u{};hj.startSide=1;hj.endSide=-1;const Hq=us.define({create(){return On.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(xu)&&(t=t.update({add:[hj.range(n.value,n.value+1)]}));return t}});function Vce(){return[Wce,Hq]}const $w="()[]{}<>«»»«[]{}";function Vq(t){for(let e=0;e<$w.length;e+=2)if($w.charCodeAt(e)==t)return $w.charAt(e+1);return C6(t<128?t:t+1)}function Uq(t,e){return t.languageDataAt("closeBrackets",e)[0]||o0}const Uce=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Wce=Ke.inputHandler.of((t,e,n,r)=>{if((Uce?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(r.length>2||r.length==2&&Za(ei(r,0))==1||e!=s.from||n!=s.to)return!1;let i=Yce(t.state,r);return i?(t.dispatch(i),!0):!1}),Gce=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Uq(t,t.selection.main.head).brackets||o0.brackets,s=null,i=t.changeByRange(a=>{if(a.empty){let o=Kce(t.doc,a.head);for(let c of r)if(c==o&&ly(t.doc,a.head)==Vq(ei(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},Xce=[{key:"Backspace",run:Gce}];function Yce(t,e){let n=Uq(t,t.selection.main.head),r=n.brackets||o0.brackets;for(let s of r){let i=Vq(ei(s,0));if(e==s)return i==s?eue(t,s,r.indexOf(s+s+s)>-1,n):Zce(t,s,i,n.before||o0.before);if(e==i&&Wq(t,t.selection.main.from))return Jce(t,s,i)}return null}function Wq(t,e){let n=!1;return t.field(Hq).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function ly(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Za(ei(n,0)))}function Kce(t,e){let n=t.sliceString(e-2,e);return Za(ei(n,0))==n.length?n:n.slice(1)}function Zce(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:xu.of(a.to+e.length),range:Ae.range(a.anchor+e.length,a.head+e.length)};let o=ly(t.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:e+n,from:a.head},effects:xu.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 Jce(t,e,n){let r=null,s=t.changeByRange(i=>i.empty&&ly(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 eue(t,e,n,r){let s=r.stringPrefixes||o0.stringPrefixes,i=null,a=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:xu.of(o.to+e.length),range:Ae.range(o.anchor+e.length,o.head+e.length)};let c=o.head,h=ly(t.doc,c),f;if(h==e){if(oE(t,c))return{changes:{insert:e+e,from:c},effects:xu.of(c+e.length),range:Ae.cursor(c+e.length)};if(Wq(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&&(f=cE(t,c-2*e.length,s))>-1&&oE(t,f))return{changes:{insert:e+e+e+e,from:c},effects:xu.of(c+e.length),range:Ae.cursor(c+e.length)};if(t.charCategorizer(c)(h)!=ar.Word&&cE(t,c,s)>-1&&!tue(t,c,e,s))return{changes:{insert:e+e,from:c},effects:xu.of(c+e.length),range:Ae.cursor(c+e.length)}}return{range:i=o}});return i?null:t.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function oE(t,e){let n=ls(t).resolveInner(e+1);return n.parent&&n.from==e}function tue(t,e,n,r){let s=ls(t).resolveInner(e,-1),i=r.reduce((a,o)=>Math.max(a,o.length),0);for(let a=0;a<5;a++){let o=t.sliceDoc(s.from,Math.min(s.to,s.from+n.length+i)),c=o.indexOf(n);if(!c||c>-1&&r.indexOf(o.slice(0,c))>-1){let f=s.firstChild;for(;f&&f.from==s.from&&f.to-f.from>n.length+c;){if(t.sliceDoc(f.to-n.length,f.to)==n)return!1;f=f.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function cE(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=ar.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))!=ar.Word)return i}return-1}function nue(t={}){return[Rce,ti,is.of(t),Mce,rue,$q]}const Gq=[{key:"Ctrl-Space",run:Fw},{mac:"Alt-`",run:Fw},{mac:"Alt-i",run:Fw},{key:"Escape",run:Cce},{key:"ArrowDown",run:yx(!0)},{key:"ArrowUp",run:yx(!1)},{key:"PageDown",run:yx(!0,"page")},{key:"PageUp",run:yx(!1,"page")},{key:"Enter",run:Nce}],rue=Ac.highest(K0.computeN([is],t=>t.facet(is).defaultKeymap?[Gq]:[]));class uE{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class hu{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let s=r.facet(c0).markerFilter;s&&(e=s(e,r));let i=e.slice().sort((x,y)=>x.from-y.from||x.to-y.to),a=new fo,o=[],c=0,h=r.doc.iter(),f=0,m=r.doc.length;for(let x=0;;){let y=x==i.length?null:i[x];if(!y&&!o.length)break;let w,S;if(o.length)w=c,S=o.reduce((C,T)=>Math.min(C,T.to),y&&y.from>w?y.from:1e8);else{if(w=y.from,w>m)break;S=y.to,o.push(y),x++}for(;xC.from||C.to==w))o.push(C),x++,S=Math.min(C.to,S);else{S=Math.min(C.from,S);break}}S=Math.min(S,m);let k=!1;if(o.some(C=>C.from==w&&(C.to==S||S==m))&&(k=w==S,!k&&S-w<10)){let C=w-(f+h.value.length);C>0&&(h.next(C),f=w);for(let T=w;;){if(T>=S){k=!0;break}if(!h.lineBreak&&f+h.value.length>T)break;T=f+h.value.length,f+=h.value.length,h.next()}}let N=gue(o);if(k)a.add(w,w,xt.widget({widget:new hue(N),diagnostics:o.slice()}));else{let C=o.reduce((T,_)=>_.markClass?T+" "+_.markClass:T,"");a.add(w,S,xt.mark({class:"cm-lintRange cm-lintRange-"+N+C,diagnostics:o.slice(),inclusiveEnd:o.some(T=>T.to>S)}))}if(c=S,c==m)break;for(let C=0;C{if(!(e&&a.diagnostics.indexOf(e)<0))if(!r)r=new uE(s,i,e||a.diagnostics[0]);else{if(a.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new uE(r.from,i,r.diagnostic)}}),r}function sue(t,e){let n=e.pos,r=e.end||n,s=t.state.facet(c0).hideOn(t,n,r);if(s!=null)return s;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(a=>a.is(Xq))||t.changes.touchesRange(i.from,Math.max(i.to,r)))}function iue(t,e){return t.field(Ei,!1)?e:e.concat(Lt.appendConfig.of(xue))}const Xq=Lt.define(),fj=Lt.define(),Yq=Lt.define(),Ei=us.define({create(){return new hu(xt.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=Nh(n,t.selected.diagnostic,i)||Nh(n,null,i)}!n.size&&s&&e.state.facet(c0).autoPanel&&(s=null),t=new hu(n,s,r)}for(let n of e.effects)if(n.is(Xq)){let r=e.state.facet(c0).autoPanel?n.value.length?u0.open:null:t.panel;t=hu.init(n.value,r,e.state)}else n.is(fj)?t=new hu(t.diagnostics,n.value?u0.open:null,t.selected):n.is(Yq)&&(t=new hu(t.diagnostics,t.panel,n.value));return t},provide:t=>[Jm.from(t,e=>e.panel),Ke.decorations.from(t,e=>e.diagnostics)]}),aue=xt.mark({class:"cm-lintRange cm-lintRange-active"});function lue(t,e,n){let{diagnostics:r}=t.state.field(Ei),s,i=-1,a=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(c,h,{spec:f})=>{if(e>=c&&e<=h&&(c==h||(e>c||n>0)&&(eZq(t,n,!1)))}const cue=t=>{let e=t.state.field(Ei,!1);(!e||!e.panel)&&t.dispatch({effects:iue(t.state,[fj.of(!0)])});let n=Zm(t,u0.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},dE=t=>{let e=t.state.field(Ei,!1);return!e||!e.panel?!1:(t.dispatch({effects:fj.of(!1)}),!0)},uue=t=>{let e=t.state.field(Ei,!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)},due=[{key:"Mod-Shift-m",run:cue,preventDefault:!0},{key:"F8",run:uue}],c0=nt.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...gl(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:hE,tooltipFilter:hE,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 hE(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function Kq(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 Zq(t,e,n){var r;let s=n?Kq(e.actions):[];return Wn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Wn("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 o=!1,c=x=>{if(x.preventDefault(),o)return;o=!0;let y=Nh(t.state.field(Ei).diagnostics,e);y&&i.apply(t,y.from,y.to)},{name:h}=i,f=s[a]?h.indexOf(s[a]):-1,m=f<0?h:[h.slice(0,f),Wn("u",h.slice(f,f+1)),h.slice(f+1)],g=i.markClass?" "+i.markClass:"";return Wn("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${h}${f<0?"":` (access key "${s[a]})"`}.`},m)}),e.source&&Wn("div",{class:"cm-diagnosticSource"},e.source))}class hue extends xl{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Wn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class fE{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Zq(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class u0{constructor(e){this.view=e,this.items=[];let n=s=>{if(s.keyCode==27)dE(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=Kq(i.actions);for(let o=0;o{for(let i=0;idE(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ei).selected;if(!e)return-1;for(let n=0;n{for(let f of h.diagnostics){if(a.has(f))continue;a.add(f);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:o,panel:c})=>{let h=c.height/this.list.offsetHeight;o.topc.bottom&&(this.list.scrollTop+=(o.bottom-c.bottom)/h)}})):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(Ei),r=Nh(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:Yq.of(r)})}static open(e){return new u0(e)}}function fue(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(t)}')`}function bx(t){return fue(``,'width="6" height="3"')}const mue=Ke.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:bx("#d11")},".cm-lintRange-warning":{backgroundImage:bx("orange")},".cm-lintRange-info":{backgroundImage:bx("#999")},".cm-lintRange-hint":{backgroundImage:bx("#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 pue(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function gue(t){let e="hint",n=1;for(let r of t){let s=pue(r.severity);s>n&&(n=s,e=r.severity)}return e}const xue=[Ei,Ke.decorations.compute([Ei],t=>{let{selected:e,panel:n}=t.field(Ei);return!e||!n||e.from==e.to?xt.none:xt.set([aue.range(e.from,e.to)])}),Zie(lue,{hideOn:sue}),mue];var mE=function(e){e===void 0&&(e={});var{crosshairCursor:n=!1}=e,r=[];e.closeBracketsKeymap!==!1&&(r=r.concat(Xce)),e.defaultKeymap!==!1&&(r=r.concat(Aoe)),e.searchKeymap!==!1&&(r=r.concat(sce)),e.historyKeymap!==!1&&(r=r.concat(Ble)),e.foldKeymap!==!1&&(r=r.concat(Xae)),e.completionKeymap!==!1&&(r=r.concat(Gq)),e.lintKeymap!==!1&&(r=r.concat(due));var s=[];return e.lineNumbers!==!1&&s.push(cae()),e.highlightActiveLineGutter!==!1&&s.push(hae()),e.highlightSpecialChars!==!1&&s.push(Cie()),e.history!==!1&&s.push(_le()),e.foldGutter!==!1&&s.push(Jae()),e.drawSelection!==!1&&s.push(gie()),e.dropCursor!==!1&&s.push(wie()),e.allowMultipleSelections!==!1&&s.push(dn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(qae()),e.syntaxHighlighting!==!1&&s.push(BB(rle,{fallback:!0})),e.bracketMatching!==!1&&s.push(ule()),e.closeBrackets!==!1&&s.push(Vce()),e.autocompletion!==!1&&s.push(nue()),e.rectangularSelection!==!1&&s.push(Fie()),n!==!1&&s.push(Hie()),e.highlightActiveLine!==!1&&s.push(Rie()),e.highlightSelectionMatches!==!1&&s.push(Boe()),e.tabSize&&typeof e.tabSize=="number"&&s.push(J0.of(" ".repeat(e.tabSize))),s.concat([K0.of(r.flat())]).filter(Boolean)};const vue="#e5c07b",pE="#e06c75",yue="#56b6c2",bue="#ffffff",h1="#abb2bf",VS="#7d8799",wue="#61afef",Sue="#98c379",gE="#d19a66",kue="#c678dd",jue="#21252b",xE="#2c313a",vE="#282c34",Qw="#353a42",Oue="#3E4451",yE="#528bff",Nue=Ke.theme({"&":{color:h1,backgroundColor:vE},".cm-content":{caretColor:yE},".cm-cursor, .cm-dropCursor":{borderLeftColor:yE},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Oue},".cm-panels":{backgroundColor:jue,color:h1},".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:vE,color:VS,border:"none"},".cm-activeLineGutter":{backgroundColor:xE},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Qw},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Qw,borderBottomColor:Qw},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:xE,color:h1}}},{dark:!0}),Cue=tp.define([{tag:xe.keyword,color:kue},{tag:[xe.name,xe.deleted,xe.character,xe.propertyName,xe.macroName],color:pE},{tag:[xe.function(xe.variableName),xe.labelName],color:wue},{tag:[xe.color,xe.constant(xe.name),xe.standard(xe.name)],color:gE},{tag:[xe.definition(xe.name),xe.separator],color:h1},{tag:[xe.typeName,xe.className,xe.number,xe.changed,xe.annotation,xe.modifier,xe.self,xe.namespace],color:vue},{tag:[xe.operator,xe.operatorKeyword,xe.url,xe.escape,xe.regexp,xe.link,xe.special(xe.string)],color:yue},{tag:[xe.meta,xe.comment],color:VS},{tag:xe.strong,fontWeight:"bold"},{tag:xe.emphasis,fontStyle:"italic"},{tag:xe.strikethrough,textDecoration:"line-through"},{tag:xe.link,color:VS,textDecoration:"underline"},{tag:xe.heading,fontWeight:"bold",color:pE},{tag:[xe.atom,xe.bool,xe.special(xe.variableName)],color:gE},{tag:[xe.processingInstruction,xe.string,xe.inserted],color:Sue},{tag:xe.invalid,color:bue}]),Jq=[Nue,BB(Cue)];var Tue=Ke.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),Eue=function(e){e===void 0&&(e={});var{indentWithTab:n=!0,editable:r=!0,readOnly:s=!1,theme:i="light",placeholder:a="",basicSetup:o=!0}=e,c=[];switch(n&&c.unshift(K0.of([Roe])),o&&(typeof o=="boolean"?c.unshift(mE()):c.unshift(mE(o))),a&&c.unshift(Lie(a)),i){case"light":c.push(Tue);break;case"dark":c.push(Jq);break;case"none":break;default:c.push(i);break}return r===!1&&c.push(Ke.editable.of(!1)),s&&c.push(dn.readOnly.of(!0)),[...c]},_ue=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 Mue{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 bE{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 Hw=null,Aue=()=>typeof window>"u"?new bE:(Hw||(Hw=new bE),Hw),wE=pl.define(),Rue=200,Due=[];function zue(t){var{value:e,selection:n,onChange:r,onStatistics:s,onCreateEditor:i,onUpdate:a,extensions:o=Due,autoFocus:c,theme:h="light",height:f=null,minHeight:m=null,maxHeight:g=null,width:x=null,minWidth:y=null,maxWidth:w=null,placeholder:S="",editable:k=!0,readOnly:N=!1,indentWithTab:C=!0,basicSetup:T=!0,root:_,initialState:E}=t,[M,L]=b.useState(),[P,I]=b.useState(),[Q,U]=b.useState(),ee=b.useState(()=>({current:null}))[0],z=b.useState(()=>({current:null}))[0],H=Ke.theme({"&":{height:f,minHeight:m,maxHeight:g,width:x,minWidth:y,maxWidth:w},"& .cm-scroller":{height:"100% !important"}}),B=Ke.updateListener.of(G=>{if(G.docChanged&&typeof r=="function"&&!G.transactions.some(W=>W.annotation(wE))){ee.current?ee.current.reset():(ee.current=new Mue(()=>{if(z.current){var W=z.current;z.current=null,W()}ee.current=null},Rue),Aue().add(ee.current));var R=G.state.doc,se=R.toString();r(se,G)}s&&s(_ue(G))}),X=Eue({theme:h,editable:k,readOnly:N,placeholder:S,indentWithTab:C,basicSetup:T}),J=[B,H,...X];return a&&typeof a=="function"&&J.push(Ke.updateListener.of(a)),J=J.concat(o),b.useLayoutEffect(()=>{if(M&&!Q){var G={doc:e,selection:n,extensions:J},R=E?dn.fromJSON(E.json,G,E.fields):dn.create(G);if(U(R),!P){var se=new Ke({state:R,parent:M,root:_});I(se),i&&i(se,R)}}return()=>{P&&(U(void 0),I(void 0))}},[M,Q]),b.useEffect(()=>{t.container&&L(t.container)},[t.container]),b.useEffect(()=>()=>{P&&(P.destroy(),I(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:Lt.reconfigure.of(J)})},[h,o,f,m,g,x,y,w,S,k,N,C,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,se=()=>{P&&e!==P.state.doc.toString()&&P.dispatch({changes:{from:0,to:P.state.doc.toString().length,insert:e||""},annotations:[wE.of(!0)]})};R?z.current=se:se()}}},[e,P]),{state:Q,setState:U,view:P,setView:I,container:M,setContainer:L}}var Pue=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],eF=b.forwardRef((t,e)=>{var{className:n,value:r="",selection:s,extensions:i=[],onChange:a,onStatistics:o,onCreateEditor:c,onUpdate:h,autoFocus:f,theme:m="light",height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:N,placeholder:C,indentWithTab:T,editable:_,readOnly:E,root:M,initialState:L}=t,P=jY(t,Pue),I=b.useRef(null),{state:Q,view:U,container:ee,setContainer:z}=zue({root:M,value:r,autoFocus:f,theme:m,height:g,minHeight:x,maxHeight:y,width:w,minWidth:S,maxWidth:k,basicSetup:N,placeholder:C,indentWithTab:T,editable:_,readOnly:E,selection:s,onChange:a,onStatistics:o,onCreateEditor:c,onUpdate:h,extensions:i,initialState:L});b.useImperativeHandle(e,()=>({editor:I.current,state:Q,view:U}),[I,ee,Q,U]);var H=b.useCallback(X=>{I.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 l.jsx("div",OY({ref:H,className:""+B+(n?" "+n:"")},P))});eF.displayName="CodeMirror";var SE={};class ev{constructor(e,n,r,s,i,a,o,c,h,f=0,m){this.p=e,this.stack=n,this.state=r,this.reducePos=s,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=c,this.curContext=h,this.lookAhead=f,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 ev(e,[],n,r,r,0,[],0,s?new kE(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)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=f):this.p.lastBigReductionSizec;)this.stack.pop();this.reduceContext(s,h)}storeNode(e,n,r,s=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[o-4]==0&&a.buffer[o-1]>-1){if(n==r)return;if(a.buffer[o-2]>=n){a.buffer[o-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 o=!1;for(let c=a;c>0&&this.buffer[c-2]>r;c-=4)if(this.buffer[c-1]>=0){o=!0;break}if(o)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 ev(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 Lue(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&&o==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 o=(a>>19)-i;if(o>1){let c=a&65535,h=this.stack.length-o*3;if(h>=0&&e.getGoto(this.stack[h],c,!1)>=0)return o<<19|65536|c}}else{let o=r(a,i+1);if(o!=null)return o}})};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 kE{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Lue{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 tv{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 tv(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 tv(this.stack,this.pos,this.index)}}function wx(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,o=!0),i+=c,o)break;i*=46}n?n[s++]=i:n=new e(i)}return n}class f1{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const jE=new f1;class Iue{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=jE,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&&ro.to&&(this.chunk2=this.chunk2.slice(0,o.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=jE,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 lh{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;Bue(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}lh.prototype.contextual=lh.prototype.fallback=lh.prototype.extend=!1;lh.prototype.fallback=lh.prototype.extend=!1;class oy{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function Bue(t,e,n,r,s,i){let a=0,o=1<0){let y=t[x];if(c.allows(y)&&(e.token.value==-1||e.token.value==y||que(y,e.token.value,s,i))){e.acceptToken(y);break}}let f=e.next,m=0,g=t[a+2];if(e.next<0&&g>m&&t[h+g*3-3]==65535){a=t[h+g*3-1];continue e}for(;m>1,y=h+x+(x<<1),w=t[y],S=t[y+1]||65536;if(f=S)m=x+1;else{a=t[y+2],e.advance();continue e}}break}}function OE(t,e,n){for(let r=e,s;(s=t[r])!=65535;r++)if(s==n)return r-e;return-1}function que(t,e,n,r){let s=OE(n,r,e);return s<0||OE(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 Fue{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?NE(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?NE(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 Xn){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 $ue{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new f1)}getActions(e){let n=0,r=null,{parser:s}=e.p,{tokenizers:i}=s,a=s.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,c=0;for(let h=0;hm.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),!f.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 f1,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 f1,{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(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>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 Fue(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(o);else{if(this.advanceStack(o,r,e))continue;{s||(s=[],i=[]),s.push(o);let c=this.tokens.getMainToken(o);i.push(c.value,c.end)}}break}}if(!r.length){let a=s&&Uue(s);if(a)return ki&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw ki&&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 ki&&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((o,c)=>c.score-o.score);r.length>a;)r.pop();r.some(o=>o.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let a=0;a500&&h.buffer.length>500)if((o.score-h.score||o.buffer.length-h.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 h=e.curContext&&e.curContext.tracker.strict,f=h?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&&(!h||(m.prop(Yt.contextHash)||0)==f))return e.useNode(m,g),ki&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(m.type.id)})`),!0;if(!(m instanceof Xn)||m.children.length==0||m.positions[0]>0)break;let x=m.children[0];if(x instanceof Xn&&m.positions[0]==0)m=x;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),ki&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let h=0;hs?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 CE(e,n),!0}}runRecovery(e,n,r){let s=null,i=!1;for(let a=0;a ":"";if(o.deadEnd&&(i||(i=!0,o.restart(),ki&&console.log(f+this.stackID(o)+" (restarted)"),this.advanceFully(o,r))))continue;let m=o.split(),g=f;for(let x=0;x<10&&m.forceReduce()&&(ki&&console.log(g+this.stackID(m)+" (via force-reduce)"),!this.advanceFully(m,r));x++)ki&&(g=this.stackID(m)+" -> ");for(let x of o.recoverByInsert(c))ki&&console.log(f+this.stackID(x)+" (via recover-insert)"),this.advanceFully(x,r);this.stream.end>o.pos?(h==o.pos&&(h++,c=0),o.recoverByDelete(c,h),ki&&console.log(f+this.stackID(o)+` (via recover-delete ${this.parser.getName(c)})`),CE(o,r)):(!s||s.scoret;class Vue{constructor(e){this.start=e.start,this.shift=e.shift||Uw,this.reduce=e.reduce||Uw,this.reuse=e.reuse||Uw,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class d0 extends V6{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 o=0;oe.topRules[o][1]),s=[];for(let o=0;o=0)i(f,c,o[h++]);else{let m=o[h+-f];for(let g=-f;g>0;g--)i(o[h++],c,m);h++}}}this.nodeSet=new Jv(n.map((o,c)=>qs.define({name:c>=this.minRepeatTerm?void 0:o,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=yB;let a=wx(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new lh(a,o):o),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 Que(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++],o=a&1,c=s[i++];if(o&&r)return c;for(let h=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=eo(this.data,i+2);else break;s=n(eo(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=eo(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(d0.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(o=>o.from==r.external);if(!i)return r;let a=Object.assign(Object.assign({},r),{external:i.to});return n.specializers[s]=TE(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 Wue=1,tF=194,nF=195,Gue=196,EE=197,Xue=198,Yue=199,Kue=200,Zue=2,rF=3,_E=201,Jue=24,ede=25,tde=49,nde=50,rde=55,sde=56,ide=57,ade=59,lde=60,ode=61,cde=62,ude=63,dde=65,hde=238,fde=71,mde=241,pde=242,gde=243,xde=244,vde=245,yde=246,bde=247,wde=248,sF=72,Sde=249,kde=250,jde=251,Ode=252,Nde=253,Cde=254,Tde=255,Ede=256,_de=73,Mde=77,Ade=263,Rde=112,Dde=130,zde=151,Pde=152,Lde=155,Pu=10,h0=13,mj=32,cy=9,pj=35,Ide=40,Bde=46,US=123,ME=125,iF=39,aF=34,AE=92,qde=111,Fde=120,$de=78,Qde=117,Hde=85,Vde=new Set([ede,tde,nde,Ade,dde,Dde,sde,ide,hde,cde,ude,sF,_de,Mde,lde,ode,zde,Pde,Lde,Rde]);function Ww(t){return t==Pu||t==h0}function Gw(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}const Ude=new oy((t,e)=>{let n;if(t.next<0)t.acceptToken(Yue);else if(e.context.flags&m1)Ww(t.next)&&t.acceptToken(Xue,1);else if(((n=t.peek(-1))<0||Ww(n))&&e.canShift(EE)){let r=0;for(;t.next==mj||t.next==cy;)t.advance(),r++;(t.next==Pu||t.next==h0||t.next==pj)&&t.acceptToken(EE,-r)}else Ww(t.next)&&t.acceptToken(Gue,1)},{contextual:!0}),Wde=new oy((t,e)=>{let n=e.context;if(n.flags)return;let r=t.peek(-1);if(r==Pu||r==h0){let s=0,i=0;for(;;){if(t.next==mj)s++;else if(t.next==cy)s+=8-s%8;else break;t.advance(),i++}s!=n.indent&&t.next!=Pu&&t.next!=h0&&t.next!=pj&&(s[t,e|lF])),Yde=new Vue({start:Gde,reduce(t,e,n,r){return t.flags&m1&&Vde.has(e)||(e==fde||e==sF)&&t.flags&lF?t.parent:t},shift(t,e,n,r){return e==tF?new p1(t,Xde(r.read(r.pos,n.pos)),0):e==nF?t.parent:e==Jue||e==rde||e==ade||e==rF?new p1(t,0,m1):RE.has(e)?new p1(t,0,RE.get(e)|t.flags&m1):t},hash(t){return t.hash}}),Kde=new oy(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==mj||n==cy)){n!=Ide&&n!=Bde&&n!=Pu&&n!=h0&&n!=pj&&t.acceptToken(Wue);return}}}),Zde=new oy((t,e)=>{let{flags:n}=e.context,r=n&Yl?aF:iF,s=(n&Kl)>0,i=!(n&Zl),a=(n&Jl)>0,o=t.pos;for(;!(t.next<0);)if(a&&t.next==US)if(t.peek(1)==US)t.advance(2);else{if(t.pos==o){t.acceptToken(rF,1);return}break}else if(i&&t.next==AE){if(t.pos==o){t.advance();let c=t.next;c>=0&&(t.advance(),Jde(t,c)),t.acceptToken(Zue);return}break}else if(t.next==AE&&!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==o){t.acceptToken(_E,s?3:1);return}break}else if(t.next==Pu){if(s)t.advance();else if(t.pos==o){t.acceptToken(_E);return}break}else t.advance();t.pos>o&&t.acceptToken(Kue)});function Jde(t,e){if(e==qde)for(let n=0;n<2&&t.next>=48&&t.next<=55;n++)t.advance();else if(e==Fde)for(let n=0;n<2&&Gw(t.next);n++)t.advance();else if(e==Qde)for(let n=0;n<4&&Gw(t.next);n++)t.advance();else if(e==Hde)for(let n=0;n<8&&Gw(t.next);n++)t.advance();else if(e==$de&&t.next==US){for(t.advance();t.next>=0&&t.next!=ME&&t.next!=iF&&t.next!=aF&&t.next!=Pu;)t.advance();t.next==ME&&t.advance()}}const ehe=U6({'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}),the={__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},nhe=d0.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:[Kde,Wde,Ude,Zde,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:t=>the[t]||-1}],tokenPrec:7668}),DE=new yae,oF=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function Sx(t){return(e,n,r)=>{if(r)return!1;let s=e.node.getChild("VariableName");return s&&n(s,t),!0}}const rhe={FunctionDefinition:Sx("function"),ClassDefinition:Sx("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:Sx("variable"),AsPattern:Sx("variable"),__proto__:null};function cF(t,e){let n=DE.get(e);if(n)return n;let r=[],s=!0;function i(a,o){let c=t.sliceString(a.from,a.to);r.push({label:c,type:o})}return e.cursor(Jr.IncludeAnonymous).iterate(a=>{if(a.name){let o=rhe[a.name];if(o&&o(a,i,s)||!s&&oF.has(a.name))return!1;s=!1}else if(a.to-a.from>8192){for(let o of cF(t,a.node))r.push(o);return!1}}),DE.set(e,r),r}const zE=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,uF=["String","FormatString","Comment","PropertyName"];function she(t){let e=ls(t.state).resolveInner(t.pos,-1);if(uF.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&zE.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let s=e;s;s=s.parent)oF.has(s.name)&&(r=r.concat(cF(t.state.doc,s)));return{options:r,from:n?e.from:t.pos,validFor:zE}}const ihe=["__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"}))),ahe=[Ul("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),Ul("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),Ul("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),Ul("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),Ul(`if \${}: - -`,{label:"if",detail:"block",type:"keyword"}),Ul("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),Ul("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),Ul("import ${module}",{label:"import",detail:"statement",type:"keyword"}),Ul("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],lhe=cce(uF,Iq(ihe.concat(ahe)));function Xw(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 Yw(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 Kw=n0.define({name:"python",parser:nhe.configure({props:[ty.add({Body:t=>{var e;let n=/^\s*(#|$)/.test(t.textAfter)&&Xw(t)||t.node;return(e=Yw(t,n))!==null&&e!==void 0?e:t.continue()},MatchBody:t=>{var e;let n=Xw(t);return(e=Yw(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":Rw({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Rw({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Rw({closing:"]"}),MemberExpression:t=>t.baseIndent+t.unit,"String FormatString":()=>null,Script:t=>{var e;let n=Xw(t);return(e=n&&Yw(t,n))!==null&&e!==void 0?e:t.continue()}}),X6.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":_B,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 ohe(){return new CB(Kw,[Kw.data.of({autocomplete:she}),Kw.data.of({autocomplete:lhe})])}const che=U6({String:xe.string,Number:xe.number,"True False":xe.bool,PropertyName:xe.propertyName,Null:xe.null,", :":xe.separator,"[ ]":xe.squareBracket,"{ }":xe.brace}),uhe=d0.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:[che],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}),dhe=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const n=hhe(e,t.state.doc);return[{from:n,message:e.message,severity:"error",to:n}]}return[]};function hhe(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 fhe=n0.define({name:"json",parser:uhe.configure({props:[ty.add({Object:PT({except:/^\s*\}/}),Array:PT({except:/^\s*\]/})}),X6.add({"Object Array":_B})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function mhe(){return new CB(fhe)}const phe={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:"#"}}},ghe={python:[ohe()],json:[mhe(),dhe()],toml:[Y6.define(phe)],text:[]};function xhe({value:t,onChange:e,language:n="text",readOnly:r=!1,height:s="400px",minHeight:i,maxHeight:a,placeholder:o,theme:c="dark",className:h=""}){const[f,m]=b.useState(!1);if(b.useEffect(()=>{m(!0)},[]),!f)return l.jsx("div",{className:`rounded-md border bg-muted animate-pulse ${h}`,style:{height:s,minHeight:i,maxHeight:a}});const g=[...ghe[n]||[],Ke.lineWrapping];return r&&g.push(Ke.editable.of(!1)),l.jsx("div",{className:`rounded-md overflow-hidden border ${h}`,children:l.jsx(eF,{value:t,height:s,minHeight:i,maxHeight:a,theme:c==="dark"?Jq:void 0,extensions:g,onChange:e,placeholder:o,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 vhe(){const[t,e]=b.useState(!0),[n,r]=b.useState(!1),[s,i]=b.useState(!1),[a,o]=b.useState(!1),[c,h]=b.useState(!1),[f,m]=b.useState(!1),[g,x]=b.useState("visual"),[y,w]=b.useState(""),[S,k]=b.useState(!1),{toast:N}=ts(),[C,T]=b.useState(null),[_,E]=b.useState(null),[M,L]=b.useState(null),[P,I]=b.useState(null),[Q,U]=b.useState(null),[ee,z]=b.useState(null),[H,B]=b.useState(null),[X,J]=b.useState(null),[G,R]=b.useState(null),[se,W]=b.useState(null),[F,V]=b.useState(null),[te,ne]=b.useState(null),[K,ie]=b.useState(null),[re,ae]=b.useState(null),[_e,Ue]=b.useState(null),[Xe,Ze]=b.useState(null),[Oe,He]=b.useState(null),[Ve,Be]=b.useState(null),ut=b.useRef(null),rt=b.useRef(!0),rn=b.useRef({}),Rn=b.useCallback(async()=>{try{const Te=await are();w(Te),k(!1)}catch(Te){N({variant:"destructive",title:"加载失败",description:Te instanceof Error?Te.message:"加载源代码失败"})}},[N]),Tn=b.useCallback(async()=>{try{e(!0);const Te=await j9();rn.current=Te,T(Te.bot),E(Te.personality);const qe=Te.chat;qe.talk_value_rules||(qe.talk_value_rules=[]),L(qe),I(Te.expression),U(Te.emoji),z(Te.memory),B(Te.tool),J(Te.mood),R(Te.voice),W(Te.lpmm_knowledge),V(Te.keyword_reaction),ne(Te.response_post_process),ie(Te.chinese_typo),ae(Te.response_splitter),Ue(Te.log),Ze(Te.debug),He(Te.maim_message),Be(Te.telemetry),o(!1),rt.current=!1,await Rn()}catch(Te){console.error("加载配置失败:",Te),N({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{e(!1)}},[N,Rn]);b.useEffect(()=>{Tn()},[Tn]);const Mt=b.useCallback(async(Te,qe)=>{if(!rt.current)try{i(!0),await ore(Te,qe),o(!1)}catch(Rt){console.error(`自动保存 ${Te} 失败:`,Rt),o(!0)}finally{i(!1)}},[]),vt=b.useCallback((Te,qe)=>{rt.current||(o(!0),ut.current&&clearTimeout(ut.current),ut.current=setTimeout(()=>{Mt(Te,qe)},2e3))},[Mt]);b.useEffect(()=>{C&&!rt.current&&vt("bot",C)},[C,vt]),b.useEffect(()=>{_&&!rt.current&&vt("personality",_)},[_,vt]),b.useEffect(()=>{M&&!rt.current&&vt("chat",M)},[M,vt]),b.useEffect(()=>{P&&!rt.current&&vt("expression",P)},[P,vt]),b.useEffect(()=>{Q&&!rt.current&&vt("emoji",Q)},[Q,vt]),b.useEffect(()=>{ee&&!rt.current&&vt("memory",ee)},[ee,vt]),b.useEffect(()=>{H&&!rt.current&&vt("tool",H)},[H,vt]),b.useEffect(()=>{X&&!rt.current&&vt("mood",X)},[X,vt]),b.useEffect(()=>{G&&!rt.current&&vt("voice",G)},[G,vt]),b.useEffect(()=>{se&&!rt.current&&vt("lpmm_knowledge",se)},[se,vt]),b.useEffect(()=>{F&&!rt.current&&vt("keyword_reaction",F)},[F,vt]),b.useEffect(()=>{te&&!rt.current&&vt("response_post_process",te)},[te,vt]),b.useEffect(()=>{K&&!rt.current&&vt("chinese_typo",K)},[K,vt]),b.useEffect(()=>{re&&!rt.current&&vt("response_splitter",re)},[re,vt]),b.useEffect(()=>{_e&&!rt.current&&vt("log",_e)},[_e,vt]),b.useEffect(()=>{Xe&&!rt.current&&vt("debug",Xe)},[Xe,vt]),b.useEffect(()=>{Oe&&!rt.current&&vt("maim_message",Oe)},[Oe,vt]),b.useEffect(()=>{Ve&&!rt.current&&vt("telemetry",Ve)},[Ve,vt]);const Ce=async()=>{try{r(!0),await lre(y),o(!1),k(!1),N({title:"保存成功",description:"配置已保存"}),await Tn()}catch(Te){k(!0),N({variant:"destructive",title:"保存失败",description:Te instanceof Error?Te.message:"保存配置失败"})}finally{r(!1)}},Le=async Te=>{if(a){N({variant:"destructive",title:"切换失败",description:"请先保存当前更改"});return}if(x(Te),Te==="source")await Rn();else try{const qe=await j9();rn.current=qe,T(qe.bot),E(qe.personality);const Rt=qe.chat;Rt.talk_value_rules||(Rt.talk_value_rules=[]),L(Rt),I(qe.expression),U(qe.emoji),z(qe.memory),B(qe.tool),J(qe.mood),R(qe.voice),W(qe.lpmm_knowledge),V(qe.keyword_reaction),ne(qe.response_post_process),ie(qe.chinese_typo),ae(qe.response_splitter),Ue(qe.log),Ze(qe.debug),He(qe.maim_message),Be(qe.telemetry),o(!1)}catch(qe){console.error("加载配置失败:",qe),N({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}},Ge=async()=>{try{r(!0),ut.current&&clearTimeout(ut.current);const Te={...rn.current,bot:C,personality:_,chat:M,expression:P,emoji:Q,memory:ee,tool:H,mood:X,voice:G,lpmm_knowledge:se,keyword_reaction:F,response_post_process:te,chinese_typo:K,response_splitter:re,log:_e,debug:Xe,maim_message:Oe,telemetry:Ve};await O9(Te),o(!1),N({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(Te){console.error("保存配置失败:",Te),N({title:"保存失败",description:Te.message,variant:"destructive"})}finally{r(!1)}},lt=async()=>{try{h(!0),Uv().catch(()=>{}),m(!0)}catch(Te){console.error("重启失败:",Te),m(!1),N({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),h(!1)}},jt=async()=>{try{r(!0),ut.current&&clearTimeout(ut.current);const Te={...rn.current,bot:C,personality:_,chat:M,expression:P,emoji:Q,memory:ee,tool:H,mood:X,voice:G,lpmm_knowledge:se,keyword_reaction:F,response_post_process:te,chinese_typo:K,response_splitter:re,log:_e,debug:Xe,maim_message:Oe,telemetry:Ve};await O9(Te),o(!1),N({title:"保存成功",description:"配置已保存,即将重启麦麦..."}),await new Promise(qe=>setTimeout(qe,500)),await lt()}catch(Te){console.error("保存失败:",Te),N({title:"保存失败",description:Te.message,variant:"destructive"})}finally{r(!1)}},Tt=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},ke=()=>{m(!1),h(!1),N({title:"重启失败",description:"服务器未能在预期时间内恢复,请手动检查",variant:"destructive"})};return t?l.jsx(hn,{className:"h-full",children:l.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):l.jsx(hn,{className:"h-full",children:l.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),l.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),l.jsxs("div",{className:"flex gap-2 w-full sm:w-auto items-center",children:[l.jsx(sa,{value:g,onValueChange:Te=>Le(Te),className:"w-auto",children:l.jsxs(Mi,{className:"h-9",children:[l.jsxs(zt,{value:"visual",className:"text-xs sm:text-sm px-2 sm:px-3",children:[l.jsx(BK,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"可视化"]}),l.jsxs(zt,{value:"source",className:"text-xs sm:text-sm px-2 sm:px-3",children:[l.jsx(qK,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1"}),"源代码"]})]})}),l.jsxs(de,{onClick:g==="visual"?Ge:Ce,disabled:n||s||!a||c,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[l.jsx(zv,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":s?"自动保存中...":a?"保存配置":"已保存"]}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsxs(de,{disabled:n||s||c,size:"sm",className:"flex-1 sm:flex-none",children:[l.jsx(a6,{className:"mr-2 h-4 w-4"}),c?"重启中...":a?"保存并重启":"重启麦麦"]})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认重启麦麦?"}),l.jsx(bn,{className:"space-y-3",asChild:!0,children:l.jsxs("div",{children:[l.jsx("p",{children:a?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),l.jsxs(Na,{className:"border-yellow-500/50 bg-yellow-500/10",children:[l.jsx(ra,{className:"h-4 w-4 text-yellow-600"}),l.jsxs(Ca,{className:"text-yellow-900 dark:text-yellow-100",children:[l.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",l.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",l.jsxs(xr,{children:[l.jsx(Bh,{asChild:!0,children:l.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:[l.jsx(Dv,{className:"h-3 w-3"}),"如何结束程序?"]})}),l.jsxs(lr,{className:"max-w-2xl",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"如何结束使用重启功能后的麦麦程序"}),l.jsx(Hr,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),l.jsxs(sa,{defaultValue:"windows",className:"w-full",children:[l.jsxs(Mi,{className:"grid w-full grid-cols-3",children:[l.jsx(zt,{value:"windows",children:"Windows"}),l.jsx(zt,{value:"macos",children:"macOS"}),l.jsx(zt,{value:"linux",children:"Linux"})]}),l.jsxs(tn,{value:"windows",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),l.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),l.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),l.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[l.jsx("p",{children:"# 查找麦麦进程"}),l.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),l.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),l.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),l.jsxs(tn,{value:"macos",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),l.jsxs("li",{children:["在进程列表中找到 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),l.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),l.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[l.jsx("p",{children:"# 查找麦麦进程"}),l.jsx("p",{children:"ps aux | grep python | grep -v grep"}),l.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),l.jsx("p",{children:"kill -9 "}),l.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),l.jsx("p",{children:"pkill -9 python"})]})]})]}),l.jsxs(tn,{value:"linux",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),l.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[l.jsx("p",{children:"# 查找麦麦进程"}),l.jsx("p",{children:"ps aux | grep python | grep -v grep"}),l.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),l.jsx("p",{children:"kill -9 "}),l.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),l.jsx("p",{children:'pkill -9 -f "bot.py"'}),l.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),l.jsx("p",{children:"pkill -9 python"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[l.jsxs("li",{children:["在终端输入 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),l.jsx(as,{children:l.jsx(k6,{asChild:!0,children:l.jsx(de,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:a?jt:lt,children:a?"保存并重启":"确认重启"})]})]})]})]})]}),l.jsxs(Na,{children:[l.jsx(ra,{className:"h-4 w-4"}),l.jsxs(Ca,{children:["配置更新后需要",l.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),g==="source"&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs(Na,{children:[l.jsx(ra,{className:"h-4 w-4"}),l.jsxs(Ca,{children:[l.jsx("strong",{children:"源代码模式(高级功能):"}),"直接编辑 TOML 配置文件。此功能仅适用于熟悉 TOML 语法的高级用户。保存时会在后端验证格式,只有格式完全正确才能保存。",S&&l.jsx("span",{className:"text-destructive font-semibold ml-2",children:"⚠️ 上次保存失败,请检查 TOML 格式"})]})]}),l.jsx(xhe,{value:y,onChange:Te=>{w(Te),o(!0),S&&k(!1)},language:"toml",theme:"dark",height:"calc(100vh - 280px)",minHeight:"500px",placeholder:"TOML 配置内容"})]}),g==="visual"&&l.jsx(l.Fragment,{children:l.jsxs(sa,{defaultValue:"bot",className:"w-full",children:[l.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:l.jsxs(Mi,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[l.jsx(zt,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),l.jsx(zt,{value:"personality",className:"flex-shrink-0",children:"人格"}),l.jsx(zt,{value:"chat",className:"flex-shrink-0",children:"聊天"}),l.jsx(zt,{value:"expression",className:"flex-shrink-0",children:"表达"}),l.jsx(zt,{value:"features",className:"flex-shrink-0",children:"功能"}),l.jsx(zt,{value:"processing",className:"flex-shrink-0",children:"处理"}),l.jsx(zt,{value:"mood",className:"flex-shrink-0",children:"情绪"}),l.jsx(zt,{value:"voice",className:"flex-shrink-0",children:"语音"}),l.jsx(zt,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),l.jsx(zt,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),l.jsx(tn,{value:"bot",className:"space-y-4",children:C&&l.jsx(yhe,{config:C,onChange:T})}),l.jsx(tn,{value:"personality",className:"space-y-4",children:_&&l.jsx(bhe,{config:_,onChange:E})}),l.jsx(tn,{value:"chat",className:"space-y-4",children:M&&l.jsx(whe,{config:M,onChange:L})}),l.jsx(tn,{value:"expression",className:"space-y-4",children:P&&l.jsx(khe,{config:P,onChange:I})}),l.jsx(tn,{value:"features",className:"space-y-4",children:Q&&ee&&H&&l.jsx(jhe,{emojiConfig:Q,memoryConfig:ee,toolConfig:H,onEmojiChange:U,onMemoryChange:z,onToolChange:B})}),l.jsx(tn,{value:"processing",className:"space-y-4",children:F&&te&&K&&re&&l.jsx(Ohe,{keywordReactionConfig:F,responsePostProcessConfig:te,chineseTypoConfig:K,responseSplitterConfig:re,onKeywordReactionChange:V,onResponsePostProcessChange:ne,onChineseTypoChange:ie,onResponseSplitterChange:ae})}),l.jsx(tn,{value:"mood",className:"space-y-4",children:X&&l.jsx(Nhe,{config:X,onChange:J})}),l.jsx(tn,{value:"voice",className:"space-y-4",children:G&&l.jsx(Che,{config:G,onChange:R})}),l.jsx(tn,{value:"lpmm",className:"space-y-4",children:se&&l.jsx(The,{config:se,onChange:W})}),l.jsxs(tn,{value:"other",className:"space-y-4",children:[_e&&l.jsx(Ehe,{config:_e,onChange:Ue}),Xe&&l.jsx(_he,{config:Xe,onChange:Ze}),Oe&&l.jsx(Mhe,{config:Oe,onChange:He}),Ve&&l.jsx(Ahe,{config:Ve,onChange:Be})]})]})}),f&&l.jsx(N6,{onRestartComplete:Tt,onRestartFailed:ke})]})})}function yhe({config:t,onChange:e}){const n=()=>{e({...t,platforms:[...t.platforms,""]})},r=c=>{e({...t,platforms:t.platforms.filter((h,f)=>f!==c)})},s=(c,h)=>{const f=[...t.platforms];f[c]=h,e({...t,platforms:f})},i=()=>{e({...t,alias_names:[...t.alias_names,""]})},a=c=>{e({...t,alias_names:t.alias_names.filter((h,f)=>f!==c)})},o=(c,h)=>{const f=[...t.alias_names];f[c]=h,e({...t,alias_names:f})};return l.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),l.jsxs("div",{className:"grid gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"platform",children:"平台"}),l.jsx(Pe,{id:"platform",value:t.platform,onChange:c=>e({...t,platform:c.target.value}),placeholder:"qq"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"qq_account",children:"QQ账号"}),l.jsx(Pe,{id:"qq_account",value:t.qq_account,onChange:c=>e({...t,qq_account:c.target.value}),placeholder:"123456789"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"nickname",children:"昵称"}),l.jsx(Pe,{id:"nickname",value:t.nickname,onChange:c=>e({...t,nickname:c.target.value}),placeholder:"麦麦"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ue,{children:"其他平台账号"}),l.jsxs(de,{onClick:n,size:"sm",variant:"outline",children:[l.jsx(ws,{className:"h-4 w-4 mr-1"}),"添加"]})]}),l.jsxs("div",{className:"space-y-2",children:[t.platforms.map((c,h)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Pe,{value:c,onChange:f=>s(h,f.target.value),placeholder:"wx:114514"}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"icon",variant:"outline",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:['确定要删除平台账号 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>r(h),children:"删除"})]})]})]})]},h)),t.platforms.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ue,{children:"别名"}),l.jsxs(de,{onClick:i,size:"sm",variant:"outline",children:[l.jsx(ws,{className:"h-4 w-4 mr-1"}),"添加"]})]}),l.jsxs("div",{className:"space-y-2",children:[t.alias_names.map((c,h)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Pe,{value:c,onChange:f=>o(h,f.target.value),placeholder:"小麦"}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"icon",variant:"outline",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:['确定要删除别名 "',c||"(空)",'" 吗?此操作无法撤销。']})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>a(h),children:"删除"})]})]})]})]},h)),t.alias_names.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function bhe({config:t,onChange:e}){const n=()=>{e({...t,states:[...t.states,""]})},r=i=>{e({...t,states:t.states.filter((a,o)=>o!==i)})},s=(i,a)=>{const o=[...t.states];o[i]=a,e({...t,states:o})};return l.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),l.jsxs("div",{className:"grid gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"personality",children:"人格特质"}),l.jsx(pr,{id:"personality",value:t.personality,onChange:i=>e({...t,personality:i.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"reply_style",children:"表达风格"}),l.jsx(pr,{id:"reply_style",value:t.reply_style,onChange:i=>e({...t,reply_style:i.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"interest",children:"兴趣"}),l.jsx(pr,{id:"interest",value:t.interest,onChange:i=>e({...t,interest:i.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"plan_style",children:"说话规则与行为风格"}),l.jsx(pr,{id:"plan_style",value:t.plan_style,onChange:i=>e({...t,plan_style:i.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"visual_style",children:"识图规则"}),l.jsx(pr,{id:"visual_style",value:t.visual_style,onChange:i=>e({...t,visual_style:i.target.value}),placeholder:"识图时的处理规则",rows:3})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"private_plan_style",children:"私聊规则"}),l.jsx(pr,{id:"private_plan_style",value:t.private_plan_style,onChange:i=>e({...t,private_plan_style:i.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ue,{children:"状态列表(人格多样性)"}),l.jsxs(de,{onClick:n,size:"sm",variant:"outline",children:[l.jsx(ws,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),l.jsx("div",{className:"space-y-2",children:t.states.map((i,a)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx(pr,{value:i,onChange:o=>s(a,o.target.value),placeholder:"描述一个人格状态",rows:2}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"icon",variant:"outline",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsx(bn,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>r(a),children:"删除"})]})]})]})]},a))})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"state_probability",children:"状态替换概率"}),l.jsx(Pe,{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)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function whe({config:t,onChange:e}){const n=()=>{e({...t,talk_value_rules:[...t.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=o=>{e({...t,talk_value_rules:t.talk_value_rules.filter((c,h)=>h!==o)})},s=(o,c,h)=>{const f=[...t.talk_value_rules];f[o]={...f[o],[c]:h},e({...t,talk_value_rules:f})},i=({value:o,onChange:c})=>{const[h,f]=b.useState("00"),[m,g]=b.useState("00"),[x,y]=b.useState("23"),[w,S]=b.useState("59");b.useEffect(()=>{const N=o.split("-");if(N.length===2){const[C,T]=N,[_,E]=C.split(":"),[M,L]=T.split(":");_&&f(_.padStart(2,"0")),E&&g(E.padStart(2,"0")),M&&y(M.padStart(2,"0")),L&&S(L.padStart(2,"0"))}},[o]);const k=(N,C,T,_)=>{const E=`${N}:${C}-${T}:${_}`;c(E)};return l.jsxs(ul,{children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[l.jsx(Zd,{className:"h-4 w-4 mr-2"}),o||"选择时间段"]})}),l.jsx(Ea,{className:"w-80",children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"小时"}),l.jsxs(qt,{value:h,onValueChange:N=>{f(N),k(N,m,x,w)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsx(Bt,{children:Array.from({length:24},(N,C)=>C).map(N=>l.jsx(De,{value:N.toString().padStart(2,"0"),children:N.toString().padStart(2,"0")},N))})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"分钟"}),l.jsxs(qt,{value:m,onValueChange:N=>{g(N),k(h,N,x,w)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsx(Bt,{children:Array.from({length:60},(N,C)=>C).map(N=>l.jsx(De,{value:N.toString().padStart(2,"0"),children:N.toString().padStart(2,"0")},N))})]})]})]})]}),l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"小时"}),l.jsxs(qt,{value:x,onValueChange:N=>{y(N),k(h,m,N,w)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsx(Bt,{children:Array.from({length:24},(N,C)=>C).map(N=>l.jsx(De,{value:N.toString().padStart(2,"0"),children:N.toString().padStart(2,"0")},N))})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"分钟"}),l.jsxs(qt,{value:w,onValueChange:N=>{S(N),k(h,m,x,N)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsx(Bt,{children:Array.from({length:60},(N,C)=>C).map(N=>l.jsx(De,{value:N.toString().padStart(2,"0"),children:N.toString().padStart(2,"0")},N))})]})]})]})]})]})})]})},a=({rule:o})=>{const c=`{ target = "${o.target}", time = "${o.time}", value = ${o.value.toFixed(1)} }`;return l.jsxs(ul,{children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{variant:"outline",size:"sm",children:[l.jsx(oa,{className:"h-4 w-4 mr-1"}),"预览"]})}),l.jsx(Ea,{className:"w-96",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),l.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:c}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return l.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),l.jsxs("div",{className:"grid gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),l.jsx(Pe,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:t.talk_value,onChange:o=>e({...t,talk_value:parseFloat(o.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"mentioned_bot_reply",checked:t.mentioned_bot_reply,onCheckedChange:o=>e({...t,mentioned_bot_reply:o})}),l.jsx(ue,{htmlFor:"mentioned_bot_reply",className:"cursor-pointer",children:"启用提及必回复"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"max_context_size",children:"上下文长度"}),l.jsx(Pe,{id:"max_context_size",type:"number",min:"1",value:t.max_context_size,onChange:o=>e({...t,max_context_size:parseInt(o.target.value)})})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"planner_smooth",children:"规划器平滑"}),l.jsx(Pe,{id:"planner_smooth",type:"number",step:"1",min:"0",value:t.planner_smooth,onChange:o=>e({...t,planner_smooth:parseFloat(o.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"enable_talk_value_rules",checked:t.enable_talk_value_rules,onCheckedChange:o=>e({...t,enable_talk_value_rules:o})}),l.jsx(ue,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"include_planner_reasoning",checked:t.include_planner_reasoning,onCheckedChange:o=>e({...t,include_planner_reasoning:o})}),l.jsx(ue,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),t.enable_talk_value_rules&&l.jsxs("div",{className:"border-t pt-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),l.jsxs(de,{onClick:n,size:"sm",children:[l.jsx(ws,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),t.talk_value_rules&&t.talk_value_rules.length>0?l.jsx("div",{className:"space-y-4",children:t.talk_value_rules.map((o,c)=>l.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",c+1]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(a,{rule:o}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{variant:"ghost",size:"sm",children:l.jsx(fn,{className:"h-4 w-4 text-destructive"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:["确定要删除规则 #",c+1," 吗?此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>r(c),children:"删除"})]})]})]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"配置类型"}),l.jsxs(qt,{value:o.target===""?"global":"specific",onValueChange:h=>{h==="global"?s(c,"target",""):s(c,"target","qq::group")},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"global",children:"全局配置"}),l.jsx(De,{value:"specific",children:"详细配置"})]})]})]}),o.target!==""&&(()=>{const h=o.target.split(":"),f=h[0]||"qq",m=h[1]||"",g=h[2]||"group";return l.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[l.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"平台"}),l.jsxs(qt,{value:f,onValueChange:x=>{s(c,"target",`${x}:${m}:${g}`)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"qq",children:"QQ"}),l.jsx(De,{value:"wx",children:"微信"})]})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"群 ID"}),l.jsx(Pe,{value:m,onChange:x=>{s(c,"target",`${f}:${x.target.value}:${g}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"类型"}),l.jsxs(qt,{value:g,onValueChange:x=>{s(c,"target",`${f}:${m}:${x}`)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"group",children:"群组(group)"}),l.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",o.target||"(未设置)"]})]})})(),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"时间段 (Time)"}),l.jsx(i,{value:o.time,onChange:h=>s(c,"time",h)}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),l.jsxs("div",{className:"grid gap-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ue,{htmlFor:`rule-value-${c}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),l.jsx(Pe,{id:`rule-value-${c}`,type:"number",step:"0.01",min:"0.01",max:"1",value:o.value,onChange:h=>{const f=parseFloat(h.target.value);isNaN(f)||s(c,"value",Math.max(.01,Math.min(1,f)))},className:"w-20 h-8 text-xs"})]}),l.jsx(V0,{value:[o.value],onValueChange:h=>s(c,"value",h[0]),min:.01,max:1,step:.01,className:"w-full"}),l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"0.01 (极少发言)"}),l.jsx("span",{children:"0.5"}),l.jsx("span",{children:"1.0 (正常)"})]})]})]})]},c))}):l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:l.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),l.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:[l.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),l.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[l.jsxs("li",{children:["• ",l.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),l.jsxs("li",{children:["• ",l.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),l.jsxs("li",{children:["• ",l.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),l.jsxs("li",{children:["• ",l.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),l.jsxs("li",{children:["• ",l.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function She({member:t,groupIndex:e,memberIndex:n,availableChatIds:r,onUpdate:s,onRemove:i}){const a=r.includes(t)||t==="*",[o,c]=b.useState(!a);return l.jsxs("div",{className:"flex gap-2",children:[l.jsx("div",{className:"flex-1 flex gap-2",children:o?l.jsxs(l.Fragment,{children:[l.jsx(Pe,{value:t,onChange:h=>s(e,n,h.target.value),placeholder:'输入 "*" 或 "qq:123456:group"',className:"flex-1"}),r.length>0&&l.jsx(de,{size:"sm",variant:"outline",onClick:()=>c(!1),title:"切换到下拉选择",children:"下拉"})]}):l.jsxs(l.Fragment,{children:[l.jsxs(qt,{value:t,onValueChange:h=>s(e,n,h),children:[l.jsx(It,{className:"flex-1",children:l.jsx(Ft,{placeholder:"选择聊天流"})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"*",children:"* (全局共享)"}),r.map((h,f)=>l.jsx(De,{value:h,children:h},f))]})]}),l.jsx(de,{size:"sm",variant:"outline",onClick:()=>c(!0),title:"切换到手动输入",children:"输入"})]})}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"icon",variant:"outline",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:['确定要删除组成员 "',t||"(空)",'" 吗?此操作无法撤销。']})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>i(e,n),children:"删除"})]})]})]})]})}function khe({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 l.jsxs(ul,{children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{variant:"outline",size:"sm",children:[l.jsx(oa,{className:"h-4 w-4 mr-1"}),"预览"]})}),l.jsx(Ea,{className:"w-96",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),l.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:g}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},a=()=>{e({...t,expression_groups:[...t.expression_groups,[]]})},o=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})},h=(m,g)=>{const x=[...t.expression_groups];x[m]=x[m].filter((y,w)=>w!==g),e({...t,expression_groups:x})},f=(m,g,x)=>{const y=[...t.expression_groups];y[m][g]=x,e({...t,expression_groups:y})};return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),l.jsxs(de,{onClick:n,size:"sm",variant:"outline",children:[l.jsx(ws,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),l.jsxs("div",{className:"space-y-4",children:[t.learning_list.map((m,g)=>{const x=t.learning_list.some((C,T)=>T!==g&&C[0]===""),y=m[0]==="",w=m[0].split(":"),S=w[0]||"qq",k=w[1]||"",N=w[2]||"group";return l.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-sm font-medium",children:["规则 ",g+1," ",y&&"(全局配置)"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(i,{rule:m}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"sm",variant:"ghost",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:["确定要删除学习规则 ",g+1," 吗?此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>r(g),children:"删除"})]})]})]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"配置类型"}),l.jsxs(qt,{value:y?"global":"specific",onValueChange:C=>{C==="global"?s(g,0,""):s(g,0,"qq::group")},disabled:x&&!y,children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"global",children:"全局配置"}),l.jsx(De,{value:"specific",disabled:x&&!y,children:"详细配置"})]})]}),x&&!y&&l.jsx("p",{className:"text-xs text-amber-600",children:"已存在全局配置,无法创建新的全局配置"})]}),!y&&l.jsxs("div",{className:"grid gap-4 p-4 rounded-lg bg-muted/50",children:[l.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"平台"}),l.jsxs(qt,{value:S,onValueChange:C=>{s(g,0,`${C}:${k}:${N}`)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"qq",children:"QQ"}),l.jsx(De,{value:"wx",children:"微信"})]})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"群 ID"}),l.jsx(Pe,{value:k,onChange:C=>{s(g,0,`${S}:${C.target.value}:${N}`)},placeholder:"输入群 ID",className:"font-mono text-sm"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"类型"}),l.jsxs(qt,{value:N,onValueChange:C=>{s(g,0,`${S}:${k}:${C}`)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"group",children:"群组(group)"}),l.jsx(De,{value:"private",children:"私聊(private)"})]})]})]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:["当前聊天流 ID:",m[0]||"(未设置)"]})]}),l.jsx("div",{className:"grid gap-2",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs font-medium",children:"使用学到的表达"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),l.jsx(Pt,{checked:m[1]==="enable",onCheckedChange:C=>s(g,1,C?"enable":"disable")})]})}),l.jsx("div",{className:"grid gap-2",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs font-medium",children:"学习表达"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),l.jsx(Pt,{checked:m[2]==="enable",onCheckedChange:C=>s(g,2,C?"enable":"disable")})]})}),l.jsxs("div",{className:"grid gap-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ue,{className:"text-xs font-medium",children:"学习强度"}),l.jsx(Pe,{type:"number",step:"0.1",min:"0",max:"5",value:m[3],onChange:C=>{const T=parseFloat(C.target.value);isNaN(T)||s(g,3,Math.max(0,Math.min(5,T)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),l.jsx(V0,{value:[parseFloat(m[3])||1],onValueChange:C=>s(g,3,C[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"0 (不学习)"}),l.jsx("span",{children:"2.5"}),l.jsx("span",{children:"5.0 (快速学习)"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},g)}),t.learning_list.length===0&&l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),l.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),l.jsxs(de,{onClick:a,size:"sm",variant:"outline",children:[l.jsx(ws,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),l.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 l.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",g+1,m.length===1&&m[0]==="*"&&"(全局共享)"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(de,{onClick:()=>c(g),size:"sm",variant:"outline",children:l.jsx(ws,{className:"h-4 w-4"})}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"sm",variant:"ghost",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:["确定要删除共享组 ",g+1," 吗?此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>o(g),children:"删除"})]})]})]})]})]}),l.jsx("div",{className:"space-y-2",children:m.map((y,w)=>l.jsx(She,{member:y,groupIndex:g,memberIndex:w,availableChatIds:x,onUpdate:f,onRemove:h},`${g}-${w}`))}),l.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:可以从下拉框选择已配置的聊天流,或手动输入。输入 "*" 启用全局共享'})]},g)}),t.expression_groups.length===0&&l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function jhe({emojiConfig:t,memoryConfig:e,toolConfig:n,onEmojiChange:r,onMemoryChange:s,onToolChange:i}){return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:a=>i({...n,enable_tool:a})}),l.jsx(ue,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),l.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),l.jsx(Pe,{id:"max_agent_iterations",type:"number",min:"1",value:e.max_agent_iterations,onChange:a=>s({...e,max_agent_iterations:parseInt(a.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),l.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),l.jsxs("div",{className:"grid gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"emoji_chance",children:"表情包激活概率"}),l.jsx(Pe,{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)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"max_reg_num",children:"最大注册数量"}),l.jsx(Pe,{id:"max_reg_num",type:"number",min:"1",value:t.max_reg_num,onChange:a=>r({...t,max_reg_num:parseInt(a.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),l.jsx(Pe,{id:"check_interval",type:"number",min:"1",value:t.check_interval,onChange:a=>r({...t,check_interval:parseInt(a.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"do_replace",checked:t.do_replace,onCheckedChange:a=>r({...t,do_replace:a})}),l.jsx(ue,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"steal_emoji",checked:t.steal_emoji,onCheckedChange:a=>r({...t,steal_emoji:a})}),l.jsx(ue,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),l.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"content_filtration",checked:t.content_filtration,onCheckedChange:a=>r({...t,content_filtration:a})}),l.jsx(ue,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),t.content_filtration&&l.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[l.jsx(ue,{htmlFor:"filtration_prompt",children:"过滤要求"}),l.jsx(Pe,{id:"filtration_prompt",value:t.filtration_prompt,onChange:a=>r({...t,filtration_prompt:a.target.value}),placeholder:"符合公序良俗"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function Ohe({keywordReactionConfig:t,responsePostProcessConfig:e,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:s,onResponsePostProcessChange:i,onChineseTypoChange:a,onResponseSplitterChange:o}){const c=()=>{s({...t,regex_rules:[...t.regex_rules,{regex:[""],reaction:""}]})},h=T=>{s({...t,regex_rules:t.regex_rules.filter((_,E)=>E!==T)})},f=(T,_,E)=>{const M=[...t.regex_rules];_==="regex"&&typeof E=="string"?M[T]={...M[T],regex:[E]}:_==="reaction"&&typeof E=="string"&&(M[T]={...M[T],reaction:E}),s({...t,regex_rules:M})},m=({regex:T,reaction:_,onRegexChange:E,onReactionChange:M})=>{const[L,P]=b.useState(!1),[I,Q]=b.useState(""),[U,ee]=b.useState(null),[z,H]=b.useState(""),[B,X]=b.useState({}),[J,G]=b.useState(""),R=b.useRef(null),[se,W]=b.useState("build"),F=K=>K.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),V=(K,ie=0)=>{const re=R.current;if(!re)return;const ae=re.selectionStart||0,_e=re.selectionEnd||0,Ue=T.substring(0,ae)+K+T.substring(_e);E(Ue),setTimeout(()=>{const Xe=ae+K.length+ie;re.setSelectionRange(Xe,Xe),re.focus()},0)};b.useEffect(()=>{if(!T||!I){ee(null),X({}),G(_),H("");return}try{const K=F(T),ie=new RegExp(K,"g"),re=I.match(ie);ee(re),H("");const _e=new RegExp(K).exec(I);if(_e&&_e.groups){X(_e.groups);let Ue=_;Object.entries(_e.groups).forEach(([Xe,Ze])=>{Ue=Ue.replace(new RegExp(`\\[${Xe}\\]`,"g"),Ze||"")}),G(Ue)}else X({}),G(_)}catch(K){H(K.message),ee(null),X({}),G(_)}},[T,I,_]);const te=()=>{if(!I||!U||U.length===0)return l.jsx("span",{className:"text-muted-foreground",children:I||"请输入测试文本"});try{const K=F(T),ie=new RegExp(K,"g");let re=0;const ae=[];let _e;for(;(_e=ie.exec(I))!==null;)_e.index>re&&ae.push(l.jsx("span",{children:I.substring(re,_e.index)},`text-${re}`)),ae.push(l.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:_e[0]},`match-${_e.index}`)),re=_e.index+_e[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 l.jsxs(xr,{open:L,onOpenChange:P,children:[l.jsx(Bh,{asChild:!0,children:l.jsxs(de,{variant:"outline",size:"sm",children:[l.jsx(C1,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),l.jsxs(lr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"正则表达式编辑器"}),l.jsx(Hr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),l.jsx(hn,{className:"max-h-[calc(90vh-120px)]",children:l.jsxs(sa,{value:se,onValueChange:K=>W(K),className:"w-full",children:[l.jsxs(Mi,{className:"grid w-full grid-cols-2",children:[l.jsx(zt,{value:"build",children:"🔧 构建器"}),l.jsx(zt,{value:"test",children:"🧪 测试器"})]}),l.jsxs(tn,{value:"build",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{className:"text-sm font-medium",children:"正则表达式"}),l.jsx(Pe,{ref:R,value:T,onChange:K=>E(K.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{className:"text-sm font-medium",children:"Reaction 内容"}),l.jsx(pr,{value:_,onChange:K=>M(K.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),l.jsxs("div",{className:"space-y-4 border-t pt-4",children:[ne.map(K=>l.jsxs("div",{className:"space-y-2",children:[l.jsx("h5",{className:"text-xs font-semibold text-primary",children:K.category}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:K.items.map(ie=>l.jsx(de,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>V(ie.pattern,ie.moveCursor||0),children:l.jsxs("div",{className:"flex flex-col items-start w-full",children:[l.jsxs("div",{className:"flex items-center gap-2 w-full",children:[l.jsx("span",{className:"text-xs font-medium",children:ie.label}),l.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:ie.pattern})]}),l.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:ie.desc})]})},ie.label))})]},K.category)),l.jsxs("div",{className:"space-y-2 border-t pt-4",children:[l.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(de,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("^(?P\\S{1,20})是这样的$"),children:l.jsxs("div",{className:"flex flex-col items-start w-full",children:[l.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),l.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),l.jsx(de,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:l.jsxs("div",{className:"flex flex-col items-start w-full",children:[l.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),l.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),l.jsx(de,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>E("(?P.+?)(?:是|为什么|怎么)"),children:l.jsxs("div",{className:"flex flex-col items-start w-full",children:[l.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),l.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),l.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:[l.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),l.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[l.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),l.jsxs("li",{children:["命名捕获组格式:",l.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),l.jsxs("li",{children:["在 reaction 中使用 ",l.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),l.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),l.jsxs(tn,{value:"test",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{className:"text-sm font-medium",children:"当前正则表达式"}),l.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:T||"(未设置)"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),l.jsx(pr,{id:"test-text",value:I,onChange:K=>Q(K.target.value),placeholder:`在此输入要测试的文本... -例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),z&&l.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[l.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),l.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:z})]}),!z&&I&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"flex items-center gap-2",children:U&&U.length>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),l.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",U.length," 处)"]})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),l.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{className:"text-sm font-medium",children:"匹配高亮"}),l.jsx(hn,{className:"h-40 rounded-md bg-muted p-3",children:l.jsx("div",{className:"text-sm break-words",children:te()})})]}),Object.keys(B).length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{className:"text-sm font-medium",children:"命名捕获组"}),l.jsx(hn,{className:"h-32 rounded-md border p-3",children:l.jsx("div",{className:"space-y-2",children:Object.entries(B).map(([K,ie])=>l.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[l.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",K,"]"]}),l.jsx("span",{className:"text-muted-foreground",children:"="}),l.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:ie})]},K))})})]}),Object.keys(B).length>0&&_&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{className:"text-sm font-medium",children:"Reaction 替换预览"}),l.jsx(hn,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:l.jsx("div",{className:"text-sm break-words",children:J})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),l.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:[l.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),l.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[l.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),l.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),l.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),l.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{s({...t,keyword_rules:[...t.keyword_rules,{keywords:[],reaction:""}]})},x=T=>{s({...t,keyword_rules:t.keyword_rules.filter((_,E)=>E!==T)})},y=(T,_,E)=>{const M=[...t.keyword_rules];typeof E=="string"&&(M[T]={...M[T],reaction:E}),s({...t,keyword_rules:M})},w=T=>{const _=[...t.keyword_rules];_[T]={..._[T],keywords:[..._[T].keywords||[],""]},s({...t,keyword_rules:_})},S=(T,_)=>{const E=[...t.keyword_rules];E[T]={...E[T],keywords:(E[T].keywords||[]).filter((M,L)=>L!==_)},s({...t,keyword_rules:E})},k=(T,_,E)=>{const M=[...t.keyword_rules],L=[...M[T].keywords||[]];L[_]=E,M[T]={...M[T],keywords:L},s({...t,keyword_rules:M})},N=({rule:T})=>{const _=`{ regex = [${(T.regex||[]).map(E=>`"${E}"`).join(", ")}], reaction = "${T.reaction}" }`;return l.jsxs(ul,{children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{variant:"outline",size:"sm",children:[l.jsx(oa,{className:"h-4 w-4 mr-1"}),"预览"]})}),l.jsx(Ea,{className:"w-[95vw] sm:w-[500px]",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),l.jsx(hn,{className:"h-60 rounded-md bg-muted p-3",children:l.jsx("pre",{className:"font-mono text-xs break-all",children:_})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},C=({rule:T})=>{const _=`[[keyword_reaction.keyword_rules]] -keywords = [${(T.keywords||[]).map(E=>`"${E}"`).join(", ")}] -reaction = "${T.reaction}"`;return l.jsxs(ul,{children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{variant:"outline",size:"sm",children:[l.jsx(oa,{className:"h-4 w-4 mr-1"}),"预览"]})}),l.jsx(Ea,{className:"w-[95vw] sm:w-[500px]",children:l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),l.jsx(hn,{className:"h-60 rounded-md bg-muted p-3",children:l.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:_})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),l.jsxs(de,{onClick:c,size:"sm",variant:"outline",children:[l.jsx(ws,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),l.jsxs("div",{className:"space-y-3",children:[t.regex_rules.map((T,_)=>l.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",_+1]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(m,{regex:T.regex&&T.regex[0]||"",reaction:T.reaction,onRegexChange:E=>f(_,"regex",E),onReactionChange:E=>f(_,"reaction",E)}),l.jsx(N,{rule:T}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"sm",variant:"ghost",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:["确定要删除正则规则 ",_+1," 吗?此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>h(_),children:"删除"})]})]})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),l.jsx(Pe,{value:T.regex&&T.regex[0]||"",onChange:E=>f(_,"regex",E.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"反应内容"}),l.jsx(pr,{value:T.reaction,onChange:E=>f(_,"reaction",E.target.value),placeholder:`触发后麦麦的反应... -可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},_)),t.regex_rules.length===0&&l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),l.jsxs("div",{className:"space-y-4 border-t pt-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),l.jsxs(de,{onClick:g,size:"sm",variant:"outline",children:[l.jsx(ws,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),l.jsxs("div",{className:"space-y-3",children:[t.keyword_rules.map((T,_)=>l.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",_+1]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(C,{rule:T}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"sm",variant:"ghost",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:["确定要删除关键词规则 ",_+1," 吗?此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>x(_),children:"删除"})]})]})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ue,{className:"text-xs font-medium",children:"关键词列表"}),l.jsxs(de,{onClick:()=>w(_),size:"sm",variant:"ghost",children:[l.jsx(ws,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),l.jsxs("div",{className:"space-y-2",children:[(T.keywords||[]).map((E,M)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Pe,{value:E,onChange:L=>k(_,M,L.target.value),placeholder:"关键词",className:"flex-1"}),l.jsx(de,{onClick:()=>S(_,M),size:"sm",variant:"ghost",children:l.jsx(fn,{className:"h-4 w-4"})})]},M)),(!T.keywords||T.keywords.length===0)&&l.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-xs font-medium",children:"反应内容"}),l.jsx(pr,{value:T.reaction,onChange:E=>y(_,"reaction",E.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},_)),t.keyword_rules.length===0&&l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"enable_response_post_process",checked:e.enable_response_post_process,onCheckedChange:T=>i({...e,enable_response_post_process:T})}),l.jsx(ue,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),e.enable_response_post_process&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t pt-6 space-y-4",children:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[l.jsx(Pt,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:T=>a({...n,enable:T})}),l.jsx(ue,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),l.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&l.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),l.jsx(Pe,{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)})})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),l.jsx(Pe,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:T=>a({...n,min_freq:parseInt(T.target.value)})})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),l.jsx(Pe,{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)})})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),l.jsx(Pe,{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)})})]})]})]})}),l.jsx("div",{className:"border-t pt-6 space-y-4",children:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[l.jsx(Pt,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:T=>o({...r,enable:T})}),l.jsx(ue,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),l.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&l.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),l.jsx(Pe,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:T=>o({...r,max_length:parseInt(T.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),l.jsx(Pe,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:T=>o({...r,max_sentence_num:parseInt(T.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:T=>o({...r,enable_kaomoji_protection:T})}),l.jsx(ue,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:T=>o({...r,enable_overflow_return_all:T})}),l.jsx(ue,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),l.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function Nhe({config:t,onChange:e}){return l.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[l.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),l.jsxs("div",{className:"grid gap-4",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{checked:t.enable_mood,onCheckedChange:n=>e({...t,enable_mood:n})}),l.jsx(ue,{className:"cursor-pointer",children:"启用情绪系统"})]}),t.enable_mood&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"情绪更新阈值"}),l.jsx(Pe,{type:"number",min:"1",value:t.mood_update_threshold,onChange:n=>e({...t,mood_update_threshold:parseInt(n.target.value)})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"情感特征"}),l.jsx(pr,{value:t.emotion_style,onChange:n=>e({...t,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function Che({config:t,onChange:e}){return l.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[l.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{checked:t.enable_asr,onCheckedChange:n=>e({...t,enable_asr:n})}),l.jsx(ue,{className:"cursor-pointer",children:"启用语音识别"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function The({config:t,onChange:e}){return l.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[l.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),l.jsxs("div",{className:"grid gap-4",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})}),l.jsx(ue,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),t.enable&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"LPMM 模式"}),l.jsxs(qt,{value:t.lpmm_mode,onValueChange:n=>e({...t,lpmm_mode:n}),children:[l.jsx(It,{children:l.jsx(Ft,{placeholder:"选择 LPMM 模式"})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"classic",children:"经典模式"}),l.jsx(De,{value:"agent",children:"Agent 模式"})]})]})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"同义词搜索 TopK"}),l.jsx(Pe,{type:"number",min:"1",value:t.rag_synonym_search_top_k,onChange:n=>e({...t,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"同义词阈值"}),l.jsx(Pe,{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)})})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"实体提取线程数"}),l.jsx(Pe,{type:"number",min:"1",value:t.info_extraction_workers,onChange:n=>e({...t,info_extraction_workers:parseInt(n.target.value)})})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"嵌入向量维度"}),l.jsx(Pe,{type:"number",min:"1",value:t.embedding_dimension,onChange:n=>e({...t,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function Ehe({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(""))},o=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"))},h=x=>{const y={...t.library_log_levels};delete y[x],e({...t,library_log_levels:y})},f=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],m=["FULL","compact","lite"],g=["none","title","full"];return l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"日期格式"}),l.jsx(Pe,{value:t.date_style,onChange:x=>e({...t,date_style:x.target.value}),placeholder:"例如: m-d H:i:s"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"日志级别样式"}),l.jsxs(qt,{value:t.log_level_style,onValueChange:x=>e({...t,log_level_style:x}),children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsx(Bt,{children:m.map(x=>l.jsx(De,{value:x,children:x},x))})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"日志文本颜色"}),l.jsxs(qt,{value:t.color_text,onValueChange:x=>e({...t,color_text:x}),children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsx(Bt,{children:g.map(x=>l.jsx(De,{value:x,children:x},x))})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"全局日志级别"}),l.jsxs(qt,{value:t.log_level,onValueChange:x=>e({...t,log_level:x}),children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsx(Bt,{children:f.map(x=>l.jsx(De,{value:x,children:x},x))})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"控制台日志级别"}),l.jsxs(qt,{value:t.console_log_level,onValueChange:x=>e({...t,console_log_level:x}),children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsx(Bt,{children:f.map(x=>l.jsx(De,{value:x,children:x},x))})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"文件日志级别"}),l.jsxs(qt,{value:t.file_log_level,onValueChange:x=>e({...t,file_log_level:x}),children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsx(Bt,{children:f.map(x=>l.jsx(De,{value:x,children:x},x))})]})]})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"mb-2 block",children:"完全屏蔽的库"}),l.jsxs("div",{className:"flex gap-2 mb-2",children:[l.jsx(Pe,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),a())}}),l.jsx(de,{onClick:a,size:"sm",className:"flex-shrink-0",children:l.jsx(ws,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:t.suppress_libraries.map(x=>l.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[l.jsx("span",{className:"text-sm",children:x}),l.jsx(de,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>o(x),children:l.jsx(fn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},x))})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"mb-2 block",children:"特定库的日志级别"}),l.jsxs("div",{className:"flex gap-2 mb-2",children:[l.jsx(Pe,{value:n,onChange:x=>r(x.target.value),placeholder:"输入库名",className:"flex-1"}),l.jsxs(qt,{value:s,onValueChange:i,children:[l.jsx(It,{className:"w-32",children:l.jsx(Ft,{})}),l.jsx(Bt,{children:f.map(x=>l.jsx(De,{value:x,children:x},x))})]}),l.jsx(de,{onClick:c,size:"sm",children:l.jsx(ws,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),l.jsx("div",{className:"space-y-2",children:Object.entries(t.library_log_levels).map(([x,y])=>l.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[l.jsx("span",{className:"text-sm font-medium",children:x}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:y}),l.jsx(de,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>h(x),children:l.jsx(fn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},x))})]})]})}function _he({config:t,onChange:e}){return l.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[l.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(ue,{children:"显示 Prompt"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),l.jsx(Pt,{checked:t.show_prompt,onCheckedChange:n=>e({...t,show_prompt:n})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(ue,{children:"显示回复器 Prompt"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),l.jsx(Pt,{checked:t.show_replyer_prompt,onCheckedChange:n=>e({...t,show_replyer_prompt:n})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(ue,{children:"显示回复器推理"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),l.jsx(Pt,{checked:t.show_replyer_reasoning,onCheckedChange:n=>e({...t,show_replyer_reasoning:n})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(ue,{children:"显示 Jargon Prompt"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),l.jsx(Pt,{checked:t.show_jargon_prompt,onCheckedChange:n=>e({...t,show_jargon_prompt:n})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(ue,{children:"显示记忆检索 Prompt"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示记忆检索相关的提示词"})]}),l.jsx(Pt,{checked:t.show_memory_prompt,onCheckedChange:n=>e({...t,show_memory_prompt:n})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(ue,{children:"显示 Planner Prompt"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 Planner 的提示词和原始返回结果"})]}),l.jsx(Pt,{checked:t.show_planner_prompt,onCheckedChange:n=>e({...t,show_planner_prompt:n})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(ue,{children:"显示 LPMM 相关文段"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示 LPMM 知识库找到的相关文段日志"})]}),l.jsx(Pt,{checked:t.show_lpmm_paragraph,onCheckedChange:n=>e({...t,show_lpmm_paragraph:n})})]})]})]})}function Mhe({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((o,c)=>c!==a)})};return l.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(ue,{children:"启用自定义服务器"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),l.jsx(Pt,{checked:t.use_custom,onCheckedChange:a=>e({...t,use_custom:a})})]}),t.use_custom&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"主机地址"}),l.jsx(Pe,{value:t.host,onChange:a=>e({...t,host:a.target.value}),placeholder:"127.0.0.1"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"端口号"}),l.jsx(Pe,{type:"number",value:t.port,onChange:a=>e({...t,port:parseInt(a.target.value)}),placeholder:"8090"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"连接模式"}),l.jsxs(qt,{value:t.mode,onValueChange:a=>e({...t,mode:a}),children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"ws",children:"WebSocket (ws)"}),l.jsx(De,{value:"tcp",children:"TCP"})]})]})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{checked:t.use_wss,onCheckedChange:a=>e({...t,use_wss:a}),disabled:t.mode!=="ws"}),l.jsx(ue,{children:"使用 WSS 安全连接"})]})]}),t.use_wss&&t.mode==="ws"&&l.jsxs("div",{className:"grid gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"SSL 证书文件路径"}),l.jsx(Pe,{value:t.cert_file,onChange:a=>e({...t,cert_file:a.target.value}),placeholder:"cert.pem"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"SSL 密钥文件路径"}),l.jsx(Pe,{value:t.key_file,onChange:a=>e({...t,key_file:a.target.value}),placeholder:"key.pem"})]})]})]})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"mb-2 block",children:"认证令牌"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),l.jsxs("div",{className:"flex gap-2 mb-2",children:[l.jsx(Pe,{value:n,onChange:a=>r(a.target.value),placeholder:"输入认证令牌",onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),s())}}),l.jsx(de,{onClick:s,size:"sm",children:l.jsx(ws,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),l.jsx("div",{className:"space-y-2",children:t.auth_token.map((a,o)=>l.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[l.jsx("span",{className:"text-sm font-mono",children:a}),l.jsx(de,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>i(o),children:l.jsx(fn,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},o))})]})]})}function Ahe({config:t,onChange:e}){return l.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[l.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-0.5",children:[l.jsx(ue,{children:"启用统计信息发送"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),l.jsx(Pt,{checked:t.enable,onCheckedChange:n=>e({...t,enable:n})})]})]})}const Vh=b.forwardRef(({className:t,...e},n)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:n,className:ve("w-full caption-bottom text-sm",t),...e})}));Vh.displayName="Table";const Uh=b.forwardRef(({className:t,...e},n)=>l.jsx("thead",{ref:n,className:ve("[&_tr]:border-b",t),...e}));Uh.displayName="TableHeader";const Wh=b.forwardRef(({className:t,...e},n)=>l.jsx("tbody",{ref:n,className:ve("[&_tr:last-child]:border-0",t),...e}));Wh.displayName="TableBody";const Rhe=b.forwardRef(({className:t,...e},n)=>l.jsx("tfoot",{ref:n,className:ve("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));Rhe.displayName="TableFooter";const bs=b.forwardRef(({className:t,...e},n)=>l.jsx("tr",{ref:n,className:ve("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));bs.displayName="TableRow";const ln=b.forwardRef(({className:t,...e},n)=>l.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}));ln.displayName="TableHead";const Qt=b.forwardRef(({className:t,...e},n)=>l.jsx("td",{ref:n,className:ve("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...e}));Qt.displayName="TableCell";const Dhe=b.forwardRef(({className:t,...e},n)=>l.jsx("caption",{ref:n,className:ve("mt-4 text-sm text-muted-foreground",t),...e}));Dhe.displayName="TableCaption";var PE=1,zhe=.9,Phe=.8,Lhe=.17,Zw=.1,Jw=.999,Ihe=.9999,Bhe=.99,qhe=/[\\\/_+.#"@\[\(\{&]/,Fhe=/[\\\/_+.#"@\[\(\{&]/g,$he=/[\s-]/,dF=/[\s-]/g;function WS(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?PE:Bhe;var o=`${s},${i}`;if(a[o]!==void 0)return a[o];for(var c=r.charAt(i),h=n.indexOf(c,s),f=0,m,g,x,y;h>=0;)m=WS(t,e,n,r,h+1,i+1,a),m>f&&(h===s?m*=PE:qhe.test(t.charAt(h-1))?(m*=Phe,x=t.slice(s,h-1).match(Fhe),x&&s>0&&(m*=Math.pow(Jw,x.length))):$he.test(t.charAt(h-1))?(m*=zhe,y=t.slice(s,h-1).match(dF),y&&s>0&&(m*=Math.pow(Jw,y.length))):(m*=Lhe,s>0&&(m*=Math.pow(Jw,h-s))),t.charAt(h)!==e.charAt(i)&&(m*=Ihe)),(mm&&(m=g*Zw)),m>f&&(f=m),h=n.indexOf(c,h+1);return a[o]=f,f}function LE(t){return t.toLowerCase().replace(dF," ")}function Qhe(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,WS(t,e,LE(t),LE(e),0,0,{})}var Hhe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dc=Hhe.reduce((t,e)=>{const n=Kk(`Primitive.${e}`),r=b.forwardRef((s,i)=>{const{asChild:a,...o}=s,c=a?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:i})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),rm='[cmdk-group=""]',e4='[cmdk-group-items=""]',Vhe='[cmdk-group-heading=""]',hF='[cmdk-item=""]',IE=`${hF}:not([aria-disabled="true"])`,GS="cmdk-item-select",Qd="data-value",Uhe=(t,e,n)=>Qhe(t,e,n),fF=b.createContext(void 0),ip=()=>b.useContext(fF),mF=b.createContext(void 0),gj=()=>b.useContext(mF),pF=b.createContext(void 0),gF=b.forwardRef((t,e)=>{let n=Hd(()=>{var W,F;return{search:"",value:(F=(W=t.value)!=null?W:t.defaultValue)!=null?F:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Hd(()=>new Set),s=Hd(()=>new Map),i=Hd(()=>new Map),a=Hd(()=>new Set),o=xF(t),{label:c,children:h,value:f,onValueChange:m,filter:g,shouldFilter:x,loop:y,disablePointerSelection:w=!1,vimBindings:S=!0,...k}=t,N=_i(),C=_i(),T=_i(),_=b.useRef(null),E=rfe();Lu(()=>{if(f!==void 0){let W=f.trim();n.current.value=W,M.emit()}},[f]),Lu(()=>{E(6,ee)},[]);let M=b.useMemo(()=>({subscribe:W=>(a.current.add(W),()=>a.current.delete(W)),snapshot:()=>n.current,setState:(W,F,V)=>{var te,ne,K,ie;if(!Object.is(n.current[W],F)){if(n.current[W]=F,W==="search")U(),I(),E(1,Q);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(N))==null||te.focus()}if(E(7,()=>{var re;n.current.selectedItemId=(re=z())==null?void 0:re.id,M.emit()}),V||E(5,ee),((ne=o.current)==null?void 0:ne.value)!==void 0){let re=F??"";(ie=(K=o.current).onValueChange)==null||ie.call(K,re);return}}M.emit()}},emit:()=>{a.current.forEach(W=>W())}}),[]),L=b.useMemo(()=>({value:(W,F,V)=>{var te;F!==((te=i.current.get(W))==null?void 0:te.value)&&(i.current.set(W,{value:F,keywords:V}),n.current.filtered.items.set(W,P(F,V)),E(2,()=>{I(),M.emit()}))},item:(W,F)=>(r.current.add(W),F&&(s.current.has(F)?s.current.get(F).add(W):s.current.set(F,new Set([W]))),E(3,()=>{U(),I(),n.current.value||Q(),M.emit()}),()=>{i.current.delete(W),r.current.delete(W),n.current.filtered.items.delete(W);let V=z();E(4,()=>{U(),V?.getAttribute("id")===W&&Q(),M.emit()})}),group:W=>(s.current.has(W)||s.current.set(W,new Set),()=>{i.current.delete(W),s.current.delete(W)}),filter:()=>o.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:N,inputId:T,labelId:C,listInnerRef:_}),[]);function P(W,F){var V,te;let ne=(te=(V=o.current)==null?void 0:V.filter)!=null?te:Uhe;return W?ne(W,n.current.search,F):0}function I(){if(!n.current.search||o.current.shouldFilter===!1)return;let W=n.current.filtered.items,F=[];n.current.filtered.groups.forEach(te=>{let ne=s.current.get(te),K=0;ne.forEach(ie=>{let re=W.get(ie);K=Math.max(re,K)}),F.push([te,K])});let V=_.current;H().sort((te,ne)=>{var K,ie;let re=te.getAttribute("id"),ae=ne.getAttribute("id");return((K=W.get(ae))!=null?K:0)-((ie=W.get(re))!=null?ie:0)}).forEach(te=>{let ne=te.closest(e4);ne?ne.appendChild(te.parentElement===ne?te:te.closest(`${e4} > *`)):V.appendChild(te.parentElement===V?te:te.closest(`${e4} > *`))}),F.sort((te,ne)=>ne[1]-te[1]).forEach(te=>{var ne;let K=(ne=_.current)==null?void 0:ne.querySelector(`${rm}[${Qd}="${encodeURIComponent(te[0])}"]`);K?.parentElement.appendChild(K)})}function Q(){let W=H().find(V=>V.getAttribute("aria-disabled")!=="true"),F=W?.getAttribute(Qd);M.setState("value",F||void 0)}function U(){var W,F,V,te;if(!n.current.search||o.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 ie=(F=(W=i.current.get(K))==null?void 0:W.value)!=null?F:"",re=(te=(V=i.current.get(K))==null?void 0:V.keywords)!=null?te:[],ae=P(ie,re);n.current.filtered.items.set(K,ae),ae>0&&ne++}for(let[K,ie]of s.current)for(let re of ie)if(n.current.filtered.items.get(re)>0){n.current.filtered.groups.add(K);break}n.current.filtered.count=ne}function ee(){var W,F,V;let te=z();te&&(((W=te.parentElement)==null?void 0:W.firstChild)===te&&((V=(F=te.closest(rm))==null?void 0:F.querySelector(Vhe))==null||V.scrollIntoView({block:"nearest"})),te.scrollIntoView({block:"nearest"}))}function z(){var W;return(W=_.current)==null?void 0:W.querySelector(`${hF}[aria-selected="true"]`)}function H(){var W;return Array.from(((W=_.current)==null?void 0:W.querySelectorAll(IE))||[])}function B(W){let F=H()[W];F&&M.setState("value",F.getAttribute(Qd))}function X(W){var F;let V=z(),te=H(),ne=te.findIndex(ie=>ie===V),K=te[ne+W];(F=o.current)!=null&&F.loop&&(K=ne+W<0?te[te.length-1]:ne+W===te.length?te[0]:te[ne+W]),K&&M.setState("value",K.getAttribute(Qd))}function J(W){let F=z(),V=F?.closest(rm),te;for(;V&&!te;)V=W>0?tfe(V,rm):nfe(V,rm),te=V?.querySelector(IE);te?M.setState("value",te.getAttribute(Qd)):X(W)}let G=()=>B(H().length-1),R=W=>{W.preventDefault(),W.metaKey?G():W.altKey?J(1):X(1)},se=W=>{W.preventDefault(),W.metaKey?B(0):W.altKey?J(-1):X(-1)};return b.createElement(Dc.div,{ref:e,tabIndex:-1,...k,"cmdk-root":"",onKeyDown:W=>{var F;(F=k.onKeyDown)==null||F.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&&se(W);break}case"ArrowUp":{se(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(GS);te.dispatchEvent(ne)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:L.inputId,id:L.labelId,style:ife},c),uy(t,W=>b.createElement(mF.Provider,{value:M},b.createElement(fF.Provider,{value:L},W))))}),Whe=b.forwardRef((t,e)=>{var n,r;let s=_i(),i=b.useRef(null),a=b.useContext(pF),o=ip(),c=xF(t),h=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a?.forceMount;Lu(()=>{if(!h)return o.item(s,a?.id)},[h]);let f=vF(s,i,[t.value,t.children,i],t.keywords),m=gj(),g=jc(E=>E.value&&E.value===f.current),x=jc(E=>h||o.filter()===!1?!0:E.search?E.filtered.items.get(s)>0:!0);b.useEffect(()=>{let E=i.current;if(!(!E||t.disabled))return E.addEventListener(GS,y),()=>E.removeEventListener(GS,y)},[x,t.onSelect,t.disabled]);function y(){var E,M;w(),(M=(E=c.current).onSelect)==null||M.call(E,f.current)}function w(){m.setState("value",f.current,!0)}if(!x)return null;let{disabled:S,value:k,onSelect:N,forceMount:C,keywords:T,..._}=t;return b.createElement(Dc.div,{ref:gc(i,e),..._,id:s,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!g,"data-disabled":!!S,"data-selected":!!g,onPointerMove:S||o.getDisablePointerSelection()?void 0:w,onClick:S?void 0:y},t.children)}),Ghe=b.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=_i(),o=b.useRef(null),c=b.useRef(null),h=_i(),f=ip(),m=jc(x=>s||f.filter()===!1?!0:x.search?x.filtered.groups.has(a):!0);Lu(()=>f.group(a),[]),vF(a,o,[t.value,t.heading,c]);let g=b.useMemo(()=>({id:a,forceMount:s}),[s]);return b.createElement(Dc.div,{ref:gc(o,e),...i,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&b.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),uy(t,x=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},b.createElement(pF.Provider,{value:g},x))))}),Xhe=b.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=b.useRef(null),i=jc(a=>!a.search);return!n&&!i?null:b.createElement(Dc.div,{ref:gc(s,e),...r,"cmdk-separator":"",role:"separator"})}),Yhe=b.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=gj(),a=jc(h=>h.search),o=jc(h=>h.selectedItemId),c=ip();return b.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),b.createElement(Dc.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":o,id:c.inputId,type:"text",value:s?t.value:a,onChange:h=>{s||i.setState("search",h.target.value),n?.(h.target.value)}})}),Khe=b.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=b.useRef(null),a=b.useRef(null),o=jc(h=>h.selectedItemId),c=ip();return b.useEffect(()=>{if(a.current&&i.current){let h=a.current,f=i.current,m,g=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let x=h.offsetHeight;f.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return g.observe(h),()=>{cancelAnimationFrame(m),g.unobserve(h)}}},[]),b.createElement(Dc.div,{ref:gc(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},uy(t,h=>b.createElement("div",{ref:gc(a,c.listInnerRef),"cmdk-list-sizer":""},h)))}),Zhe=b.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...o}=t;return b.createElement(t6,{open:n,onOpenChange:r},b.createElement(Zk,{container:a},b.createElement(Tv,{"cmdk-overlay":"",className:s}),b.createElement(Ev,{"aria-label":t.label,"cmdk-dialog":"",className:i},b.createElement(gF,{ref:e,...o}))))}),Jhe=b.forwardRef((t,e)=>jc(n=>n.filtered.count===0)?b.createElement(Dc.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),efe=b.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return b.createElement(Dc.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},uy(t,a=>b.createElement("div",{"aria-hidden":!0},a)))}),ui=Object.assign(gF,{List:Khe,Item:Whe,Input:Yhe,Group:Ghe,Separator:Xhe,Dialog:Zhe,Empty:Jhe,Loading:efe});function tfe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function nfe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function xF(t){let e=b.useRef(t);return Lu(()=>{e.current=t}),e}var Lu=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Hd(t){let e=b.useRef();return e.current===void 0&&(e.current=t()),e}function jc(t){let e=gj(),n=()=>t(e.snapshot());return b.useSyncExternalStore(e.subscribe,n,n)}function vF(t,e,n,r=[]){let s=b.useRef(),i=ip();return Lu(()=>{var a;let o=(()=>{var h;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(h=f.current.textContent)==null?void 0:h.trim():s.current}})(),c=r.map(h=>h.trim());i.value(t,o,c),(a=e.current)==null||a.setAttribute(Qd,o),s.current=o}),s}var rfe=()=>{let[t,e]=b.useState(),n=Hd(()=>new Map);return Lu(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function sfe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function uy({asChild:t,children:e},n){return t&&b.isValidElement(e)?b.cloneElement(sfe(e),{ref:e.ref},n(e.props.children)):n(e)}var ife={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const dy=b.forwardRef(({className:t,...e},n)=>l.jsx(ui,{ref:n,className:ve("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));dy.displayName=ui.displayName;const hy=b.forwardRef(({className:t,...e},n)=>l.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[l.jsx(ci,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),l.jsx(ui.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})]}));hy.displayName=ui.Input.displayName;const fy=b.forwardRef(({className:t,...e},n)=>l.jsx(ui.List,{ref:n,className:ve("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));fy.displayName=ui.List.displayName;const my=b.forwardRef((t,e)=>l.jsx(ui.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));my.displayName=ui.Empty.displayName;const f0=b.forwardRef(({className:t,...e},n)=>l.jsx(ui.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}));f0.displayName=ui.Group.displayName;const afe=b.forwardRef(({className:t,...e},n)=>l.jsx(ui.Separator,{ref:n,className:ve("-mx-1 h-px bg-border",t),...e}));afe.displayName=ui.Separator.displayName;const m0=b.forwardRef(({className:t,...e},n)=>l.jsx(ui.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}));m0.displayName=ui.Item.displayName;const li=b.forwardRef(({className:t,...e},n)=>l.jsx(tz,{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:l.jsx(jK,{className:ve("grid place-content-center text-current"),children:l.jsx(ol,{className:"h-4 w-4"})})}));li.displayName=tz.displayName;const vm=[{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 BE(t){return t?t.replace(/\/+$/,"").toLowerCase():""}function lfe(t){if(!t)return null;const e=BE(t);return vm.find(n=>n.id!=="custom"&&BE(n.base_url)===e)||null}function ofe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,o]=b.useState(!1),[c,h]=b.useState(!1),[f,m]=b.useState(!1),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(null),[N,C]=b.useState(null),[T,_]=b.useState("custom"),[E,M]=b.useState(!1),[L,P]=b.useState(!1),[I,Q]=b.useState(null),[U,ee]=b.useState(!1),[z,H]=b.useState(""),[B,X]=b.useState(new Set),[J,G]=b.useState(!1),[R,se]=b.useState(1),[W,F]=b.useState(20),[V,te]=b.useState(""),{toast:ne}=ts(),K=b.useRef(null),ie=b.useRef(!0);b.useEffect(()=>{re()},[]);const re=async()=>{try{r(!0);const ke=await th();e(ke.api_providers||[]),h(!1),ie.current=!1}catch(ke){console.error("加载配置失败:",ke)}finally{r(!1)}},ae=async()=>{try{m(!0),Uv().catch(()=>{}),x(!0)}catch(ke){console.error("重启失败:",ke),x(!1),ne({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),m(!1)}},_e=async()=>{try{i(!0),K.current&&clearTimeout(K.current);const ke=await th();ke.api_providers=t,await R1(ke),h(!1),ne({title:"保存成功",description:"正在重启麦麦..."}),await ae()}catch(ke){console.error("保存配置失败:",ke),ne({title:"保存失败",description:ke.message,variant:"destructive"}),i(!1)}},Ue=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Xe=()=>{x(!1),m(!1),ne({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},Ze=b.useCallback(async ke=>{if(!ie.current)try{o(!0),await X3("api_providers",ke),h(!1)}catch(Te){console.error("自动保存失败:",Te),h(!0)}finally{o(!1)}},[]);b.useEffect(()=>{if(!ie.current)return h(!0),K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{Ze(t)},2e3),()=>{K.current&&clearTimeout(K.current)}},[t,Ze]);const Oe=async()=>{try{i(!0),K.current&&clearTimeout(K.current);const ke=await th();ke.api_providers=t,await R1(ke),h(!1),ne({title:"保存成功",description:"模型提供商配置已保存"})}catch(ke){console.error("保存配置失败:",ke),ne({title:"保存失败",description:ke.message,variant:"destructive"})}finally{i(!1)}},He=(ke,Te)=>{if(ke){const qe=vm.find(Rt=>Rt.base_url===ke.base_url&&Rt.client_type===ke.client_type);_(qe?.id||"custom"),k(ke)}else _("custom"),k({name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10});C(Te),ee(!1),w(!0)},Ve=ke=>{_(ke),M(!1);const Te=vm.find(qe=>qe.id===ke);Te&&Te.id!=="custom"?k(qe=>({...qe,name:Te.name,base_url:Te.base_url,client_type:Te.client_type})):Te?.id==="custom"&&k(qe=>({...qe,name:"",base_url:"",client_type:"openai"}))},Be=b.useMemo(()=>T!=="custom",[T]),ut=async()=>{if(S?.api_key)try{await navigator.clipboard.writeText(S.api_key),ne({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{ne({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},rt=()=>{if(!S)return;const ke={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};if(N!==null){const Te=[...t];Te[N]=ke,e(Te)}else e([...t,ke]);w(!1),k(null),C(null)},rn=ke=>{if(!ke&&S){const Te={...S,max_retry:S.max_retry??2,timeout:S.timeout??30,retry_interval:S.retry_interval??10};k(Te)}w(ke)},Rn=ke=>{Q(ke),P(!0)},Tn=()=>{if(I!==null){const ke=t.filter((Te,qe)=>qe!==I);e(ke),ne({title:"删除成功",description:"提供商已从列表中移除"})}P(!1),Q(null)},Mt=ke=>{const Te=new Set(B);Te.has(ke)?Te.delete(ke):Te.add(ke),X(Te)},vt=()=>{if(B.size===Ge.length)X(new Set);else{const ke=Ge.map((Te,qe)=>t.findIndex(Rt=>Rt===Ge[qe]));X(new Set(ke))}},Ce=()=>{if(B.size===0){ne({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}G(!0)},Le=()=>{const ke=t.filter((Te,qe)=>!B.has(qe));e(ke),X(new Set),G(!1),ne({title:"批量删除成功",description:`已删除 ${B.size} 个提供商`})},Ge=t.filter(ke=>{if(!z)return!0;const Te=z.toLowerCase();return ke.name.toLowerCase().includes(Te)||ke.base_url.toLowerCase().includes(Te)||ke.client_type.toLowerCase().includes(Te)}),lt=Math.ceil(Ge.length/W),jt=Ge.slice((R-1)*W,R*W),Tt=()=>{const ke=parseInt(V);ke>=1&&ke<=lt&&(se(ke),te(""))};return n?l.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):l.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"AI模型厂商配置"}),l.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 AI 模型厂商的 API 配置"})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[B.size>0&&l.jsxs(de,{onClick:Ce,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[l.jsx(fn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",B.size,")"]}),l.jsxs(de,{onClick:()=>He(null,null),size:"sm",className:"w-full sm:w-auto",children:[l.jsx(ws,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),l.jsxs(de,{onClick:Oe,disabled:s||a||!c||f,size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[l.jsx(zv,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),s?"保存中...":a?"自动保存中...":c?"保存配置":"已保存"]}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsxs(de,{disabled:s||a||f,size:"sm",className:"w-full sm:w-auto",children:[l.jsx(a6,{className:"mr-2 h-4 w-4"}),f?"重启中...":c?"保存并重启":"重启麦麦"]})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认重启麦麦?"}),l.jsx(bn,{className:"space-y-3",asChild:!0,children:l.jsxs("div",{children:[l.jsx("p",{children:c?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),l.jsxs(Na,{className:"border-yellow-500/50 bg-yellow-500/10",children:[l.jsx(ra,{className:"h-4 w-4 text-yellow-600"}),l.jsxs(Ca,{className:"text-yellow-900 dark:text-yellow-100",children:[l.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",l.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",l.jsxs(xr,{children:[l.jsx(Bh,{asChild:!0,children:l.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:[l.jsx(Dv,{className:"h-3 w-3"}),"如何结束程序?"]})}),l.jsxs(lr,{className:"max-w-2xl",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"如何结束使用重启功能后的麦麦程序"}),l.jsx(Hr,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),l.jsxs(sa,{defaultValue:"windows",className:"w-full",children:[l.jsxs(Mi,{className:"grid w-full grid-cols-3",children:[l.jsx(zt,{value:"windows",children:"Windows"}),l.jsx(zt,{value:"macos",children:"macOS"}),l.jsx(zt,{value:"linux",children:"Linux"})]}),l.jsxs(tn,{value:"windows",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),l.jsxs("li",{children:["在“进程”或“详细信息”标签页中找到 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),l.jsx("li",{children:"右键点击并选择“结束任务”"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),l.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[l.jsx("p",{children:"# 查找麦麦进程"}),l.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),l.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),l.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),l.jsxs(tn,{value:"macos",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"})," 打开 Spotlight,搜索“活动监视器”"]}),l.jsxs("li",{children:["在进程列表中找到 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),l.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),l.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[l.jsx("p",{children:"# 查找麦麦进程"}),l.jsx("p",{children:"ps aux | grep python | grep -v grep"}),l.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),l.jsx("p",{children:"kill -9 "}),l.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),l.jsx("p",{children:"pkill -9 python"})]})]})]}),l.jsxs(tn,{value:"linux",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),l.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[l.jsx("p",{children:"# 查找麦麦进程"}),l.jsx("p",{children:"ps aux | grep python | grep -v grep"}),l.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),l.jsx("p",{children:"kill -9 "}),l.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),l.jsx("p",{children:'pkill -9 -f "bot.py"'}),l.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),l.jsx("p",{children:"pkill -9 python"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[l.jsxs("li",{children:["在终端输入 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),l.jsx(as,{children:l.jsx(k6,{asChild:!0,children:l.jsx(de,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:c?_e:ae,children:c?"保存并重启":"确认重启"})]})]})]})]})]}),l.jsxs(Na,{children:[l.jsx(ra,{className:"h-4 w-4"}),l.jsxs(Ca,{children:["配置更新后需要",l.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),l.jsxs(hn,{className:"h-[calc(100vh-260px)]",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[l.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[l.jsx(ci,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(Pe,{placeholder:"搜索提供商名称、URL 或类型...",value:z,onChange:ke=>H(ke.target.value),className:"pl-9"})]}),z&&l.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Ge.length," 个结果"]})]}),l.jsx("div",{className:"md:hidden space-y-3",children:Ge.length===0?l.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:z?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):jt.map((ke,Te)=>{const qe=t.findIndex(Rt=>Rt===ke);return l.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("h3",{className:"font-semibold text-base truncate",children:ke.name}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ke.base_url})]}),l.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[l.jsxs(de,{variant:"default",size:"sm",onClick:()=>He(ke,qe),children:[l.jsx(wu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),l.jsxs(de,{size:"sm",onClick:()=>Rn(qe),className:"bg-red-600 hover:bg-red-700 text-white",children:[l.jsx(fn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),l.jsx("p",{className:"font-medium",children:ke.client_type})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),l.jsx("p",{className:"font-medium",children:ke.max_retry})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),l.jsx("p",{className:"font-medium",children:ke.timeout})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),l.jsx("p",{className:"font-medium",children:ke.retry_interval})]})]})]},Te)})}),l.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs(Vh,{children:[l.jsx(Uh,{children:l.jsxs(bs,{children:[l.jsx(ln,{className:"w-12",children:l.jsx(li,{checked:B.size===Ge.length&&Ge.length>0,onCheckedChange:vt})}),l.jsx(ln,{children:"名称"}),l.jsx(ln,{children:"基础URL"}),l.jsx(ln,{children:"客户端类型"}),l.jsx(ln,{className:"text-right",children:"最大重试"}),l.jsx(ln,{className:"text-right",children:"超时(秒)"}),l.jsx(ln,{className:"text-right",children:"重试间隔(秒)"}),l.jsx(ln,{className:"text-right",children:"操作"})]})}),l.jsx(Wh,{children:jt.length===0?l.jsx(bs,{children:l.jsx(Qt,{colSpan:8,className:"text-center text-muted-foreground py-8",children:z?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):jt.map((ke,Te)=>{const qe=t.findIndex(Rt=>Rt===ke);return l.jsxs(bs,{children:[l.jsx(Qt,{children:l.jsx(li,{checked:B.has(qe),onCheckedChange:()=>Mt(qe)})}),l.jsx(Qt,{className:"font-medium",children:ke.name}),l.jsx(Qt,{className:"max-w-xs truncate",title:ke.base_url,children:ke.base_url}),l.jsx(Qt,{children:ke.client_type}),l.jsx(Qt,{className:"text-right",children:ke.max_retry}),l.jsx(Qt,{className:"text-right",children:ke.timeout}),l.jsx(Qt,{className:"text-right",children:ke.retry_interval}),l.jsx(Qt,{className:"text-right",children:l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsxs(de,{variant:"default",size:"sm",onClick:()=>He(ke,qe),children:[l.jsx(wu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),l.jsxs(de,{size:"sm",onClick:()=>Rn(qe),className:"bg-red-600 hover:bg-red-700 text-white",children:[l.jsx(fn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},Te)})})]})})}),Ge.length>0&&l.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{htmlFor:"page-size-provider",className:"text-sm whitespace-nowrap",children:"每页显示"}),l.jsxs(qt,{value:W.toString(),onValueChange:ke=>{F(parseInt(ke)),se(1),X(new Set)},children:[l.jsx(It,{id:"page-size-provider",className:"w-20",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"10",children:"10"}),l.jsx(De,{value:"20",children:"20"}),l.jsx(De,{value:"50",children:"50"}),l.jsx(De,{value:"100",children:"100"})]})]}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(R-1)*W+1," 到"," ",Math.min(R*W,Ge.length)," 条,共 ",Ge.length," 条"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(de,{variant:"outline",size:"sm",onClick:()=>se(1),disabled:R===1,className:"hidden sm:flex",children:l.jsx(L0,{className:"h-4 w-4"})}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>se(ke=>Math.max(1,ke-1)),disabled:R===1,children:[l.jsx($u,{className:"h-4 w-4 sm:mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Pe,{type:"number",value:V,onChange:ke=>te(ke.target.value),onKeyDown:ke=>ke.key==="Enter"&&Tt(),placeholder:R.toString(),className:"w-16 h-8 text-center",min:1,max:lt}),l.jsx(de,{variant:"outline",size:"sm",onClick:Tt,disabled:!V,className:"h-8",children:"跳转"})]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>se(ke=>ke+1),disabled:R>=lt,children:[l.jsx("span",{className:"hidden sm:inline",children:"下一页"}),l.jsx(Qu,{className:"h-4 w-4 sm:ml-1"})]}),l.jsx(de,{variant:"outline",size:"sm",onClick:()=>se(lt),disabled:R>=lt,className:"hidden sm:flex",children:l.jsx(I0,{className:"h-4 w-4"})})]})]})]}),l.jsx(xr,{open:y,onOpenChange:rn,children:l.jsxs(lr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(or,{children:[l.jsx(cr,{children:N!==null?"编辑提供商":"添加提供商"}),l.jsx(Hr,{children:"配置 API 提供商的连接信息和参数"})]}),l.jsxs("form",{onSubmit:ke=>{ke.preventDefault(),rt()},autoComplete:"off",children:[l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"template",children:"提供商模板"}),l.jsxs(ul,{open:E,onOpenChange:M,children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{variant:"outline",role:"combobox","aria-expanded":E,className:"w-full justify-between",children:[T?vm.find(ke=>ke.id===T)?.display_name:"选择提供商模板...",l.jsx(l6,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),l.jsx(Ea,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(dy,{children:[l.jsx(hy,{placeholder:"搜索提供商模板..."}),l.jsx(hn,{className:"h-[300px]",children:l.jsxs(fy,{className:"max-h-none overflow-visible",children:[l.jsx(my,{children:"未找到匹配的模板"}),l.jsx(f0,{children:vm.map(ke=>l.jsxs(m0,{value:ke.display_name,onSelect:()=>Ve(ke.id),children:[l.jsx(ol,{className:`mr-2 h-4 w-4 ${T===ke.id?"opacity-100":"opacity-0"}`}),ke.display_name]},ke.id))})]})})]})})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"选择预设模板可自动填充 URL 和客户端类型,支持搜索"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"name",children:"名称 *"}),l.jsx(Pe,{id:"name",value:S?.name||"",onChange:ke=>k(Te=>Te?{...Te,name:ke.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"base_url",children:"基础 URL *"}),l.jsx(Pe,{id:"base_url",value:S?.base_url||"",onChange:ke=>k(Te=>Te?{...Te,base_url:ke.target.value}:null),placeholder:"https://api.example.com/v1",disabled:Be,className:Be?"bg-muted cursor-not-allowed":""}),Be&&l.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时 URL 不可编辑,切换到"自定义"以手动配置'})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"api_key",children:"API Key *"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Pe,{id:"api_key",type:U?"text":"password",value:S?.api_key||"",onChange:ke=>k(Te=>Te?{...Te,api_key:ke.target.value}:null),placeholder:"sk-...",className:"flex-1"}),l.jsx(de,{type:"button",variant:"outline",size:"icon",onClick:()=>ee(!U),title:U?"隐藏密钥":"显示密钥",children:U?l.jsx(N1,{className:"h-4 w-4"}):l.jsx(oa,{className:"h-4 w-4"})}),l.jsx(de,{type:"button",variant:"outline",size:"icon",onClick:ut,title:"复制密钥",children:l.jsx(O1,{className:"h-4 w-4"})})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"client_type",children:"客户端类型"}),l.jsxs(qt,{value:S?.client_type||"openai",onValueChange:ke=>k(Te=>Te?{...Te,client_type:ke}:null),disabled:Be,children:[l.jsx(It,{id:"client_type",className:Be?"bg-muted cursor-not-allowed":"",children:l.jsx(Ft,{placeholder:"选择客户端类型"})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"openai",children:"OpenAI"}),l.jsx(De,{value:"gemini",children:"Gemini"})]})]}),Be&&l.jsx("p",{className:"text-xs text-muted-foreground",children:'使用模板时客户端类型不可编辑,切换到"自定义"以手动配置'})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"max_retry",children:"最大重试"}),l.jsx(Pe,{id:"max_retry",type:"number",min:"0",value:S?.max_retry??"",onChange:ke=>{const Te=ke.target.value===""?null:parseInt(ke.target.value);k(qe=>qe?{...qe,max_retry:Te}:null)},placeholder:"默认: 2"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"timeout",children:"超时(秒)"}),l.jsx(Pe,{id:"timeout",type:"number",min:"1",value:S?.timeout??"",onChange:ke=>{const Te=ke.target.value===""?null:parseInt(ke.target.value);k(qe=>qe?{...qe,timeout:Te}:null)},placeholder:"默认: 30"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),l.jsx(Pe,{id:"retry_interval",type:"number",min:"1",value:S?.retry_interval??"",onChange:ke=>{const Te=ke.target.value===""?null:parseInt(ke.target.value);k(qe=>qe?{...qe,retry_interval:Te}:null)},placeholder:"默认: 10"})]})]})]}),l.jsxs(as,{children:[l.jsx(de,{type:"button",variant:"outline",onClick:()=>w(!1),children:"取消"}),l.jsx(de,{type:"submit",children:"保存"})]})]})]})}),l.jsx(Nn,{open:L,onOpenChange:P,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:['确定要删除提供商 "',I!==null?t[I]?.name:"",'" 吗? 此操作无法撤销。']})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:Tn,children:"删除"})]})]})}),l.jsx(Nn,{open:J,onOpenChange:G,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认批量删除"}),l.jsxs(bn,{children:["确定要删除选中的 ",B.size," 个提供商吗? 此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:Le,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),g&&l.jsx(N6,{onRestartComplete:Ue,onRestartFailed:Xe})]})}function cfe(){for(var t=arguments.length,e=new Array(t),n=0;nr=>{e.forEach(s=>s(r))},e)}const py=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gh(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function xj(t){return"nodeType"in t}function di(t){var e,n;return t?Gh(t)?t:xj(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function vj(t){const{Document:e}=di(t);return t instanceof e}function ap(t){return Gh(t)?!1:t instanceof di(t).HTMLElement}function yF(t){return t instanceof di(t).SVGElement}function Xh(t){return t?Gh(t)?t.document:xj(t)?vj(t)?t:ap(t)||yF(t)?t.ownerDocument:document:document:document}const fl=py?b.useLayoutEffect:b.useEffect;function yj(t){const e=b.useRef(t);return fl(()=>{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 p0(t,e){e===void 0&&(e=[t]);const n=b.useRef(t);return fl(()=>{n.current!==t&&(n.current=t)},e),n}function lp(t,e){const n=b.useRef();return b.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function nv(t){const e=yj(t),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function XS(t){const e=b.useRef();return b.useEffect(()=>{e.current=t},[t]),e.current}let t4={};function op(t,e){return b.useMemo(()=>{if(e)return e;const n=t4[t]==null?0:t4[t]+1;return t4[t]=n,t+"-"+n},[t,e])}function bF(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const o=Object.entries(a);for(const[c,h]of o){const f=i[c];f!=null&&(i[c]=f+t*h)}return i},{...e})}}const oh=bF(1),g0=bF(-1);function dfe(t){return"clientX"in t&&"clientY"in t}function bj(t){if(!t)return!1;const{KeyboardEvent:e}=di(t.target);return e&&t instanceof e}function hfe(t){if(!t)return!1;const{TouchEvent:e}=di(t.target);return e&&t instanceof e}function YS(t){if(hfe(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 dfe(t)?{x:t.clientX,y:t.clientY}:null}const x0=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[x0.Translate.toString(t),x0.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),qE="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ffe(t){return t.matches(qE)?t:t.querySelector(qE)}const mfe={display:"none"};function pfe(t){let{id:e,value:n}=t;return he.createElement("div",{id:e,style:mfe},n)}function gfe(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 he.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function xfe(){const[t,e]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const wF=b.createContext(null);function vfe(t){const e=b.useContext(wF);b.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(t)},[t,e])}function yfe(){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 o;return(o=a[s])==null?void 0:o.call(a,i)})},[t]),e]}const bfe={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. - `},wfe={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 Sfe(t){let{announcements:e=wfe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=bfe}=t;const{announce:i,announcement:a}=xfe(),o=op("DndLiveRegion"),[c,h]=b.useState(!1);if(b.useEffect(()=>{h(!0)},[]),vfe(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 f=he.createElement(he.Fragment,null,he.createElement(pfe,{id:r,value:s.draggable}),he.createElement(gfe,{id:o,announcement:a}));return n?fu.createPortal(f,n):f}var Zr;(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"})(Zr||(Zr={}));function rv(){}function FE(t,e){return b.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function kfe(){for(var t=arguments.length,e=new Array(t),n=0;n[...e].filter(r=>r!=null),[...e])}const Aa=Object.freeze({x:0,y:0});function SF(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function kF(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function jfe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function $E(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 jF(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function QE(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 Ofe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=QE(e,e.left,e.top),i=[];for(const a of r){const{id:o}=a,c=n.get(o);if(c){const h=SF(QE(c),s);i.push({id:o,data:{droppableContainer:a,value:h}})}}return i.sort(kF)},Nfe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=$E(e),i=[];for(const a of r){const{id:o}=a,c=n.get(o);if(c){const h=$E(c),f=s.reduce((g,x,y)=>g+SF(h[y],x),0),m=Number((f/4).toFixed(4));i.push({id:o,data:{droppableContainer:a,value:m}})}}return i.sort(kF)};function Cfe(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,o=i-n;if(r{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:a}=i,o=n.get(a);if(o){const c=Cfe(o,e);c>0&&s.push({id:a,data:{droppableContainer:i,value:c}})}}return s.sort(jfe)};function Efe(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function OF(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Aa}function _fe(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*o.y,bottom:a.bottom+t*o.y,left:a.left+t*o.x,right:a.right+t*o.x}),{...n})}}const Mfe=_fe(1);function Afe(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 Rfe(t,e,n){const r=Afe(e);if(!r)return t;const{scaleX:s,scaleY:i,x:a,y:o}=r,c=t.left-a-(1-s)*parseFloat(n),h=t.top-o-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,m=i?t.height/i:t.height;return{width:f,height:m,top:h,right:c+f,bottom:h+m,left:c}}const Dfe={ignoreTransform:!1};function Yh(t,e){e===void 0&&(e=Dfe);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:h,transformOrigin:f}=di(t).getComputedStyle(t);h&&(n=Rfe(n,h,f))}const{top:r,left:s,width:i,height:a,bottom:o,right:c}=n;return{top:r,left:s,width:i,height:a,bottom:o,right:c}}function HE(t){return Yh(t,{ignoreTransform:!0})}function zfe(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function Pfe(t,e){return e===void 0&&(e=di(t).getComputedStyle(t)),e.position==="fixed"}function Lfe(t,e){e===void 0&&(e=di(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 gy(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(vj(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!ap(s)||yF(s)||n.includes(s))return n;const i=di(t).getComputedStyle(s);return s!==t&&Lfe(s,i)&&n.push(s),Pfe(s,i)?n:r(s.parentNode)}return t?r(t):n}function NF(t){const[e]=gy(t,1);return e??null}function n4(t){return!py||!t?null:Gh(t)?t:xj(t)?vj(t)||t===Xh(t).scrollingElement?window:ap(t)?t:null:null}function CF(t){return Gh(t)?t.scrollX:t.scrollLeft}function TF(t){return Gh(t)?t.scrollY:t.scrollTop}function KS(t){return{x:CF(t),y:TF(t)}}var ss;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(ss||(ss={}));function EF(t){return!py||!t?!1:t===document.scrollingElement}function _F(t){const e={x:0,y:0},n=EF(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,o=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:a,isRight:o,maxScroll:r,minScroll:e}}const Ife={x:.2,y:.2};function Bfe(t,e,n,r,s){let{top:i,left:a,right:o,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=Ife);const{isTop:h,isBottom:f,isLeft:m,isRight:g}=_F(t),x={x:0,y:0},y={x:0,y:0},w={height:e.height*s.y,width:e.width*s.x};return!h&&i<=e.top+w.height?(x.y=ss.Backward,y.y=r*Math.abs((e.top+w.height-i)/w.height)):!f&&c>=e.bottom-w.height&&(x.y=ss.Forward,y.y=r*Math.abs((e.bottom-w.height-c)/w.height)),!g&&o>=e.right-w.width?(x.x=ss.Forward,y.x=r*Math.abs((e.right-w.width-o)/w.width)):!m&&a<=e.left+w.width&&(x.x=ss.Backward,y.x=r*Math.abs((e.left+w.width-a)/w.width)),{direction:x,speed:y}}function qfe(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 MF(t){return t.reduce((e,n)=>oh(e,KS(n)),Aa)}function Ffe(t){return t.reduce((e,n)=>e+CF(n),0)}function $fe(t){return t.reduce((e,n)=>e+TF(n),0)}function Qfe(t,e){if(e===void 0&&(e=Yh),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);NF(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const Hfe=[["x",["left","right"],Ffe],["y",["top","bottom"],$fe]];class wj{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=gy(n),s=MF(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,a,o]of Hfe)for(const c of a)Object.defineProperty(this,c,{get:()=>{const h=o(r),f=s[i]-h;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Dm{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 Vfe(t){const{EventTarget:e}=di(t);return t instanceof e?t:Xh(t)}function r4(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 Gi;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Gi||(Gi={}));function VE(t){t.preventDefault()}function Ufe(t){t.stopPropagation()}var un;(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"})(un||(un={}));const AF={start:[un.Space,un.Enter],cancel:[un.Esc],end:[un.Space,un.Enter,un.Tab]},Wfe=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case un.Right:return{...n,x:n.x+25};case un.Left:return{...n,x:n.x-25};case un.Down:return{...n,y:n.y+25};case un.Up:return{...n,y:n.y-25}}};class Sj{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 Dm(Xh(n)),this.windowListeners=new Dm(di(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Gi.Resize,this.handleCancel),this.windowListeners.add(Gi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Gi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&Qfe(r),n(Aa)}handleKeyDown(e){if(bj(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=AF,coordinateGetter:a=Wfe,scrollBehavior:o="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:h}=r.current,f=h?{x:h.left,y:h.top}:Aa;this.referenceCoordinates||(this.referenceCoordinates=f);const m=a(e,{active:n,context:r.current,currentCoordinates:f});if(m){const g=g0(m,f),x={x:0,y:0},{scrollableAncestors:y}=r.current;for(const w of y){const S=e.code,{isTop:k,isRight:N,isLeft:C,isBottom:T,maxScroll:_,minScroll:E}=_F(w),M=qfe(w),L={x:Math.min(S===un.Right?M.right-M.width/2:M.right,Math.max(S===un.Right?M.left:M.left+M.width/2,m.x)),y:Math.min(S===un.Down?M.bottom-M.height/2:M.bottom,Math.max(S===un.Down?M.top:M.top+M.height/2,m.y))},P=S===un.Right&&!N||S===un.Left&&!C,I=S===un.Down&&!T||S===un.Up&&!k;if(P&&L.x!==m.x){const Q=w.scrollLeft+g.x,U=S===un.Right&&Q<=_.x||S===un.Left&&Q>=E.x;if(U&&!g.y){w.scrollTo({left:Q,behavior:o});return}U?x.x=w.scrollLeft-Q:x.x=S===un.Right?w.scrollLeft-_.x:w.scrollLeft-E.x,x.x&&w.scrollBy({left:-x.x,behavior:o});break}else if(I&&L.y!==m.y){const Q=w.scrollTop+g.y,U=S===un.Down&&Q<=_.y||S===un.Up&&Q>=E.y;if(U&&!g.x){w.scrollTo({top:Q,behavior:o});return}U?x.y=w.scrollTop-Q:x.y=S===un.Down?w.scrollTop-_.y:w.scrollTop-E.y,x.y&&w.scrollBy({top:-x.y,behavior:o});break}}this.handleMove(e,oh(g0(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()}}Sj.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=AF,onActivation:s}=e,{active:i}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const o=i.activatorNode.current;return o&&t.target!==o?!1:(t.preventDefault(),s?.({event:t.nativeEvent}),!0)}return!1}}];function UE(t){return!!(t&&"distance"in t)}function WE(t){return!!(t&&"delay"in t)}class kj{constructor(e,n,r){var s;r===void 0&&(r=Vfe(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=Xh(a),this.documentListeners=new Dm(this.document),this.listeners=new Dm(r),this.windowListeners=new Dm(di(a)),this.initialCoordinates=(s=YS(i))!=null?s:Aa,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(Gi.Resize,this.handleCancel),this.windowListeners.add(Gi.DragStart,VE),this.windowListeners.add(Gi.VisibilityChange,this.handleCancel),this.windowListeners.add(Gi.ContextMenu,VE),this.documentListeners.add(Gi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(WE(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(UE(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(Gi.Click,Ufe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Gi.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:a,options:{activationConstraint:o}}=i;if(!s)return;const c=(n=YS(e))!=null?n:Aa,h=g0(s,c);if(!r&&o){if(UE(o)){if(o.tolerance!=null&&r4(h,o.tolerance))return this.handleCancel();if(r4(h,o.distance))return this.handleStart()}if(WE(o)&&r4(h,o.tolerance))return this.handleCancel();this.handlePending(o,h);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===un.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const Gfe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class jj extends kj{constructor(e){const{event:n}=e,r=Xh(n.target);super(e,Gfe,r)}}jj.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 Xfe={move:{name:"mousemove"},end:{name:"mouseup"}};var ZS;(function(t){t[t.RightClick=2]="RightClick"})(ZS||(ZS={}));class Yfe extends kj{constructor(e){super(e,Xfe,Xh(e.event.target))}}Yfe.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===ZS.RightClick?!1:(r?.({event:n}),!0)}}];const s4={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Kfe extends kj{constructor(e){super(e,s4)}static setup(){return window.addEventListener(s4.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(s4.move.name,e)};function e(){}}}Kfe.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 zm;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(zm||(zm={}));var sv;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(sv||(sv={}));function Zfe(t){let{acceleration:e,activator:n=zm.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:a=5,order:o=sv.TreeOrder,pointerCoordinates:c,scrollableAncestors:h,scrollableAncestorRects:f,delta:m,threshold:g}=t;const x=eme({delta:m,disabled:!i}),[y,w]=ufe(),S=b.useRef({x:0,y:0}),k=b.useRef({x:0,y:0}),N=b.useMemo(()=>{switch(n){case zm.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case zm.DraggableRect:return s}},[n,s,c]),C=b.useRef(null),T=b.useCallback(()=>{const E=C.current;if(!E)return;const M=S.current.x*k.current.x,L=S.current.y*k.current.y;E.scrollBy(M,L)},[]),_=b.useMemo(()=>o===sv.TreeOrder?[...h].reverse():h,[o,h]);b.useEffect(()=>{if(!i||!h.length||!N){w();return}for(const E of _){if(r?.(E)===!1)continue;const M=h.indexOf(E),L=f[M];if(!L)continue;const{direction:P,speed:I}=Bfe(E,L,N,e,g);for(const Q of["x","y"])x[Q][P[Q]]||(I[Q]=0,P[Q]=0);if(I.x>0||I.y>0){w(),C.current=E,y(T,a),S.current=I,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(N),JSON.stringify(x),y,h,_,f,JSON.stringify(g)])}const Jfe={x:{[ss.Backward]:!1,[ss.Forward]:!1},y:{[ss.Backward]:!1,[ss.Forward]:!1}};function eme(t){let{delta:e,disabled:n}=t;const r=XS(e);return lp(s=>{if(n||!r||!s)return Jfe;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[ss.Backward]:s.x[ss.Backward]||i.x===-1,[ss.Forward]:s.x[ss.Forward]||i.x===1},y:{[ss.Backward]:s.y[ss.Backward]||i.y===-1,[ss.Forward]:s.y[ss.Forward]||i.y===1}}},[n,e,r])}function tme(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return lp(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function nme(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 v0;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(v0||(v0={}));var JS;(function(t){t.Optimized="optimized"})(JS||(JS={}));const GE=new Map;function rme(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,a]=b.useState(null),{frequency:o,measure:c,strategy:h}=s,f=b.useRef(t),m=S(),g=p0(m),x=b.useCallback(function(k){k===void 0&&(k=[]),!g.current&&a(N=>N===null?k:N.concat(k.filter(C=>!N.includes(C))))},[g]),y=b.useRef(null),w=lp(k=>{if(m&&!n)return GE;if(!k||k===GE||f.current!==t||i!=null){const N=new Map;for(let C of t){if(!C)continue;if(i&&i.length>0&&!i.includes(C.id)&&C.rect.current){N.set(C.id,C.rect.current);continue}const T=C.node.current,_=T?new wj(c(T),T):null;C.rect.current=_,_&&N.set(C.id,_)}return N}return k},[t,i,n,m,c]);return b.useEffect(()=>{f.current=t},[t]),b.useEffect(()=>{m||x()},[n,m]),b.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),b.useEffect(()=>{m||typeof o!="number"||y.current!==null||(y.current=setTimeout(()=>{x(),y.current=null},o))},[o,m,x,...r]),{droppableRects:w,measureDroppableContainers:x,measuringScheduled:i!=null};function S(){switch(h){case v0.Always:return!1;case v0.BeforeDragging:return n;default:return!n}}}function RF(t,e){return lp(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function sme(t,e){return RF(t,e)}function ime(t){let{callback:e,disabled:n}=t;const r=yj(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 xy(t){let{callback:e,disabled:n}=t;const r=yj(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 ame(t){return new wj(Yh(t),t)}function XE(t,e,n){e===void 0&&(e=ame);const[r,s]=b.useState(null);function i(){s(c=>{if(!t)return null;if(t.isConnected===!1){var h;return(h=c??n)!=null?h:null}const f=e(t);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const a=ime({callback(c){if(t)for(const h of c){const{type:f,target:m}=h;if(f==="childList"&&m instanceof HTMLElement&&m.contains(t)){i();break}}}}),o=xy({callback:i});return fl(()=>{i(),t?(o?.observe(t),a?.observe(document.body,{childList:!0,subtree:!0})):(o?.disconnect(),a?.disconnect())},[t]),r}function lme(t){const e=RF(t);return OF(t,e)}const YE=[];function ome(t){const e=b.useRef(t),n=lp(r=>t?r&&r!==YE&&t&&e.current&&t.parentNode===e.current.parentNode?r:gy(t):YE,[t]);return b.useEffect(()=>{e.current=t},[t]),n}function cme(t){const[e,n]=b.useState(null),r=b.useRef(t),s=b.useCallback(i=>{const a=n4(i.target);a&&n(o=>o?(o.set(a,KS(a)),new Map(o)):null)},[]);return b.useEffect(()=>{const i=r.current;if(t!==i){a(i);const o=t.map(c=>{const h=n4(c);return h?(h.addEventListener("scroll",s,{passive:!0}),[h,KS(h)]):null}).filter(c=>c!=null);n(o.length?new Map(o):null),r.current=t}return()=>{a(t),a(i)};function a(o){o.forEach(c=>{const h=n4(c);h?.removeEventListener("scroll",s)})}},[s,t]),b.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,a)=>oh(i,a),Aa):MF(t):Aa,[t,e])}function KE(t,e){e===void 0&&(e=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},e),b.useEffect(()=>{const r=t!==Aa;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?g0(t,n.current):Aa}function ume(t){b.useEffect(()=>{if(!py)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 dme(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 DF(t){return b.useMemo(()=>t?zfe(t):null,[t])}const ZE=[];function hme(t,e){e===void 0&&(e=Yh);const[n]=t,r=DF(n?di(n):null),[s,i]=b.useState(ZE);function a(){i(()=>t.length?t.map(c=>EF(c)?r:new wj(e(c),c)):ZE)}const o=xy({callback:a});return fl(()=>{o?.disconnect(),a(),t.forEach(c=>o?.observe(c))},[t]),s}function fme(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return ap(e)?e:t}function mme(t){let{measure:e}=t;const[n,r]=b.useState(null),s=b.useCallback(h=>{for(const{target:f}of h)if(ap(f)){r(m=>{const g=e(f);return m?{...m,width:g.width,height:g.height}:g});break}},[e]),i=xy({callback:s}),a=b.useCallback(h=>{const f=fme(h);i?.disconnect(),f&&i?.observe(f),r(f?e(f):null)},[e,i]),[o,c]=nv(a);return b.useMemo(()=>({nodeRef:o,rect:n,setRef:c}),[n,o,c])}const pme=[{sensor:jj,options:{}},{sensor:Sj,options:{}}],gme={current:{}},g1={draggable:{measure:HE},droppable:{measure:HE,strategy:v0.WhileDragging,frequency:JS.Optimized},dragOverlay:{measure:Yh}};class Pm 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 xme={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Pm,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rv},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:g1,measureDroppableContainers:rv,windowRect:null,measuringScheduled:!1},vme={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rv,draggableNodes:new Map,over:null,measureDroppableContainers:rv},vy=b.createContext(vme),zF=b.createContext(xme);function yme(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pm}}}function bme(t,e){switch(e.type){case Zr.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Zr.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 Zr.DragEnd:case Zr.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Zr.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new Pm(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case Zr.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 Pm(t.droppable.containers);return a.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:a}}}case Zr.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new Pm(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function wme(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(vy),i=XS(r),a=XS(n?.id);return b.useEffect(()=>{if(!e&&!r&&i&&a!=null){if(!bj(i)||document.activeElement===i.target)return;const o=s.get(a);if(!o)return;const{activatorNode:c,node:h}=o;if(!c.current&&!h.current)return;requestAnimationFrame(()=>{for(const f of[c.current,h.current]){if(!f)continue;const m=ffe(f);if(m){m.focus();break}}})}},[r,e,s,a,i]),null}function Sme(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function kme(t){return b.useMemo(()=>({draggable:{...g1.draggable,...t?.draggable},droppable:{...g1.droppable,...t?.droppable},dragOverlay:{...g1.dragOverlay,...t?.dragOverlay}}),[t?.draggable,t?.droppable,t?.dragOverlay])}function jme(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=b.useRef(!1),{x:a,y:o}=typeof s=="boolean"?{x:s,y:s}:s;fl(()=>{if(!a&&!o||!e){i.current=!1;return}if(i.current||!r)return;const h=e?.node.current;if(!h||h.isConnected===!1)return;const f=n(h),m=OF(f,r);if(a||(m.x=0),o||(m.y=0),i.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const g=NF(h);g&&g.scrollBy({top:m.y,left:m.x})}},[e,a,o,r,n])}const PF=b.createContext({...Aa,scaleX:1,scaleY:1});var lc;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(lc||(lc={}));const Ome=b.memo(function(e){var n,r,s,i;let{id:a,accessibility:o,autoScroll:c=!0,children:h,sensors:f=pme,collisionDetection:m=Tfe,measuring:g,modifiers:x,...y}=e;const w=b.useReducer(bme,void 0,yme),[S,k]=w,[N,C]=yfe(),[T,_]=b.useState(lc.Uninitialized),E=T===lc.Initialized,{draggable:{active:M,nodes:L,translate:P},droppable:{containers:I}}=S,Q=M!=null?L.get(M):null,U=b.useRef({initial:null,translated:null}),ee=b.useMemo(()=>{var Ot;return M!=null?{id:M,data:(Ot=Q?.data)!=null?Ot:gme,rect:U}:null},[M,Q]),z=b.useRef(null),[H,B]=b.useState(null),[X,J]=b.useState(null),G=p0(y,Object.values(y)),R=op("DndDescribedBy",a),se=b.useMemo(()=>I.getEnabled(),[I]),W=kme(g),{droppableRects:F,measureDroppableContainers:V,measuringScheduled:te}=rme(se,{dragging:E,dependencies:[P.x,P.y],config:W.droppable}),ne=tme(L,M),K=b.useMemo(()=>X?YS(X):null,[X]),ie=Nt(),re=sme(ne,W.draggable.measure);jme({activeNode:M!=null?L.get(M):null,config:ie.layoutShiftCompensation,initialRect:re,measure:W.draggable.measure});const ae=XE(ne,W.draggable.measure,re),_e=XE(ne?ne.parentElement:null),Ue=b.useRef({activatorEvent:null,active:null,activeNode:ne,collisionRect:null,collisions:null,droppableRects:F,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:I,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Xe=I.getNodeFor((n=Ue.current.over)==null?void 0:n.id),Ze=mme({measure:W.dragOverlay.measure}),Oe=(r=Ze.nodeRef.current)!=null?r:ne,He=E?(s=Ze.rect)!=null?s:ae:null,Ve=!!(Ze.nodeRef.current&&Ze.rect),Be=lme(Ve?null:ae),ut=DF(Oe?di(Oe):null),rt=ome(E?Xe??ne:null),rn=hme(rt),Rn=Sme(x,{transform:{x:P.x-Be.x,y:P.y-Be.y,scaleX:1,scaleY:1},activatorEvent:X,active:ee,activeNodeRect:ae,containerNodeRect:_e,draggingNodeRect:He,over:Ue.current.over,overlayNodeRect:Ze.rect,scrollableAncestors:rt,scrollableAncestorRects:rn,windowRect:ut}),Tn=K?oh(K,P):null,Mt=cme(rt),vt=KE(Mt),Ce=KE(Mt,[ae]),Le=oh(Rn,vt),Ge=He?Mfe(He,Rn):null,lt=ee&&Ge?m({active:ee,collisionRect:Ge,droppableRects:F,droppableContainers:se,pointerCoordinates:Tn}):null,jt=jF(lt,"id"),[Tt,ke]=b.useState(null),Te=Ve?Rn:oh(Rn,Ce),qe=Efe(Te,(i=Tt?.rect)!=null?i:null,ae),Rt=b.useRef(null),At=b.useCallback((Ot,it)=>{let{sensor:Vn,options:jr}=it;if(z.current==null)return;const Or=L.get(z.current);if(!Or)return;const ge=Ot.nativeEvent,ze=new Vn({active:z.current,activeNode:Or,event:ge,options:jr,context:Ue,onAbort(Gt){if(!L.get(Gt))return;const{onDragAbort:Wr}=G.current,Ar={id:Gt};Wr?.(Ar),N({type:"onDragAbort",event:Ar})},onPending(Gt,Mr,Wr,Ar){if(!L.get(Gt))return;const{onDragPending:ga}=G.current,mi={id:Gt,constraint:Mr,initialCoordinates:Wr,offset:Ar};ga?.(mi),N({type:"onDragPending",event:mi})},onStart(Gt){const Mr=z.current;if(Mr==null)return;const Wr=L.get(Mr);if(!Wr)return;const{onDragStart:Ar}=G.current,Rr={activatorEvent:ge,active:{id:Mr,data:Wr.data,rect:U}};fu.unstable_batchedUpdates(()=>{Ar?.(Rr),_(lc.Initializing),k({type:Zr.DragStart,initialCoordinates:Gt,active:Mr}),N({type:"onDragStart",event:Rr}),B(Rt.current),J(ge)})},onMove(Gt){k({type:Zr.DragMove,coordinates:Gt})},onEnd:Et(Zr.DragEnd),onCancel:Et(Zr.DragCancel)});Rt.current=ze;function Et(Gt){return async function(){const{active:Wr,collisions:Ar,over:Rr,scrollAdjustedTranslate:ga}=Ue.current;let mi=null;if(Wr&&ga){const{cancelDrop:Ba}=G.current;mi={activatorEvent:ge,active:Wr,collisions:Ar,delta:ga,over:Rr},Gt===Zr.DragEnd&&typeof Ba=="function"&&await Promise.resolve(Ba(mi))&&(Gt=Zr.DragCancel)}z.current=null,fu.unstable_batchedUpdates(()=>{k({type:Gt}),_(lc.Uninitialized),ke(null),B(null),J(null),Rt.current=null;const Ba=Gt===Zr.DragEnd?"onDragEnd":"onDragCancel";if(mi){const Hs=G.current[Ba];Hs?.(mi),N({type:Ba,event:mi})}})}}},[L]),vr=b.useCallback((Ot,it)=>(Vn,jr)=>{const Or=Vn.nativeEvent,ge=L.get(jr);if(z.current!==null||!ge||Or.dndKit||Or.defaultPrevented)return;const ze={active:ge};Ot(Vn,it.options,ze)===!0&&(Or.dndKit={capturedBy:it.sensor},z.current=jr,At(Vn,it))},[L,At]),ft=nme(f,vr);ume(f),fl(()=>{ae&&T===lc.Initializing&&_(lc.Initialized)},[ae,T]),b.useEffect(()=>{const{onDragMove:Ot}=G.current,{active:it,activatorEvent:Vn,collisions:jr,over:Or}=Ue.current;if(!it||!Vn)return;const ge={active:it,activatorEvent:Vn,collisions:jr,delta:{x:Le.x,y:Le.y},over:Or};fu.unstable_batchedUpdates(()=>{Ot?.(ge),N({type:"onDragMove",event:ge})})},[Le.x,Le.y]),b.useEffect(()=>{const{active:Ot,activatorEvent:it,collisions:Vn,droppableContainers:jr,scrollAdjustedTranslate:Or}=Ue.current;if(!Ot||z.current==null||!it||!Or)return;const{onDragOver:ge}=G.current,ze=jr.get(jt),Et=ze&&ze.rect.current?{id:ze.id,rect:ze.rect.current,data:ze.data,disabled:ze.disabled}:null,Gt={active:Ot,activatorEvent:it,collisions:Vn,delta:{x:Or.x,y:Or.y},over:Et};fu.unstable_batchedUpdates(()=>{ke(Et),ge?.(Gt),N({type:"onDragOver",event:Gt})})},[jt]),fl(()=>{Ue.current={activatorEvent:X,active:ee,activeNode:ne,collisionRect:Ge,collisions:lt,droppableRects:F,draggableNodes:L,draggingNode:Oe,draggingNodeRect:He,droppableContainers:I,over:Tt,scrollableAncestors:rt,scrollAdjustedTranslate:Le},U.current={initial:He,translated:Ge}},[ee,ne,lt,Ge,L,Oe,He,F,I,Tt,rt,Le]),Zfe({...ie,delta:P,draggingRect:Ge,pointerCoordinates:Tn,scrollableAncestors:rt,scrollableAncestorRects:rn});const mn=b.useMemo(()=>({active:ee,activeNode:ne,activeNodeRect:ae,activatorEvent:X,collisions:lt,containerNodeRect:_e,dragOverlay:Ze,draggableNodes:L,droppableContainers:I,droppableRects:F,over:Tt,measureDroppableContainers:V,scrollableAncestors:rt,scrollableAncestorRects:rn,measuringConfiguration:W,measuringScheduled:te,windowRect:ut}),[ee,ne,ae,X,lt,_e,Ze,L,I,F,Tt,V,rt,rn,W,te,ut]),gt=b.useMemo(()=>({activatorEvent:X,activators:ft,active:ee,activeNodeRect:ae,ariaDescribedById:{draggable:R},dispatch:k,draggableNodes:L,over:Tt,measureDroppableContainers:V}),[X,ft,ee,ae,k,R,L,Tt,V]);return he.createElement(wF.Provider,{value:C},he.createElement(vy.Provider,{value:gt},he.createElement(zF.Provider,{value:mn},he.createElement(PF.Provider,{value:qe},h)),he.createElement(wme,{disabled:o?.restoreFocus===!1})),he.createElement(Sfe,{...o,hiddenTextDescribedById:R}));function Nt(){const Ot=H?.autoScrollEnabled===!1,it=typeof c=="object"?c.enabled===!1:c===!1,Vn=E&&!Ot&&!it;return typeof c=="object"?{...c,enabled:Vn}:{enabled:Vn}}}),Nme=b.createContext(null),JE="button",Cme="Draggable";function Tme(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=op(Cme),{activators:a,activatorEvent:o,active:c,activeNodeRect:h,ariaDescribedById:f,draggableNodes:m,over:g}=b.useContext(vy),{role:x=JE,roleDescription:y="draggable",tabIndex:w=0}=s??{},S=c?.id===e,k=b.useContext(S?PF:Nme),[N,C]=nv(),[T,_]=nv(),E=dme(a,e),M=p0(n);fl(()=>(m.set(e,{id:e,key:i,node:N,activatorNode:T,data:M}),()=>{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===JE?!0:void 0,"aria-roledescription":y,"aria-describedby":f.draggable}),[r,x,w,S,y,f.draggable]);return{active:c,activatorEvent:o,activeNodeRect:h,attributes:L,isDragging:S,listeners:r?void 0:E,node:N,over:g,setNodeRef:C,setActivatorNodeRef:_,transform:k}}function Eme(){return b.useContext(zF)}const _me="Droppable",Mme={timeout:25};function Ame(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=op(_me),{active:a,dispatch:o,over:c,measureDroppableContainers:h}=b.useContext(vy),f=b.useRef({disabled:n}),m=b.useRef(!1),g=b.useRef(null),x=b.useRef(null),{disabled:y,updateMeasurementsFor:w,timeout:S}={...Mme,...s},k=p0(w??r),N=b.useCallback(()=>{if(!m.current){m.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{h(Array.isArray(k.current)?k.current:[k.current]),x.current=null},S)},[S]),C=xy({callback:N,disabled:y||!a}),T=b.useCallback((L,P)=>{C&&(P&&(C.unobserve(P),m.current=!1),L&&C.observe(L))},[C]),[_,E]=nv(T),M=p0(e);return b.useEffect(()=>{!C||!_.current||(C.disconnect(),m.current=!1,C.observe(_.current))},[_,C]),b.useEffect(()=>(o({type:Zr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:_,rect:g,data:M}}),()=>o({type:Zr.UnregisterDroppable,key:i,id:r})),[r]),b.useEffect(()=>{n!==f.current.disabled&&(o({type:Zr.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,o]),{active:a,rect:g,isOver:c?.id===r,node:_,over:c,setNodeRef:E}}function Oj(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function Rme(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function kx(t){return t!==null&&t>=0}function Dme(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 o=(e=n[s])!=null?e:r;if(!o)return null;const c=Lme(n,a,s);if(a===s){const h=n[i];return h?{x:ss&&a<=i?{x:-o.width-c,y:0,...jx}:a=i?{x:o.width+c,y:0,...jx}:{x:0,y:0,...jx}};function Lme(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=Oj(e,r,n),a=e[s],o=i[s];return!o||!a?null:{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}},IF="Sortable",BF=he.createContext({activeIndex:-1,containerId:IF,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:LF,disabled:{draggable:!1,droppable:!1}});function Ime(t){let{children:e,id:n,items:r,strategy:s=LF,disabled:i=!1}=t;const{active:a,dragOverlay:o,droppableRects:c,over:h,measureDroppableContainers:f}=Eme(),m=op(IF,n),g=o.rect!==null,x=b.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),y=a!=null,w=a?x.indexOf(a.id):-1,S=h?x.indexOf(h.id):-1,k=b.useRef(x),N=!Dme(x,k.current),C=S!==-1&&w===-1||N,T=zme(i);fl(()=>{N&&y&&f(x)},[N,x,y,f]),b.useEffect(()=>{k.current=x},[x]);const _=b.useMemo(()=>({activeIndex:w,containerId:m,disabled:T,disableTransforms:C,items:x,overIndex:S,useDragOverlay:g,sortedRects:Rme(x,c),strategy:s}),[w,m,T.draggable,T.droppable,C,x,S,c,g,s]);return he.createElement(BF.Provider,{value:_},e)}const Bme=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return Oj(n,r,s).indexOf(e)},qme=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:a,previousItems:o,previousContainerId:c,transition:h}=t;return!h||!r||o!==i&&s===a?!1:n?!0:a!==s&&e===c},Fme={duration:200,easing:"ease"},qF="transform",$me=x0.Transition.toString({property:qF,duration:0,easing:"linear"}),Qme={roleDescription:"sortable"};function Hme(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,a]=b.useState(null),o=b.useRef(n);return fl(()=>{if(!e&&n!==o.current&&r.current){const c=s.current;if(c){const h=Yh(r.current,{ignoreTransform:!0}),f={x:c.left-h.left,y:c.top-h.top,scaleX:c.width/h.width,scaleY:c.height/h.height};(f.x||f.y)&&a(f)}}n!==o.current&&(o.current=n)},[e,n,r,s]),b.useEffect(()=>{i&&a(null)},[i]),i}function Vme(t){let{animateLayoutChanges:e=qme,attributes:n,disabled:r,data:s,getNewIndex:i=Bme,id:a,strategy:o,resizeObserverConfig:c,transition:h=Fme}=t;const{items:f,containerId:m,activeIndex:g,disabled:x,disableTransforms:y,sortedRects:w,overIndex:S,useDragOverlay:k,strategy:N}=b.useContext(BF),C=Ume(r,x),T=f.indexOf(a),_=b.useMemo(()=>({sortable:{containerId:m,index:T,items:f},...s}),[m,s,T,f]),E=b.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:M,node:L,isOver:P,setNodeRef:I}=Ame({id:a,data:_,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:Q,activatorEvent:U,activeNodeRect:ee,attributes:z,setNodeRef:H,listeners:B,isDragging:X,over:J,setActivatorNodeRef:G,transform:R}=Tme({id:a,data:_,attributes:{...Qme,...n},disabled:C.draggable}),se=cfe(I,H),W=!!Q,F=W&&!y&&kx(g)&&kx(S),V=!k&&X,te=V&&F?R:null,K=F?te??(o??N)({rects:w,activeNodeRect:ee,activeIndex:g,overIndex:S,index:T}):null,ie=kx(g)&&kx(S)?i({id:a,items:f,activeIndex:g,overIndex:S}):T,re=Q?.id,ae=b.useRef({activeId:re,items:f,newIndex:ie,containerId:m}),_e=f!==ae.current.items,Ue=e({active:Q,containerId:m,isDragging:X,isSorting:W,id:a,index:T,items:f,newIndex:ae.current.newIndex,previousItems:ae.current.items,previousContainerId:ae.current.containerId,transition:h,wasDragging:ae.current.activeId!=null}),Xe=Hme({disabled:!Ue,index:T,node:L,rect:M});return b.useEffect(()=>{W&&ae.current.newIndex!==ie&&(ae.current.newIndex=ie),m!==ae.current.containerId&&(ae.current.containerId=m),f!==ae.current.items&&(ae.current.items=f)},[W,ie,m,f]),b.useEffect(()=>{if(re===ae.current.activeId)return;if(re!=null&&ae.current.activeId==null){ae.current.activeId=re;return}const Oe=setTimeout(()=>{ae.current.activeId=re},50);return()=>clearTimeout(Oe)},[re]),{active:Q,activeIndex:g,attributes:z,data:_,rect:M,index:T,newIndex:ie,items:f,isOver:P,isSorting:W,isDragging:X,listeners:B,node:L,overIndex:S,over:J,setNodeRef:se,setActivatorNodeRef:G,setDroppableNodeRef:I,setDraggableNodeRef:H,transform:Xe??K,transition:Ze()};function Ze(){if(Xe||_e&&ae.current.newIndex===T)return $me;if(!(V&&!bj(U)||!h)&&(W||Ue))return x0.Transition.toString({...h,property:qF})}}function Ume(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 iv(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 Wme=[un.Down,un.Right,un.Up,un.Left],Gme=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:s,droppableContainers:i,over:a,scrollableAncestors:o}}=e;if(Wme.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 un.Down:r.topg.top&&c.push(m);break;case un.Left:r.left>g.left&&c.push(m);break;case un.Right:r.left1&&(f=h[1].id),f!=null){const m=i.get(n.id),g=i.get(f),x=g?s.get(g.id):null,y=g?.node.current;if(y&&x&&m&&g){const S=gy(y).some((E,M)=>o[M]!==E),k=FF(m,g),N=Xme(m,g),C=S||!k?{x:0,y:0}:{x:N?r.width-x.width:0,y:N?r.height-x.height:0},T={x:x.left,y:x.top};return C.x&&C.y?T:g0(T,C)}}}};function FF(t,e){return!iv(t)||!iv(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function Xme(t,e){return!iv(t)||!iv(e)||!FF(t,e)?!1:t.data.current.sortable.index{f.stopPropagation(),n(t)}})]})})}function Kme({options:t,selected:e,onChange:n,placeholder:r="选择选项...",emptyText:s="未找到选项",className:i}){const[a,o]=b.useState(!1),c=kfe(FE(jj,{activationConstraint:{distance:8}}),FE(Sj,{coordinateGetter:Gme})),h=g=>{e.includes(g)?n(e.filter(x=>x!==g)):n([...e,g])},f=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(Oj(e,w,S))}};return l.jsxs(ul,{open:a,onOpenChange:o,children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{variant:"outline",role:"combobox","aria-expanded":a,className:ve("w-full justify-between min-h-10 h-auto",i),children:[l.jsx(Ome,{sensors:c,collisionDetection:Ofe,onDragEnd:m,children:l.jsx(Ime,{items:e,strategy:Pme,children:l.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:e.length===0?l.jsx("span",{className:"text-muted-foreground",children:r}):e.map(g=>{const x=t.find(y=>y.value===g);return l.jsx(Yme,{value:g,label:x?.label||g,onRemove:f},g)})})})}),l.jsx(l6,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),l.jsx(Ea,{className:"w-full p-0",align:"start",children:l.jsxs(dy,{children:[l.jsx(hy,{placeholder:"搜索...",className:"h-9"}),l.jsxs(fy,{children:[l.jsx(my,{children:s}),l.jsx(f0,{children:t.map(g=>{const x=e.includes(g.value);return l.jsxs(m0,{value:g.value,onSelect:()=>h(g.value),children:[l.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:l.jsx(ol,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),l.jsx("span",{children:g.label})]},g.value)})})]})]})})]})}const e_=new Map,Zme=300*1e3;function Jme(){const[t,e]=b.useState([]),[n,r]=b.useState([]),[s,i]=b.useState([]),[a,o]=b.useState([]),[c,h]=b.useState(null),[f,m]=b.useState(!0),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[N,C]=b.useState(!1),[T,_]=b.useState(!1),[E,M]=b.useState(!1),[L,P]=b.useState(null),[I,Q]=b.useState(null),[U,ee]=b.useState(!1),[z,H]=b.useState(null),[B,X]=b.useState(""),[J,G]=b.useState(new Set),[R,se]=b.useState(!1),[W,F]=b.useState(1),[V,te]=b.useState(20),[ne,K]=b.useState(""),[ie,re]=b.useState([]),[ae,_e]=b.useState(!1),[Ue,Xe]=b.useState(null),[Ze,Oe]=b.useState(!1),[He,Ve]=b.useState(null),{toast:Be}=ts(),ut=b.useRef(null),rt=b.useRef(null),rn=b.useRef(!0);b.useEffect(()=>{Rn()},[]);const Rn=async()=>{try{m(!0);const ge=await th(),ze=ge.models||[];e(ze),o(ze.map(Gt=>Gt.name));const Et=ge.api_providers||[];r(Et.map(Gt=>Gt.name)),i(Et),h(ge.model_task_config||null),k(!1),rn.current=!1}catch(ge){console.error("加载配置失败:",ge)}finally{m(!1)}},Tn=b.useCallback(ge=>s.find(ze=>ze.name===ge),[s]),Mt=b.useCallback(async(ge,ze=!1)=>{const Et=Tn(ge);if(!Et?.base_url){re([]),Ve(null),Xe('提供商配置不完整,请先在"模型提供商配置"中配置');return}if(!Et.api_key){re([]),Ve(null),Xe('该提供商未配置 API Key,请先在"模型提供商配置"中填写');return}const Gt=lfe(Et.base_url);if(Ve(Gt),!Gt?.modelFetcher){re([]),Xe(null);return}const Mr=`${ge}:${Et.base_url}`,Wr=e_.get(Mr);if(!ze&&Wr&&Date.now()-Wr.timestamp{E&&L?.api_provider&&Mt(L.api_provider)},[E,L?.api_provider,Mt]);const vt=async()=>{try{C(!0),Uv().catch(()=>{}),_(!0)}catch(ge){console.error("重启失败:",ge),_(!1),Be({title:"重启失败",description:"无法发送重启请求,请手动重启",variant:"destructive"}),C(!1)}},Ce=async()=>{try{x(!0),ut.current&&clearTimeout(ut.current),rt.current&&clearTimeout(rt.current);const ge=await th();ge.models=t,ge.model_task_config=c,await R1(ge),k(!1),Be({title:"保存成功",description:"正在重启麦麦..."}),await vt()}catch(ge){console.error("保存配置失败:",ge),Be({title:"保存失败",description:ge.message,variant:"destructive"}),x(!1)}},Le=()=>{localStorage.removeItem("access-token"),window.location.href="/auth"},Ge=()=>{_(!1),C(!1),Be({title:"重启超时",description:"服务未能在预期时间内恢复,请手动检查或刷新页面",variant:"destructive"})},lt=b.useCallback(async ge=>{if(!rn.current)try{w(!0),await X3("models",ge),k(!1)}catch(ze){console.error("自动保存模型列表失败:",ze),k(!0)}finally{w(!1)}},[]),jt=b.useCallback(async ge=>{if(!rn.current)try{w(!0),await X3("model_task_config",ge),k(!1)}catch(ze){console.error("自动保存任务配置失败:",ze),k(!0)}finally{w(!1)}},[]);b.useEffect(()=>{if(!rn.current)return k(!0),ut.current&&clearTimeout(ut.current),ut.current=setTimeout(()=>{lt(t)},2e3),()=>{ut.current&&clearTimeout(ut.current)}},[t,lt]),b.useEffect(()=>{if(!(rn.current||!c))return k(!0),rt.current&&clearTimeout(rt.current),rt.current=setTimeout(()=>{jt(c)},2e3),()=>{rt.current&&clearTimeout(rt.current)}},[c,jt]);const Tt=async()=>{try{x(!0),ut.current&&clearTimeout(ut.current),rt.current&&clearTimeout(rt.current);const ge=await th();ge.models=t,ge.model_task_config=c,await R1(ge),k(!1),Be({title:"保存成功",description:"模型配置已保存"}),await Rn()}catch(ge){console.error("保存配置失败:",ge),Be({title:"保存失败",description:ge.message,variant:"destructive"})}finally{x(!1)}},ke=(ge,ze)=>{P(ge||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),Q(ze),M(!0)},Te=()=>{if(!L)return;const ge={...L,price_in:L.price_in??0,price_out:L.price_out??0};let ze;I!==null?(ze=[...t],ze[I]=ge):ze=[...t,ge],e(ze),o(ze.map(Et=>Et.name)),M(!1),P(null),Q(null)},qe=ge=>{if(!ge&&L){const ze={...L,price_in:L.price_in??0,price_out:L.price_out??0};P(ze)}M(ge)},Rt=ge=>{H(ge),ee(!0)},At=()=>{if(z!==null){const ge=t.filter((ze,Et)=>Et!==z);e(ge),o(ge.map(ze=>ze.name)),Be({title:"删除成功",description:"模型已从列表中移除"})}ee(!1),H(null)},vr=ge=>{const ze=new Set(J);ze.has(ge)?ze.delete(ge):ze.add(ge),G(ze)},ft=()=>{if(J.size===Ot.length)G(new Set);else{const ge=Ot.map((ze,Et)=>t.findIndex(Gt=>Gt===Ot[Et]));G(new Set(ge))}},mn=()=>{if(J.size===0){Be({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}se(!0)},gt=()=>{const ge=t.filter((ze,Et)=>!J.has(Et));e(ge),o(ge.map(ze=>ze.name)),G(new Set),se(!1),Be({title:"批量删除成功",description:`已删除 ${J.size} 个模型`})},Nt=(ge,ze,Et)=>{c&&h({...c,[ge]:{...c[ge],[ze]:Et}})},Ot=t.filter(ge=>{if(!B)return!0;const ze=B.toLowerCase();return ge.name.toLowerCase().includes(ze)||ge.model_identifier.toLowerCase().includes(ze)||ge.api_provider.toLowerCase().includes(ze)}),it=Math.ceil(Ot.length/V),Vn=Ot.slice((W-1)*V,W*V),jr=()=>{const ge=parseInt(ne);ge>=1&&ge<=it&&(F(ge),K(""))},Or=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(Et=>Et.includes(ge)):!1;return f?l.jsx(hn,{className:"h-full",children:l.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})})}):l.jsx(hn,{className:"h-full",children:l.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型管理与分配"}),l.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"添加模型并为模型分配功能"})]}),l.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[l.jsxs(de,{onClick:Tt,disabled:g||y||!S||N,size:"sm",variant:"outline",className:"flex-1 sm:flex-none",children:[l.jsx(zv,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),g?"保存中...":y?"自动保存中...":S?"保存配置":"已保存"]}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsxs(de,{disabled:g||y||N,size:"sm",className:"flex-1 sm:flex-none",children:[l.jsx(a6,{className:"mr-2 h-4 w-4"}),N?"重启中...":S?"保存并重启":"重启麦麦"]})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认重启麦麦?"}),l.jsx(bn,{className:"space-y-3",asChild:!0,children:l.jsxs("div",{children:[l.jsx("p",{children:S?"当前有未保存的配置更改。点击确认将先保存配置,然后重启麦麦使新配置生效。重启过程中麦麦将暂时离线。":"即将重启麦麦主程序。重启过程中麦麦将暂时离线,配置将在重启后生效。"}),l.jsxs(Na,{className:"border-yellow-500/50 bg-yellow-500/10",children:[l.jsx(ra,{className:"h-4 w-4 text-yellow-600"}),l.jsxs(Ca,{className:"text-yellow-900 dark:text-yellow-100",children:[l.jsx("strong",{children:"重要提示:"}),"由于技术原因,使用重启功能后,将无法再使用 ",l.jsx("code",{className:"px-1 py-0.5 bg-yellow-200 dark:bg-yellow-900 rounded",children:"Ctrl+C"})," 结束程序。",l.jsxs(xr,{children:[l.jsx(Bh,{asChild:!0,children:l.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:[l.jsx(Dv,{className:"h-3 w-3"}),"如何结束程序?"]})}),l.jsxs(lr,{className:"max-w-2xl",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"如何结束使用重启功能后的麦麦程序"}),l.jsx(Hr,{children:"由于重启功能会使程序脱离终端控制,需要通过系统命令来结束进程"})]}),l.jsxs(sa,{defaultValue:"windows",className:"w-full",children:[l.jsxs(Mi,{className:"grid w-full grid-cols-3",children:[l.jsx(zt,{value:"windows",children:"Windows"}),l.jsx(zt,{value:"macos",children:"macOS"}),l.jsx(zt,{value:"linux",children:"Linux"})]}),l.jsxs(tn,{value:"windows",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法一:使用任务管理器"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Ctrl + Shift + Esc"})," 打开任务管理器"]}),l.jsxs("li",{children:['在"进程"或"详细信息"标签页中找到 ',l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"python.exe"})]}),l.jsx("li",{children:'右键点击并选择"结束任务"'})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法二:使用命令行"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"打开 PowerShell 或命令提示符,执行以下命令:"}),l.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[l.jsx("p",{children:"# 查找麦麦进程"}),l.jsx("p",{children:'Get-Process python | Where-Object {$_.MainWindowTitle -eq ""}'}),l.jsx("p",{className:"mt-2",children:"# 结束所有 Python 进程(谨慎使用)"}),l.jsx("p",{children:"Stop-Process -Name python -Force"})]})]})]}),l.jsxs(tn,{value:"macos",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法一:使用活动监视器"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Cmd + Space"}),' 打开 Spotlight,搜索"活动监视器"']}),l.jsxs("li",{children:["在进程列表中找到 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"Python"})]}),l.jsx("li",{children:"选中后点击左上角的 X 按钮结束进程"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"方法二:使用终端"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),l.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[l.jsx("p",{children:"# 查找麦麦进程"}),l.jsx("p",{children:"ps aux | grep python | grep -v grep"}),l.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),l.jsx("p",{children:"kill -9 "}),l.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),l.jsx("p",{children:"pkill -9 python"})]})]})]}),l.jsxs(tn,{value:"linux",className:"space-y-4 mt-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"使用终端命令"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"打开终端,执行以下命令:"}),l.jsxs("div",{className:"bg-muted p-3 rounded-md font-mono text-sm",children:[l.jsx("p",{children:"# 查找麦麦进程"}),l.jsx("p",{children:"ps aux | grep python | grep -v grep"}),l.jsx("p",{className:"mt-2",children:"# 结束指定 PID 的进程"}),l.jsx("p",{children:"kill -9 "}),l.jsx("p",{className:"mt-2",children:"# 或使用 pkill 按名称结束"}),l.jsx("p",{children:'pkill -9 -f "bot.py"'}),l.jsx("p",{className:"mt-2",children:"# 或结束所有 Python 进程(谨慎使用)"}),l.jsx("p",{children:"pkill -9 python"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"font-semibold",children:"使用 htop(如已安装)"}),l.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-sm text-muted-foreground",children:[l.jsxs("li",{children:["在终端输入 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"htop"})]}),l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F3"})," 搜索 python"]}),l.jsxs("li",{children:["按 ",l.jsx("code",{className:"px-1 py-0.5 bg-muted rounded",children:"F9"})," 发送信号,选择 SIGKILL"]})]})]})]})]}),l.jsx(as,{children:l.jsx(k6,{asChild:!0,children:l.jsx(de,{variant:"outline",children:"关闭"})})})]})]})]})]})]})})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:S?Ce:vt,children:S?"保存并重启":"确认重启"})]})]})]})]})]}),l.jsxs(Na,{children:[l.jsx(ra,{className:"h-4 w-4"}),l.jsxs(Ca,{children:["配置更新后需要",l.jsx("strong",{children:"重启麦麦"}),'才能生效。你可以点击右上角的"保存并重启"按钮一键完成保存和重启。']})]}),l.jsxs(sa,{defaultValue:"models",className:"w-full",children:[l.jsxs(Mi,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[l.jsx(zt,{value:"models",children:"添加模型"}),l.jsx(zt,{value:"tasks",children:"为模型分配功能"})]}),l.jsxs(tn,{value:"models",className:"space-y-4 mt-0",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),l.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[J.size>0&&l.jsxs(de,{onClick:mn,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[l.jsx(fn,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",J.size,")"]}),l.jsxs(de,{onClick:()=>ke(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[l.jsx(ws,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[l.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[l.jsx(ci,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(Pe,{placeholder:"搜索模型名称、标识符或提供商...",value:B,onChange:ge=>X(ge.target.value),className:"pl-9"})]}),B&&l.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Ot.length," 个结果"]})]}),l.jsx("div",{className:"md:hidden space-y-3",children:Vn.length===0?l.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:B?"未找到匹配的模型":"暂无模型配置"}):Vn.map((ge,ze)=>{const Et=t.findIndex(Mr=>Mr===ge),Gt=Or(ge.name);return l.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("h3",{className:"font-semibold text-base",children:ge.name}),l.jsx(In,{variant:Gt?"default":"secondary",className:Gt?"bg-green-600 hover:bg-green-700":"",children:Gt?"已使用":"未使用"})]}),l.jsx("p",{className:"text-xs text-muted-foreground break-all",title:ge.model_identifier,children:ge.model_identifier})]}),l.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[l.jsxs(de,{variant:"default",size:"sm",onClick:()=>ke(ge,Et),children:[l.jsx(wu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),l.jsxs(de,{size:"sm",onClick:()=>Rt(Et),className:"bg-red-600 hover:bg-red-700 text-white",children:[l.jsx(fn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),l.jsx("p",{className:"font-medium",children:ge.api_provider})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),l.jsx("p",{className:"font-medium",children:ge.force_stream_mode?"是":"否"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),l.jsxs("p",{className:"font-medium",children:["¥",ge.price_in,"/M"]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),l.jsxs("p",{className:"font-medium",children:["¥",ge.price_out,"/M"]})]})]})]},ze)})}),l.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs(Vh,{children:[l.jsx(Uh,{children:l.jsxs(bs,{children:[l.jsx(ln,{className:"w-12",children:l.jsx(li,{checked:J.size===Ot.length&&Ot.length>0,onCheckedChange:ft})}),l.jsx(ln,{className:"w-24",children:"使用状态"}),l.jsx(ln,{children:"模型名称"}),l.jsx(ln,{children:"模型标识符"}),l.jsx(ln,{children:"提供商"}),l.jsx(ln,{className:"text-right",children:"输入价格"}),l.jsx(ln,{className:"text-right",children:"输出价格"}),l.jsx(ln,{className:"text-center",children:"强制流式"}),l.jsx(ln,{className:"text-right",children:"操作"})]})}),l.jsx(Wh,{children:Vn.length===0?l.jsx(bs,{children:l.jsx(Qt,{colSpan:9,className:"text-center text-muted-foreground py-8",children:B?"未找到匹配的模型":"暂无模型配置"})}):Vn.map((ge,ze)=>{const Et=t.findIndex(Mr=>Mr===ge),Gt=Or(ge.name);return l.jsxs(bs,{children:[l.jsx(Qt,{children:l.jsx(li,{checked:J.has(Et),onCheckedChange:()=>vr(Et)})}),l.jsx(Qt,{children:l.jsx(In,{variant:Gt?"default":"secondary",className:Gt?"bg-green-600 hover:bg-green-700":"",children:Gt?"已使用":"未使用"})}),l.jsx(Qt,{className:"font-medium",children:ge.name}),l.jsx(Qt,{className:"max-w-xs truncate",title:ge.model_identifier,children:ge.model_identifier}),l.jsx(Qt,{children:ge.api_provider}),l.jsxs(Qt,{className:"text-right",children:["¥",ge.price_in,"/M"]}),l.jsxs(Qt,{className:"text-right",children:["¥",ge.price_out,"/M"]}),l.jsx(Qt,{className:"text-center",children:ge.force_stream_mode?"是":"否"}),l.jsx(Qt,{className:"text-right",children:l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsxs(de,{variant:"default",size:"sm",onClick:()=>ke(ge,Et),children:[l.jsx(wu,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"编辑"]}),l.jsxs(de,{size:"sm",onClick:()=>Rt(Et),className:"bg-red-600 hover:bg-red-700 text-white",children:[l.jsx(fn,{className:"h-4 w-4 mr-1",strokeWidth:2,fill:"none"}),"删除"]})]})})]},ze)})})]})})}),Ot.length>0&&l.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{htmlFor:"page-size-model",className:"text-sm whitespace-nowrap",children:"每页显示"}),l.jsxs(qt,{value:V.toString(),onValueChange:ge=>{te(parseInt(ge)),F(1),G(new Set)},children:[l.jsx(It,{id:"page-size-model",className:"w-20",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"10",children:"10"}),l.jsx(De,{value:"20",children:"20"}),l.jsx(De,{value:"50",children:"50"}),l.jsx(De,{value:"100",children:"100"})]})]}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:["显示 ",(W-1)*V+1," 到"," ",Math.min(W*V,Ot.length)," 条,共 ",Ot.length," 条"]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(de,{variant:"outline",size:"sm",onClick:()=>F(1),disabled:W===1,className:"hidden sm:flex",children:l.jsx(L0,{className:"h-4 w-4"})}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>F(ge=>Math.max(1,ge-1)),disabled:W===1,children:[l.jsx($u,{className:"h-4 w-4 sm:mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Pe,{type:"number",value:ne,onChange:ge=>K(ge.target.value),onKeyDown:ge=>ge.key==="Enter"&&jr(),placeholder:W.toString(),className:"w-16 h-8 text-center",min:1,max:it}),l.jsx(de,{variant:"outline",size:"sm",onClick:jr,disabled:!ne,className:"h-8",children:"跳转"})]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>F(ge=>ge+1),disabled:W>=it,children:[l.jsx("span",{className:"hidden sm:inline",children:"下一页"}),l.jsx(Qu,{className:"h-4 w-4 sm:ml-1"})]}),l.jsx(de,{variant:"outline",size:"sm",onClick:()=>F(it),disabled:W>=it,className:"hidden sm:flex",children:l.jsx(I0,{className:"h-4 w-4"})})]})]})]}),l.jsxs(tn,{value:"tasks",className:"space-y-6 mt-0",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),c&&l.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[l.jsx(ba,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:c.utils,modelNames:a,onChange:(ge,ze)=>Nt("utils",ge,ze)}),l.jsx(ba,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:c.utils_small,modelNames:a,onChange:(ge,ze)=>Nt("utils_small",ge,ze)}),l.jsx(ba,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:c.tool_use,modelNames:a,onChange:(ge,ze)=>Nt("tool_use",ge,ze)}),l.jsx(ba,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:c.replyer,modelNames:a,onChange:(ge,ze)=>Nt("replyer",ge,ze)}),l.jsx(ba,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:c.planner,modelNames:a,onChange:(ge,ze)=>Nt("planner",ge,ze)}),l.jsx(ba,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:c.vlm,modelNames:a,onChange:(ge,ze)=>Nt("vlm",ge,ze),hideTemperature:!0}),l.jsx(ba,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:c.voice,modelNames:a,onChange:(ge,ze)=>Nt("voice",ge,ze),hideTemperature:!0,hideMaxTokens:!0}),l.jsx(ba,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:c.embedding,modelNames:a,onChange:(ge,ze)=>Nt("embedding",ge,ze),hideTemperature:!0,hideMaxTokens:!0}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),l.jsx(ba,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:c.lpmm_entity_extract,modelNames:a,onChange:(ge,ze)=>Nt("lpmm_entity_extract",ge,ze)}),l.jsx(ba,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:c.lpmm_rdf_build,modelNames:a,onChange:(ge,ze)=>Nt("lpmm_rdf_build",ge,ze)}),l.jsx(ba,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:c.lpmm_qa,modelNames:a,onChange:(ge,ze)=>Nt("lpmm_qa",ge,ze)})]})]})]})]}),l.jsx(xr,{open:E,onOpenChange:qe,children:l.jsxs(lr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(or,{children:[l.jsx(cr,{children:I!==null?"编辑模型":"添加模型"}),l.jsx(Hr,{children:"配置模型的基本信息和参数"})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"model_name",children:"模型名称 *"}),l.jsx(Pe,{id:"model_name",value:L?.name||"",onChange:ge=>P(ze=>ze?{...ze,name:ge.target.value}:null),placeholder:"例如: qwen3-30b"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"api_provider",children:"API 提供商 *"}),l.jsxs(qt,{value:L?.api_provider||"",onValueChange:ge=>{P(ze=>ze?{...ze,api_provider:ge}:null),re([]),Xe(null)},children:[l.jsx(It,{id:"api_provider",children:l.jsx(Ft,{placeholder:"选择提供商"})}),l.jsx(Bt,{children:n.map(ge=>l.jsx(De,{value:ge,children:ge},ge))})]})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ue,{htmlFor:"model_identifier",children:"模型标识符 *"}),He?.modelFetcher&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(In,{variant:"secondary",className:"text-xs",children:He.display_name}),l.jsx(de,{variant:"ghost",size:"sm",className:"h-6 px-2",onClick:()=>L?.api_provider&&Mt(L.api_provider,!0),disabled:ae,children:ae?l.jsx(vc,{className:"h-3 w-3 animate-spin"}):l.jsx(Ls,{className:"h-3 w-3"})})]})]}),He?.modelFetcher?l.jsxs(ul,{open:Ze,onOpenChange:Oe,children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{variant:"outline",role:"combobox","aria-expanded":Ze,className:"w-full justify-between font-normal",disabled:ae||!!Ue,children:[ae?l.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx(vc,{className:"h-4 w-4 animate-spin"}),"正在获取模型列表..."]}):Ue?l.jsx("span",{className:"text-muted-foreground text-sm",children:"点击下方输入框手动填写"}):L?.model_identifier?l.jsx("span",{className:"truncate",children:L.model_identifier}):l.jsx("span",{className:"text-muted-foreground",children:"搜索或选择模型..."}),l.jsx(l6,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),l.jsx(Ea,{className:"p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:l.jsxs(dy,{children:[l.jsx(hy,{placeholder:"搜索模型..."}),l.jsx(hn,{className:"h-[300px]",children:l.jsxs(fy,{className:"max-h-none overflow-visible",children:[l.jsx(my,{children:Ue?l.jsxs("div",{className:"py-4 px-2 text-center space-y-2",children:[l.jsx("p",{className:"text-sm text-destructive",children:Ue}),!Ue.includes("API Key")&&l.jsx(de,{variant:"link",size:"sm",onClick:()=>L?.api_provider&&Mt(L.api_provider,!0),children:"重试"})]}):"未找到匹配的模型"}),l.jsx(f0,{heading:"可用模型",children:ie.map(ge=>l.jsxs(m0,{value:ge.id,onSelect:()=>{P(ze=>ze?{...ze,model_identifier:ge.id}:null),Oe(!1)},children:[l.jsx(ol,{className:`mr-2 h-4 w-4 ${L?.model_identifier===ge.id?"opacity-100":"opacity-0"}`}),l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{children:ge.id}),ge.name!==ge.id&&l.jsx("span",{className:"text-xs text-muted-foreground",children:ge.name})]})]},ge.id))}),l.jsx(f0,{heading:"手动输入",children:l.jsxs(m0,{value:"__manual_input__",onSelect:()=>{Oe(!1)},children:[l.jsx(wu,{className:"mr-2 h-4 w-4"}),"手动输入模型标识符..."]})})]})})]})})]}):l.jsx(Pe,{id:"model_identifier",value:L?.model_identifier||"",onChange:ge=>P(ze=>ze?{...ze,model_identifier:ge.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),Ue&&He?.modelFetcher&&l.jsxs(Na,{variant:"destructive",className:"mt-2 py-2",children:[l.jsx(ra,{className:"h-4 w-4"}),l.jsx(Ca,{className:"text-xs",children:Ue})]}),He?.modelFetcher&&l.jsx(Pe,{value:L?.model_identifier||"",onChange:ge=>P(ze=>ze?{...ze,model_identifier:ge.target.value}:null),placeholder:"或手动输入模型标识符",className:"mt-2"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:Ue?'请手动输入模型标识符,或前往"模型提供商配置"检查 API Key':He?.modelFetcher?`已识别为 ${He.display_name},支持自动获取模型列表`:"API 提供商提供的模型 ID"})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),l.jsx(Pe,{id:"price_in",type:"number",step:"0.1",min:"0",value:L?.price_in??"",onChange:ge=>{const ze=ge.target.value===""?null:parseFloat(ge.target.value);P(Et=>Et?{...Et,price_in:ze}:null)},placeholder:"默认: 0"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),l.jsx(Pe,{id:"price_out",type:"number",step:"0.1",min:"0",value:L?.price_out??"",onChange:ge=>{const ze=ge.target.value===""?null:parseFloat(ge.target.value);P(Et=>Et?{...Et,price_out:ze}:null)},placeholder:"默认: 0"})]})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"force_stream_mode",checked:L?.force_stream_mode||!1,onCheckedChange:ge=>P(ze=>ze?{...ze,force_stream_mode:ge}:null)}),l.jsx(ue,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),l.jsxs(as,{children:[l.jsx(de,{variant:"outline",onClick:()=>M(!1),children:"取消"}),l.jsx(de,{onClick:Te,children:"保存"})]})]})}),l.jsx(Nn,{open:U,onOpenChange:ee,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:['确定要删除模型 "',z!==null?t[z]?.name:"",'" 吗? 此操作无法撤销。']})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:At,children:"删除"})]})]})}),l.jsx(Nn,{open:R,onOpenChange:se,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认批量删除"}),l.jsxs(bn,{children:["确定要删除选中的 ",J.size," 个模型吗? 此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:gt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})}),T&&l.jsx(N6,{onRestartComplete:Le,onRestartFailed:Ge})]})})}function ba({title:t,description:e,taskConfig:n,modelNames:r,onChange:s,hideTemperature:i=!1,hideMaxTokens:a=!1}){const o=c=>{s("model_list",c)};return l.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:t}),l.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:e})]}),l.jsxs("div",{className:"grid gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"模型列表"}),l.jsx(Kme,{options:r.map(c=>({label:c,value:c})),selected:n.model_list||[],onChange:o,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!i&&l.jsxs("div",{className:"grid gap-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(ue,{children:"温度"}),l.jsx(Pe,{type:"number",step:"0.1",min:"0",max:"1",value:n.temperature??.3,onChange:c=>{const h=parseFloat(c.target.value);!isNaN(h)&&h>=0&&h<=1&&s("temperature",h)},className:"w-20 h-8 text-sm"})]}),l.jsx(V0,{value:[n.temperature??.3],onValueChange:c=>s("temperature",c[0]),min:0,max:1,step:.1,className:"w-full"})]}),!a&&l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{children:"最大 Token"}),l.jsx(Pe,{type:"number",step:"1",min:"1",value:n.max_tokens??1024,onChange:c=>s("max_tokens",parseInt(c.target.value))})]})]})]})]})}const yy="/api/webui/config";async function e0e(){const e=await(await pt(`${yy}/adapter-config/path`)).json();return!e.success||!e.path?null:{path:e.path,lastModified:e.lastModified}}async function t_(t){const n=await(await pt(`${yy}/adapter-config/path`,{method:"POST",headers:Ct(),body:JSON.stringify({path:t})})).json();if(!n.success)throw new Error(n.message||"保存路径失败")}async function n_(t){const n=await(await pt(`${yy}/adapter-config?path=${encodeURIComponent(t)}`)).json();if(!n.success)throw new Error("读取配置文件失败");return n.content}async function r_(t,e){const r=await(await pt(`${yy}/adapter-config`,{method:"POST",headers:Ct(),body:JSON.stringify({path:t,content:e})})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}const ji={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"}},i4={oneclick:{name:"一键包",description:"使用一键包部署的适配器配置",path:"../MaiBot-Napcat-Adapter/config.toml",icon:mh},docker:{name:"Docker",description:"Docker Compose 部署的适配器配置",path:"./docker-config/adapters/config.toml",icon:$K}};function t0e(){const[t,e]=b.useState("upload"),[n,r]=b.useState(null),[s,i]=b.useState(""),[a,o]=b.useState(""),[c,h]=b.useState("oneclick"),[f,m]=b.useState(""),[g,x]=b.useState(!1),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[N,C]=b.useState(!1),[T,_]=b.useState(null),E=b.useRef(null),{toast:M}=ts(),L=b.useRef(null),P=K=>{if(!K.trim())return{valid:!1,error:"路径不能为空"};if(!K.toLowerCase().endsWith(".toml"))return{valid:!1,error:"文件必须是 .toml 格式"};const ie=/^([a-zA-Z]:\\|\\\\[^\\]+\\[^\\]+\\).+\.toml$/i,re=/^(\/|~\/).+\.toml$/i,ae=/^(\.{1,2}[\\/]|[^:\\/]).+\.toml$/i,_e=ie.test(K),Ue=re.test(K),Xe=ae.test(K);return!_e&&!Ue&&!Xe?{valid:!1,error:"路径格式错误"}:/[<>"|?*\x00-\x1F]/.test(K)?{valid:!1,error:"路径包含非法字符"}:{valid:!0,error:""}},I=K=>{if(o(K),K.trim()){const ie=P(K);m(ie.error)}else m("")},Q=b.useCallback(async K=>{const ie=i4[K];w(!0);try{const re=await n_(ie.path),ae=W(re);r(ae),h(K),o(ie.path),await t_(ie.path),M({title:"加载成功",description:`已从${ie.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 ie=P(K);if(!ie.valid){m(ie.error),M({title:"路径无效",description:ie.error,variant:"destructive"});return}m(""),w(!0);try{const re=await n_(K),ae=W(re);r(ae),o(K),await t_(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 ie=await e0e();if(ie&&ie.path){o(ie.path);const re=Object.entries(i4).find(([,ae])=>ae.path===ie.path);re?(e("preset"),h(re[0]),await Q(re[0])):(e("path"),await U(ie.path))}}catch(ie){console.error("加载保存的路径失败:",ie)}})()},[U,Q]);const ee=b.useCallback(K=>{t!=="path"&&t!=="preset"||!a||(L.current&&clearTimeout(L.current),L.current=setTimeout(async()=>{x(!0);try{const ie=F(K);await r_(a,ie),M({title:"自动保存成功",description:"配置已保存到文件"})}catch(ie){console.error("自动保存失败:",ie),M({title:"自动保存失败",description:ie instanceof Error?ie.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 ie=F(n);await r_(a,ie),M({title:"保存成功",description:"配置已保存到文件"})}catch(ie){console.error("保存失败:",ie),M({title:"保存失败",description:ie instanceof Error?ie.message:"保存配置失败",variant:"destructive"})}finally{x(!1)}},H=async()=>{a&&await U(a)},B=K=>{if(K!==t){if(n){_(K),k(!0);return}X(K)}},X=K=>{r(null),i(""),m(""),e(K),K==="preset"&&Q("oneclick"),M({title:"已切换模式",description:{upload:"现在可以上传配置文件",path:"现在可以指定配置文件路径",preset:"现在可以使用预设配置"}[K]})},J=()=>{T&&(X(T),_(null)),k(!1)},G=()=>{if(n){C(!0);return}R()},R=()=>{o(""),r(null),m(""),M({title:"已清空",description:"路径和配置已清空"})},se=()=>{R(),C(!1)},W=K=>{const ie=JSON.parse(JSON.stringify(ji)),re=K.split(` -`);let ae="";for(const _e of re){const Ue=_e.trim();if(!Ue||Ue.startsWith("#"))continue;const Xe=Ue.match(/^\[(\w+)\]/);if(Xe){ae=Xe[1];continue}const Ze=Ue.match(/^(\w+)\s*=\s*(.+)$/);if(Ze&&ae){const[,Oe,He]=Ze;let Ve=He.trim();const Be=Ve.match(/^("[^"]*")/);if(Be)Ve=Be[1];else{const rt=Ve.indexOf("#");rt!==-1&&(Ve=Ve.substring(0,rt).trim())}let ut;if(Ve==="true")ut=!0;else if(Ve==="false")ut=!1;else if(Ve.startsWith("[")&&Ve.endsWith("]")){const rt=Ve.slice(1,-1).trim();if(rt){const rn=rt.split(",").map(Tn=>{const Mt=Tn.trim();return isNaN(Number(Mt))?Mt.replace(/"/g,""):Number(Mt)}),Rn=typeof rn[0];ut=rn.every(Tn=>typeof Tn===Rn)?rn:rn.filter(Tn=>typeof Tn=="number")}else ut=[]}else Ve.startsWith('"')&&Ve.endsWith('"')?ut=Ve.slice(1,-1):isNaN(Number(Ve))?ut=Ve.replace(/"/g,""):ut=Number(Ve);if(ae in ie){const rt=ie[ae];rt[Oe]=ut}}}return ie},F=K=>{const ie=[],re=(ae,_e)=>ae===""||ae===null||ae===void 0?_e:ae;return ie.push("[inner]"),ie.push(`version = "${re(K.inner.version,ji.inner.version)}" # 版本号`),ie.push("# 请勿修改版本号,除非你知道自己在做什么"),ie.push(""),ie.push("[nickname] # 现在没用"),ie.push(`nickname = "${re(K.nickname.nickname,ji.nickname.nickname)}"`),ie.push(""),ie.push("[napcat_server] # Napcat连接的ws服务设置"),ie.push(`host = "${re(K.napcat_server.host,ji.napcat_server.host)}" # Napcat设定的主机地址`),ie.push(`port = ${re(K.napcat_server.port||0,ji.napcat_server.port)} # Napcat设定的端口`),ie.push(`token = "${re(K.napcat_server.token,ji.napcat_server.token)}" # Napcat设定的访问令牌,若无则留空`),ie.push(`heartbeat_interval = ${re(K.napcat_server.heartbeat_interval||0,ji.napcat_server.heartbeat_interval)} # 与Napcat设置的心跳相同(按秒计)`),ie.push(""),ie.push("[maibot_server] # 连接麦麦的ws服务设置"),ie.push(`host = "${re(K.maibot_server.host,ji.maibot_server.host)}" # 麦麦在.env文件中设置的主机地址,即HOST字段`),ie.push(`port = ${re(K.maibot_server.port||0,ji.maibot_server.port)} # 麦麦在.env文件中设置的端口,即PORT字段`),ie.push(""),ie.push("[chat] # 黑白名单功能"),ie.push(`group_list_type = "${re(K.chat.group_list_type,ji.chat.group_list_type)}" # 群组名单类型,可选为:whitelist, blacklist`),ie.push(`group_list = [${K.chat.group_list.join(", ")}] # 群组名单`),ie.push("# 当group_list_type为whitelist时,只有群组名单中的群组可以聊天"),ie.push("# 当group_list_type为blacklist时,群组名单中的任何群组无法聊天"),ie.push(`private_list_type = "${re(K.chat.private_list_type,ji.chat.private_list_type)}" # 私聊名单类型,可选为:whitelist, blacklist`),ie.push(`private_list = [${K.chat.private_list.join(", ")}] # 私聊名单`),ie.push("# 当private_list_type为whitelist时,只有私聊名单中的用户可以聊天"),ie.push("# 当private_list_type为blacklist时,私聊名单中的任何用户无法聊天"),ie.push(`ban_user_id = [${K.chat.ban_user_id.join(", ")}] # 全局禁止名单(全局禁止名单中的用户无法进行任何聊天)`),ie.push(`ban_qq_bot = ${K.chat.ban_qq_bot} # 是否屏蔽QQ官方机器人`),ie.push(`enable_poke = ${K.chat.enable_poke} # 是否启用戳一戳功能`),ie.push(""),ie.push("[voice] # 发送语音设置"),ie.push(`use_tts = ${K.voice.use_tts} # 是否使用tts语音(请确保你配置了tts并有对应的adapter)`),ie.push(""),ie.push("[debug]"),ie.push(`level = "${re(K.debug.level,ji.debug.level)}" # 日志等级(DEBUG, INFO, WARNING, ERROR, CRITICAL)`),ie.join(` -`)},V=K=>{const ie=K.target.files?.[0];if(!ie)return;const re=new FileReader;re.onload=ae=>{try{const _e=ae.target?.result,Ue=W(_e);r(Ue),i(ie.name),M({title:"上传成功",description:`已加载配置文件:${ie.name}`})}catch(_e){console.error("解析配置文件失败:",_e),M({title:"解析失败",description:"配置文件格式错误,请检查文件内容",variant:"destructive"})}},re.readAsText(ie)},te=()=>{if(!n)return;const K=F(n),ie=new Blob([K],{type:"text/plain;charset=utf-8"}),re=URL.createObjectURL(ie),ae=document.createElement("a");ae.href=re,ae.download=s||"config.toml",document.body.appendChild(ae),ae.click(),document.body.removeChild(ae),URL.revokeObjectURL(re),M({title:"下载成功",description:"配置文件已下载,请手动覆盖并重启适配器"})},ne=()=>{r(JSON.parse(JSON.stringify(ji))),i("config.toml"),M({title:"已加载默认配置",description:"可以开始编辑配置"})};return l.jsx(hn,{className:"h-full",children:l.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[l.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦适配器配置"}),l.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的 QQ 适配器的配置文件"})]})}),l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"工作模式"}),l.jsx(Fr,{children:"选择配置文件的管理方式"})]}),l.jsxs(Dn,{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 md:gap-4",children:[l.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:l.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[l.jsx(mh,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"预设模式"}),l.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"使用预设的部署配置"})]})]})}),l.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:l.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[l.jsx(IC,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"上传文件模式"}),l.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"上传配置文件,编辑后下载并手动覆盖"})]})]})}),l.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:l.jsxs("div",{className:"flex items-start gap-2 md:gap-3",children:[l.jsx(QK,{className:"h-4 w-4 md:h-5 md:w-5 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"font-semibold text-sm md:text-base",children:"指定路径模式"}),l.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-1 line-clamp-2",children:"指定配置文件路径,自动加载和保存"})]})]})})]}),t==="preset"&&l.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[l.jsx(ue,{className:"text-sm md:text-base",children:"选择部署方式"}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:Object.entries(i4).map(([K,ie])=>{const re=ie.icon,ae=c===K;return l.jsx("div",{className:`border-2 rounded-lg p-3 cursor-pointer transition-all ${ae?"border-primary bg-primary/5":"border-muted hover:border-primary/50"}`,onClick:()=>{h(K),Q(K)},children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(re,{className:"h-5 w-5 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h4",{className:"font-semibold text-sm",children:ie.name}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:ie.description}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1 font-mono break-all",children:ie.path})]})]})},K)})})]}),t==="path"&&l.jsxs("div",{className:"space-y-3 pt-2 border-t",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"config-path",className:"text-sm md:text-base",children:"配置文件路径"}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsx(Pe,{id:"config-path",value:a,onChange:K=>I(K.target.value),placeholder:"例: C:\\Adapter\\config.toml",className:`text-sm ${f?"border-destructive":""}`}),f&&l.jsx("p",{className:"text-xs text-destructive",children:f})]}),l.jsx(de,{onClick:()=>U(a),disabled:y||!a||!!f,className:"w-full sm:w-auto",children:y?l.jsxs(l.Fragment,{children:[l.jsx(Ls,{className:"h-4 w-4 animate-spin mr-2"}),l.jsx("span",{className:"sm:hidden",children:"加载中..."})]}):l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"sm:hidden",children:"加载配置"}),l.jsx("span",{className:"hidden sm:inline",children:"加载"})]})})]})]}),l.jsxs("details",{className:"rounded-lg bg-muted/50 p-3 group",children:[l.jsxs("summary",{className:"text-xs font-medium cursor-pointer select-none list-none flex items-center justify-between",children:[l.jsx("span",{children:"路径格式说明"}),l.jsx("svg",{className:"h-4 w-4 transition-transform group-open:rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),l.jsxs("div",{className:"mt-2 space-y-2 text-xs text-muted-foreground",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Windows"})}),l.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[l.jsx("div",{children:"C:\\Adapter\\config.toml"}),l.jsx("div",{className:"hidden sm:block",children:"D:\\MaiBot\\adapter\\config.toml"}),l.jsx("div",{className:"hidden sm:block",children:"\\\\server\\share\\config.toml"})]})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx("span",{className:"font-mono bg-background px-1.5 py-0.5 rounded text-[10px] md:text-xs whitespace-nowrap",children:"Linux"})}),l.jsxs("div",{className:"pl-2 space-y-0.5 text-[10px] md:text-xs break-all",children:[l.jsx("div",{children:"/opt/adapter/config.toml"}),l.jsx("div",{className:"hidden sm:block",children:"/home/user/adapter/config.toml"}),l.jsx("div",{className:"hidden sm:block",children:"~/adapter/config.toml"})]})]}),l.jsx("p",{className:"pt-1 border-t text-[10px] md:text-xs",children:"💡 配置会自动保存到指定文件,修改后 1 秒自动保存"})]})]})]})]})]}),l.jsxs(Na,{children:[l.jsx(ra,{className:"h-4 w-4"}),l.jsx(Ca,{children:t==="preset"?l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:"预设模式:"}),"选择预设的部署方式,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]}):t==="upload"?l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:"上传文件模式:"}),"上传配置文件 → 在线编辑 → 下载文件 → 手动覆盖并重启适配器"]}):l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:"指定路径模式:"}),"指定配置文件路径后,配置会自动加载,修改后 1 秒自动保存",g&&" (正在保存...)"]})})]}),t==="upload"&&!n&&l.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full",children:[l.jsx("input",{ref:E,type:"file",accept:".toml",className:"hidden",onChange:V}),l.jsxs(de,{onClick:()=>E.current?.click(),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[l.jsx(IC,{className:"mr-2 h-4 w-4"}),"上传配置"]}),l.jsxs(de,{onClick:ne,size:"sm",className:"w-full sm:w-auto",children:[l.jsx(lo,{className:"mr-2 h-4 w-4"}),"使用默认配置"]})]}),t==="upload"&&n&&l.jsx("div",{className:"flex gap-2",children:l.jsxs(de,{onClick:te,size:"sm",className:"w-full sm:w-auto",children:[l.jsx(Su,{className:"mr-2 h-4 w-4"}),"下载配置"]})}),(t==="preset"||t==="path")&&n&&l.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[l.jsxs(de,{onClick:z,size:"sm",disabled:g||!!f,className:"w-full sm:w-auto",children:[l.jsx(zv,{className:"mr-2 h-4 w-4"}),g?"保存中...":"立即保存"]}),l.jsxs(de,{onClick:H,size:"sm",variant:"outline",disabled:y,className:"w-full sm:w-auto",children:[l.jsx(Ls,{className:`mr-2 h-4 w-4 ${y?"animate-spin":""}`}),"刷新"]}),t==="path"&&l.jsxs(de,{onClick:G,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[l.jsx(fn,{className:"mr-2 h-4 w-4"}),"清空路径"]})]}),n?l.jsxs(sa,{defaultValue:"napcat",className:"w-full",children:[l.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:l.jsxs(Mi,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5",children:[l.jsxs(zt,{value:"napcat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[l.jsx("span",{className:"hidden sm:inline",children:"Napcat 连接"}),l.jsx("span",{className:"sm:hidden",children:"Napcat"})]}),l.jsxs(zt,{value:"maibot",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[l.jsx("span",{className:"hidden sm:inline",children:"麦麦连接"}),l.jsx("span",{className:"sm:hidden",children:"麦麦"})]}),l.jsxs(zt,{value:"chat",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[l.jsx("span",{className:"hidden sm:inline",children:"聊天控制"}),l.jsx("span",{className:"sm:hidden",children:"聊天"})]}),l.jsxs(zt,{value:"voice",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:[l.jsx("span",{className:"hidden sm:inline",children:"语音设置"}),l.jsx("span",{className:"sm:hidden",children:"语音"})]}),l.jsx(zt,{value:"debug",className:"flex-shrink-0 text-xs sm:text-sm whitespace-nowrap",children:"调试"})]})}),l.jsx(tn,{value:"napcat",className:"space-y-4",children:l.jsx(n0e,{config:n,onChange:K=>{r(K),ee(K)}})}),l.jsx(tn,{value:"maibot",className:"space-y-4",children:l.jsx(r0e,{config:n,onChange:K=>{r(K),ee(K)}})}),l.jsx(tn,{value:"chat",className:"space-y-4",children:l.jsx(s0e,{config:n,onChange:K=>{r(K),ee(K)}})}),l.jsx(tn,{value:"voice",className:"space-y-4",children:l.jsx(i0e,{config:n,onChange:K=>{r(K),ee(K)}})}),l.jsx(tn,{value:"debug",className:"space-y-4",children:l.jsx(a0e,{config:n,onChange:K=>{r(K),ee(K)}})})]}):l.jsx("div",{className:"rounded-lg border bg-card p-6 md:p-12",children:l.jsxs("div",{className:"text-center space-y-3 md:space-y-4",children:[l.jsx(lo,{className:"h-12 w-12 md:h-16 md:w-16 mx-auto text-muted-foreground"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-base md:text-lg font-semibold",children:"尚未加载配置"}),l.jsx("p",{className:"text-xs md:text-sm text-muted-foreground mt-2 px-4",children:t==="preset"?"请选择预设的部署方式":t==="upload"?"请上传现有配置文件,或使用默认配置开始编辑":"请指定配置文件路径并点击加载按钮"})]})]})}),l.jsx(Nn,{open:S,onOpenChange:k,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认切换模式"}),l.jsxs(bn,{children:["切换模式将清空当前配置,确定要继续吗?",l.jsx("br",{}),l.jsx("span",{className:"text-destructive font-medium",children:"请确保已保存重要配置"})]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{onClick:()=>{k(!1),_(null)},children:"取消"}),l.jsx(wn,{onClick:J,children:"确认切换"})]})]})}),l.jsx(Nn,{open:N,onOpenChange:C,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认清空路径"}),l.jsxs(bn,{children:["清空路径将清除当前配置,确定要继续吗?",l.jsx("br",{}),l.jsx("span",{className:"text-muted-foreground text-sm",children:"此操作不会删除配置文件,只是清除界面中的配置"})]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{onClick:()=>C(!1),children:"取消"}),l.jsx(wn,{onClick:se,className:"bg-destructive hover:bg-destructive/90",children:"确认清空"})]})]})})]})})}function n0e({config:t,onChange:e}){return l.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"Napcat WebSocket 服务设置"}),l.jsxs("div",{className:"grid gap-3 md:gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"napcat-host",className:"text-sm md:text-base",children:"主机地址"}),l.jsx(Pe,{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"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的主机地址"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"napcat-port",className:"text-sm md:text-base",children:"端口"}),l.jsx(Pe,{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"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的端口(留空使用默认值 8095)"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"napcat-token",className:"text-sm md:text-base",children:"访问令牌(Token)"}),l.jsx(Pe,{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"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Napcat 设定的访问令牌,若无则留空"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"napcat-heartbeat",className:"text-sm md:text-base",children:"心跳间隔(秒)"}),l.jsx(Pe,{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"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"与 Napcat 设置的心跳间隔保持一致(留空使用默认值 30)"})]})]})]})})}function r0e({config:t,onChange:e}){return l.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"麦麦 WebSocket 服务设置"}),l.jsxs("div",{className:"grid gap-3 md:gap-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"maibot-host",className:"text-sm md:text-base",children:"主机地址"}),l.jsx(Pe,{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"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 HOST 字段"})]}),l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{htmlFor:"maibot-port",className:"text-sm md:text-base",children:"端口"}),l.jsx(Pe,{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"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦在 .env 文件中设置的 PORT 字段(留空使用默认值 8000)"})]})]})]})})}function s0e({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 o={...t};i==="group"?o.chat.group_list=o.chat.group_list.filter((c,h)=>h!==a):i==="private"?o.chat.private_list=o.chat.private_list.filter((c,h)=>h!==a):o.chat.ban_user_id=o.chat.ban_user_id.filter((c,h)=>h!==a),e(o)},s=(i,a,o)=>{const c={...t};i==="group"?c.chat.group_list[a]=o:i==="private"?c.chat.private_list[a]=o:c.chat.ban_user_id[a]=o,e(c)};return l.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"聊天黑白名单功能"}),l.jsxs("div",{className:"grid gap-4 md:gap-6",children:[l.jsxs("div",{className:"space-y-3 md:space-y-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-sm md:text-base",children:"群组名单类型"}),l.jsxs(qt,{value:t.chat.group_list_type,onValueChange:i=>e({...t,chat:{...t.chat,group_list_type:i}}),children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),l.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[l.jsx(ue,{className:"text-sm md:text-base",children:"群组列表"}),l.jsxs(de,{onClick:()=>n("group"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[l.jsx(lo,{className:"mr-1 h-4 w-4"}),"添加群号"]})]}),t.chat.group_list.map((i,a)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Pe,{type:"number",value:i,onChange:o=>s("group",a,parseInt(o.target.value)||0),placeholder:"输入群号",className:"text-sm md:text-base"}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"icon",variant:"outline",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:["确定要删除群号 ",i," 吗?此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>r("group",a),children:"删除"})]})]})]})]},a)),t.chat.group_list.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无群组"})]})]}),l.jsxs("div",{className:"space-y-3 md:space-y-4",children:[l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-sm md:text-base",children:"私聊名单类型"}),l.jsxs(qt,{value:t.chat.private_list_type,onValueChange:i=>e({...t,chat:{...t.chat,private_list_type:i}}),children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"whitelist",children:"白名单(仅名单内可聊天)"}),l.jsx(De,{value:"blacklist",children:"黑名单(名单内禁止聊天)"})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[l.jsx(ue,{className:"text-sm md:text-base",children:"私聊列表"}),l.jsxs(de,{onClick:()=>n("private"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[l.jsx(lo,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.private_list.map((i,a)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Pe,{type:"number",value:i,onChange:o=>s("private",a,parseInt(o.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"icon",variant:"outline",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:["确定要删除用户 ",i," 吗?此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>r("private",a),children:"删除"})]})]})]})]},a)),t.chat.private_list.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无用户"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-0",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-sm md:text-base",children:"全局禁止名单"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"名单中的用户无法进行任何聊天"})]}),l.jsxs(de,{onClick:()=>n("ban"),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[l.jsx(lo,{className:"mr-1 h-4 w-4"}),"添加用户"]})]}),t.chat.ban_user_id.map((i,a)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Pe,{type:"number",value:i,onChange:o=>s("ban",a,parseInt(o.target.value)||0),placeholder:"输入QQ号",className:"text-sm md:text-base"}),l.jsxs(Nn,{children:[l.jsx(Qr,{asChild:!0,children:l.jsx(de,{size:"icon",variant:"outline",children:l.jsx(fn,{className:"h-4 w-4"})})}),l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:["确定要从全局禁止名单中删除用户 ",i," 吗?此操作无法撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>r("ban",a),children:"删除"})]})]})]})]},a)),t.chat.ban_user_id.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无禁止用户"})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-sm md:text-base",children:"屏蔽QQ官方机器人"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否屏蔽来自QQ官方机器人的消息"})]}),l.jsx(Pt,{checked:t.chat.ban_qq_bot,onCheckedChange:i=>e({...t,chat:{...t.chat,ban_qq_bot:i}})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-sm md:text-base",children:"启用戳一戳功能"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"是否响应戳一戳消息"})]}),l.jsx(Pt,{checked:t.chat.enable_poke,onCheckedChange:i=>e({...t,chat:{...t.chat,enable_poke:i}})})]})]})]})})}function i0e({config:t,onChange:e}){return l.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"发送语音设置"}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-sm md:text-base",children:"使用 TTS 语音"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"请确保已配置 TTS 并有对应的适配器"})]}),l.jsx(Pt,{checked:t.voice.use_tts,onCheckedChange:n=>e({...t,voice:{use_tts:n}})})]})]})})}function a0e({config:t,onChange:e}){return l.jsx("div",{className:"rounded-lg border bg-card p-4 md:p-6 space-y-4 md:space-y-6",children:l.jsxs("div",{children:[l.jsx("h3",{className:"text-base md:text-lg font-semibold mb-3 md:mb-4",children:"调试设置"}),l.jsx("div",{className:"grid gap-3 md:gap-4",children:l.jsxs("div",{className:"grid gap-2",children:[l.jsx(ue,{className:"text-sm md:text-base",children:"日志等级"}),l.jsxs(qt,{value:t.debug.level,onValueChange:n=>e({...t,debug:{level:n}}),children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"DEBUG",children:"DEBUG(调试)"}),l.jsx(De,{value:"INFO",children:"INFO(信息)"}),l.jsx(De,{value:"WARNING",children:"WARNING(警告)"}),l.jsx(De,{value:"ERROR",children:"ERROR(错误)"}),l.jsx(De,{value:"CRITICAL",children:"CRITICAL(严重)"})]})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"设置适配器的日志输出等级"})]})})]})})}function s_(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 l0e(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const o0e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,c0e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,u0e={};function i_(t,e){return(u0e.jsx?c0e:o0e).test(t)}const d0e=/[ \t\n\f\r]/g;function h0e(t){return typeof t=="object"?t.type==="text"?a_(t.value):!1:a_(t)}function a_(t){return t.replace(d0e,"")===""}class cp{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}cp.prototype.normal={};cp.prototype.property={};cp.prototype.space=void 0;function $F(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new cp(n,r,e)}function y0(t){return t.toLowerCase()}class hi{constructor(e,n){this.attribute=n,this.property=e}}hi.prototype.attribute="";hi.prototype.booleanish=!1;hi.prototype.boolean=!1;hi.prototype.commaOrSpaceSeparated=!1;hi.prototype.commaSeparated=!1;hi.prototype.defined=!1;hi.prototype.mustUseProperty=!1;hi.prototype.number=!1;hi.prototype.overloadedBoolean=!1;hi.prototype.property="";hi.prototype.spaceSeparated=!1;hi.prototype.space=void 0;let f0e=0;const Ut=Hu(),Br=Hu(),ek=Hu(),Qe=Hu(),Zn=Hu(),ch=Hu(),Oi=Hu();function Hu(){return 2**++f0e}const tk=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ut,booleanish:Br,commaOrSpaceSeparated:Oi,commaSeparated:ch,number:Qe,overloadedBoolean:ek,spaceSeparated:Zn},Symbol.toStringTag,{value:"Module"})),a4=Object.keys(tk);class Nj extends hi{constructor(e,n,r,s){let i=-1;if(super(e,n),l_(this,"space",s),typeof r=="number")for(;++i4&&n.slice(0,4)==="data"&&v0e.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(o_,b0e);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!o_.test(i)){let a=i.replace(x0e,y0e);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=Nj}return new s(r,e)}function y0e(t){return"-"+t.toLowerCase()}function b0e(t){return t.charAt(1).toUpperCase()}const YF=$F([QF,m0e,UF,WF,GF],"html"),by=$F([QF,p0e,UF,WF,GF],"svg");function c_(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function w0e(t){return t.join(" ").trim()}var Ed={},l4,u_;function S0e(){if(u_)return l4;u_=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,c=` -`,h="/",f="*",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 N=1,C=1;function T(z){var H=z.match(e);H&&(N+=H.length);var B=z.lastIndexOf(c);C=~B?z.length-B:C+z.length}function _(){var z={line:N,column:C};return function(H){return H.position=new E(z),P(),H}}function E(z){this.start=z,this.end={line:N,column:C},this.source=k.source}E.prototype.content=S;function M(z){var H=new Error(k.source+":"+N+":"+C+": "+z);if(H.reason=z,H.filename=k.source,H.line=N,H.column=C,H.source=S,!k.silent)throw H}function L(z){var H=z.exec(S);if(H){var B=H[0];return T(B),S=S.slice(B.length),H}}function P(){L(n)}function I(z){var H;for(z=z||[];H=Q();)H!==!1&&z.push(H);return z}function Q(){var z=_();if(!(h!=S.charAt(0)||f!=S.charAt(1))){for(var H=2;m!=S.charAt(H)&&(f!=S.charAt(H)||h!=S.charAt(H+1));)++H;if(H+=2,m===S.charAt(H-1))return M("End of comment missing");var B=S.slice(2,H-2);return C+=2,T(B),S=S.slice(H),C+=2,z({type:g,comment:B})}}function U(){var z=_(),H=L(r);if(H){if(Q(),!L(s))return M("property missing ':'");var B=L(i),X=z({type:x,property:w(H[0].replace(t,m)),value:B?w(B[0].replace(t,m)):m});return L(a),X}}function ee(){var z=[];I(z);for(var H;H=U();)H!==!1&&(z.push(H),I(z));return z}return P(),ee()}function w(S){return S?S.replace(o,m):m}return l4=y,l4}var d_;function k0e(){if(d_)return Ed;d_=1;var t=Ed&&Ed.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ed,"__esModule",{value:!0}),Ed.default=n;const e=t(S0e());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,e.default)(r),o=typeof s=="function";return a.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:f}=c;o?s(h,f,c):f&&(i=i||{},i[h]=f)}),i}return Ed}var sm={},h_;function j0e(){if(h_)return sm;h_=1,Object.defineProperty(sm,"__esModule",{value:!0}),sm.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(h){return!h||n.test(h)||t.test(h)},a=function(h,f){return f.toUpperCase()},o=function(h,f){return"".concat(f,"-")},c=function(h,f){return f===void 0&&(f={}),i(h)?h:(h=h.toLowerCase(),f.reactCompat?h=h.replace(s,o):h=h.replace(r,o),h.replace(e,a))};return sm.camelCase=c,sm}var im,f_;function O0e(){if(f_)return im;f_=1;var t=im&&im.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(k0e()),n=j0e();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(o,c){o&&c&&(a[(0,n.camelCase)(o,i)]=c)}),a}return r.default=r,im=r,im}var N0e=O0e();const C0e=Fk(N0e),KF=ZF("end"),Cj=ZF("start");function ZF(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 T0e(t){const e=Cj(t),n=KF(t);if(e&&n)return{start:e,end:n}}function Lm(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?m_(t.position):"start"in t||"end"in t?m_(t):"line"in t||"column"in t?nk(t):""}function nk(t){return p_(t&&t.line)+":"+p_(t&&t.column)}function m_(t){return nk(t&&t.start)+"-"+nk(t&&t.end)}function p_(t){return t&&typeof t=="number"?t:1}class _s 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 o=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=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Lm(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}}_s.prototype.file="";_s.prototype.name="";_s.prototype.reason="";_s.prototype.message="";_s.prototype.stack="";_s.prototype.column=void 0;_s.prototype.line=void 0;_s.prototype.ancestors=void 0;_s.prototype.cause=void 0;_s.prototype.fatal=void 0;_s.prototype.place=void 0;_s.prototype.ruleId=void 0;_s.prototype.source=void 0;const Tj={}.hasOwnProperty,E0e=new Map,_0e=/[A-Z]/g,M0e=new Set(["table","tbody","thead","tfoot","tr"]),A0e=new Set(["td","th"]),JF="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function R0e(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=F0e(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=q0e(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"?by:YF,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=e$(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function e$(t,e,n){if(e.type==="element")return D0e(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return z0e(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return L0e(t,e,n);if(e.type==="mdxjsEsm")return P0e(t,e);if(e.type==="root")return I0e(t,e,n);if(e.type==="text")return B0e(t,e)}function D0e(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=by,t.schema=s),t.ancestors.push(e);const i=n$(t,e.tagName,!1),a=$0e(t,e);let o=_j(t,e);return M0e.has(e.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!h0e(c):!0})),t$(t,a,i,e),Ej(a,o),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function z0e(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)}b0(t,e.position)}function P0e(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);b0(t,e.position)}function L0e(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=by,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:n$(t,e.name,!0),a=Q0e(t,e),o=_j(t,e);return t$(t,a,i,e),Ej(a,o),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function I0e(t,e,n){const r={};return Ej(r,_j(t,e)),t.create(e,t.Fragment,r,n)}function B0e(t,e){return e.value}function t$(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Ej(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function q0e(t,e,n){return r;function r(s,i,a,o){const h=Array.isArray(a.children)?n:e;return o?h(i,a,o):h(i,a)}}function F0e(t,e){return n;function n(r,s,i,a){const o=Array.isArray(i.children),c=Cj(r);return e(s,i,a,o,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function $0e(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&Tj.call(e.properties,s)){const i=H0e(t,s,e.properties[s]);if(i){const[a,o]=i;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&A0e.has(e.tagName)?r=o:n[a]=o}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Q0e(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 o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else b0(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 o=r.value.data.estree.body[0];o.type,i=t.evaluater.evaluateExpression(o.expression)}else b0(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function _j(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:E0e;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?(Ai(t,t.length,0,e),t):e}const v_={}.hasOwnProperty;function s$(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 Ta(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const zs=zc(/[A-Za-z]/),Ts=zc(/[\dA-Za-z]/),J0e=zc(/[#-'*+\--9=?A-Z^-~]/);function av(t){return t!==null&&(t<32||t===127)}const rk=zc(/\d/),epe=zc(/[\dA-Fa-f]/),tpe=zc(/[!-/:-@[-`{-~]/);function ht(t){return t!==null&&t<-2}function Yn(t){return t!==null&&(t<0||t===32)}function nn(t){return t===-2||t===-1||t===32}const wy=zc(new RegExp("\\p{P}|\\p{S}","u")),Iu=zc(/\s/);function zc(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Zh(t){const e=[];let n=-1,r=0,s=0;for(;++n55295&&i<57344){const o=t.charCodeAt(n+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),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 Zt(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return nn(c)?(t.enter(n),o(c)):e(c)}function o(c){return nn(c)&&i++a))return;const M=e.events.length;let L=M,P,I;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){if(P){I=e.events[L][1].end;break}P=!0}for(k(r),E=M;EC;){const _=n[T];e.containerState=_[1],_[0].exit.call(e,t)}n.length=C}function N(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function ape(t,e,n){return Zt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ch(t){if(t===null||Yn(t)||Iu(t))return 1;if(wy(t))return 2}function Sy(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};b_(m,-c),b_(g,c),a={type:c>1?"strongSequence":"emphasisSequence",start:m,end:{...t[r][1].end}},o={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:{...o.end}},t[r][1].end={...a.start},t[n][1].start={...o.end},h=[],t[r][1].end.offset-t[r][1].start.offset&&(h=Yi(h,[["enter",t[r][1],e],["exit",t[r][1],e]])),h=Yi(h,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),h=Yi(h,Sy(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),h=Yi(h,[["exit",i,e],["enter",o,e],["exit",o,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(f=2,h=Yi(h,[["enter",t[n][1],e],["exit",t[n][1],e]])):f=0,Ai(t,r-1,n-r+3,h),n=r+h.length-f-2;break}}for(n=-1;++n0&&nn(E)?Zt(t,N,"linePrefix",i+1)(E):N(E)}function N(E){return E===null||ht(E)?t.check(w_,w,T)(E):(t.enter("codeFlowValue"),C(E))}function C(E){return E===null||ht(E)?(t.exit("codeFlowValue"),N(E)):(t.consume(E),C)}function T(E){return t.exit("codeFenced"),e(E)}function _(E,M,L){let P=0;return I;function I(H){return E.enter("lineEnding"),E.consume(H),E.exit("lineEnding"),Q}function Q(H){return E.enter("codeFencedFence"),nn(H)?Zt(E,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):U(H)}function U(H){return H===o?(E.enter("codeFencedFenceSequence"),ee(H)):L(H)}function ee(H){return H===o?(P++,E.consume(H),ee):P>=a?(E.exit("codeFencedFenceSequence"),nn(H)?Zt(E,z,"whitespace")(H):z(H)):L(H)}function z(H){return H===null||ht(H)?(E.exit("codeFencedFence"),M(H)):L(H)}}}function vpe(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 c4={name:"codeIndented",tokenize:bpe},ype={partial:!0,tokenize:wpe};function bpe(t,e,n){const r=this;return s;function s(h){return t.enter("codeIndented"),Zt(t,i,"linePrefix",5)(h)}function i(h){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(h):n(h)}function a(h){return h===null?c(h):ht(h)?t.attempt(ype,a,c)(h):(t.enter("codeFlowValue"),o(h))}function o(h){return h===null||ht(h)?(t.exit("codeFlowValue"),a(h)):(t.consume(h),o)}function c(h){return t.exit("codeIndented"),e(h)}}function wpe(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):ht(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):Zt(t,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):ht(a)?s(a):n(a)}}const Spe={name:"codeText",previous:jpe,resolve:kpe,tokenize:Ope};function kpe(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&&am(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),am(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),am(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 u$(t,e,n,r,s,i,a,o,c){const h=c||Number.POSITIVE_INFINITY;let f=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||av(k)?n(k):(t.enter(r),t.enter(a),t.enter(o),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(o),t.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===62?(t.exit("chunkString"),t.exit(o),g(k)):k===null||k===60||ht(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!f&&(k===null||k===41||Yn(k))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(r),e(k)):f999||x===null||x===91||x===93&&!c||x===94&&!o&&"_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):ht(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),f):(t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||x===91||x===93||ht(x)||o++>999?(t.exit("chunkString"),f(x)):(t.consume(x),c||(c=!nn(x)),x===92?g:m)}function g(x){return x===91||x===92||x===93?(t.consume(x),o++,m):m(x)}}function h$(t,e,n,r,s,i){let a;return o;function o(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),h(g))}function h(g){return g===a?(t.exit(i),c(a)):g===null?n(g):ht(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),Zt(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===a||g===null||ht(g)?(t.exit("chunkString"),h(g)):(t.consume(g),g===92?m:f)}function m(g){return g===a||g===92?(t.consume(g),f):f(g)}}function Im(t,e){let n;return r;function r(s){return ht(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):nn(s)?Zt(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const Rpe={name:"definition",tokenize:zpe},Dpe={partial:!0,tokenize:Ppe};function zpe(t,e,n){const r=this;let s;return i;function i(x){return t.enter("definition"),a(x)}function a(x){return d$.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function o(x){return s=Ta(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 Yn(x)?Im(t,h)(x):h(x)}function h(x){return u$(t,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function f(x){return t.attempt(Dpe,m,m)(x)}function m(x){return nn(x)?Zt(t,g,"whitespace")(x):g(x)}function g(x){return x===null||ht(x)?(t.exit("definition"),r.parser.defined.push(s),e(x)):n(x)}}function Ppe(t,e,n){return r;function r(o){return Yn(o)?Im(t,s)(o):n(o)}function s(o){return h$(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return nn(o)?Zt(t,a,"whitespace")(o):a(o)}function a(o){return o===null||ht(o)?e(o):n(o)}}const Lpe={name:"hardBreakEscape",tokenize:Ipe};function Ipe(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return ht(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const Bpe={name:"headingAtx",resolve:qpe,tokenize:Fpe};function qpe(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"},Ai(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function Fpe(t,e,n){let r=0;return s;function s(f){return t.enter("atxHeading"),i(f)}function i(f){return t.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(t.consume(f),a):f===null||Yn(f)?(t.exit("atxHeadingSequence"),o(f)):n(f)}function o(f){return f===35?(t.enter("atxHeadingSequence"),c(f)):f===null||ht(f)?(t.exit("atxHeading"),e(f)):nn(f)?Zt(t,o,"whitespace")(f):(t.enter("atxHeadingText"),h(f))}function c(f){return f===35?(t.consume(f),c):(t.exit("atxHeadingSequence"),o(f))}function h(f){return f===null||f===35||Yn(f)?(t.exit("atxHeadingText"),o(f)):(t.consume(f),h)}}const $pe=["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"],k_=["pre","script","style","textarea"],Qpe={concrete:!0,name:"htmlFlow",resolveTo:Upe,tokenize:Wpe},Hpe={partial:!0,tokenize:Xpe},Vpe={partial:!0,tokenize:Gpe};function Upe(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 Wpe(t,e,n){const r=this;let s,i,a,o,c;return h;function h(F){return f(F)}function f(F){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(F),m}function m(F){return F===33?(t.consume(F),g):F===47?(t.consume(F),i=!0,w):F===63?(t.consume(F),s=3,r.interrupt?e:R):zs(F)?(t.consume(F),a=String.fromCharCode(F),S):n(F)}function g(F){return F===45?(t.consume(F),s=2,x):F===91?(t.consume(F),s=5,o=0,y):zs(F)?(t.consume(F),s=4,r.interrupt?e:R):n(F)}function x(F){return F===45?(t.consume(F),r.interrupt?e:R):n(F)}function y(F){const V="CDATA[";return F===V.charCodeAt(o++)?(t.consume(F),o===V.length?r.interrupt?e:U:y):n(F)}function w(F){return zs(F)?(t.consume(F),a=String.fromCharCode(F),S):n(F)}function S(F){if(F===null||F===47||F===62||Yn(F)){const V=F===47,te=a.toLowerCase();return!V&&!i&&k_.includes(te)?(s=1,r.interrupt?e(F):U(F)):$pe.includes(a.toLowerCase())?(s=6,V?(t.consume(F),k):r.interrupt?e(F):U(F)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):i?N(F):C(F))}return F===45||Ts(F)?(t.consume(F),a+=String.fromCharCode(F),S):n(F)}function k(F){return F===62?(t.consume(F),r.interrupt?e:U):n(F)}function N(F){return nn(F)?(t.consume(F),N):I(F)}function C(F){return F===47?(t.consume(F),I):F===58||F===95||zs(F)?(t.consume(F),T):nn(F)?(t.consume(F),C):I(F)}function T(F){return F===45||F===46||F===58||F===95||Ts(F)?(t.consume(F),T):_(F)}function _(F){return F===61?(t.consume(F),E):nn(F)?(t.consume(F),_):C(F)}function E(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(t.consume(F),c=F,M):nn(F)?(t.consume(F),E):L(F)}function M(F){return F===c?(t.consume(F),c=null,P):F===null||ht(F)?n(F):(t.consume(F),M)}function L(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||Yn(F)?_(F):(t.consume(F),L)}function P(F){return F===47||F===62||nn(F)?C(F):n(F)}function I(F){return F===62?(t.consume(F),Q):n(F)}function Q(F){return F===null||ht(F)?U(F):nn(F)?(t.consume(F),Q):n(F)}function U(F){return F===45&&s===2?(t.consume(F),B):F===60&&s===1?(t.consume(F),X):F===62&&s===4?(t.consume(F),se):F===63&&s===3?(t.consume(F),R):F===93&&s===5?(t.consume(F),G):ht(F)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(Hpe,W,ee)(F)):F===null||ht(F)?(t.exit("htmlFlowData"),ee(F)):(t.consume(F),U)}function ee(F){return t.check(Vpe,z,W)(F)}function z(F){return t.enter("lineEnding"),t.consume(F),t.exit("lineEnding"),H}function H(F){return F===null||ht(F)?ee(F):(t.enter("htmlFlowData"),U(F))}function B(F){return F===45?(t.consume(F),R):U(F)}function X(F){return F===47?(t.consume(F),a="",J):U(F)}function J(F){if(F===62){const V=a.toLowerCase();return k_.includes(V)?(t.consume(F),se):U(F)}return zs(F)&&a.length<8?(t.consume(F),a+=String.fromCharCode(F),J):U(F)}function G(F){return F===93?(t.consume(F),R):U(F)}function R(F){return F===62?(t.consume(F),se):F===45&&s===2?(t.consume(F),R):U(F)}function se(F){return F===null||ht(F)?(t.exit("htmlFlowData"),W(F)):(t.consume(F),se)}function W(F){return t.exit("htmlFlow"),e(F)}}function Gpe(t,e,n){const r=this;return s;function s(a){return ht(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 Xpe(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(up,e,n)}}const Ype={name:"htmlText",tokenize:Kpe};function Kpe(t,e,n){const r=this;let s,i,a;return o;function o(R){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(R),c}function c(R){return R===33?(t.consume(R),h):R===47?(t.consume(R),_):R===63?(t.consume(R),C):zs(R)?(t.consume(R),L):n(R)}function h(R){return R===45?(t.consume(R),f):R===91?(t.consume(R),i=0,y):zs(R)?(t.consume(R),N):n(R)}function f(R){return R===45?(t.consume(R),x):n(R)}function m(R){return R===null?n(R):R===45?(t.consume(R),g):ht(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 se="CDATA[";return R===se.charCodeAt(i++)?(t.consume(R),i===se.length?w:y):n(R)}function w(R){return R===null?n(R):R===93?(t.consume(R),S):ht(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 N(R){return R===null||R===62?B(R):ht(R)?(a=N,X(R)):(t.consume(R),N)}function C(R){return R===null?n(R):R===63?(t.consume(R),T):ht(R)?(a=C,X(R)):(t.consume(R),C)}function T(R){return R===62?B(R):C(R)}function _(R){return zs(R)?(t.consume(R),E):n(R)}function E(R){return R===45||Ts(R)?(t.consume(R),E):M(R)}function M(R){return ht(R)?(a=M,X(R)):nn(R)?(t.consume(R),M):B(R)}function L(R){return R===45||Ts(R)?(t.consume(R),L):R===47||R===62||Yn(R)?P(R):n(R)}function P(R){return R===47?(t.consume(R),B):R===58||R===95||zs(R)?(t.consume(R),I):ht(R)?(a=P,X(R)):nn(R)?(t.consume(R),P):B(R)}function I(R){return R===45||R===46||R===58||R===95||Ts(R)?(t.consume(R),I):Q(R)}function Q(R){return R===61?(t.consume(R),U):ht(R)?(a=Q,X(R)):nn(R)?(t.consume(R),Q):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):ht(R)?(a=U,X(R)):nn(R)?(t.consume(R),U):(t.consume(R),z)}function ee(R){return R===s?(t.consume(R),s=void 0,H):R===null?n(R):ht(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||Yn(R)?P(R):(t.consume(R),z)}function H(R){return R===47||R===62||Yn(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 nn(R)?Zt(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 Rj={name:"labelEnd",resolveAll:tge,resolveTo:nge,tokenize:rge},Zpe={tokenize:sge},Jpe={tokenize:ige},ege={tokenize:age};function tge(t){let e=-1;const n=[];for(;++e=3&&(h===null||ht(h))?(t.exit("thematicBreak"),e(h)):n(h)}function c(h){return h===s?(t.consume(h),r++,c):(t.exit("thematicBreakSequence"),nn(h)?Zt(t,o,"whitespace")(h):o(h))}}const Ks={continuation:{tokenize:gge},exit:vge,name:"list",tokenize:pge},fge={partial:!0,tokenize:yge},mge={partial:!0,tokenize:xge};function pge(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 o;function o(x){const y=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:rk(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(x1,n,h)(x):h(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(x)}return n(x)}function c(x){return rk(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"),h(x)):n(x)}function h(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(up,r.interrupt?n:f,t.attempt(fge,g,m))}function f(x){return r.containerState.initialBlankLine=!0,i++,g(x)}function m(x){return nn(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 gge(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(up,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Zt(t,e,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!nn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(mge,e,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Zt(t,t.attempt(Ks,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function xge(t,e,n){const r=this;return Zt(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 vge(t){t.exit(this.containerState.type)}function yge(t,e,n){const r=this;return Zt(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!nn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const j_={name:"setextUnderline",resolveTo:bge,tokenize:wge};function bge(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 wge(t,e,n){const r=this;let s;return i;function i(h){let f=r.events.length,m;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){m=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(t.enter("setextHeadingLine"),s=h,a(h)):n(h)}function a(h){return t.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===s?(t.consume(h),o):(t.exit("setextHeadingLineSequence"),nn(h)?Zt(t,c,"lineSuffix")(h):c(h))}function c(h){return h===null||ht(h)?(t.exit("setextHeadingLine"),e(h)):n(h)}}const Sge={tokenize:kge};function kge(t){const e=this,n=t.attempt(up,r,t.attempt(this.parser.constructs.flowInitial,s,Zt(t,t.attempt(this.parser.constructs.flow,s,t.attempt(Tpe,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 jge={resolveAll:m$()},Oge=f$("string"),Nge=f$("text");function f$(t){return{resolveAll:m$(t==="text"?Cge:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,o);return a;function a(f){return h(f)?i(f):o(f)}function o(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),c}function c(f){return h(f)?(n.exit("data"),i(f)):(n.consume(f),c)}function h(f){if(f===null)return!0;const m=s[f];let g=-1;if(m)for(;++g-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function qge(t,e){let n=-1;const r=[];let s;for(;++n0){const Tt=Ge.tokenStack[Ge.tokenStack.length-1];(Tt[1]||N_).call(Ge,void 0,Tt[0])}for(Le.position={start:Jo(Ce.length>0?Ce[0][1].start:{line:1,column:1,offset:0}),end:Jo(Ce.length>0?Ce[Ce.length-2][1].end:{line:1,column:1,offset:0})},jt=-1;++jt1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,c);const h={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(e,h),t.applyData(e,h)}function rxe(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 sxe(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function x$(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 ixe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return x$(t,e);const s={src:Zh(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 axe(t,e){const n={src:Zh(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 lxe(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 oxe(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return x$(t,e);const s={href:Zh(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 cxe(t,e){const n={href:Zh(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 uxe(t,e,n){const r=t.all(e),s=n?dxe(n):v$(e),i={},a=[];if(typeof e.checked=="boolean"){const f=r[0];let m;f&&f.type==="element"&&f.tagName==="p"?m=f:(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 o=-1;for(;++o1}function hxe(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)},o=Cj(e.children[1]),c=KF(e.children[e.children.length-1]);o&&c&&(a.position={start:o,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 xxe(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,o=a?a.length:e.children.length;let c=-1;const h=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(e);return i.push(E_(e.slice(s),s>0,!1)),i.join("")}function E_(t,e,n){let r=0,s=t.length;if(e){let i=t.codePointAt(r);for(;i===C_||i===T_;)r++,i=t.codePointAt(r)}if(n){let i=t.codePointAt(s-1);for(;i===C_||i===T_;)s--,i=t.codePointAt(s-1)}return s>r?t.slice(r,s):""}function bxe(t,e){const n={type:"text",value:yxe(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function wxe(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Sxe={blockquote:Kge,break:Zge,code:Jge,delete:exe,emphasis:txe,footnoteReference:nxe,heading:rxe,html:sxe,imageReference:ixe,image:axe,inlineCode:lxe,linkReference:oxe,link:cxe,listItem:uxe,list:hxe,paragraph:fxe,root:mxe,strong:pxe,table:gxe,tableCell:vxe,tableRow:xxe,text:bxe,thematicBreak:wxe,toml:Ox,yaml:Ox,definition:Ox,footnoteDefinition:Ox};function Ox(){}const y$=-1,ky=0,Bm=1,lv=2,Dj=3,zj=4,Pj=5,Lj=6,b$=7,w$=8,__=typeof self=="object"?self:globalThis,kxe=(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 ky:case y$:return n(a,s);case Bm:{const o=n([],s);for(const c of a)o.push(r(c));return o}case lv:{const o=n({},s);for(const[c,h]of a)o[r(c)]=r(h);return o}case Dj:return n(new Date(a),s);case zj:{const{source:o,flags:c}=a;return n(new RegExp(o,c),s)}case Pj:{const o=n(new Map,s);for(const[c,h]of a)o.set(r(c),r(h));return o}case Lj:{const o=n(new Set,s);for(const c of a)o.add(r(c));return o}case b$:{const{name:o,message:c}=a;return n(new __[o](c),s)}case w$: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:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new __[i](a),s)};return r},M_=t=>kxe(new Map,t)(0),_d="",{toString:jxe}={},{keys:Oxe}=Object,lm=t=>{const e=typeof t;if(e!=="object"||!t)return[ky,e];const n=jxe.call(t).slice(8,-1);switch(n){case"Array":return[Bm,_d];case"Object":return[lv,_d];case"Date":return[Dj,_d];case"RegExp":return[zj,_d];case"Map":return[Pj,_d];case"Set":return[Lj,_d];case"DataView":return[Bm,n]}return n.includes("Array")?[Bm,n]:n.includes("Error")?[b$,n]:[lv,n]},Nx=([t,e])=>t===ky&&(e==="function"||e==="symbol"),Nxe=(t,e,n,r)=>{const s=(a,o)=>{const c=r.push(a)-1;return n.set(o,c),c},i=a=>{if(n.has(a))return n.get(a);let[o,c]=lm(a);switch(o){case ky:{let f=a;switch(c){case"bigint":o=w$,f=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);f=null;break;case"undefined":return s([y$],a)}return s([o,f],a)}case Bm:{if(c){let g=a;return c==="DataView"?g=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(a)),s([c,[...g]],a)}const f=[],m=s([o,f],a);for(const g of a)f.push(i(g));return m}case lv:{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 f=[],m=s([o,f],a);for(const g of Oxe(a))(t||!Nx(lm(a[g])))&&f.push([i(g),i(a[g])]);return m}case Dj:return s([o,a.toISOString()],a);case zj:{const{source:f,flags:m}=a;return s([o,{source:f,flags:m}],a)}case Pj:{const f=[],m=s([o,f],a);for(const[g,x]of a)(t||!(Nx(lm(g))||Nx(lm(x))))&&f.push([i(g),i(x)]);return m}case Lj:{const f=[],m=s([o,f],a);for(const g of a)(t||!Nx(lm(g)))&&f.push(i(g));return m}}const{message:h}=a;return s([o,{name:c,message:h}],a)};return i},A_=(t,{json:e,lossy:n}={})=>{const r=[];return Nxe(!(e||n),!!e,new Map,r)(t),r},ov=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?M_(A_(t,e)):structuredClone(t):(t,e)=>M_(A_(t,e));function Cxe(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 Txe(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Exe(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Cxe,r=t.options.footnoteBackLabel||Txe,s=t.options.footnoteLabel||"Footnotes",i=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c0&&y.push({type:"text",value:" "});let N=typeof n=="string"?n:n(c,x);typeof N=="string"&&(N={type:"text",value:N}),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(N)?N:[N]})}const S=f[f.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const N=S.children[S.children.length-1];N&&N.type==="text"?N.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...y)}else f.push(...y);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(f,!0)};t.patch(h,k),o.push(k)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ov(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:` -`}]}}const dp=(function(t){if(t==null)return Rxe;if(typeof t=="function")return jy(t);if(typeof t=="object")return Array.isArray(t)?_xe(t):Mxe(t);if(typeof t=="string")return Axe(t);throw new Error("Expected function, string, or object as test")});function _xe(t){const e=[];let n=-1;for(;++n":""))+")"})}return g;function g(){let x=S$,y,w,S;if((!e||i(c,h,f[f.length-1]||void 0))&&(x=Pxe(n(c,f)),x[0]===ik))return x;if("children"in c&&c.children){const k=c;if(k.children&&x[0]!==k$)for(w=(r?k.children.length:-1)+a,S=f.concat(k);w>-1&&w0&&n.push({type:"text",value:` -`}),n}function R_(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function D_(t,e){const n=Ixe(t,e),r=n.one(t,void 0),s=Exe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function Qxe(t,e){return t&&"run"in t?async function(n,r){const s=D_(n,{file:r,...e});await t.run(s,r)}:function(n,r){return D_(n,{file:r,...t||e})}}function z_(t){if(t)throw t}var d4,P_;function Hxe(){if(P_)return d4;P_=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):e.call(h)==="[object Array]"},i=function(h){if(!h||e.call(h)!=="[object Object]")return!1;var f=t.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&t.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!f&&!m)return!1;var g;for(g in h);return typeof g>"u"||t.call(h,g)},a=function(h,f){n&&f.name==="__proto__"?n(h,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):h[f.name]=f.newValue},o=function(h,f){if(f==="__proto__")if(t.call(h,f)){if(r)return r(h,f).value}else return;return h[f]};return d4=function c(){var h,f,m,g,x,y,w=arguments[0],S=1,k=arguments.length,N=!1;for(typeof w=="boolean"&&(N=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});Sa.length;let c;o&&a.push(s);try{c=t.apply(this,a)}catch(h){const f=h;if(o&&n)throw f;return s(f)}o||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...o){n||(n=!0,e(a,...o))}function i(a){s(null,a)}}const Xa={basename:Gxe,dirname:Xxe,extname:Yxe,join:Kxe,sep:"/"};function Gxe(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');hp(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,o=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(t.codePointAt(s)===e.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function Xxe(t){if(hp(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 Yxe(t){hp(t);let e=t.length,n=-1,r=0,s=-1,i=0,a;for(;e--;){const o=t.codePointAt(e);if(o===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),o===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 Kxe(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Jxe(t,e){let n="",r=0,s=-1,i=0,a=-1,o,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 o===46&&i>-1?i++:i=-1}return n}function hp(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const e1e={cwd:t1e};function t1e(){return"/"}function ok(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function n1e(t){if(typeof t=="string")t=new URL(t);else if(!ok(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 r1e(t)}function r1e(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]=f;const w=r[g][1];lk(w)&&lk(x)&&(x=h4(!0,w,x)),r[g]=[h,x,...y]}}}}const l1e=new qj().freeze();function g4(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function x4(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function v4(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 I_(t){if(!lk(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function B_(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Cx(t){return o1e(t)?t:new j$(t)}function o1e(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function c1e(t){return typeof t=="string"||u1e(t)}function u1e(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const d1e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",q_=[],F_={allowDangerousHtml:!0},h1e=/^(https?|ircs?|mailto|xmpp)$/i,f1e=[{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 m1e(t){const e=p1e(t),n=g1e(t);return x1e(e.runSync(e.parse(n),n),t)}function p1e(t){const e=t.rehypePlugins||q_,n=t.remarkPlugins||q_,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...F_}:F_;return l1e().use(Yge).use(n).use(Qxe,r).use(e)}function g1e(t){const e=t.children||"",n=new j$;return typeof e=="string"&&(n.value=e),n}function x1e(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,c=e.urlTransform||v1e;for(const f of f1e)Object.hasOwn(e,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+d1e+f.id,void 0);return Bj(t,h),R0e(t,{Fragment:l.Fragment,components:s,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function h(f,m,g){if(f.type==="raw"&&g&&typeof m=="number")return a?g.children.splice(m,1):g.children[m]={type:"text",value:f.value},m;if(f.type==="element"){let x;for(x in o4)if(Object.hasOwn(o4,x)&&Object.hasOwn(f.properties,x)){const y=f.properties[x],w=o4[x];(w===null||w.includes(f.tagName))&&(f.properties[x]=c(String(y||""),x,f))}}if(f.type==="element"){let x=n?!n.includes(f.tagName):i?i.includes(f.tagName):!1;if(!x&&r&&typeof m=="number"&&(x=!r(f,m,g)),x&&g&&typeof m=="number")return o&&f.children?g.children.splice(m,1,...f.children):g.children.splice(m,1),m}}}function v1e(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||h1e.test(t.slice(0,e))?t:""}function $_(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 y1e(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function b1e(t,e,n){const s=dp((n||{}).ignore||[]),i=w1e(e);let a=-1;for(;++a0?{type:"text",value:E}:void 0),E===!1?g.lastIndex=T+1:(y!==T&&N.push({type:"text",value:h.value.slice(y,T)}),Array.isArray(E)?N.push(...E):E&&N.push(E),y=T+C[0].length,k=!0),!g.global)break;C=g.exec(h.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=$_(t,"(");let i=$_(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 O$(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||Iu(n)||wy(n))&&(!e||n!==47)}N$.peek=H1e;function P1e(){this.buffer()}function L1e(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function I1e(){this.buffer()}function B1e(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function q1e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ta(this.sliceSerialize(t)).toLowerCase(),n.label=e}function F1e(t){this.exit(t)}function $1e(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ta(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Q1e(t){this.exit(t)}function H1e(){return"["}function N$(t,e,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return i+=s.move(n.safe(n.associationId(t),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function V1e(){return{enter:{gfmFootnoteCallString:P1e,gfmFootnoteCall:L1e,gfmFootnoteDefinitionLabelString:I1e,gfmFootnoteDefinition:B1e},exit:{gfmFootnoteCallString:q1e,gfmFootnoteCall:F1e,gfmFootnoteDefinitionLabelString:$1e,gfmFootnoteDefinition:Q1e}}}function U1e(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:N$},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const o=i.createTracker(a);let c=o.move("[^");const h=i.enter("footnoteDefinition"),f=i.enter("label");return c+=o.move(i.safe(i.associationId(r),{before:c,after:"]"})),f(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((e?` -`:" ")+i.indentLines(i.containerFlow(r,o.current()),e?C$:W1e))),h(),c}}function W1e(t,e,n){return e===0?t:C$(t,e,n)}function C$(t,e,n){return(n?"":" ")+t}const G1e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];T$.peek=J1e;function X1e(){return{canContainEols:["delete"],enter:{strikethrough:K1e},exit:{strikethrough:Z1e}}}function Y1e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:G1e}],handlers:{delete:T$}}}function K1e(t){this.enter({type:"delete",children:[]},t)}function Z1e(t){this.exit(t)}function T$(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 J1e(){return"~"}function eve(t){return t.length}function tve(t,e){const n=e||{},r=(n.align||[]).concat(),s=n.stringLength||eve,i=[],a=[],o=[],c=[];let h=0,f=-1;for(;++fh&&(h=t[f].length);++kc[k])&&(c[k]=C)}w.push(N)}a[f]=w,o[f]=S}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mc[m]&&(c[m]=N),x[m]=N),g[m]=C}a.splice(1,0,g),o.splice(1,0,x),f=-1;const y=[];for(;++f "),i.shift(2);const a=n.indentLines(n.containerFlow(t,i.current()),sve);return s(),a}function sve(t,e,n){return">"+(n?"":" ")+t}function ive(t,e){return H_(t,e.inConstruct,!0)&&!H_(t,e.notInConstruct,!1)}function H_(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 ave(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 lve(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 ove(t,e,n,r){const s=lve(n),i=t.value||"",a=s==="`"?"GraveAccent":"Tilde";if(ave(t,n)){const m=n.enter("codeIndented"),g=n.indentLines(i,cve);return m(),g}const o=n.createTracker(r),c=s.repeat(Math.max(E$(i,s)+1,3)),h=n.enter("codeFenced");let f=o.move(c);if(t.lang){const m=n.enter(`codeFencedLang${a}`);f+=o.move(n.safe(t.lang,{before:f,after:" ",encode:["`"],...o.current()})),m()}if(t.lang&&t.meta){const m=n.enter(`codeFencedMeta${a}`);f+=o.move(" "),f+=o.move(n.safe(t.meta,{before:f,after:` -`,encode:["`"],...o.current()})),m()}return f+=o.move(` -`),i&&(f+=o.move(i+` -`)),f+=o.move(c),h(),f}function cve(t,e,n){return(n?"":" ")+t}function Fj(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 uve(t,e,n,r){const s=Fj(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let h=c.move("[");return h+=c.move(n.safe(n.associationId(t),{before:h,after:"]",...c.current()})),h+=c.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(t.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=n.enter("destinationRaw"),h+=c.move(n.safe(t.url,{before:h,after:t.title?" ":` -`,...c.current()}))),o(),t.title&&(o=n.enter(`title${i}`),h+=c.move(" "+s),h+=c.move(n.safe(t.title,{before:h,after:s,...c.current()})),h+=c.move(s),o()),a(),h}function dve(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 w0(t){return"&#x"+t.toString(16).toUpperCase()+";"}function cv(t,e,n){const r=Ch(t),s=Ch(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}}_$.peek=hve;function _$(t,e,n,r){const s=dve(n),i=n.enter("emphasis"),a=n.createTracker(r),o=a.move(s);let c=a.move(n.containerPhrasing(t,{after:s,before:o,...a.current()}));const h=c.charCodeAt(0),f=cv(r.before.charCodeAt(r.before.length-1),h,s);f.inside&&(c=w0(h)+c.slice(1));const m=c.charCodeAt(c.length-1),g=cv(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+w0(m));const x=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:f.outside},o+c+x}function hve(t,e,n){return n.options.emphasis||"*"}function fve(t,e){let n=!1;return Bj(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ik}),!!((!t.depth||t.depth<3)&&Mj(t)&&(e.options.setext||n))}function mve(t,e,n,r){const s=Math.max(Math.min(6,t.depth||1),1),i=n.createTracker(r);if(fve(t,n)){const f=n.enter("headingSetext"),m=n.enter("phrasing"),g=n.containerPhrasing(t,{...i.current(),before:` -`,after:` -`});return m(),f(),g+` -`+(s===1?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf(` -`))+1))}const a="#".repeat(s),o=n.enter("headingAtx"),c=n.enter("phrasing");i.move(a+" ");let h=n.containerPhrasing(t,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(h)&&(h=w0(h.charCodeAt(0))+h.slice(1)),h=h?a+" "+h:a,n.options.closeAtx&&(h+=" "+a),c(),o(),h}M$.peek=pve;function M$(t){return t.value||""}function pve(){return"<"}A$.peek=gve;function A$(t,e,n,r){const s=Fj(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let h=c.move("![");return h+=c.move(n.safe(t.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(t.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=n.enter("destinationRaw"),h+=c.move(n.safe(t.url,{before:h,after:t.title?" ":")",...c.current()}))),o(),t.title&&(o=n.enter(`title${i}`),h+=c.move(" "+s),h+=c.move(n.safe(t.title,{before:h,after:s,...c.current()})),h+=c.move(s),o()),h+=c.move(")"),a(),h}function gve(){return"!"}R$.peek=xve;function R$(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const h=n.safe(t.alt,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...o.current()});return a(),n.stack=f,i(),s==="full"||!h||h!==m?c+=o.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function xve(){return"!"}D$.peek=vve;function D$(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))}P$.peek=yve;function P$(t,e,n,r){const s=Fj(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,c;if(z$(t,n)){const f=n.stack;n.stack=[],o=n.enter("autolink");let m=a.move("<");return m+=a.move(n.containerPhrasing(t,{before:m,after:">",...a.current()})),m+=a.move(">"),o(),n.stack=f,m}o=n.enter("link"),c=n.enter("label");let h=a.move("[");return h+=a.move(n.containerPhrasing(t,{before:h,after:"](",...a.current()})),h+=a.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=n.enter("destinationLiteral"),h+=a.move("<"),h+=a.move(n.safe(t.url,{before:h,after:">",...a.current()})),h+=a.move(">")):(c=n.enter("destinationRaw"),h+=a.move(n.safe(t.url,{before:h,after:t.title?" ":")",...a.current()}))),c(),t.title&&(c=n.enter(`title${i}`),h+=a.move(" "+s),h+=a.move(n.safe(t.title,{before:h,after:s,...a.current()})),h+=a.move(s),c()),h+=a.move(")"),o(),h}function yve(t,e,n){return z$(t,n)?"<":"["}L$.peek=bve;function L$(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const h=n.containerPhrasing(t,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),a();const f=n.stack;n.stack=[],a=n.enter("reference");const m=n.safe(n.associationId(t),{before:c,after:"]",...o.current()});return a(),n.stack=f,i(),s==="full"||!h||h!==m?c+=o.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function bve(){return"["}function $j(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 wve(t){const e=$j(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 Sve(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 I$(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 kve(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?Sve(n):$j(n);const o=t.ordered?a==="."?")":".":wve(n);let c=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const f=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&f&&(!f.children||!f.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),I$(n)===a&&f){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 o=n.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const c=n.enter("listItem"),h=n.indentLines(n.containerFlow(t,o.current()),f);return c(),h;function f(m,g,x){return g?(x?"":" ".repeat(a))+m:(x?i:i+" ".repeat(a-i.length))+m}}function Nve(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const Cve=dp(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Tve(t,e,n,r){return(t.children.some(function(a){return Cve(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function Eve(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}B$.peek=_ve;function B$(t,e,n,r){const s=Eve(n),i=n.enter("strong"),a=n.createTracker(r),o=a.move(s+s);let c=a.move(n.containerPhrasing(t,{after:s,before:o,...a.current()}));const h=c.charCodeAt(0),f=cv(r.before.charCodeAt(r.before.length-1),h,s);f.inside&&(c=w0(h)+c.slice(1));const m=c.charCodeAt(c.length-1),g=cv(r.after.charCodeAt(0),m,s);g.inside&&(c=c.slice(0,-1)+w0(m));const x=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:g.outside,before:f.outside},o+c+x}function _ve(t,e,n){return n.options.strong||"*"}function Mve(t,e,n,r){return n.safe(t.value,r)}function Ave(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 Rve(t,e,n){const r=(I$(n)+(n.options.ruleSpaces?" ":"")).repeat(Ave(n));return n.options.ruleSpaces?r.slice(0,-1):r}const q$={blockquote:rve,break:V_,code:ove,definition:uve,emphasis:_$,hardBreak:V_,heading:mve,html:M$,image:A$,imageReference:R$,inlineCode:D$,link:P$,linkReference:L$,list:kve,listItem:Ove,paragraph:Nve,root:Tve,strong:B$,text:Mve,thematicBreak:Rve};function Dve(){return{enter:{table:zve,tableData:U_,tableHeader:U_,tableRow:Lve},exit:{codeText:Ive,table:Pve,tableData:S4,tableHeader:S4,tableRow:S4}}}function zve(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 Pve(t){this.exit(t),this.data.inTable=void 0}function Lve(t){this.enter({type:"tableRow",children:[]},t)}function S4(t){this.exit(t)}function U_(t){this.enter({type:"tableCell",children:[]},t)}function Ive(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Bve));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function Bve(t,e){return e==="|"?e:t}function qve(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:o}};function a(x,y,w,S){return h(f(x,w,S),x.align)}function o(x,y,w,S){const k=m(x,w,S),N=h([k]);return N.slice(0,N.indexOf(` -`))}function c(x,y,w,S){const k=w.enter("tableCell"),N=w.enter("phrasing"),C=w.containerPhrasing(x,{...S,before:i,after:i});return N(),k(),C}function h(x,y){return tve(x,{align:y,alignDelimiters:r,padding:n,stringLength:s})}function f(x,y,w){const S=x.children;let k=-1;const N=[],C=y.enter("table");for(;++k0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const sye={tokenize:hye,partial:!0};function iye(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cye,continuation:{tokenize:uye},exit:dye}},text:{91:{name:"gfmFootnoteCall",tokenize:oye},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aye,resolveTo:lye}}}}function aye(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 o;function o(c){if(!a||!a._balanced)return n(c);const h=Ta(r.sliceSerialize({start:a.end,end:r.now()}));return h.codePointAt(0)!==94||!i.includes(h.slice(1))?n(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),e(c))}}function lye(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)},o=[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,...o),t}function oye(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(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",h)}function h(m){if(i>999||m===93&&!a||m===null||m===91||Yn(m))return n(m);if(m===93){t.exit("chunkString");const g=t.exit("gfmFootnoteCallString");return s.includes(Ta(r.sliceSerialize(g)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(m),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(m)}return Yn(m)||(a=!0),i++,t.consume(m),m===92?f:h}function f(m){return m===91||m===92||m===93?(t.consume(m),i++,h):h(m)}}function cye(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return c;function c(y){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(y){return y===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",f):n(y)}function f(y){if(a>999||y===93&&!o||y===null||y===91||Yn(y))return n(y);if(y===93){t.exit("chunkString");const w=t.exit("gfmFootnoteDefinitionLabelString");return i=Ta(r.sliceSerialize(w)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(y),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),g}return Yn(y)||(o=!0),a++,t.consume(y),y===92?m:f}function m(y){return y===91||y===92||y===93?(t.consume(y),a++,f):f(y)}function g(y){return y===58?(t.enter("definitionMarker"),t.consume(y),t.exit("definitionMarker"),s.includes(i)||s.push(i),Zt(t,x,"gfmFootnoteDefinitionWhitespace")):n(y)}function x(y){return e(y)}}function uye(t,e,n){return t.check(up,e,t.attempt(sye,e,n))}function dye(t){t.exit("gfmFootnoteDefinition")}function hye(t,e,n){const r=this;return Zt(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 fye(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,o){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=Ch(y);return S._open=!k||k===2&&!!w,S._close=!w||w===2&&!!k,o(y)}}}class mye{constructor(){this.map=[]}add(e,n,r){pye(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 pye(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const z=r.events[Q][1].type;if(z==="lineEnding"||z==="linePrefix")Q--;else break}const U=Q>-1?r.events[Q][1].type:null,ee=U==="tableHead"||U==="tableRow"?E:c;return ee===E&&r.parser.lazy[r.now().line]?n(I):ee(I)}function c(I){return t.enter("tableHead"),t.enter("tableRow"),h(I)}function h(I){return I===124||(a=!0,i+=1),f(I)}function f(I){return I===null?n(I):ht(I)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),x):n(I):nn(I)?Zt(t,f,"whitespace")(I):(i+=1,a&&(a=!1,s+=1),I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),a=!0,f):(t.enter("data"),m(I)))}function m(I){return I===null||I===124||Yn(I)?(t.exit("data"),f(I)):(t.consume(I),I===92?g:m)}function g(I){return I===92||I===124?(t.consume(I),m):m(I)}function x(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(t.enter("tableDelimiterRow"),a=!1,nn(I)?Zt(t,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):y(I))}function y(I){return I===45||I===58?S(I):I===124?(a=!0,t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),w):_(I)}function w(I){return nn(I)?Zt(t,S,"whitespace")(I):S(I)}function S(I){return I===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),k):I===45?(i+=1,k(I)):I===null||ht(I)?T(I):_(I)}function k(I){return I===45?(t.enter("tableDelimiterFiller"),N(I)):_(I)}function N(I){return I===45?(t.consume(I),N):I===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(I),t.exit("tableDelimiterMarker"),C):(t.exit("tableDelimiterFiller"),C(I))}function C(I){return nn(I)?Zt(t,T,"whitespace")(I):T(I)}function T(I){return I===124?y(I):I===null||ht(I)?!a||s!==i?_(I):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(I)):_(I)}function _(I){return n(I)}function E(I){return t.enter("tableRow"),M(I)}function M(I){return I===124?(t.enter("tableCellDivider"),t.consume(I),t.exit("tableCellDivider"),M):I===null||ht(I)?(t.exit("tableRow"),e(I)):nn(I)?Zt(t,M,"whitespace")(I):(t.enter("data"),L(I))}function L(I){return I===null||I===124||Yn(I)?(t.exit("data"),M(I)):(t.consume(I),I===92?P:L)}function P(I){return I===92||I===124?(t.consume(I),L):L(I)}}function yye(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,h,f,m;const g=new mye;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({},Vd(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function G_(t,e,n,r,s){const i=[],a=Vd(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 Vd(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const bye={name:"tasklistCheck",tokenize:Sye};function wye(){return{text:{91:bye}}}function Sye(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 Yn(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"),o):n(c)}function o(c){return ht(c)?e(c):nn(c)?t.check({tokenize:kye},e,n)(c):n(c)}}function kye(t,e,n){return Zt(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function jye(t){return s$([Xve(),iye(),fye(t),xye(),wye()])}const Oye={};function Nye(t){const e=this,n=t||Oye,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(jye(n)),i.push(Vve()),a.push(Uve(n))}function Cye(){return{enter:{mathFlow:t,mathFlowFenceMeta:e,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:o,mathText:a,mathTextData:o}};function t(c){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},c)}function e(){this.buffer()}function n(){const c=this.resume(),h=this.stack[this.stack.length-1];h.type,h.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),f=this.stack[this.stack.length-1];f.type,this.exit(c),f.value=h;const m=f.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:h}),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 h=this.resume(),f=this.stack[this.stack.length-1];f.type,this.exit(c),f.value=h,f.data.hChildren.push({type:"text",value:h})}function o(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function Tye(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,o,c){const h=i.value||"",f=o.createTracker(c),m="$".repeat(Math.max(E$(h,"$")+1,2)),g=o.enter("mathFlow");let x=f.move(m);if(i.meta){const y=o.enter("mathFlowMeta");x+=f.move(o.safe(i.meta,{after:` -`,before:x,encode:["$"],...f.current()})),y()}return x+=f.move(` -`),h&&(x+=f.move(h+` -`)),x+=f.move(m),g(),x}function r(i,a,o){let c=i.value||"",h=1;for(e||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(c);)h++;const f="$".repeat(h);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let m=-1;for(;++m15?h="…"+o.slice(s-15,s):h=o.slice(0,s);var f;i+15":">","<":"<",'"':""","'":"'"},qye=/[&><"']/g;function Fye(t){return String(t).replace(qye,e=>Bye[e])}var X$=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},$ye=function(e){var n=X$(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},Qye=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Hye=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"},Mn={deflt:Pye,escape:Fye,hyphenate:Iye,getBaseElem:X$,isCharacterBox:$ye,protocolFromUrl:Hye},v1={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 Vye(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 Hj{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 v1)if(v1.hasOwnProperty(n)){var r=v1[n];this[n]=e[n]!==void 0?r.processor?r.processor(e[n]):e[n]:Vye(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=Mn.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 ec{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 Ka[Uye[this.id]]}sub(){return Ka[Wye[this.id]]}fracNum(){return Ka[Gye[this.id]]}fracDen(){return Ka[Xye[this.id]]}cramp(){return Ka[Yye[this.id]]}text(){return Ka[Kye[this.id]]}isTight(){return this.size>=2}}var Vj=0,uv=1,uh=2,co=3,S0=4,ta=5,Th=6,Ps=7,Ka=[new ec(Vj,0,!1),new ec(uv,0,!0),new ec(uh,1,!1),new ec(co,1,!0),new ec(S0,2,!1),new ec(ta,2,!0),new ec(Th,3,!1),new ec(Ps,3,!0)],Uye=[S0,ta,S0,ta,Th,Ps,Th,Ps],Wye=[ta,ta,ta,ta,Ps,Ps,Ps,Ps],Gye=[uh,co,S0,ta,Th,Ps,Th,Ps],Xye=[co,co,ta,ta,Ps,Ps,Ps,Ps],Yye=[uv,uv,co,co,ta,ta,Ps,Ps],Kye=[Vj,uv,uh,co,uh,co,uh,co],St={DISPLAY:Ka[Vj],TEXT:Ka[uh],SCRIPT:Ka[S0],SCRIPTSCRIPT:Ka[Th]},uk=[{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 Zye(t){for(var e=0;e=s[0]&&t<=s[1])return n.name}return null}var y1=[];uk.forEach(t=>t.blocks.forEach(e=>y1.push(...e)));function Y$(t){for(var e=0;e=y1[e]&&t<=y1[e+1])return!0;return!1}var Md=80,Jye=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 -s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 -c69,-144,104.5,-217.7,106.5,-221 -l`+e/2.075+" -"+e+` -c5.3,-9.3,12,-14,20,-14 -H400000v`+(40+e)+`H845.2724 -s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 -c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},ebe=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+` -c4.7,-7.3,11,-11,19,-11 -H40000v`+(40+e)+`H1012.3 -s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 -c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 -s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 -c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},tbe=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 -s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 -c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 -c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 -c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 -c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},nbe=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 -s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 -l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 -v`+(40+e)+`H1014.6 -s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 -c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+` -h400000v`+(40+e)+"h-400000z"},rbe=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"},sbe=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},ibe=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"},abe=function(e,n,r){n=1e3*n;var s="";switch(e){case"sqrtMain":s=Jye(n,Md);break;case"sqrtSize1":s=ebe(n,Md);break;case"sqrtSize2":s=tbe(n,Md);break;case"sqrtSize3":s=nbe(n,Md);break;case"sqrtSize4":s=rbe(n,Md);break;case"sqrtTall":s=ibe(n,Md,r)}return s},lbe=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""}},Y_={doubleleftarrow:`M262 157 -l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 - 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 - 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 -c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 - 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 --86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 --2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z -m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l --10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 - 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 --33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 --17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 --13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 -c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 --107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 - 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 --5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 -c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 - 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 - 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 - l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 --45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 - 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 - 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 - 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 --331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 -H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 - 435 0h399565z`,leftgroupunder:`M400000 262 -H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 - 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 --3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 --18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 --196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 - 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 --4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 --10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z -m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 - 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 - 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 --152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 - 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 --2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 -v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 --83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 --68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z -M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z -M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 --.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 -c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z -M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 -c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 --53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 - 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 - 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 -c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 - 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 - 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 --5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 --320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z -m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 -60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 --451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z -m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 -c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 --480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z -m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 -85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 --707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z -m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 -c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 --16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 - 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 - 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 --40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 - 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l --6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 -s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 -c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 - 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 --174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 - 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 - 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 --3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 --10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 - 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 --18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 - 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z -m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 - 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 --7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 --27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 - 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 - 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 --64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z -m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 - 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 --13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z -M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 - 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 --52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 --167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 - 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 --70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 --40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 --37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 - 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 -c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 - 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 - 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 --19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 - 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 --2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 - 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 - 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 --68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 --8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 - 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 -c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 - 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 --11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 - 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 - 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 - -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 --11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 - 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 - 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 - -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 -3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 -10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 --1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 --7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 -H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 -c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 -c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, --5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 -c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 -c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 -s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 -121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 -s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 -c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z -M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 --27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 -13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 --84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 --119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 -151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 -c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 -c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 -c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z -M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, -1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, --152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z -M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},obe=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 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":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 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z -M367 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 -c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z -MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z -M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z -M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 -c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, --36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, -949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 -c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, --544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 -l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, --210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, -63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 -c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+` -c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 -c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 -c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 -c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 -l0,-`+(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 fp{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 il={"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]}},Ex={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]},K_={Å:"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 cbe(t,e){il[t]=e}function Uj(t,e,n){if(!il[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),s=il[e][r];if(!s&&t[0]in K_&&(r=K_[t[0]].charCodeAt(0),s=il[e][r]),!s&&n==="text"&&Y$(r)&&(s=il[e][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var k4={};function ube(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!k4[e]){var n=k4[e]={cssEmPerMu:Ex.quad[e]/18};for(var r in Ex)Ex.hasOwnProperty(r)&&(n[r]=Ex[r][e])}return k4[e]}var dbe=[[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]],Z_=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],J_=function(e,n){return n.size<2?e:dbe[e-1][n.size-1]};class to{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||to.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=Z_[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 to(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:J_(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:Z_[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=J_(to.BASESIZE,e);return this.size===n&&this.textSize===to.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!==to.BASESIZE?["sizing","reset-size"+this.size,"size"+to.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=ube(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}to.BASESIZE=6;var dk={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},hbe={ex:!0,em:!0,mu:!0},K$=function(e){return typeof e!="string"&&(e=e.unit),e in dk||e in hbe||e==="ex"},gr=function(e,n){var r;if(e.unit in dk)r=dk[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)},We=function(e){return+e.toFixed(4)+"em"},Oc=function(e){return e.filter(n=>n).join(" ")},Z$=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)}},J$=function(e){var n=document.createElement(e);n.className=Oc(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]/,eQ=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+Mn.escape(Oc(this.classes))+'"');var r="";for(var s in this.style)this.style.hasOwnProperty(s)&&(r+=Mn.hyphenate(s)+":"+this.style[s]+";");r&&(n+=' style="'+Mn.escape(r)+'"');for(var i in this.attributes)if(this.attributes.hasOwnProperty(i)){if(fbe.test(i))throw new $e("Invalid attribute name '"+i+"'");n+=" "+i+'="'+Mn.escape(this.attributes[i])+'"'}n+=">";for(var a=0;a",n};class mp{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,Z$.call(this,e,r,s),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return J$.call(this,"span")}toMarkup(){return eQ.call(this,"span")}}class Wj{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,Z$.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 J$.call(this,"a")}toMarkup(){return eQ.call(this,"a")}}class mbe{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=''+Mn.escape(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=We(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Oc(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+=Mn.hyphenate(s)+":"+this.style[s]+";");r&&(e=!0,n+=' style="'+Mn.escape(r)+'"');var i=Mn.escape(this.text);return e?(n+=">",n+=i,n+="",n):i}}class go{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 hk{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 xbe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},vbe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Jn={math:{},text:{}};function A(t,e,n,r,s,i){Jn[t][s]={font:e,group:n,replace:r},i&&r&&(Jn[t][r]=Jn[t][s])}var D="math",Ie="text",$="main",le="ams",ur="accent-token",st="bin",$s="close",Jh="inner",wt="mathord",Ur="op-token",Pi="open",Oy="punct",oe="rel",jo="spacing",me="textord";A(D,$,oe,"≡","\\equiv",!0);A(D,$,oe,"≺","\\prec",!0);A(D,$,oe,"≻","\\succ",!0);A(D,$,oe,"∼","\\sim",!0);A(D,$,oe,"⊥","\\perp");A(D,$,oe,"⪯","\\preceq",!0);A(D,$,oe,"⪰","\\succeq",!0);A(D,$,oe,"≃","\\simeq",!0);A(D,$,oe,"∣","\\mid",!0);A(D,$,oe,"≪","\\ll",!0);A(D,$,oe,"≫","\\gg",!0);A(D,$,oe,"≍","\\asymp",!0);A(D,$,oe,"∥","\\parallel");A(D,$,oe,"⋈","\\bowtie",!0);A(D,$,oe,"⌣","\\smile",!0);A(D,$,oe,"⊑","\\sqsubseteq",!0);A(D,$,oe,"⊒","\\sqsupseteq",!0);A(D,$,oe,"≐","\\doteq",!0);A(D,$,oe,"⌢","\\frown",!0);A(D,$,oe,"∋","\\ni",!0);A(D,$,oe,"∝","\\propto",!0);A(D,$,oe,"⊢","\\vdash",!0);A(D,$,oe,"⊣","\\dashv",!0);A(D,$,oe,"∋","\\owns");A(D,$,Oy,".","\\ldotp");A(D,$,Oy,"⋅","\\cdotp");A(D,$,me,"#","\\#");A(Ie,$,me,"#","\\#");A(D,$,me,"&","\\&");A(Ie,$,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(Ie,$,me,"§","\\S");A(D,$,me,"¶","\\P",!0);A(Ie,$,me,"¶","\\P");A(D,$,me,"†","\\dag");A(Ie,$,me,"†","\\dag");A(Ie,$,me,"†","\\textdagger");A(D,$,me,"‡","\\ddag");A(Ie,$,me,"‡","\\ddag");A(Ie,$,me,"‡","\\textdaggerdbl");A(D,$,$s,"⎱","\\rmoustache",!0);A(D,$,Pi,"⎰","\\lmoustache",!0);A(D,$,$s,"⟯","\\rgroup",!0);A(D,$,Pi,"⟮","\\lgroup",!0);A(D,$,st,"∓","\\mp",!0);A(D,$,st,"⊖","\\ominus",!0);A(D,$,st,"⊎","\\uplus",!0);A(D,$,st,"⊓","\\sqcap",!0);A(D,$,st,"∗","\\ast");A(D,$,st,"⊔","\\sqcup",!0);A(D,$,st,"◯","\\bigcirc",!0);A(D,$,st,"∙","\\bullet",!0);A(D,$,st,"‡","\\ddagger");A(D,$,st,"≀","\\wr",!0);A(D,$,st,"⨿","\\amalg");A(D,$,st,"&","\\And");A(D,$,oe,"⟵","\\longleftarrow",!0);A(D,$,oe,"⇐","\\Leftarrow",!0);A(D,$,oe,"⟸","\\Longleftarrow",!0);A(D,$,oe,"⟶","\\longrightarrow",!0);A(D,$,oe,"⇒","\\Rightarrow",!0);A(D,$,oe,"⟹","\\Longrightarrow",!0);A(D,$,oe,"↔","\\leftrightarrow",!0);A(D,$,oe,"⟷","\\longleftrightarrow",!0);A(D,$,oe,"⇔","\\Leftrightarrow",!0);A(D,$,oe,"⟺","\\Longleftrightarrow",!0);A(D,$,oe,"↦","\\mapsto",!0);A(D,$,oe,"⟼","\\longmapsto",!0);A(D,$,oe,"↗","\\nearrow",!0);A(D,$,oe,"↩","\\hookleftarrow",!0);A(D,$,oe,"↪","\\hookrightarrow",!0);A(D,$,oe,"↘","\\searrow",!0);A(D,$,oe,"↼","\\leftharpoonup",!0);A(D,$,oe,"⇀","\\rightharpoonup",!0);A(D,$,oe,"↙","\\swarrow",!0);A(D,$,oe,"↽","\\leftharpoondown",!0);A(D,$,oe,"⇁","\\rightharpoondown",!0);A(D,$,oe,"↖","\\nwarrow",!0);A(D,$,oe,"⇌","\\rightleftharpoons",!0);A(D,le,oe,"≮","\\nless",!0);A(D,le,oe,"","\\@nleqslant");A(D,le,oe,"","\\@nleqq");A(D,le,oe,"⪇","\\lneq",!0);A(D,le,oe,"≨","\\lneqq",!0);A(D,le,oe,"","\\@lvertneqq");A(D,le,oe,"⋦","\\lnsim",!0);A(D,le,oe,"⪉","\\lnapprox",!0);A(D,le,oe,"⊀","\\nprec",!0);A(D,le,oe,"⋠","\\npreceq",!0);A(D,le,oe,"⋨","\\precnsim",!0);A(D,le,oe,"⪹","\\precnapprox",!0);A(D,le,oe,"≁","\\nsim",!0);A(D,le,oe,"","\\@nshortmid");A(D,le,oe,"∤","\\nmid",!0);A(D,le,oe,"⊬","\\nvdash",!0);A(D,le,oe,"⊭","\\nvDash",!0);A(D,le,oe,"⋪","\\ntriangleleft");A(D,le,oe,"⋬","\\ntrianglelefteq",!0);A(D,le,oe,"⊊","\\subsetneq",!0);A(D,le,oe,"","\\@varsubsetneq");A(D,le,oe,"⫋","\\subsetneqq",!0);A(D,le,oe,"","\\@varsubsetneqq");A(D,le,oe,"≯","\\ngtr",!0);A(D,le,oe,"","\\@ngeqslant");A(D,le,oe,"","\\@ngeqq");A(D,le,oe,"⪈","\\gneq",!0);A(D,le,oe,"≩","\\gneqq",!0);A(D,le,oe,"","\\@gvertneqq");A(D,le,oe,"⋧","\\gnsim",!0);A(D,le,oe,"⪊","\\gnapprox",!0);A(D,le,oe,"⊁","\\nsucc",!0);A(D,le,oe,"⋡","\\nsucceq",!0);A(D,le,oe,"⋩","\\succnsim",!0);A(D,le,oe,"⪺","\\succnapprox",!0);A(D,le,oe,"≆","\\ncong",!0);A(D,le,oe,"","\\@nshortparallel");A(D,le,oe,"∦","\\nparallel",!0);A(D,le,oe,"⊯","\\nVDash",!0);A(D,le,oe,"⋫","\\ntriangleright");A(D,le,oe,"⋭","\\ntrianglerighteq",!0);A(D,le,oe,"","\\@nsupseteqq");A(D,le,oe,"⊋","\\supsetneq",!0);A(D,le,oe,"","\\@varsupsetneq");A(D,le,oe,"⫌","\\supsetneqq",!0);A(D,le,oe,"","\\@varsupsetneqq");A(D,le,oe,"⊮","\\nVdash",!0);A(D,le,oe,"⪵","\\precneqq",!0);A(D,le,oe,"⪶","\\succneqq",!0);A(D,le,oe,"","\\@nsubseteqq");A(D,le,st,"⊴","\\unlhd");A(D,le,st,"⊵","\\unrhd");A(D,le,oe,"↚","\\nleftarrow",!0);A(D,le,oe,"↛","\\nrightarrow",!0);A(D,le,oe,"⇍","\\nLeftarrow",!0);A(D,le,oe,"⇏","\\nRightarrow",!0);A(D,le,oe,"↮","\\nleftrightarrow",!0);A(D,le,oe,"⇎","\\nLeftrightarrow",!0);A(D,le,oe,"△","\\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(Ie,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(Ie,$,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(Ie,le,me,"¥","\\yen",!0);A(D,le,me,"✓","\\checkmark",!0);A(Ie,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,Pi,"┌","\\@ulcorner",!0);A(D,le,$s,"┐","\\@urcorner",!0);A(D,le,Pi,"└","\\@llcorner",!0);A(D,le,$s,"┘","\\@lrcorner",!0);A(D,le,oe,"≦","\\leqq",!0);A(D,le,oe,"⩽","\\leqslant",!0);A(D,le,oe,"⪕","\\eqslantless",!0);A(D,le,oe,"≲","\\lesssim",!0);A(D,le,oe,"⪅","\\lessapprox",!0);A(D,le,oe,"≊","\\approxeq",!0);A(D,le,st,"⋖","\\lessdot");A(D,le,oe,"⋘","\\lll",!0);A(D,le,oe,"≶","\\lessgtr",!0);A(D,le,oe,"⋚","\\lesseqgtr",!0);A(D,le,oe,"⪋","\\lesseqqgtr",!0);A(D,le,oe,"≑","\\doteqdot");A(D,le,oe,"≓","\\risingdotseq",!0);A(D,le,oe,"≒","\\fallingdotseq",!0);A(D,le,oe,"∽","\\backsim",!0);A(D,le,oe,"⋍","\\backsimeq",!0);A(D,le,oe,"⫅","\\subseteqq",!0);A(D,le,oe,"⋐","\\Subset",!0);A(D,le,oe,"⊏","\\sqsubset",!0);A(D,le,oe,"≼","\\preccurlyeq",!0);A(D,le,oe,"⋞","\\curlyeqprec",!0);A(D,le,oe,"≾","\\precsim",!0);A(D,le,oe,"⪷","\\precapprox",!0);A(D,le,oe,"⊲","\\vartriangleleft");A(D,le,oe,"⊴","\\trianglelefteq");A(D,le,oe,"⊨","\\vDash",!0);A(D,le,oe,"⊪","\\Vvdash",!0);A(D,le,oe,"⌣","\\smallsmile");A(D,le,oe,"⌢","\\smallfrown");A(D,le,oe,"≏","\\bumpeq",!0);A(D,le,oe,"≎","\\Bumpeq",!0);A(D,le,oe,"≧","\\geqq",!0);A(D,le,oe,"⩾","\\geqslant",!0);A(D,le,oe,"⪖","\\eqslantgtr",!0);A(D,le,oe,"≳","\\gtrsim",!0);A(D,le,oe,"⪆","\\gtrapprox",!0);A(D,le,st,"⋗","\\gtrdot");A(D,le,oe,"⋙","\\ggg",!0);A(D,le,oe,"≷","\\gtrless",!0);A(D,le,oe,"⋛","\\gtreqless",!0);A(D,le,oe,"⪌","\\gtreqqless",!0);A(D,le,oe,"≖","\\eqcirc",!0);A(D,le,oe,"≗","\\circeq",!0);A(D,le,oe,"≜","\\triangleq",!0);A(D,le,oe,"∼","\\thicksim");A(D,le,oe,"≈","\\thickapprox");A(D,le,oe,"⫆","\\supseteqq",!0);A(D,le,oe,"⋑","\\Supset",!0);A(D,le,oe,"⊐","\\sqsupset",!0);A(D,le,oe,"≽","\\succcurlyeq",!0);A(D,le,oe,"⋟","\\curlyeqsucc",!0);A(D,le,oe,"≿","\\succsim",!0);A(D,le,oe,"⪸","\\succapprox",!0);A(D,le,oe,"⊳","\\vartriangleright");A(D,le,oe,"⊵","\\trianglerighteq");A(D,le,oe,"⊩","\\Vdash",!0);A(D,le,oe,"∣","\\shortmid");A(D,le,oe,"∥","\\shortparallel");A(D,le,oe,"≬","\\between",!0);A(D,le,oe,"⋔","\\pitchfork",!0);A(D,le,oe,"∝","\\varpropto");A(D,le,oe,"◀","\\blacktriangleleft");A(D,le,oe,"∴","\\therefore",!0);A(D,le,oe,"∍","\\backepsilon");A(D,le,oe,"▶","\\blacktriangleright");A(D,le,oe,"∵","\\because",!0);A(D,le,oe,"⋘","\\llless");A(D,le,oe,"⋙","\\gggtr");A(D,le,st,"⊲","\\lhd");A(D,le,st,"⊳","\\rhd");A(D,le,oe,"≂","\\eqsim",!0);A(D,$,oe,"⋈","\\Join");A(D,le,oe,"≑","\\Doteq",!0);A(D,le,st,"∔","\\dotplus",!0);A(D,le,st,"∖","\\smallsetminus");A(D,le,st,"⋒","\\Cap",!0);A(D,le,st,"⋓","\\Cup",!0);A(D,le,st,"⩞","\\doublebarwedge",!0);A(D,le,st,"⊟","\\boxminus",!0);A(D,le,st,"⊞","\\boxplus",!0);A(D,le,st,"⋇","\\divideontimes",!0);A(D,le,st,"⋉","\\ltimes",!0);A(D,le,st,"⋊","\\rtimes",!0);A(D,le,st,"⋋","\\leftthreetimes",!0);A(D,le,st,"⋌","\\rightthreetimes",!0);A(D,le,st,"⋏","\\curlywedge",!0);A(D,le,st,"⋎","\\curlyvee",!0);A(D,le,st,"⊝","\\circleddash",!0);A(D,le,st,"⊛","\\circledast",!0);A(D,le,st,"⋅","\\centerdot");A(D,le,st,"⊺","\\intercal",!0);A(D,le,st,"⋒","\\doublecap");A(D,le,st,"⋓","\\doublecup");A(D,le,st,"⊠","\\boxtimes",!0);A(D,le,oe,"⇢","\\dashrightarrow",!0);A(D,le,oe,"⇠","\\dashleftarrow",!0);A(D,le,oe,"⇇","\\leftleftarrows",!0);A(D,le,oe,"⇆","\\leftrightarrows",!0);A(D,le,oe,"⇚","\\Lleftarrow",!0);A(D,le,oe,"↞","\\twoheadleftarrow",!0);A(D,le,oe,"↢","\\leftarrowtail",!0);A(D,le,oe,"↫","\\looparrowleft",!0);A(D,le,oe,"⇋","\\leftrightharpoons",!0);A(D,le,oe,"↶","\\curvearrowleft",!0);A(D,le,oe,"↺","\\circlearrowleft",!0);A(D,le,oe,"↰","\\Lsh",!0);A(D,le,oe,"⇈","\\upuparrows",!0);A(D,le,oe,"↿","\\upharpoonleft",!0);A(D,le,oe,"⇃","\\downharpoonleft",!0);A(D,$,oe,"⊶","\\origof",!0);A(D,$,oe,"⊷","\\imageof",!0);A(D,le,oe,"⊸","\\multimap",!0);A(D,le,oe,"↭","\\leftrightsquigarrow",!0);A(D,le,oe,"⇉","\\rightrightarrows",!0);A(D,le,oe,"⇄","\\rightleftarrows",!0);A(D,le,oe,"↠","\\twoheadrightarrow",!0);A(D,le,oe,"↣","\\rightarrowtail",!0);A(D,le,oe,"↬","\\looparrowright",!0);A(D,le,oe,"↷","\\curvearrowright",!0);A(D,le,oe,"↻","\\circlearrowright",!0);A(D,le,oe,"↱","\\Rsh",!0);A(D,le,oe,"⇊","\\downdownarrows",!0);A(D,le,oe,"↾","\\upharpoonright",!0);A(D,le,oe,"⇂","\\downharpoonright",!0);A(D,le,oe,"⇝","\\rightsquigarrow",!0);A(D,le,oe,"⇝","\\leadsto");A(D,le,oe,"⇛","\\Rrightarrow",!0);A(D,le,oe,"↾","\\restriction");A(D,$,me,"‘","`");A(D,$,me,"$","\\$");A(Ie,$,me,"$","\\$");A(Ie,$,me,"$","\\textdollar");A(D,$,me,"%","\\%");A(Ie,$,me,"%","\\%");A(D,$,me,"_","\\_");A(Ie,$,me,"_","\\_");A(Ie,$,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,$,wt,"α","\\alpha",!0);A(D,$,wt,"β","\\beta",!0);A(D,$,wt,"γ","\\gamma",!0);A(D,$,wt,"δ","\\delta",!0);A(D,$,wt,"ϵ","\\epsilon",!0);A(D,$,wt,"ζ","\\zeta",!0);A(D,$,wt,"η","\\eta",!0);A(D,$,wt,"θ","\\theta",!0);A(D,$,wt,"ι","\\iota",!0);A(D,$,wt,"κ","\\kappa",!0);A(D,$,wt,"λ","\\lambda",!0);A(D,$,wt,"μ","\\mu",!0);A(D,$,wt,"ν","\\nu",!0);A(D,$,wt,"ξ","\\xi",!0);A(D,$,wt,"ο","\\omicron",!0);A(D,$,wt,"π","\\pi",!0);A(D,$,wt,"ρ","\\rho",!0);A(D,$,wt,"σ","\\sigma",!0);A(D,$,wt,"τ","\\tau",!0);A(D,$,wt,"υ","\\upsilon",!0);A(D,$,wt,"ϕ","\\phi",!0);A(D,$,wt,"χ","\\chi",!0);A(D,$,wt,"ψ","\\psi",!0);A(D,$,wt,"ω","\\omega",!0);A(D,$,wt,"ε","\\varepsilon",!0);A(D,$,wt,"ϑ","\\vartheta",!0);A(D,$,wt,"ϖ","\\varpi",!0);A(D,$,wt,"ϱ","\\varrho",!0);A(D,$,wt,"ς","\\varsigma",!0);A(D,$,wt,"φ","\\varphi",!0);A(D,$,st,"∗","*",!0);A(D,$,st,"+","+");A(D,$,st,"−","-",!0);A(D,$,st,"⋅","\\cdot",!0);A(D,$,st,"∘","\\circ",!0);A(D,$,st,"÷","\\div",!0);A(D,$,st,"±","\\pm",!0);A(D,$,st,"×","\\times",!0);A(D,$,st,"∩","\\cap",!0);A(D,$,st,"∪","\\cup",!0);A(D,$,st,"∖","\\setminus",!0);A(D,$,st,"∧","\\land");A(D,$,st,"∨","\\lor");A(D,$,st,"∧","\\wedge",!0);A(D,$,st,"∨","\\vee",!0);A(D,$,me,"√","\\surd");A(D,$,Pi,"⟨","\\langle",!0);A(D,$,Pi,"∣","\\lvert");A(D,$,Pi,"∥","\\lVert");A(D,$,$s,"?","?");A(D,$,$s,"!","!");A(D,$,$s,"⟩","\\rangle",!0);A(D,$,$s,"∣","\\rvert");A(D,$,$s,"∥","\\rVert");A(D,$,oe,"=","=");A(D,$,oe,":",":");A(D,$,oe,"≈","\\approx",!0);A(D,$,oe,"≅","\\cong",!0);A(D,$,oe,"≥","\\ge");A(D,$,oe,"≥","\\geq",!0);A(D,$,oe,"←","\\gets");A(D,$,oe,">","\\gt",!0);A(D,$,oe,"∈","\\in",!0);A(D,$,oe,"","\\@not");A(D,$,oe,"⊂","\\subset",!0);A(D,$,oe,"⊃","\\supset",!0);A(D,$,oe,"⊆","\\subseteq",!0);A(D,$,oe,"⊇","\\supseteq",!0);A(D,le,oe,"⊈","\\nsubseteq",!0);A(D,le,oe,"⊉","\\nsupseteq",!0);A(D,$,oe,"⊨","\\models");A(D,$,oe,"←","\\leftarrow",!0);A(D,$,oe,"≤","\\le");A(D,$,oe,"≤","\\leq",!0);A(D,$,oe,"<","\\lt",!0);A(D,$,oe,"→","\\rightarrow",!0);A(D,$,oe,"→","\\to");A(D,le,oe,"≱","\\ngeq",!0);A(D,le,oe,"≰","\\nleq",!0);A(D,$,jo," ","\\ ");A(D,$,jo," ","\\space");A(D,$,jo," ","\\nobreakspace");A(Ie,$,jo," ","\\ ");A(Ie,$,jo," "," ");A(Ie,$,jo," ","\\space");A(Ie,$,jo," ","\\nobreakspace");A(D,$,jo,null,"\\nobreak");A(D,$,jo,null,"\\allowbreak");A(D,$,Oy,",",",");A(D,$,Oy,";",";");A(D,le,st,"⊼","\\barwedge",!0);A(D,le,st,"⊻","\\veebar",!0);A(D,$,st,"⊙","\\odot",!0);A(D,$,st,"⊕","\\oplus",!0);A(D,$,st,"⊗","\\otimes",!0);A(D,$,me,"∂","\\partial",!0);A(D,$,st,"⊘","\\oslash",!0);A(D,le,st,"⊚","\\circledcirc",!0);A(D,le,st,"⊡","\\boxdot",!0);A(D,$,st,"△","\\bigtriangleup");A(D,$,st,"▽","\\bigtriangledown");A(D,$,st,"†","\\dagger");A(D,$,st,"⋄","\\diamond");A(D,$,st,"⋆","\\star");A(D,$,st,"◃","\\triangleleft");A(D,$,st,"▹","\\triangleright");A(D,$,Pi,"{","\\{");A(Ie,$,me,"{","\\{");A(Ie,$,me,"{","\\textbraceleft");A(D,$,$s,"}","\\}");A(Ie,$,me,"}","\\}");A(Ie,$,me,"}","\\textbraceright");A(D,$,Pi,"{","\\lbrace");A(D,$,$s,"}","\\rbrace");A(D,$,Pi,"[","\\lbrack",!0);A(Ie,$,me,"[","\\lbrack",!0);A(D,$,$s,"]","\\rbrack",!0);A(Ie,$,me,"]","\\rbrack",!0);A(D,$,Pi,"(","\\lparen",!0);A(D,$,$s,")","\\rparen",!0);A(Ie,$,me,"<","\\textless",!0);A(Ie,$,me,">","\\textgreater",!0);A(D,$,Pi,"⌊","\\lfloor",!0);A(D,$,$s,"⌋","\\rfloor",!0);A(D,$,Pi,"⌈","\\lceil",!0);A(D,$,$s,"⌉","\\rceil",!0);A(D,$,me,"\\","\\backslash");A(D,$,me,"∣","|");A(D,$,me,"∣","\\vert");A(Ie,$,me,"|","\\textbar",!0);A(D,$,me,"∥","\\|");A(D,$,me,"∥","\\Vert");A(Ie,$,me,"∥","\\textbardbl");A(Ie,$,me,"~","\\textasciitilde");A(Ie,$,me,"\\","\\textbackslash");A(Ie,$,me,"^","\\textasciicircum");A(D,$,oe,"↑","\\uparrow",!0);A(D,$,oe,"⇑","\\Uparrow",!0);A(D,$,oe,"↓","\\downarrow",!0);A(D,$,oe,"⇓","\\Downarrow",!0);A(D,$,oe,"↕","\\updownarrow",!0);A(D,$,oe,"⇕","\\Updownarrow",!0);A(D,$,Ur,"∐","\\coprod");A(D,$,Ur,"⋁","\\bigvee");A(D,$,Ur,"⋀","\\bigwedge");A(D,$,Ur,"⨄","\\biguplus");A(D,$,Ur,"⋂","\\bigcap");A(D,$,Ur,"⋃","\\bigcup");A(D,$,Ur,"∫","\\int");A(D,$,Ur,"∫","\\intop");A(D,$,Ur,"∬","\\iint");A(D,$,Ur,"∭","\\iiint");A(D,$,Ur,"∏","\\prod");A(D,$,Ur,"∑","\\sum");A(D,$,Ur,"⨂","\\bigotimes");A(D,$,Ur,"⨁","\\bigoplus");A(D,$,Ur,"⨀","\\bigodot");A(D,$,Ur,"∮","\\oint");A(D,$,Ur,"∯","\\oiint");A(D,$,Ur,"∰","\\oiiint");A(D,$,Ur,"⨆","\\bigsqcup");A(D,$,Ur,"∫","\\smallint");A(Ie,$,Jh,"…","\\textellipsis");A(D,$,Jh,"…","\\mathellipsis");A(Ie,$,Jh,"…","\\ldots",!0);A(D,$,Jh,"…","\\ldots",!0);A(D,$,Jh,"⋯","\\@cdots",!0);A(D,$,Jh,"⋱","\\ddots",!0);A(D,$,me,"⋮","\\varvdots");A(Ie,$,me,"⋮","\\varvdots");A(D,$,ur,"ˊ","\\acute");A(D,$,ur,"ˋ","\\grave");A(D,$,ur,"¨","\\ddot");A(D,$,ur,"~","\\tilde");A(D,$,ur,"ˉ","\\bar");A(D,$,ur,"˘","\\breve");A(D,$,ur,"ˇ","\\check");A(D,$,ur,"^","\\hat");A(D,$,ur,"⃗","\\vec");A(D,$,ur,"˙","\\dot");A(D,$,ur,"˚","\\mathring");A(D,$,wt,"","\\@imath");A(D,$,wt,"","\\@jmath");A(D,$,me,"ı","ı");A(D,$,me,"ȷ","ȷ");A(Ie,$,me,"ı","\\i",!0);A(Ie,$,me,"ȷ","\\j",!0);A(Ie,$,me,"ß","\\ss",!0);A(Ie,$,me,"æ","\\ae",!0);A(Ie,$,me,"œ","\\oe",!0);A(Ie,$,me,"ø","\\o",!0);A(Ie,$,me,"Æ","\\AE",!0);A(Ie,$,me,"Œ","\\OE",!0);A(Ie,$,me,"Ø","\\O",!0);A(Ie,$,ur,"ˊ","\\'");A(Ie,$,ur,"ˋ","\\`");A(Ie,$,ur,"ˆ","\\^");A(Ie,$,ur,"˜","\\~");A(Ie,$,ur,"ˉ","\\=");A(Ie,$,ur,"˘","\\u");A(Ie,$,ur,"˙","\\.");A(Ie,$,ur,"¸","\\c");A(Ie,$,ur,"˚","\\r");A(Ie,$,ur,"ˇ","\\v");A(Ie,$,ur,"¨",'\\"');A(Ie,$,ur,"˝","\\H");A(Ie,$,ur,"◯","\\textcircled");var tQ={"--":!0,"---":!0,"``":!0,"''":!0};A(Ie,$,me,"–","--",!0);A(Ie,$,me,"–","\\textendash");A(Ie,$,me,"—","---",!0);A(Ie,$,me,"—","\\textemdash");A(Ie,$,me,"‘","`",!0);A(Ie,$,me,"‘","\\textquoteleft");A(Ie,$,me,"’","'",!0);A(Ie,$,me,"’","\\textquoteright");A(Ie,$,me,"“","``",!0);A(Ie,$,me,"“","\\textquotedblleft");A(Ie,$,me,"”","''",!0);A(Ie,$,me,"”","\\textquotedblright");A(D,$,me,"°","\\degree",!0);A(Ie,$,me,"°","\\degree");A(Ie,$,me,"°","\\textdegree",!0);A(D,$,me,"£","\\pounds");A(D,$,me,"£","\\mathsterling",!0);A(Ie,$,me,"£","\\pounds");A(Ie,$,me,"£","\\textsterling",!0);A(D,le,me,"✠","\\maltese");A(Ie,le,me,"✠","\\maltese");var tM='0123456789/@."';for(var j4=0;j40)return Sa(i,h,s,n,a.concat(f));if(c){var m,g;if(c==="boldsymbol"){var x=wbe(i,s,n,a,r);m=x.fontName,g=[x.fontClass]}else o?(m=sQ[c].fontName,g=[c]):(m=Rx(c,n.fontWeight,n.fontShape),g=[c,n.fontWeight,n.fontShape]);if(Ny(i,m,s).metrics)return Sa(i,m,s,n,a.concat(g));if(tQ.hasOwnProperty(i)&&m.slice(0,10)==="Typewriter"){for(var y=[],w=0;w{if(Oc(t.classes)!==Oc(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},jbe=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},Zs=function(e,n,r,s){var i=new mp(e,n,r,s);return Gj(i),i},nQ=(t,e,n,r)=>new mp(t,e,n,r),Obe=function(e,n,r){var s=Zs([e],[],n);return s.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=We(s.height),s.maxFontSize=1,s},Nbe=function(e,n,r,s){var i=new Wj(e,n,r,s);return Gj(i),i},rQ=function(e){var n=new fp(e);return Gj(n),n},Cbe=function(e,n){return e instanceof fp?Zs([],[e],n):e},Tbe=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=Zs(["mspace"],[],e),r=gr(t,e);return n.style.marginRight=We(r),n},Rx=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},sQ={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"}},iQ={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Mbe=function(e,n){var[r,s,i]=iQ[e],a=new Nc(r),o=new go([a],{width:We(s),height:We(i),style:"width:"+We(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=nQ(["overlay"],[o],n);return c.height=i,c.style.height=We(i),c.style.width=We(s),c},be={fontMap:sQ,makeSymbol:Sa,mathsym:bbe,makeSpan:Zs,makeSvgSpan:nQ,makeLineSpan:Obe,makeAnchor:Nbe,makeFragment:rQ,wrapFragment:Cbe,makeVList:Ebe,makeOrd:Sbe,makeGlue:_be,staticSvg:Mbe,svgData:iQ,tryCombineChars:jbe},fr={number:3,unit:"mu"},lu={number:4,unit:"mu"},Wl={number:5,unit:"mu"},Abe={mord:{mop:fr,mbin:lu,mrel:Wl,minner:fr},mop:{mord:fr,mop:fr,mrel:Wl,minner:fr},mbin:{mord:lu,mop:lu,mopen:lu,minner:lu},mrel:{mord:Wl,mop:Wl,mopen:Wl,minner:Wl},mopen:{},mclose:{mop:fr,mbin:lu,mrel:Wl,minner:fr},mpunct:{mord:fr,mop:fr,mrel:Wl,mopen:fr,mclose:fr,mpunct:fr,minner:fr},minner:{mord:fr,mop:fr,mbin:lu,mrel:Wl,mopen:fr,mpunct:fr,minner:fr}},Rbe={mord:{mop:fr},mop:{mord:fr,mop:fr},mbin:{},mrel:{},mopen:{},mclose:{mop:fr},mpunct:{},minner:{mop:fr}},aQ={},hv={},fv={};function et(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,o={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"&&zbe.includes(k)?w.classes[0]="mord":k==="mbin"&&Dbe.includes(S)&&(y.classes[0]="mord")},{node:m},g,x),aM(i,(y,w)=>{var S=mk(w),k=mk(y),N=S&&k?y.hasClass("mtight")?Rbe[S][k]:Abe[S][k]:null;if(N)return be.makeGlue(N,h)},{node:m},g,x),i},aM=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()},lQ=function(e){return e instanceof fp||e instanceof Wj||e instanceof mp&&e.hasClass("enclosing")?e:null},Ibe=function t(e,n){var r=lQ(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},mk=function(e,n){return e?(n&&(e=Ibe(e,n)),Lbe[e.classes[0]]||null):null},k0=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return xo(n.concat(r))},Cn=function(e,n,r){if(!e)return xo();if(hv[e.type]){var s=hv[e.type](e,n);if(r&&n.size!==r.size){s=xo(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 Dx(t,e){var n=xo(["base"],t,e),r=xo(["strut"]);return r.style.height=We(n.height+n.depth),n.depth&&(r.style.verticalAlign=We(-n.depth)),n.children.unshift(r),n}function pk(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=es(t,e,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push(Dx(a,e)),a=[]),i.push(r[o]));a.length>0&&i.push(Dx(a,e));var h;n?(h=Dx(es(n,e,!0)),h.classes=["tag"],i.push(h)):s&&i.push(s);var f=xo(["katex-html"],i);if(f.setAttribute("aria-hidden","true"),h){var m=h.children[0];m.style.height=We(f.height+f.depth),f.depth&&(m.style.verticalAlign=We(-f.depth))}return f}function oQ(t){return new fp(t)}class Ti{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=Oc(this.classes));for(var r=0;r0&&(e+=' class ="'+Mn.escape(Oc(this.classes))+'"'),e+=">";for(var r=0;r",e}toText(){return this.children.map(e=>e.toText()).join("")}}class al{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Mn.escape(this.toText())}toText(){return this.text}}class Bbe{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",We(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Fe={MathNode:Ti,TextNode:al,SpaceNode:Bbe,newDocumentFragment:oQ},da=function(e,n,r){return Jn[n][e]&&Jn[n][e].replace&&e.charCodeAt(0)!==55349&&!(tQ.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=Jn[n][e].replace),new Fe.TextNode(e)},Xj=function(e){return e.length===1?e[0]:new Fe.MathNode("mrow",e)},Yj=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;Jn[s][i]&&Jn[s][i].replace&&(i=Jn[s][i].replace);var a=be.fontMap[r].fontName;return Uj(i,a,s)?be.fontMap[r].variant:null};function T4(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof al&&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 al&&n.text===","}else return!1}var fi=function(e,n,r){if(e.length===1){var s=Kn(e[0],n);return r&&s instanceof Ti&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||T4(a))){var h=c.children[0];h instanceof Ti&&h.type==="mn"&&(h.children=[...a.children,...h.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var f=a.children[0];if(f instanceof al&&f.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var m=c.children[0];m instanceof al&&m.text.length>0&&(m.text=m.text.slice(0,1)+"̸"+m.text.slice(1),i.pop())}}}i.push(c),a=c}return i},Cc=function(e,n,r){return Xj(fi(e,n,r))},Kn=function(e,n){if(!e)return new Fe.MathNode("mrow");if(fv[e.type]){var r=fv[e.type](e,n);return r}else throw new $e("Got group of unknown type: '"+e.type+"'")};function lM(t,e,n,r,s){var i=fi(t,n),a;i.length===1&&i[0]instanceof Ti&&["mrow","mtable"].includes(i[0].type)?a=i[0]:a=new Fe.MathNode("mrow",i);var o=new Fe.MathNode("annotation",[new Fe.TextNode(e)]);o.setAttribute("encoding","application/x-tex");var c=new Fe.MathNode("semantics",[a,o]),h=new Fe.MathNode("math",[c]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&h.setAttribute("display","block");var f=s?"katex":"katex-mathml";return be.makeSpan([f],[h])}var cQ=function(e){return new to({style:e.displayMode?St.DISPLAY:St.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},uQ=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},qbe=function(e,n,r){var s=cQ(r),i;if(r.output==="mathml")return lM(e,n,s,r.displayMode,!0);if(r.output==="html"){var a=pk(e,s);i=be.makeSpan(["katex"],[a])}else{var o=lM(e,n,s,r.displayMode,!1),c=pk(e,s);i=be.makeSpan(["katex"],[o,c])}return uQ(i,r)},Fbe=function(e,n,r){var s=cQ(r),i=pk(e,s),a=be.makeSpan(["katex"],[i]);return uQ(a,r)},$be={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":"="},Qbe=function(e){var n=new Fe.MathNode("mo",[new Fe.TextNode($be[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},Hbe={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]},Vbe=function(e){return e.type==="ordgroup"?e.body.length:1},Ube=function(e,n){function r(){var o=4e5,c=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(c)){var h=e,f=Vbe(h.base),m,g,x;if(f>5)c==="widehat"||c==="widecheck"?(m=420,o=2364,x=.42,g=c+"4"):(m=312,o=2340,x=.34,g="tilde4");else{var y=[1,1,2,2,3,3][f];c==="widehat"||c==="widecheck"?(o=[0,1062,2364,2364,2364][y],m=[0,239,300,360,420][y],x=[0,.24,.3,.3,.36,.42][y],g=c+y):(o=[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 Nc(g),S=new go([w],{width:"100%",height:We(x),viewBox:"0 0 "+o+" "+m,preserveAspectRatio:"none"});return{span:be.makeSvgSpan([],[S],n),minWidth:0,height:x}}else{var k=[],N=Hbe[c],[C,T,_]=N,E=_/1e3,M=C.length,L,P;if(M===1){var I=N[3];L=["hide-tail"],P=[I]}else if(M===2)L=["halfarrow-left","halfarrow-right"],P=["xMinYMin","xMaxYMin"];else if(M===3)L=["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 Q=0;Q0&&(s.style.minWidth=We(i)),s},Wbe=function(e,n,r,s,i){var a,o=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 h=[];/^[bx]cancel$/.test(n)&&h.push(new hk({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&h.push(new hk({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var f=new go(h,{width:"100%",height:We(o)});a=be.makeSvgSpan([],[f],i)}return a.height=o,a.style.height=We(o),a},vo={encloseSpan:Wbe,mathMLnode:Qbe,svgSpan:Ube};function Wt(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 Kj(t){var e=Cy(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 Cy(t){return t&&(t.type==="atom"||vbe.hasOwnProperty(t.type))?t:null}var Zj=(t,e)=>{var n,r,s;t&&t.type==="supsub"?(r=Wt(t.base,"accent"),n=r.base,t.base=n,s=gbe(Cn(t,e)),t.base=r):(r=Wt(t,"accent"),n=r.base);var i=Cn(n,e.havingCrampedStyle()),a=r.isShifty&&Mn.isCharacterBox(n),o=0;if(a){var c=Mn.getBaseElem(n),h=Cn(c,e.havingCrampedStyle());o=eM(h).skew}var f=r.label==="\\c",m=f?i.height+i.depth:Math.min(i.height,e.fontMetrics().xHeight),g;if(r.isStretchy)g=vo.svgSpan(r,e),g=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:g,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+We(2*o)+")",marginLeft:We(2*o)}: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=eM(x),x.italic=0,y=x.width,f&&(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=o;w||(S-=y/2),g.style.left=We(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},dQ=(t,e)=>{var n=t.isStretchy?vo.mathMLnode(t.label):new Fe.MathNode("mo",[da(t.label,t.mode)]),r=new Fe.MathNode("mover",[Kn(t.base,e),n]);return r.setAttribute("accent","true"),r},Gbe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));et({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=mv(e[0]),r=!Gbe.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:Zj,mathmlBuilder:dQ});et({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:Zj,mathmlBuilder:dQ});et({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=Cn(t.base,e),r=vo.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=vo.mathMLnode(t.label),r=new Fe.MathNode("munder",[Kn(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var zx=t=>{var e=new Fe.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};et({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(Cn(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(Cn(t.below,r,e),e),a.classes.push(i+"-arrow-pad"));var o=vo.svgSpan(t,e),c=-e.fontMetrics().axisHeight+.5*o.height,h=-e.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||t.label==="\\xleftequilibrium")&&(h-=s.depth);var f;if(a){var m=-e.fontMetrics().axisHeight+a.height+.5*o.height+.111;f=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:o,shift:c},{type:"elem",elem:a,shift:m}]},e)}else f=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:o,shift:c}]},e);return f.children[0].children[0].children[1].classes.push("svg-align"),be.makeSpan(["mrel","x-arrow"],[f],e)},mathmlBuilder(t,e){var n=vo.mathMLnode(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var s=zx(Kn(t.body,e));if(t.below){var i=zx(Kn(t.below,e));r=new Fe.MathNode("munderover",[n,i,s])}else r=new Fe.MathNode("mover",[n,s])}else if(t.below){var a=zx(Kn(t.below,e));r=new Fe.MathNode("munder",[n,a])}else r=zx(),r=new Fe.MathNode("mover",[n,r]);return r}});var Xbe=be.makeSpan;function hQ(t,e){var n=es(t.body,e,!0);return Xbe([t.mclass],n,e)}function fQ(t,e){var n,r=fi(t.body,e);return t.mclass==="minner"?n=new Fe.MathNode("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new Fe.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new Fe.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}et({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:Er(s),isCharacterBox:Mn.isCharacterBox(s)}},htmlBuilder:hQ,mathmlBuilder:fQ});var Ty=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"};et({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:Ty(e[0]),body:Er(e[1]),isCharacterBox:Mn.isCharacterBox(e[1])}}});et({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=Ty(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Er(s)},c={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:a,body:[c],isCharacterBox:Mn.isCharacterBox(c)}},htmlBuilder:hQ,mathmlBuilder:fQ});et({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:Ty(e[0]),body:Er(e[0])}},htmlBuilder(t,e){var n=es(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=fi(t.body,e),r=new Fe.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Ybe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},oM=()=>({type:"styling",body:[],mode:"math",style:"display"}),cM=t=>t.type==="textord"&&t.text==="@",Kbe=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function Zbe(t,e,n){var r=Ybe[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],[]),o=n.callFunction("\\\\cdright",[e[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,o]};return n.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Jbe(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(h)>-1)for(var m=0;m<2;m++){for(var g=!0,x=c+1;xAV=|." after @',a[c]);var y=Zbe(h,f,t),w={type:"styling",body:[y],mode:"math",style:"display"};r.push(w),o=oM()}i%2===0?r.push(o):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([])}}et({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(Cn(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=We(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new Fe.MathNode("mrow",[Kn(t.label,e)]);return n=new Fe.MathNode("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Fe.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});et({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(Cn(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new Fe.MathNode("mrow",[Kn(t.fragment,e)])}});et({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=Wt(e[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new $e("\\@char with invalid code point "+i);return c<=65535?h=String.fromCharCode(c):(c-=65536,h=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:n.mode,text:h}}});var mQ=(t,e)=>{var n=es(t.body,e.withColor(t.color),!1);return be.makeFragment(n)},pQ=(t,e)=>{var n=fi(t.body,e.withColor(t.color)),r=new Fe.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};et({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=Wt(e[0],"color-token").color,s=e[1];return{type:"color",mode:n.mode,color:r,body:Er(s)}},htmlBuilder:mQ,mathmlBuilder:pQ});et({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,s=Wt(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:mQ,mathmlBuilder:pQ});et({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&&Wt(s,"size").value}},htmlBuilder(t,e){var n=be.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=We(gr(t.size,e)))),n},mathmlBuilder(t,e){var n=new Fe.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",We(gr(t.size,e)))),n}});var gk={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},gQ=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new $e("Expected a control sequence",t);return e},e2e=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},xQ=(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)};et({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(gk[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=gk[r.text]),Wt(e.parseFunction(),"internal");throw new $e("Invalid token after macro prefix",r)}});et({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,o=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){a=e.gullet.future(),o[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++,o.push([])}else{if(r.text==="EOF")throw new $e("Expected a macro definition");o[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:o},n===gk[n]),{type:"internal",mode:e.mode}}});et({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=gQ(e.gullet.popToken());e.gullet.consumeSpaces();var s=e2e(e);return xQ(e,r,s,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});et({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=gQ(e.gullet.popToken()),s=e.gullet.popToken(),i=e.gullet.popToken();return xQ(e,r,i,n==="\\\\globalfuture"),e.gullet.pushToken(i),e.gullet.pushToken(s),{type:"internal",mode:e.mode}}});var ym=function(e,n,r){var s=Jn.math[e]&&Jn.math[e].replace,i=Uj(s||e,n,r);if(!i)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return i},Jj=function(e,n,r,s){var i=r.havingBaseStyle(n),a=be.makeSpan(s.concat(i.sizingClasses(r)),[e],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},vQ=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=We(i),e.height-=i,e.depth+=i},t2e=function(e,n,r,s,i,a){var o=be.makeSymbol(e,"Main-Regular",i,s),c=Jj(o,n,s,a);return r&&vQ(c,s,n),c},n2e=function(e,n,r,s){return be.makeSymbol(e,"Size"+n+"-Regular",r,s)},yQ=function(e,n,r,s,i,a){var o=n2e(e,n,i,s),c=Jj(be.makeSpan(["delimsizing","size"+n],[o],s),St.TEXT,s,a);return r&&vQ(c,s,St.TEXT),c},E4=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}},_4=function(e,n,r){var s=il["Size4-Regular"][e.charCodeAt(0)]?il["Size4-Regular"][e.charCodeAt(0)][4]:il["Size1-Regular"][e.charCodeAt(0)][4],i=new Nc("inner",lbe(e,Math.round(1e3*n))),a=new go([i],{width:We(s),height:We(n),style:"width:"+We(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),o=be.makeSvgSpan([],[a],r);return o.height=n,o.style.height=We(n),o.style.width=We(s),{type:"elem",elem:o}},xk=.008,Px={type:"kern",size:-1*xk},r2e=["|","\\lvert","\\rvert","\\vert"],s2e=["\\|","\\lVert","\\rVert","\\Vert"],bQ=function(e,n,r,s,i,a){var o,c,h,f,m="",g=0;o=h=f=e,c=null;var x="Size1-Regular";e==="\\uparrow"?h=f="⏐":e==="\\Uparrow"?h=f="‖":e==="\\downarrow"?o=h="⏐":e==="\\Downarrow"?o=h="‖":e==="\\updownarrow"?(o="\\uparrow",h="⏐",f="\\downarrow"):e==="\\Updownarrow"?(o="\\Uparrow",h="‖",f="\\Downarrow"):r2e.includes(e)?(h="∣",m="vert",g=333):s2e.includes(e)?(h="∥",m="doublevert",g=556):e==="["||e==="\\lbrack"?(o="⎡",h="⎢",f="⎣",x="Size4-Regular",m="lbrack",g=667):e==="]"||e==="\\rbrack"?(o="⎤",h="⎥",f="⎦",x="Size4-Regular",m="rbrack",g=667):e==="\\lfloor"||e==="⌊"?(h=o="⎢",f="⎣",x="Size4-Regular",m="lfloor",g=667):e==="\\lceil"||e==="⌈"?(o="⎡",h=f="⎢",x="Size4-Regular",m="lceil",g=667):e==="\\rfloor"||e==="⌋"?(h=o="⎥",f="⎦",x="Size4-Regular",m="rfloor",g=667):e==="\\rceil"||e==="⌉"?(o="⎤",h=f="⎥",x="Size4-Regular",m="rceil",g=667):e==="("||e==="\\lparen"?(o="⎛",h="⎜",f="⎝",x="Size4-Regular",m="lparen",g=875):e===")"||e==="\\rparen"?(o="⎞",h="⎟",f="⎠",x="Size4-Regular",m="rparen",g=875):e==="\\{"||e==="\\lbrace"?(o="⎧",c="⎨",f="⎩",h="⎪",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(o="⎫",c="⎬",f="⎭",h="⎪",x="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(o="⎧",f="⎩",h="⎪",x="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(o="⎫",f="⎭",h="⎪",x="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(o="⎧",f="⎭",h="⎪",x="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(o="⎫",f="⎩",h="⎪",x="Size4-Regular");var y=ym(o,x,i),w=y.height+y.depth,S=ym(h,x,i),k=S.height+S.depth,N=ym(f,x,i),C=N.height+N.depth,T=0,_=1;if(c!==null){var E=ym(c,x,i);T=E.height+E.depth,_=2}var M=w+C+T,L=Math.max(0,Math.ceil((n-M)/(_*k))),P=M+L*_*k,I=s.fontMetrics().axisHeight;r&&(I*=s.sizeMultiplier);var Q=P/2-I,U=[];if(m.length>0){var ee=P-w-C,z=Math.round(P*1e3),H=obe(m,Math.round(ee*1e3)),B=new Nc(m,H),X=(g/1e3).toFixed(3)+"em",J=(z/1e3).toFixed(3)+"em",G=new go([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(E4(f,x,i)),U.push(Px),c===null){var se=P-w-C+2*xk;U.push(_4(h,se,s))}else{var W=(P-w-C-T)/2+2*xk;U.push(_4(h,W,s)),U.push(Px),U.push(E4(c,x,i)),U.push(Px),U.push(_4(h,W,s))}U.push(Px),U.push(E4(o,x,i))}var F=s.havingBaseStyle(St.TEXT),V=be.makeVList({positionType:"bottom",positionData:Q,children:U},F);return Jj(be.makeSpan(["delimsizing","mult"],[V],F),St.TEXT,s,a)},M4=80,A4=.08,R4=function(e,n,r,s,i){var a=abe(e,s,r),o=new Nc(e,a),c=new go([o],{width:"400em",height:We(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return be.makeSvgSpan(["hide-tail"],[c],i)},i2e=function(e,n){var r=n.havingBaseSizing(),s=jQ("\\surd",e*r.sizeMultiplier,kQ,r),i=r.sizeMultiplier,a=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),o,c=0,h=0,f=0,m;return s.type==="small"?(f=1e3+1e3*a+M4,e<1?i=1:e<1.4&&(i=.7),c=(1+a+A4)/i,h=(1+a)/i,o=R4("sqrtMain",c,f,a,n),o.style.minWidth="0.853em",m=.833/i):s.type==="large"?(f=(1e3+M4)*qm[s.size],h=(qm[s.size]+a)/i,c=(qm[s.size]+a+A4)/i,o=R4("sqrtSize"+s.size,c,f,a,n),o.style.minWidth="1.02em",m=1/i):(c=e+a+A4,h=e+a,f=Math.floor(1e3*e+a)+M4,o=R4("sqrtTall",c,f,a,n),o.style.minWidth="0.742em",m=1.056),o.height=h,o.style.height=We(c),{span:o,advanceWidth:m,ruleWidth:(n.fontMetrics().sqrtRuleThickness+a)*i}},wQ=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],a2e=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],SQ=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],qm=[0,1.2,1.8,2.4,3],l2e=function(e,n,r,s,i){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),wQ.includes(e)||SQ.includes(e))return yQ(e,n,!1,r,s,i);if(a2e.includes(e))return bQ(e,qm[n],!1,r,s,i);throw new $e("Illegal delimiter: '"+e+"'")},o2e=[{type:"small",style:St.SCRIPTSCRIPT},{type:"small",style:St.SCRIPT},{type:"small",style:St.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],c2e=[{type:"small",style:St.SCRIPTSCRIPT},{type:"small",style:St.SCRIPT},{type:"small",style:St.TEXT},{type:"stack"}],kQ=[{type:"small",style:St.SCRIPTSCRIPT},{type:"small",style:St.SCRIPT},{type:"small",style:St.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],u2e=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.")},jQ=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]},OQ=function(e,n,r,s,i,a){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var o;SQ.includes(e)?o=o2e:wQ.includes(e)?o=kQ:o=c2e;var c=jQ(e,n,o,s);return c.type==="small"?t2e(e,c.style,r,s,i,a):c.type==="large"?yQ(e,c.size,r,s,i,a):bQ(e,n,r,s,i,a)},d2e=function(e,n,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,h=5/s.fontMetrics().ptPerEm,f=Math.max(n-o,r+o),m=Math.max(f/500*c,2*f-h);return OQ(e,m,!0,s,i,a)},uo={sqrtImage:i2e,sizedDelim:l2e,sizeToMaxHeight:qm,customSizedDelim:OQ,leftRightDelim:d2e},uM={"\\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}},h2e=["(","\\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 Ey(t,e){var n=Cy(t);if(n&&h2e.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)}et({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=Ey(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:uM[t.funcName].size,mclass:uM[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?be.makeSpan([t.mclass]):uo.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(da(t.delim,t.mode));var n=new Fe.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=We(uo.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function dM(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}et({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:Ey(e[0],t).text,color:n}}});et({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Ey(e[0],t),r=t.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Wt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(t,e)=>{dM(t);for(var n=es(t.body,e,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{dM(t);var n=fi(t.body,e);if(t.left!=="."){var r=new Fe.MathNode("mo",[da(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var s=new Fe.MathNode("mo",[da(t.right,t.mode)]);s.setAttribute("fence","true"),t.rightColor&&s.setAttribute("mathcolor",t.rightColor),n.push(s)}return Xj(n)}});et({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=Ey(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=k0(e,[]);else{n=uo.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==="|"?da("|","text"):da(t.delim,t.mode),r=new Fe.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var eO=(t,e)=>{var n=be.wrapFragment(Cn(t.body,e),e),r=t.label.slice(1),s=e.sizeMultiplier,i,a=0,o=Mn.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=gr({number:.6,unit:"pt"},e),h=gr({number:.35,unit:"ex"},e),f=e.havingBaseSizing();s=s/f.sizeMultiplier;var m=n.height+n.depth+c+h;n.style.paddingLeft=We(m/2+c);var g=Math.floor(1e3*m*s),x=sbe(g),y=new go([new Nc("phase",x)],{width:"400em",height:We(g/1e3),viewBox:"0 0 400000 "+g,preserveAspectRatio:"xMinYMin slice"});i=be.makeSvgSpan(["hide-tail"],[y],e),i.style.height=We(m),a=n.depth+c+h}else{/cancel/.test(r)?o||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=o?.2:0,S=w),i=vo.encloseSpan(n,r,w,S,e),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=We(k)):r==="angl"&&k!==.049&&(i.style.borderTopWidth=We(k),i.style.borderRightWidth=We(k)),a=n.depth+S,t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor,t.borderColor&&(i.style.borderColor=t.borderColor))}var N;if(t.backgroundColor)N=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:n,shift:0}]},e);else{var C=/cancel|phase/.test(r)?["svg-align"]:[];N=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:C}]},e)}return/cancel/.test(r)&&(N.height=n.height,N.depth=n.depth),/cancel/.test(r)&&!o?be.makeSpan(["mord","cancel-lap"],[N],e):be.makeSpan(["mord"],[N],e)},tO=(t,e)=>{var n=0,r=new Fe.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Kn(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};et({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=Wt(e[0],"color-token").color,a=e[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:eO,mathmlBuilder:tO});et({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:s}=t,i=Wt(e[0],"color-token").color,a=Wt(e[1],"color-token").color,o=e[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:eO,mathmlBuilder:tO});et({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]}}});et({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:eO,mathmlBuilder:tO});et({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 NQ={};function yl(t){for(var{type:e,names:n,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=t,o={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 nO(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function Pc(t,e,n){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:c,singleRow:h,emptySingleRow:f,maxNumCols:m,leqno:g}=e;if(t.gullet.beginGroup(),h||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=[],N=c!=null?[]:void 0;function C(){c&&t.gullet.macros.set("\\@eqnsw","1",!0)}function T(){N&&(t.gullet.macros.get("\\df@tag")?(N.push(t.subparse([new Ri("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):N.push(!!c&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(C(),k.push(hM(t));;){var _=t.parseExpression(!1,h?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),_={type:"ordgroup",mode:t.mode,body:_},n&&(_={type:"styling",mode:t.mode,style:n,body:[_]}),y.push(_);var E=t.fetch().text;if(E==="&"){if(m&&y.length===m){if(h||o)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(E==="\\end"){T(),y.length===1&&_.type==="styling"&&_.body[0].body.length===0&&(w.length>1||!f)&&w.pop(),k.length0&&(C+=.25),h.push({pos:C,isDashed:Be[ut]})}for(T(a[0]),r=0;r0&&(Q+=N,MBe))for(r=0;r=o)){var K=void 0;(s>0||e.hskipBeforeAndAfter)&&(K=Mn.deflt(W.pregap,g),K!==0&&(H=be.makeSpan(["arraycolsep"],[]),H.style.width=We(K),z.push(H)));var ie=[];for(r=0;r0){for(var Ue=be.makeLineSpan("hline",n,f),Xe=be.makeLineSpan("hdashline",n,f),Ze=[{type:"elem",elem:c,shift:0}];h.length>0;){var Oe=h.pop(),He=Oe.pos-U;Oe.isDashed?Ze.push({type:"elem",elem:Xe,shift:He}):Ze.push({type:"elem",elem:Ue,shift:He})}c=be.makeVList({positionType:"individualShift",children:Ze},n)}if(X.length===0)return be.makeSpan(["mord"],[c],n);var Ve=be.makeVList({positionType:"individualShift",children:X},n);return Ve=be.makeSpan(["tag"],[Ve],n),be.makeFragment([c,Ve])},f2e={c:"center ",l:"left ",r:"right "},wl=function(e,n){for(var r=[],s=new Fe.MathNode("mtd",[],["mtr-glue"]),i=new Fe.MathNode("mtd",[],["mml-eqn-num"]),a=0;a0){var y=e.cols,w="",S=!1,k=0,N=y.length;y[0].type==="separator"&&(g+="top ",k=1),y[y.length-1].type==="separator"&&(g+="bottom ",N-=1);for(var C=k;C0?"left ":"",g+=L[L.length-1].length>0?"right ":"";for(var P=1;P-1?"alignat":"align",i=e.envName==="split",a=Pc(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:nO(e.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),o,c=0,h={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var f="",m=0;m0&&x&&(S=1),r[y]={type:"align",align:w,pregap:S,postgap:0}}return a.colSeparationType=x?"align":"alignat",a};yl({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=Cy(e[0]),r=n?[e[0]]:Wt(e[0],"ordgroup").body,s=r.map(function(a){var o=Kj(a),c=o.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 Pc(t.parser,i,rO(t.envName))},htmlBuilder:bl,mathmlBuilder:wl});yl({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=Pc(t.parser,r,rO(t.envName)),a=Math.max(0,...i.body.map(o=>o.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:bl,mathmlBuilder:wl});yl({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=Pc(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:bl,mathmlBuilder:wl});yl({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=Cy(e[0]),r=n?[e[0]]:Wt(e[0],"ordgroup").body,s=r.map(function(a){var o=Kj(a),c=o.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=Pc(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:bl,mathmlBuilder:wl});yl({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=Pc(t.parser,e,rO(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:bl,mathmlBuilder:wl});yl({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:TQ,htmlBuilder:bl,mathmlBuilder:wl});yl({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){["gather","gather*"].includes(t.envName)&&_y(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:nO(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Pc(t.parser,e,"display")},htmlBuilder:bl,mathmlBuilder:wl});yl({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:TQ,htmlBuilder:bl,mathmlBuilder:wl});yl({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){_y(t);var e={autoTag:nO(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Pc(t.parser,e,"display")},htmlBuilder:bl,mathmlBuilder:wl});yl({type:"array",names:["CD"],props:{numArgs:0},handler(t){return _y(t),Jbe(t.parser)},htmlBuilder:bl,mathmlBuilder:wl});Z("\\nonumber","\\gdef\\@eqnsw{0}");Z("\\notag","\\nonumber");et({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 fM=NQ;et({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 Cn(t.body,r)},_Q=(t,e)=>{var n=t.font,r=e.withFont(n);return Kn(t.body,r)},mM={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};et({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=mv(e[0]),i=r;return i in mM&&(i=mM[i]),{type:"font",mode:n.mode,font:i.slice(1),body:s}},htmlBuilder:EQ,mathmlBuilder:_Q});et({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0],s=Mn.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Ty(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:s}}});et({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),o="math"+r.slice(1);return{type:"font",mode:i,font:o,body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:EQ,mathmlBuilder:_Q});var MQ=(t,e)=>{var n=e;return t==="display"?n=n.id>=St.SCRIPT.id?n.text():St.DISPLAY:t==="text"&&n.size===St.DISPLAY.size?n=St.TEXT:t==="script"?n=St.SCRIPT:t==="scriptscript"&&(n=St.SCRIPTSCRIPT),n},sO=(t,e)=>{var n=MQ(t.size,e.style),r=n.fracNum(),s=n.fracDen(),i;i=e.havingStyle(r);var a=Cn(t.numer,i,e);if(t.continued){var o=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(f){var N=e.fontMetrics().axisHeight;x-a.depth-(N+.5*m){var n=new Fe.MathNode("mfrac",[Kn(t.numer,e),Kn(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=gr(t.barSize,e);n.setAttribute("linethickness",We(r))}var s=MQ(t.size,e.style);if(s.size!==e.style.size){n=new Fe.MathNode("mstyle",[n]);var i=s.size===St.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 o=new Fe.MathNode("mo",[new Fe.TextNode(t.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),a.push(o)}if(a.push(n),t.rightDelim!=null){var c=new Fe.MathNode("mo",[new Fe.TextNode(t.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),a.push(c)}return Xj(a)}return n};et({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,o=null,c=null,h="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,o="(",c=")";break;case"\\\\bracefrac":a=!1,o="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,o="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":h="display";break;case"\\tfrac":case"\\tbinom":h="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:s,denom:i,hasBarLine:a,leftDelim:o,rightDelim:c,size:h,barSize:null}},htmlBuilder:sO,mathmlBuilder:iO});et({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}}});et({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 pM=["display","text","script","scriptscript"],gM=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};et({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=mv(e[0]),a=i.type==="atom"&&i.family==="open"?gM(i.text):null,o=mv(e[1]),c=o.type==="atom"&&o.family==="close"?gM(o.text):null,h=Wt(e[2],"size"),f,m=null;h.isBlank?f=!0:(m=h.value,f=m.number>0);var g="auto",x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var y=Wt(x.body[0],"textord");g=pM[Number(y.text)]}}else x=Wt(x,"textord"),g=pM[Number(x.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:s,continued:!1,hasBarLine:f,barSize:m,leftDelim:a,rightDelim:c,size:g}},htmlBuilder:sO,mathmlBuilder:iO});et({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:Wt(e[0],"size").value,token:s}}});et({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,s=e[0],i=Qye(Wt(e[1],"infix").size),a=e[2],o=i.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:sO,mathmlBuilder:iO});var AQ=(t,e)=>{var n=e.style,r,s;t.type==="supsub"?(r=t.sup?Cn(t.sup,e.havingStyle(n.sup()),e):Cn(t.sub,e.havingStyle(n.sub()),e),s=Wt(t.base,"horizBrace")):s=Wt(t,"horizBrace");var i=Cn(s.base,e.havingBaseStyle(St.DISPLAY)),a=vo.svgSpan(s,e),o;if(s.isOver?(o=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a}]},e),o.children[0].children[0].children[1].classes.push("svg-align")):(o=be.makeVList({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:i}]},e),o.children[0].children[0].children[0].classes.push("svg-align")),r){var c=be.makeSpan(["mord",s.isOver?"mover":"munder"],[o],e);s.isOver?o=be.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]},e):o=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"],[o],e)},m2e=(t,e)=>{var n=vo.mathMLnode(t.label);return new Fe.MathNode(t.isOver?"mover":"munder",[Kn(t.base,e),n])};et({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:AQ,mathmlBuilder:m2e});et({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],s=Wt(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Er(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=es(t.body,e,!1);return be.makeAnchor(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=Cc(t.body,e);return n instanceof Ti||(n=new Ti("mrow",[n])),n.setAttribute("href",t.href),n}});et({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=Wt(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=Wt(e[0],"raw").string,a=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,c={};switch(r){case"\\htmlClass":c.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var h=i.split(","),f=0;f{var n=es(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)=>Cc(t.body,e)});et({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:Er(e[0]),mathml:Er(e[1])}},htmlBuilder:(t,e)=>{var n=es(t.html,e,!1);return be.makeFragment(n)},mathmlBuilder:(t,e)=>Cc(t.mathml,e)});var D4=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(!K$(r))throw new $e("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};et({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"},o="";if(n[0])for(var c=Wt(n[0],"raw").string,h=c.split(","),f=0;f{var n=gr(t.height,e),r=0;t.totalheight.number>0&&(r=gr(t.totalheight,e)-n);var s=0;t.width.number>0&&(s=gr(t.width,e));var i={height:We(n+r)};s>0&&(i.width=We(s)),r>0&&(i.verticalAlign=We(-r));var a=new mbe(t.src,t.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(t,e)=>{var n=new Fe.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=gr(t.height,e),s=0;if(t.totalheight.number>0&&(s=gr(t.totalheight,e)-r,n.setAttribute("valign",We(-s))),n.setAttribute("height",We(r+s)),t.width.number>0){var i=gr(t.width,e);n.setAttribute("width",We(i))}return n.setAttribute("src",t.src),n}});et({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=Wt(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=gr(t.dimension,e);return new Fe.SpaceNode(n)}});et({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([],[Cn(t.body,e)]),n=be.makeSpan(["inner"],[n],e)):n=be.makeSpan(["inner"],[Cn(t.body,e)]);var r=be.makeSpan(["fix"],[]),s=be.makeSpan([t.alignment],[n,r],e),i=be.makeSpan(["strut"]);return i.style.height=We(s.height+s.depth),s.depth&&(i.style.verticalAlign=We(-s.depth)),s.children.unshift(i),s=be.makeSpan(["thinbox"],[s],e),be.makeSpan(["mord","vbox"],[s],e)},mathmlBuilder:(t,e)=>{var n=new Fe.MathNode("mpadded",[Kn(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}});et({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}}});et({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new $e("Mismatched "+t.funcName)}});var xM=(t,e)=>{switch(e.style.size){case St.DISPLAY.size:return t.display;case St.TEXT.size:return t.text;case St.SCRIPT.size:return t.script;case St.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};et({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:Er(e[0]),text:Er(e[1]),script:Er(e[2]),scriptscript:Er(e[3])}},htmlBuilder:(t,e)=>{var n=xM(t,e),r=es(n,e,!1);return be.makeFragment(r)},mathmlBuilder:(t,e)=>{var n=xM(t,e);return Cc(n,e)}});var RQ=(t,e,n,r,s,i,a)=>{t=be.makeSpan([],[t]);var o=n&&Mn.isCharacterBox(n),c,h;if(e){var f=Cn(e,r.havingStyle(s.sup()),r);h={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-f.depth)}}if(n){var m=Cn(n,r.havingStyle(s.sub()),r);c={elem:m,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-m.height)}}var g;if(h&&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:We(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:We(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:We(-i)},{type:"kern",size:c.kern},{type:"elem",elem:t}]},r)}else if(h){var w=t.depth+a;g=be.makeVList({positionType:"bottom",positionData:w,children:[{type:"elem",elem:t},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:We(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return t;var S=[g];if(c&&i!==0&&!o){var k=be.makeSpan(["mspace"],[],r);k.style.marginRight=We(i),S.unshift(k)}return be.makeSpan(["mop","op-limits"],S,r)},DQ=["\\smallint"],ef=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=Wt(t.base,"op"),s=!0):i=Wt(t,"op");var a=e.style,o=!1;a.size===St.DISPLAY.size&&i.symbol&&!DQ.includes(i.name)&&(o=!0);var c;if(i.symbol){var h=o?"Size2-Regular":"Size1-Regular",f="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(f=i.name.slice(1),i.name=f==="oiint"?"\\iint":"\\iiint"),c=be.makeSymbol(i.name,h,"math",e,["mop","op-symbol",o?"large-op":"small-op"]),f.length>0){var m=c.italic,g=be.staticSvg(f+"Size"+(o?"2":"1"),e);c=be.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:g,shift:o?.08:0}]},e),i.name="\\"+f,c.classes.unshift("mop"),c.italic=m}}else if(i.body){var x=es(i.body,e,!0);x.length===1&&x[0]instanceof ua?(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 Ti("mo",[da(t.name,t.mode)]),DQ.includes(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new Ti("mo",fi(t.body,e));else{n=new Ti("mi",[new al(t.name.slice(1))]);var r=new Ti("mo",[da("⁡","text")]);t.parentIsSupSub?n=new Ti("mrow",[n,r]):n=oQ([n,r])}return n},p2e={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};et({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=p2e[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:ef,mathmlBuilder:pp});et({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:Er(r)}},htmlBuilder:ef,mathmlBuilder:pp});var g2e={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};et({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:ef,mathmlBuilder:pp});et({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:ef,mathmlBuilder:pp});et({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=g2e[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:ef,mathmlBuilder:pp});var zQ=(t,e)=>{var n,r,s=!1,i;t.type==="supsub"?(n=t.sup,r=t.sub,i=Wt(t.base,"operatorname"),s=!0):i=Wt(t,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(m=>{var g=m.text;return typeof g=="string"?{type:"textord",mode:m.mode,text:g}:m}),c=es(o,e.withFont("mathrm"),!0),h=0;h{for(var n=fi(t.body,e.withFont("mathrm")),r=!0,s=0;sf.toText()).join("");n=[new Fe.TextNode(o)]}var c=new Fe.MathNode("mi",n);c.setAttribute("mathvariant","normal");var h=new Fe.MathNode("mo",[da("⁡","text")]);return t.parentIsSupSub?new Fe.MathNode("mrow",[c,h]):Fe.newDocumentFragment([c,h])};et({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:Er(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:zQ,mathmlBuilder:x2e});Z("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Vu({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?be.makeFragment(es(t.body,e,!1)):be.makeSpan(["mord"],es(t.body,e,!0),e)},mathmlBuilder(t,e){return Cc(t.body,e,!0)}});et({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=Cn(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 Fe.MathNode("mo",[new Fe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Fe.MathNode("mover",[Kn(t.body,e),n]);return r.setAttribute("accent","true"),r}});et({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:Er(r)}},htmlBuilder:(t,e)=>{var n=es(t.body,e.withPhantom(),!1);return be.makeFragment(n)},mathmlBuilder:(t,e)=>{var n=fi(t.body,e);return new Fe.MathNode("mphantom",n)}});et({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([],[Cn(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=fi(Er(t.body),e),r=new Fe.MathNode("mphantom",n),s=new Fe.MathNode("mpadded",[r]);return s.setAttribute("height","0px"),s.setAttribute("depth","0px"),s}});et({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"],[Cn(t.body,e.withPhantom())]),r=be.makeSpan(["fix"],[]);return be.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=fi(Er(t.body),e),r=new Fe.MathNode("mphantom",n),s=new Fe.MathNode("mpadded",[r]);return s.setAttribute("width","0px"),s}});et({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=Wt(e[0],"size").value,s=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:s}},htmlBuilder(t,e){var n=Cn(t.body,e),r=gr(t.dy,e);return be.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new Fe.MathNode("mpadded",[Kn(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});et({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});et({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=Wt(e[0],"size"),a=Wt(e[1],"size");return{type:"rule",mode:r.mode,shift:s&&Wt(s,"size").value,width:i.value,height:a.value}},htmlBuilder(t,e){var n=be.makeSpan(["mord","rule"],[],e),r=gr(t.width,e),s=gr(t.height,e),i=t.shift?gr(t.shift,e):0;return n.style.borderRightWidth=We(r),n.style.borderTopWidth=We(s),n.style.bottom=We(i),n.width=r,n.height=s+i,n.depth=-i,n.maxFontSize=s*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=gr(t.width,e),r=gr(t.height,e),s=t.shift?gr(t.shift,e):0,i=e.color&&e.getColor()||"black",a=new Fe.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",We(n)),a.setAttribute("height",We(r));var o=new Fe.MathNode("mpadded",[a]);return s>=0?o.setAttribute("height",We(s)):(o.setAttribute("height",We(s)),o.setAttribute("depth",We(-s))),o.setAttribute("voffset",We(s)),o}});function PQ(t,e,n){for(var r=es(t,e,!1),s=e.sizeMultiplier/n.sizeMultiplier,i=0;i{var n=e.havingSize(t.size);return PQ(t.body,n,e)};et({type:"sizing",names:vM,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:vM.indexOf(r)+1,body:i}},htmlBuilder:v2e,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=fi(t.body,n),s=new Fe.MathNode("mstyle",r);return s.setAttribute("mathsize",We(n.sizeMultiplier)),s}});et({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]&&Wt(n[0],"ordgroup");if(a)for(var o="",c=0;c{var n=be.makeSpan([],[Cn(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 Fe.MathNode("mpadded",[Kn(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});et({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=Cn(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-h;n.style.paddingLeft=We(f);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:h}]},e);if(t.index){var y=e.havingStyle(St.SCRIPTSCRIPT),w=Cn(t.index,y,e),S=.6*(x.height-x.depth),k=be.makeVList({positionType:"shift",positionData:-S,children:[{type:"elem",elem:w}]},e),N=be.makeSpan(["root"],[k]);return be.makeSpan(["mord","sqrt"],[N,x],e)}else return be.makeSpan(["mord","sqrt"],[x],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new Fe.MathNode("mroot",[Kn(n,e),Kn(r,e)]):new Fe.MathNode("msqrt",[Kn(n,e)])}});var yM={display:St.DISPLAY,text:St.TEXT,script:St.SCRIPT,scriptscript:St.SCRIPTSCRIPT};et({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=yM[t.style],r=e.havingStyle(n).withFont("");return PQ(t.body,r,e)},mathmlBuilder(t,e){var n=yM[t.style],r=e.havingStyle(n),s=fi(t.body,r),i=new Fe.MathNode("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[t.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var y2e=function(e,n){var r=e.base;if(r)if(r.type==="op"){var s=r.limits&&(n.style.size===St.DISPLAY.size||r.alwaysHandleSupSub);return s?ef:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===St.DISPLAY.size||r.limits);return i?zQ:null}else{if(r.type==="accent")return Mn.isCharacterBox(r.base)?Zj:null;if(r.type==="horizBrace"){var a=!e.sub;return a===r.isOver?AQ:null}else return null}else return null};Vu({type:"supsub",htmlBuilder(t,e){var n=y2e(t,e);if(n)return n(t,e);var{base:r,sup:s,sub:i}=t,a=Cn(r,e),o,c,h=e.fontMetrics(),f=0,m=0,g=r&&Mn.isCharacterBox(r);if(s){var x=e.havingStyle(e.style.sup());o=Cn(s,x,e),g||(f=a.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(i){var y=e.havingStyle(e.style.sub());c=Cn(i,y,e),g||(m=a.depth+y.fontMetrics().subDrop*y.sizeMultiplier/e.sizeMultiplier)}var w;e.style===St.DISPLAY?w=h.sup1:e.style.cramped?w=h.sup3:w=h.sup2;var S=e.sizeMultiplier,k=We(.5/h.ptPerEm/S),N=null;if(c){var C=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(a instanceof ua||C)&&(N=We(-a.italic))}var T;if(o&&c){f=Math.max(f,w,o.depth+.25*h.xHeight),m=Math.max(m,h.sub2);var _=h.defaultRuleThickness,E=4*_;if(f-o.depth-(c.height-m)0&&(f+=M,m-=M)}var L=[{type:"elem",elem:c,shift:m,marginRight:k,marginLeft:N},{type:"elem",elem:o,shift:-f,marginRight:k}];T=be.makeVList({positionType:"individualShift",children:L},e)}else if(c){m=Math.max(m,h.sub1,c.height-.8*h.xHeight);var P=[{type:"elem",elem:c,marginLeft:N,marginRight:k}];T=be.makeVList({positionType:"shift",positionData:m,children:P},e)}else if(o)f=Math.max(f,w,o.depth+.25*h.xHeight),T=be.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:o,marginRight:k}]},e);else throw new Error("supsub must have either sup or sub.");var I=mk(a,"right")||"mord";return be.makeSpan([I],[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=[Kn(t.base,e)];t.sub&&i.push(Kn(t.sub,e)),t.sup&&i.push(Kn(t.sup,e));var a;if(n)a=r?"mover":"munder";else if(t.sub)if(t.sup){var h=t.base;h&&h.type==="op"&&h.limits&&e.style===St.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(e.style===St.DISPLAY||h.limits)?a="munderover":a="msubsup"}else{var c=t.base;c&&c.type==="op"&&c.limits&&(e.style===St.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||e.style===St.DISPLAY)?a="munder":a="msub"}else{var o=t.base;o&&o.type==="op"&&o.limits&&(e.style===St.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||e.style===St.DISPLAY)?a="mover":a="msup"}return new Fe.MathNode(a,i)}});Vu({type:"atom",htmlBuilder(t,e){return be.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new Fe.MathNode("mo",[da(t.text,t.mode)]);if(t.family==="bin"){var r=Yj(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 LQ={mi:"italic",mn:"normal",mtext:"normal"};Vu({type:"mathord",htmlBuilder(t,e){return be.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var n=new Fe.MathNode("mi",[da(t.text,t.mode,e)]),r=Yj(t,e)||"italic";return r!==LQ[n.type]&&n.setAttribute("mathvariant",r),n}});Vu({type:"textord",htmlBuilder(t,e){return be.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var n=da(t.text,t.mode,e),r=Yj(t,e)||"normal",s;return t.mode==="text"?s=new Fe.MathNode("mtext",[n]):/[0-9]/.test(t.text)?s=new Fe.MathNode("mn",[n]):t.text==="\\prime"?s=new Fe.MathNode("mo",[n]):s=new Fe.MathNode("mi",[n]),r!==LQ[s.type]&&s.setAttribute("mathvariant",r),s}});var z4={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},P4={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Vu({type:"spacing",htmlBuilder(t,e){if(P4.hasOwnProperty(t.text)){var n=P4[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(z4.hasOwnProperty(t.text))return be.makeSpan(["mspace",z4[t.text]],[],e);throw new $e('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(P4.hasOwnProperty(t.text))n=new Fe.MathNode("mtext",[new Fe.TextNode(" ")]);else{if(z4.hasOwnProperty(t.text))return new Fe.MathNode("mspace");throw new $e('Unknown type of space "'+t.text+'"')}return n}});var bM=()=>{var t=new Fe.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};Vu({type:"tag",mathmlBuilder(t,e){var n=new Fe.MathNode("mtable",[new Fe.MathNode("mtr",[bM(),new Fe.MathNode("mtd",[Cc(t.body,e)]),bM(),new Fe.MathNode("mtd",[Cc(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var wM={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},SM={"\\textbf":"textbf","\\textmd":"textmd"},b2e={"\\textit":"textit","\\textup":"textup"},kM=(t,e)=>{var n=t.font;if(n){if(wM[n])return e.withTextFontFamily(wM[n]);if(SM[n])return e.withTextFontWeight(SM[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(b2e[n])};et({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:Er(s),font:r}},htmlBuilder(t,e){var n=kM(t,e),r=es(t.body,n,!0);return be.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=kM(t,e);return Cc(t.body,n)}});et({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=Cn(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 Fe.MathNode("mo",[new Fe.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Fe.MathNode("munder",[Kn(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});et({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=Cn(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 Fe.MathNode("mpadded",[Kn(t.body,e)],["vcenter"])}});et({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=jM(t),r=[],s=e.havingStyle(e.style.text()),i=0;it.body.replace(/ /g,t.star?"␣":" "),fc=aQ,IQ=`[ \r - ]`,w2e="\\\\[a-zA-Z@]+",S2e="\\\\[^\uD800-\uDFFF]",k2e="("+w2e+")"+IQ+"*",j2e=`\\\\( -|[ \r ]+ -?)[ \r ]*`,vk="[̀-ͯ]",O2e=new RegExp(vk+"+$"),N2e="("+IQ+"+)|"+(j2e+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(vk+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(vk+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+k2e)+("|"+S2e+")");class OM{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(N2e,"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 Ri("EOF",new Js(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new $e("Unexpected character: '"+e[n]+"'",new Ri(e[n],new Js(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 Ri(s,new Js(this,n,this.tokenRegex.lastIndex))}}class C2e{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 T2e=CQ;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 NM={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=NM[e.text],r==null||r>=n)throw new $e("Invalid base-"+n+" digit "+e.text);for(var s;(s=NM[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 o=0;if(s=t.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",h=t.expandNextToken();h.text!=="]"&&h.text!=="EOF";)c+=h.text,h=t.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new $e("Invalid number of arguments: "+c);o=parseInt(c),s=t.consumeArg().tokens}return a&&r||t.macros.set(i,{tokens:s,numArgs:o}),""};Z("\\newcommand",t=>aO(t,!1,!0,!1));Z("\\renewcommand",t=>aO(t,!0,!1,!1));Z("\\providecommand",t=>aO(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],Jn.math[n],Jn.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 CM={",":"\\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 CM?e=CM[n]:(n.slice(0,4)==="\\not"||n in Jn.math&&["bin","rel"].includes(Jn.math[n].group))&&(e="\\dotsb"),e});var lO={")":!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 lO?"\\ldots\\,":"\\ldots"});Z("\\dotsc",function(t){var e=t.future().text;return e in lO&&e!==","?"\\ldots\\,":"\\ldots"});Z("\\cdots",function(t){var e=t.future().text;return e in lO?"\\@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 BQ=We(il["Main-Regular"][84][1]-.7*il["Main-Regular"][65][1]);Z("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+BQ+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");Z("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+BQ+"}{\\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 qQ=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,s=e.consumeArg().tokens,i=e.consumeArg().tokens,a=e.macros.get("|"),o=e.macros.get("\\|");e.macros.beginGroup();var c=m=>g=>{t&&(g.macros.set("|",a),s.length&&g.macros.set("\\|",o));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 h=e.consumeArg().tokens,f=e.expandTokens([...i,...h,...n]);return e.macros.endGroup(),{tokens:f.reverse(),numArgs:0}};Z("\\bra@ket",qQ(!1));Z("\\bra@set",qQ(!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 FQ={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class E2e{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 C2e(T2e,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new OM(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 Ri("EOF",r.loc)),this.pushTokens(s),new Ri("",Js.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,o=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[o]:"}")+"'",i);if(e&&r)if((a===0||a===1&&e[o]==="{")&&i.text===e[o]){if(++o,o===e.length){n.splice(-o,o);break}}else o=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 o=i.length-1;o>=0;--o){var c=i[o];if(c.text==="#"){if(o===0)throw new $e("Incomplete placeholder at end of macro body",c);if(c=i[--o],c.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(c.text))i.splice(o,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 Ri(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 o=new OM(s,this.settings),c=[],h=o.lex();h.text!=="EOF";)c.push(h),h=o.lex();c.reverse();var f={tokens:c,numArgs:i};return f}return s}isDefined(e){return this.macros.has(e)||fc.hasOwnProperty(e)||Jn.math.hasOwnProperty(e)||Jn.text.hasOwnProperty(e)||FQ.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 TM=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Lx=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","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),L4={"́":{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"}},EM={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class My{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 E2e(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 Ri("}")),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(My.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 o=Jn[this.mode][n].group,c=Js.range(e),h;if(xbe.hasOwnProperty(o)){var f=o;h={type:"atom",mode:this.mode,family:f,loc:c,text:n}}else h={type:o,mode:this.mode,loc:c,text:n};a=h}else if(n.charCodeAt(0)>=128)this.settings.strict&&(Y$(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:Js.range(e),text:n};else return null;if(this.consume(),i)for(var m=0;mh&&(h=f):f&&(h!==void 0&&h>-1&&c.push(` -`.repeat(h)||" "),h=-1,c.push(f))}return c.join("")}function GQ(t,e,n){return t.type==="element"?awe(t,e,n):t.type==="text"?n.whitespace==="normal"?XQ(t,n):lwe(t):[]}function awe(t,e,n){const r=YQ(t,n),s=t.children||[];let i=-1,a=[];if(swe(t))return a;let o,c;for(bk(t)||IM(t)&&DM(e,t,IM)?c=` -`:rwe(t)?(o=2,c=2):WQ(t)&&(o=1,c=1);++i{try{i(!0);const Oe=await xwe({page:a,page_size:f,is_registered:g==="all"?void 0:g==="registered",is_banned:y==="all"?void 0:y==="banned",format:S==="all"?void 0:S,sort_by:N,sort_order:T});e(Oe.data),h(Oe.total)}catch(Oe){const He=Oe instanceof Error?Oe.message:"加载表情包列表失败";W({title:"错误",description:He,variant:"destructive"})}finally{i(!1)}},[a,f,g,y,S,N,T,W]),V=async()=>{try{const Oe=await wwe();r(Oe.data)}catch(Oe){console.error("加载统计数据失败:",Oe)}};b.useEffect(()=>{F()},[F]),b.useEffect(()=>{V()},[]);const te=async Oe=>{try{const He=await vwe(Oe.id);M(He.data),P(!0)}catch(He){const Ve=He instanceof Error?He.message:"加载详情失败";W({title:"错误",description:Ve,variant:"destructive"})}},ne=Oe=>{M(Oe),Q(!0)},K=Oe=>{M(Oe),ee(!0)},ie=async()=>{if(E)try{await bwe(E.id),W({title:"成功",description:"表情包已删除"}),ee(!1),M(null),F(),V()}catch(Oe){const He=Oe instanceof Error?Oe.message:"删除失败";W({title:"错误",description:He,variant:"destructive"})}},re=async Oe=>{try{await Swe(Oe.id),W({title:"成功",description:"表情包已注册"}),F(),V()}catch(He){const Ve=He instanceof Error?He.message:"注册失败";W({title:"错误",description:Ve,variant:"destructive"})}},ae=async Oe=>{try{await kwe(Oe.id),W({title:"成功",description:"表情包已封禁"}),F(),V()}catch(He){const Ve=He instanceof Error?He.message:"封禁失败";W({title:"错误",description:Ve,variant:"destructive"})}},_e=Oe=>{const He=new Set(z);He.has(Oe)?He.delete(Oe):He.add(Oe),H(He)},Ue=async()=>{try{const Oe=await jwe(Array.from(z));W({title:"批量删除完成",description:Oe.message}),H(new Set),X(!1),F(),V()}catch(Oe){W({title:"批量删除失败",description:Oe instanceof Error?Oe.message:"批量删除失败",variant:"destructive"})}},Xe=()=>{const Oe=parseInt(J),He=Math.ceil(c/f);Oe>=1&&Oe<=He?(o(Oe),G("")):W({title:"无效的页码",description:`请输入1-${He}之间的页码`,variant:"destructive"})},Ze=n?.formats?Object.keys(n.formats):[];return l.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[l.jsxs("div",{className:"mb-4 sm:mb-6",children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),l.jsx(hn,{className:"flex-1",children:l.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[n&&l.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[l.jsx(Dt,{children:l.jsxs(kn,{className:"pb-2",children:[l.jsx(Fr,{children:"总数"}),l.jsx(jn,{className:"text-2xl",children:n.total})]})}),l.jsx(Dt,{children:l.jsxs(kn,{className:"pb-2",children:[l.jsx(Fr,{children:"已注册"}),l.jsx(jn,{className:"text-2xl text-green-600",children:n.registered})]})}),l.jsx(Dt,{children:l.jsxs(kn,{className:"pb-2",children:[l.jsx(Fr,{children:"已封禁"}),l.jsx(jn,{className:"text-2xl text-red-600",children:n.banned})]})}),l.jsx(Dt,{children:l.jsxs(kn,{className:"pb-2",children:[l.jsx(Fr,{children:"未注册"}),l.jsx(jn,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),l.jsxs(Dt,{children:[l.jsx(kn,{children:l.jsxs(jn,{className:"flex items-center gap-2",children:[l.jsx(P3,{className:"h-5 w-5"}),"筛选和排序"]})}),l.jsxs(Dn,{className:"space-y-4",children:[l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"排序方式"}),l.jsxs(qt,{value:`${N}-${T}`,onValueChange:Oe=>{const[He,Ve]=Oe.split("-");C(He),_(Ve),o(1)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"usage_count-desc",children:"使用次数 (多→少)"}),l.jsx(De,{value:"usage_count-asc",children:"使用次数 (少→多)"}),l.jsx(De,{value:"register_time-desc",children:"注册时间 (新→旧)"}),l.jsx(De,{value:"register_time-asc",children:"注册时间 (旧→新)"}),l.jsx(De,{value:"record_time-desc",children:"记录时间 (新→旧)"}),l.jsx(De,{value:"record_time-asc",children:"记录时间 (旧→新)"}),l.jsx(De,{value:"last_used_time-desc",children:"最后使用 (新→旧)"}),l.jsx(De,{value:"last_used_time-asc",children:"最后使用 (旧→新)"})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"注册状态"}),l.jsxs(qt,{value:g,onValueChange:Oe=>{x(Oe),o(1)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"all",children:"全部"}),l.jsx(De,{value:"registered",children:"已注册"}),l.jsx(De,{value:"unregistered",children:"未注册"})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"封禁状态"}),l.jsxs(qt,{value:y,onValueChange:Oe=>{w(Oe),o(1)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"all",children:"全部"}),l.jsx(De,{value:"banned",children:"已封禁"}),l.jsx(De,{value:"unbanned",children:"未封禁"})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"格式"}),l.jsxs(qt,{value:S,onValueChange:Oe=>{k(Oe),o(1)},children:[l.jsx(It,{children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"all",children:"全部"}),Ze.map(Oe=>l.jsxs(De,{value:Oe,children:[Oe.toUpperCase()," (",n?.formats[Oe],")"]},Oe))]})]})]})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 pt-4 border-t",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[z.size>0&&l.jsxs("span",{className:"text-sm text-muted-foreground",children:["已选择 ",z.size," 个表情包"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{className:"text-sm whitespace-nowrap",children:"卡片大小"}),l.jsxs(qt,{value:R,onValueChange:Oe=>se(Oe),children:[l.jsx(It,{className:"w-24",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"small",children:"小"}),l.jsx(De,{value:"medium",children:"中"}),l.jsx(De,{value:"large",children:"大"})]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{htmlFor:"emoji-page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),l.jsxs(qt,{value:f.toString(),onValueChange:Oe=>{m(parseInt(Oe)),o(1),H(new Set)},children:[l.jsx(It,{id:"emoji-page-size",className:"w-20",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"20",children:"20"}),l.jsx(De,{value:"40",children:"40"}),l.jsx(De,{value:"60",children:"60"}),l.jsx(De,{value:"100",children:"100"})]})]}),z.size>0&&l.jsxs(l.Fragment,{children:[l.jsx(de,{variant:"outline",size:"sm",onClick:()=>H(new Set),children:"取消选择"}),l.jsxs(de,{variant:"destructive",size:"sm",onClick:()=>X(!0),children:[l.jsx(fn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]}),l.jsx("div",{className:"flex justify-end pt-4 border-t",children:l.jsxs(de,{variant:"outline",size:"sm",onClick:F,disabled:s,children:[l.jsx(Ls,{className:`h-4 w-4 mr-2 ${s?"animate-spin":""}`}),"刷新"]})})]})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"表情包列表"}),l.jsxs(Fr,{children:["共 ",c," 个表情包,当前第 ",a," 页"]})]}),l.jsxs(Dn,{children:[t.length===0?l.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"暂无数据"}):l.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=>l.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:()=>_e(Oe.id),children:[l.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:l.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)&&l.jsx(xc,{className:"h-3 w-3"})})}),l.jsxs("div",{className:"absolute top-1 right-1 z-10 flex flex-col gap-0.5",children:[Oe.is_registered&&l.jsx(In,{variant:"default",className:"bg-green-600 text-[10px] px-1 py-0",children:"已注册"}),Oe.is_banned&&l.jsx(In,{variant:"destructive",className:"text-[10px] px-1 py-0",children:"已封禁"})]}),l.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:l.jsx("img",{src:KQ(Oe.id),alt:"表情包",className:"w-full h-full object-contain",loading:"lazy",onError:He=>{const Ve=He.target;Ve.style.display="none";const Be=Ve.parentElement;Be&&(Be.innerHTML='')}})}),l.jsxs("div",{className:`border-t bg-card ${R==="small"?"p-1":"p-2"}`,children:[l.jsxs("div",{className:"flex items-center justify-between gap-1 text-xs text-muted-foreground mb-1",children:[l.jsx(In,{variant:"outline",className:"text-[10px] px-1 py-0",children:Oe.format.toUpperCase()}),l.jsxs("span",{className:"font-mono",children:[Oe.usage_count,"次"]})]}),l.jsxs("div",{className:`flex gap-1 justify-center opacity-0 group-hover:opacity-100 transition-opacity ${R==="small"?"flex-wrap":""}`,children:[l.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:He=>{He.stopPropagation(),ne(Oe)},title:"编辑",children:l.jsx(Qm,{className:"h-3 w-3"})}),l.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:He=>{He.stopPropagation(),te(Oe)},title:"详情",children:l.jsx(ra,{className:"h-3 w-3"})}),!Oe.is_registered&&l.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6 text-green-600 hover:text-green-700",onClick:He=>{He.stopPropagation(),re(Oe)},title:"注册",children:l.jsx(xc,{className:"h-3 w-3"})}),!Oe.is_banned&&l.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6 text-orange-600 hover:text-orange-700",onClick:He=>{He.stopPropagation(),ae(Oe)},title:"封禁",children:l.jsx(HK,{className:"h-3 w-3"})}),l.jsx(de,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-600 hover:text-red-700",onClick:He=>{He.stopPropagation(),K(Oe)},title:"删除",children:l.jsx(fn,{className:"h-3 w-3"})})]})]})]},Oe.id))}),c>0&&l.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-4",children:[l.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(a-1)*f+1," 到"," ",Math.min(a*f,c)," 条,共 ",c," 条"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(de,{variant:"outline",size:"sm",onClick:()=>o(1),disabled:a===1,className:"hidden sm:flex",children:l.jsx(L0,{className:"h-4 w-4"})}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>o(Oe=>Math.max(1,Oe-1)),disabled:a===1,children:[l.jsx($u,{className:"h-4 w-4 sm:mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Pe,{type:"number",value:J,onChange:Oe=>G(Oe.target.value),onKeyDown:Oe=>Oe.key==="Enter"&&Xe(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(c/f)}),l.jsx(de,{variant:"outline",size:"sm",onClick:Xe,disabled:!J,className:"h-8",children:"跳转"})]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>o(Oe=>Oe+1),disabled:a>=Math.ceil(c/f),children:[l.jsx("span",{className:"hidden sm:inline",children:"下一页"}),l.jsx(Qu,{className:"h-4 w-4 sm:ml-1"})]}),l.jsx(de,{variant:"outline",size:"sm",onClick:()=>o(Math.ceil(c/f)),disabled:a>=Math.ceil(c/f),className:"hidden sm:flex",children:l.jsx(I0,{className:"h-4 w-4"})})]})]})]})]}),l.jsx(Nwe,{emoji:E,open:L,onOpenChange:P}),l.jsx(Cwe,{emoji:E,open:I,onOpenChange:Q,onSuccess:()=>{F(),V()}})]})}),l.jsx(Nn,{open:B,onOpenChange:X,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认批量删除"}),l.jsxs(bn,{children:["你确定要删除选中的 ",z.size," 个表情包吗?此操作不可撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:Ue,children:"确认删除"})]})]})}),l.jsx(xr,{open:U,onOpenChange:ee,children:l.jsxs(lr,{children:[l.jsxs(or,{children:[l.jsx(cr,{children:"确认删除"}),l.jsx(Hr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),l.jsxs(as,{children:[l.jsx(de,{variant:"outline",onClick:()=>ee(!1),children:"取消"}),l.jsx(de,{variant:"destructive",onClick:ie,children:"删除"})]})]})})]})}function Nwe({emoji:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return l.jsx(xr,{open:e,onOpenChange:n,children:l.jsxs(lr,{className:"max-w-2xl max-h-[90vh]",children:[l.jsx(or,{children:l.jsx(cr,{children:"表情包详情"})}),l.jsx(hn,{className:"max-h-[calc(90vh-8rem)] pr-4",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"w-32 h-32 bg-muted rounded-lg flex items-center justify-center overflow-hidden",children:l.jsx("img",{src:KQ(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='')}})})}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"ID"}),l.jsx("div",{className:"mt-1 font-mono",children:t.id})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"格式"}),l.jsx("div",{className:"mt-1",children:l.jsx(In,{variant:"outline",children:t.format.toUpperCase()})})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"文件路径"}),l.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.full_path})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"哈希值"}),l.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:t.emoji_hash})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"描述"}),t.description?l.jsx("div",{className:"mt-1 rounded-lg border bg-muted/50 p-3",children:l.jsx(gwe,{className:"prose-sm",children:t.description})}):l.jsx("div",{className:"mt-1 text-sm text-muted-foreground",children:"-"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"情绪"}),l.jsx("div",{className:"mt-1",children:t.emotion?l.jsx("span",{className:"text-sm",children:t.emotion}):l.jsx("span",{className:"text-sm text-muted-foreground",children:"-"})})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"状态"}),l.jsxs("div",{className:"mt-2 flex gap-2",children:[t.is_registered&&l.jsx(In,{variant:"default",className:"bg-green-600",children:"已注册"}),t.is_banned&&l.jsx(In,{variant:"destructive",children:"已封禁"}),!t.is_registered&&!t.is_banned&&l.jsx(In,{variant:"outline",children:"未注册"})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"使用次数"}),l.jsx("div",{className:"mt-1 font-mono text-lg",children:t.usage_count})]})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"记录时间"}),l.jsx("div",{className:"mt-1 text-sm",children:r(t.record_time)})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"注册时间"}),l.jsx("div",{className:"mt-1 text-sm",children:r(t.register_time)})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-muted-foreground",children:"最后使用"}),l.jsx("div",{className:"mt-1 text-sm",children:r(t.last_used_time)})]})]})})]})})}function Cwe({emoji:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState(""),[a,o]=b.useState(!1),[c,h]=b.useState(!1),[f,m]=b.useState(!1),{toast:g}=ts();b.useEffect(()=>{t&&(i(t.emotion||""),o(t.is_registered),h(t.is_banned))},[t]);const x=async()=>{if(t)try{m(!0);const y=s.split(/[,,]/).map(w=>w.trim()).filter(Boolean).join(",");await ywe(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?l.jsx(xr,{open:e,onOpenChange:n,children:l.jsxs(lr,{className:"max-w-2xl",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"编辑表情包"}),l.jsx(Hr,{children:"修改表情包的情绪和状态信息"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(ue,{children:"情绪"}),l.jsx(pr,{value:s,onChange:y=>i(y.target.value),placeholder:"输入情绪描述...",rows:2,className:"mt-1"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入情绪相关的文本描述"})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(li,{id:"is_registered",checked:a,onCheckedChange:y=>{y===!0?(o(!0),h(!1)):o(!1)}}),l.jsx(ue,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(li,{id:"is_banned",checked:c,onCheckedChange:y=>{y===!0?(h(!0),o(!1)):h(!1)}}),l.jsx(ue,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),l.jsxs(as,{children:[l.jsx(de,{variant:"outline",onClick:()=>n(!1),children:"取消"}),l.jsx(de,{onClick:x,disabled:f,children:f?"保存中...":"保存"})]})]})}):null}const Lc="/api/webui/expression";async function Twe(){const t=await pt(`${Lc}/chats`,{headers:Ct()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取聊天列表失败")}return t.json()}async function Ewe(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 pt(`${Lc}/list?${e}`,{headers:Ct()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function _we(t){const e=await pt(`${Lc}/${t}`,{headers:Ct()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取表达方式详情失败")}return e.json()}async function Mwe(t){const e=await pt(`${Lc}/`,{method:"POST",headers:Ct(),body:JSON.stringify(t)});if(!e.ok){const n=await e.json();throw new Error(n.detail||"创建表达方式失败")}return e.json()}async function Awe(t,e){const n=await pt(`${Lc}/${t}`,{method:"PATCH",headers:Ct(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function Rwe(t){const e=await pt(`${Lc}/${t}`,{method:"DELETE",headers:Ct()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除表达方式失败")}return e.json()}async function Dwe(t){const e=await pt(`${Lc}/batch/delete`,{method:"POST",headers:Ct(),body:JSON.stringify({ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除表达方式失败")}return e.json()}async function zwe(){const t=await pt(`${Lc}/stats/summary`,{headers:Ct()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}function Pwe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,o]=b.useState(1),[c,h]=b.useState(20),[f,m]=b.useState(""),[g,x]=b.useState(null),[y,w]=b.useState(!1),[S,k]=b.useState(!1),[N,C]=b.useState(!1),[T,_]=b.useState(null),[E,M]=b.useState(new Set),[L,P]=b.useState(!1),[I,Q]=b.useState(""),[U,ee]=b.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),[z,H]=b.useState([]),[B,X]=b.useState(new Map),{toast:J}=ts(),G=async()=>{try{r(!0);const ae=await Ewe({page:a,page_size:c,search:f||void 0});e(ae.data),i(ae.total)}catch(ae){J({title:"加载失败",description:ae instanceof Error?ae.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},R=async()=>{try{const ae=await zwe();ae?.data&&ee(ae.data)}catch(ae){console.error("加载统计数据失败:",ae)}},se=async()=>{try{const ae=await Twe();if(ae?.data){H(ae.data);const _e=new Map;ae.data.forEach(Ue=>{_e.set(Ue.chat_id,Ue.chat_name)}),X(_e)}}catch(ae){console.error("加载聊天列表失败:",ae)}},W=ae=>B.get(ae)||ae;b.useEffect(()=>{G(),R(),se()},[a,c,f]);const F=async ae=>{try{const _e=await _we(ae.id);x(_e.data),w(!0)}catch(_e){J({title:"加载详情失败",description:_e instanceof Error?_e.message:"无法加载表达方式详情",variant:"destructive"})}},V=ae=>{x(ae),k(!0)},te=async ae=>{try{await Rwe(ae.id),J({title:"删除成功",description:`已删除表达方式: ${ae.situation}`}),_(null),G(),R()}catch(_e){J({title:"删除失败",description:_e instanceof Error?_e.message:"无法删除表达方式",variant:"destructive"})}},ne=ae=>{const _e=new Set(E);_e.has(ae)?_e.delete(ae):_e.add(ae),M(_e)},K=()=>{E.size===t.length&&t.length>0?M(new Set):M(new Set(t.map(ae=>ae.id)))},ie=async()=>{try{await Dwe(Array.from(E)),J({title:"批量删除成功",description:`已删除 ${E.size} 个表达方式`}),M(new Set),P(!1),G(),R()}catch(ae){J({title:"批量删除失败",description:ae instanceof Error?ae.message:"无法批量删除表达方式",variant:"destructive"})}},re=()=>{const ae=parseInt(I),_e=Math.ceil(s/c);ae>=1&&ae<=_e?(o(ae),Q("")):J({title:"无效的页码",description:`请输入1-${_e}之间的页码`,variant:"destructive"})};return l.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[l.jsx("div",{className:"mb-4 sm:mb-6",children:l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[l.jsxs("div",{children:[l.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[l.jsx(z0,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),l.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),l.jsxs(de,{onClick:()=>C(!0),className:"gap-2",children:[l.jsx(ws,{className:"h-4 w-4"}),"新增表达方式"]})]})}),l.jsx(hn,{className:"flex-1",children:l.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[l.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[l.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),l.jsx("div",{className:"text-2xl font-bold mt-1",children:U.total})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[l.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),l.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:U.recent_7days})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[l.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),l.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:U.chat_count})]})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[l.jsx(ue,{htmlFor:"search",children:"搜索"}),l.jsx("div",{className:"flex flex-col sm:flex-row gap-2 mt-1.5",children:l.jsxs("div",{className:"flex-1 relative",children:[l.jsx(ci,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx(Pe,{id:"search",placeholder:"搜索情境、风格或上下文...",value:f,onChange:ae=>m(ae.target.value),className:"pl-9"})]})}),l.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:[l.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:E.size>0&&l.jsxs("span",{children:["已选择 ",E.size," 个表达方式"]})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),l.jsxs(qt,{value:c.toString(),onValueChange:ae=>{h(parseInt(ae)),o(1),M(new Set)},children:[l.jsx(It,{id:"page-size",className:"w-20",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"10",children:"10"}),l.jsx(De,{value:"20",children:"20"}),l.jsx(De,{value:"50",children:"50"}),l.jsx(De,{value:"100",children:"100"})]})]}),E.size>0&&l.jsxs(l.Fragment,{children:[l.jsx(de,{variant:"outline",size:"sm",onClick:()=>M(new Set),children:"取消选择"}),l.jsxs(de,{variant:"destructive",size:"sm",onClick:()=>P(!0),children:[l.jsx(fn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),l.jsxs("div",{className:"rounded-lg border bg-card",children:[l.jsx("div",{className:"hidden md:block",children:l.jsxs(Vh,{children:[l.jsx(Uh,{children:l.jsxs(bs,{children:[l.jsx(ln,{className:"w-12",children:l.jsx(li,{checked:E.size===t.length&&t.length>0,onCheckedChange:K})}),l.jsx(ln,{children:"情境"}),l.jsx(ln,{children:"风格"}),l.jsx(ln,{children:"聊天"}),l.jsx(ln,{className:"text-right",children:"操作"})]})}),l.jsx(Wh,{children:n?l.jsx(bs,{children:l.jsx(Qt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?l.jsx(bs,{children:l.jsx(Qt,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(ae=>l.jsxs(bs,{children:[l.jsx(Qt,{children:l.jsx(li,{checked:E.has(ae.id),onCheckedChange:()=>ne(ae.id)})}),l.jsx(Qt,{className:"font-medium max-w-xs truncate",children:ae.situation}),l.jsx(Qt,{className:"max-w-xs truncate",children:ae.style}),l.jsx(Qt,{className:"max-w-[200px] truncate",title:W(ae.chat_id),style:{wordBreak:"keep-all"},children:l.jsx("span",{className:"whitespace-nowrap overflow-hidden text-ellipsis block",children:W(ae.chat_id)})}),l.jsx(Qt,{className:"text-right",children:l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsxs(de,{variant:"default",size:"sm",onClick:()=>V(ae),children:[l.jsx(Qm,{className:"h-4 w-4 mr-1"}),"编辑"]}),l.jsx(de,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>F(ae),title:"查看详情",children:l.jsx(oa,{className:"h-4 w-4"})}),l.jsxs(de,{size:"sm",onClick:()=>_(ae),className:"bg-red-600 hover:bg-red-700 text-white",children:[l.jsx(fn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},ae.id))})]})}),l.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(ae=>l.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(li,{checked:E.has(ae.id),onCheckedChange:()=>ne(ae.id),className:"mt-1"}),l.jsxs("div",{className:"min-w-0 flex-1 overflow-hidden space-y-2",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"情境"}),l.jsx("h3",{className:"font-semibold text-sm line-clamp-2 w-full break-all",title:ae.situation,children:ae.situation})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"风格"}),l.jsx("p",{className:"text-sm line-clamp-2 w-full break-all",title:ae.style,children:ae.style})]})]})]}),l.jsxs("div",{className:"text-sm",children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"聊天"}),l.jsx("p",{className:"text-sm truncate",title:W(ae.chat_id),style:{wordBreak:"keep-all"},children:W(ae.chat_id)})]}),l.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>V(ae),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[l.jsx(Qm,{className:"h-3 w-3 mr-1"}),"编辑"]}),l.jsx(de,{variant:"outline",size:"sm",onClick:()=>F(ae),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:l.jsx(oa,{className:"h-3 w-3"})}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>_(ae),className:"text-xs px-2 py-1 h-auto flex-shrink-0 text-destructive hover:text-destructive",children:[l.jsx(fn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},ae.id))}),s>0&&l.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[l.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(de,{variant:"outline",size:"sm",onClick:()=>o(1),disabled:a===1,className:"hidden sm:flex",children:l.jsx(L0,{className:"h-4 w-4"})}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>o(a-1),disabled:a===1,children:[l.jsx($u,{className:"h-4 w-4 sm:mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Pe,{type:"number",value:I,onChange:ae=>Q(ae.target.value),onKeyDown:ae=>ae.key==="Enter"&&re(),placeholder:a.toString(),className:"w-16 h-8 text-center",min:1,max:Math.ceil(s/c)}),l.jsx(de,{variant:"outline",size:"sm",onClick:re,disabled:!I,className:"h-8",children:"跳转"})]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>o(a+1),disabled:a>=Math.ceil(s/c),children:[l.jsx("span",{className:"hidden sm:inline",children:"下一页"}),l.jsx(Qu,{className:"h-4 w-4 sm:ml-1"})]}),l.jsx(de,{variant:"outline",size:"sm",onClick:()=>o(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:l.jsx(I0,{className:"h-4 w-4"})})]})]})]})]})}),l.jsx(Lwe,{expression:g,open:y,onOpenChange:w,chatNameMap:B}),l.jsx(Iwe,{open:N,onOpenChange:C,chatList:z,onSuccess:()=>{G(),R(),C(!1)}}),l.jsx(Bwe,{expression:g,open:S,onOpenChange:k,chatList:z,onSuccess:()=>{G(),R(),k(!1)}}),l.jsx(Nn,{open:!!T,onOpenChange:()=>_(null),children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:['确定要删除表达方式 "',T?.situation,'" 吗? 此操作不可撤销。']})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>T&&te(T),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),l.jsx(qwe,{open:L,onOpenChange:P,onConfirm:ie,count:E.size})]})}function Lwe({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 l.jsx(xr,{open:e,onOpenChange:n,children:l.jsxs(lr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"表达方式详情"}),l.jsx(Hr,{children:"查看表达方式的完整信息"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(om,{label:"情境",value:t.situation}),l.jsx(om,{label:"风格",value:t.style}),l.jsx(om,{label:"聊天",value:i(t.chat_id)}),l.jsx(om,{icon:L3,label:"记录ID",value:t.id.toString(),mono:!0})]}),l.jsx("div",{className:"grid grid-cols-2 gap-4",children:l.jsx(om,{icon:Zd,label:"创建时间",value:s(t.create_date)})})]}),l.jsx(as,{children:l.jsx(de,{onClick:()=>n(!1),children:"关闭"})})]})})}function om({icon:t,label:e,value:n,mono:r=!1}){return l.jsxs("div",{className:"space-y-1",children:[l.jsxs(ue,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&l.jsx(t,{className:"h-3 w-3"}),e]}),l.jsx("div",{className:ve("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function Iwe({open:t,onOpenChange:e,chatList:n,onSuccess:r}){const[s,i]=b.useState({situation:"",style:"",chat_id:""}),[a,o]=b.useState(!1),{toast:c}=ts(),h=async()=>{if(!s.situation||!s.style||!s.chat_id){c({title:"验证失败",description:"请填写必填字段:情境、风格和聊天",variant:"destructive"});return}try{o(!0),await Mwe(s),c({title:"创建成功",description:"表达方式已创建"}),i({situation:"",style:"",chat_id:""}),r()}catch(f){c({title:"创建失败",description:f instanceof Error?f.message:"无法创建表达方式",variant:"destructive"})}finally{o(!1)}};return l.jsx(xr,{open:t,onOpenChange:e,children:l.jsxs(lr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"新增表达方式"}),l.jsx(Hr,{children:"创建新的表达方式记录"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs(ue,{htmlFor:"situation",children:["情境 ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsx(Pe,{id:"situation",value:s.situation,onChange:f=>i({...s,situation:f.target.value}),placeholder:"描述使用场景"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(ue,{htmlFor:"style",children:["风格 ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsx(Pe,{id:"style",value:s.style,onChange:f=>i({...s,style:f.target.value}),placeholder:"描述表达风格"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(ue,{htmlFor:"chat_id",children:["聊天 ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsxs(qt,{value:s.chat_id,onValueChange:f=>i({...s,chat_id:f}),children:[l.jsx(It,{children:l.jsx(Ft,{placeholder:"选择关联的聊天"})}),l.jsx(Bt,{children:n.map(f=>l.jsx(De,{value:f.chat_id,children:l.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[f.chat_name,f.is_group&&l.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},f.chat_id))})]})]})]}),l.jsxs(as,{children:[l.jsx(de,{variant:"outline",onClick:()=>e(!1),children:"取消"}),l.jsx(de,{onClick:h,disabled:a,children:a?"创建中...":"创建"})]})]})})}function Bwe({expression:t,open:e,onOpenChange:n,chatList:r,onSuccess:s}){const[i,a]=b.useState({}),[o,c]=b.useState(!1),{toast:h}=ts();b.useEffect(()=>{t&&a({situation:t.situation,style:t.style,chat_id:t.chat_id})},[t]);const f=async()=>{if(t)try{c(!0),await Awe(t.id,i),h({title:"保存成功",description:"表达方式已更新"}),s()}catch(m){h({title:"保存失败",description:m instanceof Error?m.message:"无法更新表达方式",variant:"destructive"})}finally{c(!1)}};return t?l.jsx(xr,{open:e,onOpenChange:n,children:l.jsxs(lr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"编辑表达方式"}),l.jsx(Hr,{children:"修改表达方式的信息"})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"edit_situation",children:"情境"}),l.jsx(Pe,{id:"edit_situation",value:i.situation||"",onChange:m=>a({...i,situation:m.target.value}),placeholder:"描述使用场景"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"edit_style",children:"风格"}),l.jsx(Pe,{id:"edit_style",value:i.style||"",onChange:m=>a({...i,style:m.target.value}),placeholder:"描述表达风格"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"edit_chat_id",children:"聊天"}),l.jsxs(qt,{value:i.chat_id||"",onValueChange:m=>a({...i,chat_id:m}),children:[l.jsx(It,{children:l.jsx(Ft,{placeholder:"选择关联的聊天"})}),l.jsx(Bt,{children:r.map(m=>l.jsx(De,{value:m.chat_id,children:l.jsxs("span",{className:"truncate",style:{wordBreak:"keep-all"},children:[m.chat_name,m.is_group&&l.jsx("span",{className:"text-muted-foreground ml-1",children:"(群聊)"})]})},m.chat_id))})]})]})]}),l.jsxs(as,{children:[l.jsx(de,{variant:"outline",onClick:()=>n(!1),children:"取消"}),l.jsx(de,{onClick:f,disabled:o,children:o?"保存中...":"保存"})]})]})}):null}function qwe({open:t,onOpenChange:e,onConfirm:n,count:r}){return l.jsx(Nn,{open:t,onOpenChange:e,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认批量删除"}),l.jsxs(bn,{children:["您即将删除 ",r," 个表达方式,此操作无法撤销。确定要继续吗?"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"确认删除"})]})]})})}const tf="/api/webui/person";async function Fwe(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 pt(`${tf}/list?${e}`,{headers:Ct()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function $we(t){const e=await pt(`${tf}/${t}`,{headers:Ct()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"获取人物详情失败")}return e.json()}async function Qwe(t,e){const n=await pt(`${tf}/${t}`,{method:"PATCH",headers:Ct(),body:JSON.stringify(e)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function Hwe(t){const e=await pt(`${tf}/${t}`,{method:"DELETE",headers:Ct()});if(!e.ok){const n=await e.json();throw new Error(n.detail||"删除人物信息失败")}return e.json()}async function Vwe(){const t=await pt(`${tf}/stats/summary`,{headers:Ct()});if(!t.ok){const e=await t.json();throw new Error(e.detail||"获取统计数据失败")}return t.json()}async function Uwe(t){const e=await pt(`${tf}/batch/delete`,{method:"POST",headers:Ct(),body:JSON.stringify({person_ids:t})});if(!e.ok){const n=await e.json();throw new Error(n.detail||"批量删除失败")}return e.json()}function Wwe(){const[t,e]=b.useState([]),[n,r]=b.useState(!0),[s,i]=b.useState(0),[a,o]=b.useState(1),[c,h]=b.useState(20),[f,m]=b.useState(""),[g,x]=b.useState(void 0),[y,w]=b.useState(void 0),[S,k]=b.useState(null),[N,C]=b.useState(!1),[T,_]=b.useState(!1),[E,M]=b.useState(null),[L,P]=b.useState({total:0,known:0,unknown:0,platforms:{}}),[I,Q]=b.useState(new Set),[U,ee]=b.useState(!1),[z,H]=b.useState(""),{toast:B}=ts(),X=async()=>{try{r(!0);const re=await Fwe({page:a,page_size:c,search:f||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 Vwe();re?.data&&P(re.data)}catch(re){console.error("加载统计数据失败:",re)}};b.useEffect(()=>{X(),J()},[a,c,f,g,y]);const G=async re=>{try{const ae=await $we(re.person_id);k(ae.data),C(!0)}catch(ae){B({title:"加载详情失败",description:ae instanceof Error?ae.message:"无法加载人物详情",variant:"destructive"})}},R=re=>{k(re),_(!0)},se=async re=>{try{await Hwe(re.person_id),B({title:"删除成功",description:`已删除人物信息: ${re.person_name||re.nickname||re.user_id}`}),M(null),X(),J()}catch(ae){B({title:"删除失败",description:ae instanceof Error?ae.message:"无法删除人物信息",variant:"destructive"})}},W=b.useMemo(()=>Object.keys(L.platforms),[L.platforms]),F=re=>{const ae=new Set(I);ae.has(re)?ae.delete(re):ae.add(re),Q(ae)},V=()=>{I.size===t.length&&t.length>0?Q(new Set):Q(new Set(t.map(re=>re.person_id)))},te=()=>{if(I.size===0){B({title:"未选择任何人物",description:"请先选择要删除的人物",variant:"destructive"});return}ee(!0)},ne=async()=>{try{const re=await Uwe(Array.from(I));B({title:"批量删除完成",description:re.message}),Q(new Set),ee(!1),X(),J()}catch(re){B({title:"批量删除失败",description:re instanceof Error?re.message:"批量删除失败",variant:"destructive"})}},K=()=>{const re=parseInt(z),ae=Math.ceil(s/c);re>=1&&re<=ae?(o(re),H("")):B({title:"无效的页码",description:`请输入1-${ae}之间的页码`,variant:"destructive"})},ie=re=>re?new Date(re*1e3).toLocaleString("zh-CN"):"-";return l.jsxs("div",{className:"h-[calc(100vh-4rem)] flex flex-col p-4 sm:p-6",children:[l.jsx("div",{className:"mb-4 sm:mb-6",children:l.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:l.jsxs("div",{children:[l.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[l.jsx(VK,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),l.jsx("p",{className:"text-muted-foreground mt-1 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})})}),l.jsx(hn,{className:"flex-1",children:l.jsxs("div",{className:"space-y-4 sm:space-y-6 pr-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[l.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[l.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),l.jsx("div",{className:"text-2xl font-bold mt-1",children:L.total})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[l.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),l.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:L.known})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[l.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),l.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:L.unknown})]})]}),l.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[l.jsxs("div",{className:"sm:col-span-2",children:[l.jsx(ue,{htmlFor:"search",children:"搜索"}),l.jsxs("div",{className:"relative mt-1.5",children:[l.jsx(ci,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx(Pe,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:f,onChange:re=>m(re.target.value),className:"pl-9"})]})]}),l.jsxs("div",{children:[l.jsx(ue,{htmlFor:"filter-known",children:"认识状态"}),l.jsxs(qt,{value:g===void 0?"all":g.toString(),onValueChange:re=>{x(re==="all"?void 0:re==="true"),o(1)},children:[l.jsx(It,{id:"filter-known",className:"mt-1.5",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"all",children:"全部"}),l.jsx(De,{value:"true",children:"已认识"}),l.jsx(De,{value:"false",children:"未认识"})]})]})]}),l.jsxs("div",{children:[l.jsx(ue,{htmlFor:"filter-platform",children:"平台"}),l.jsxs(qt,{value:y||"all",onValueChange:re=>{w(re==="all"?void 0:re),o(1)},children:[l.jsx(It,{id:"filter-platform",className:"mt-1.5",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"all",children:"全部平台"}),W.map(re=>l.jsxs(De,{value:re,children:[re," (",L.platforms[re],")"]},re))]})]})]})]}),l.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:[l.jsx("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:I.size>0&&l.jsxs("span",{children:["已选择 ",I.size," 个人物"]})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ue,{htmlFor:"page-size",className:"text-sm whitespace-nowrap",children:"每页显示"}),l.jsxs(qt,{value:c.toString(),onValueChange:re=>{h(parseInt(re)),o(1),Q(new Set)},children:[l.jsx(It,{id:"page-size",className:"w-20",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"10",children:"10"}),l.jsx(De,{value:"20",children:"20"}),l.jsx(De,{value:"50",children:"50"}),l.jsx(De,{value:"100",children:"100"})]})]}),I.size>0&&l.jsxs(l.Fragment,{children:[l.jsx(de,{variant:"outline",size:"sm",onClick:()=>Q(new Set),children:"取消选择"}),l.jsxs(de,{variant:"destructive",size:"sm",onClick:te,children:[l.jsx(fn,{className:"h-4 w-4 mr-1"}),"批量删除"]})]})]})]})]}),l.jsxs("div",{className:"rounded-lg border bg-card",children:[l.jsx("div",{className:"hidden md:block",children:l.jsxs(Vh,{children:[l.jsx(Uh,{children:l.jsxs(bs,{children:[l.jsx(ln,{className:"w-12",children:l.jsx(li,{checked:t.length>0&&I.size===t.length,onCheckedChange:V,"aria-label":"全选"})}),l.jsx(ln,{children:"状态"}),l.jsx(ln,{children:"名称"}),l.jsx(ln,{children:"昵称"}),l.jsx(ln,{children:"平台"}),l.jsx(ln,{children:"用户ID"}),l.jsx(ln,{children:"最后更新"}),l.jsx(ln,{className:"text-right",children:"操作"})]})}),l.jsx(Wh,{children:n?l.jsx(bs,{children:l.jsx(Qt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):t.length===0?l.jsx(bs,{children:l.jsx(Qt,{colSpan:8,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):t.map(re=>l.jsxs(bs,{children:[l.jsx(Qt,{children:l.jsx(li,{checked:I.has(re.person_id),onCheckedChange:()=>F(re.person_id),"aria-label":`选择 ${re.person_name||re.nickname||re.user_id}`})}),l.jsx(Qt,{children:l.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?"已认识":"未认识"})}),l.jsx(Qt,{className:"font-medium",children:re.person_name||l.jsx("span",{className:"text-muted-foreground",children:"-"})}),l.jsx(Qt,{children:re.nickname||"-"}),l.jsx(Qt,{children:re.platform}),l.jsx(Qt,{className:"font-mono text-sm",children:re.user_id}),l.jsx(Qt,{className:"text-sm text-muted-foreground",children:ie(re.last_know)}),l.jsx(Qt,{className:"text-right",children:l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsxs(de,{variant:"default",size:"sm",onClick:()=>G(re),children:[l.jsx(oa,{className:"h-4 w-4 mr-1"}),"详情"]}),l.jsxs(de,{variant:"default",size:"sm",onClick:()=>R(re),children:[l.jsx(Qm,{className:"h-4 w-4 mr-1"}),"编辑"]}),l.jsxs(de,{size:"sm",onClick:()=>M(re),className:"bg-red-600 hover:bg-red-700 text-white",children:[l.jsx(fn,{className:"h-4 w-4 mr-1"}),"删除"]})]})})]},re.id))})]})}),l.jsx("div",{className:"md:hidden space-y-3 p-4",children:n?l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"加载中..."}):t.length===0?l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"暂无数据"}):t.map(re=>l.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3 overflow-hidden",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(li,{checked:I.has(re.person_id),onCheckedChange:()=>F(re.person_id),className:"mt-1"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.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?"已认识":"未认识"}),l.jsx("h3",{className:"font-semibold text-sm line-clamp-1 w-full break-all",children:re.person_name||l.jsx("span",{className:"text-muted-foreground",children:"未命名"})}),re.nickname&&l.jsxs("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1 w-full break-all",children:["昵称: ",re.nickname]})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"平台"}),l.jsx("p",{className:"font-medium text-xs",children:re.platform})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"用户ID"}),l.jsx("p",{className:"font-mono text-xs truncate",title:re.user_id,children:re.user_id})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"最后更新"}),l.jsx("p",{className:"text-xs",children:ie(re.last_know)})]})]}),l.jsxs("div",{className:"flex flex-wrap gap-1 pt-2 border-t overflow-hidden",children:[l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>G(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[l.jsx(oa,{className:"h-3 w-3 mr-1"}),"查看"]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>R(re),className:"text-xs px-2 py-1 h-auto flex-shrink-0",children:[l.jsx(Qm,{className:"h-3 w-3 mr-1"}),"编辑"]}),l.jsxs(de,{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:[l.jsx(fn,{className:"h-3 w-3 mr-1"}),"删除"]})]})]},re.id))}),s>0&&l.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[l.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",s," 条记录,第 ",a," / ",Math.ceil(s/c)," 页"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(de,{variant:"outline",size:"sm",onClick:()=>o(1),disabled:a===1,className:"hidden sm:flex",children:l.jsx(L0,{className:"h-4 w-4"})}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>o(a-1),disabled:a===1,children:[l.jsx($u,{className:"h-4 w-4 sm:mr-1"}),l.jsx("span",{className:"hidden sm:inline",children:"上一页"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Pe,{type:"number",value:z,onChange:re=>H(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)}),l.jsx(de,{variant:"outline",size:"sm",onClick:K,disabled:!z,className:"h-8",children:"跳转"})]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:()=>o(a+1),disabled:a>=Math.ceil(s/c),children:[l.jsx("span",{className:"hidden sm:inline",children:"下一页"}),l.jsx(Qu,{className:"h-4 w-4 sm:ml-1"})]}),l.jsx(de,{variant:"outline",size:"sm",onClick:()=>o(Math.ceil(s/c)),disabled:a>=Math.ceil(s/c),className:"hidden sm:flex",children:l.jsx(I0,{className:"h-4 w-4"})})]})]})]})]})}),l.jsx(Gwe,{person:S,open:N,onOpenChange:C}),l.jsx(Xwe,{person:S,open:T,onOpenChange:_,onSuccess:()=>{X(),J(),_(!1)}}),l.jsx(Nn,{open:!!E,onOpenChange:()=>M(null),children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认删除"}),l.jsxs(bn,{children:['确定要删除人物信息 "',E?.person_name||E?.nickname||E?.user_id,'" 吗? 此操作不可撤销。']})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:()=>E&&se(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})}),l.jsx(Nn,{open:U,onOpenChange:ee,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"确认批量删除"}),l.jsxs(bn,{children:["确定要删除选中的 ",I.size," 个人物信息吗? 此操作不可撤销。"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{children:"取消"}),l.jsx(wn,{onClick:ne,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function Gwe({person:t,open:e,onOpenChange:n}){if(!t)return null;const r=s=>s?new Date(s*1e3).toLocaleString("zh-CN"):"-";return l.jsx(xr,{open:e,onOpenChange:n,children:l.jsxs(lr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"人物详情"}),l.jsxs(Hr,{children:["查看 ",t.person_name||t.nickname||t.user_id," 的完整信息"]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(Gl,{icon:az,label:"人物名称",value:t.person_name}),l.jsx(Gl,{icon:z0,label:"昵称",value:t.nickname}),l.jsx(Gl,{icon:L3,label:"用户ID",value:t.user_id,mono:!0}),l.jsx(Gl,{icon:L3,label:"人物ID",value:t.person_id,mono:!0}),l.jsx(Gl,{label:"平台",value:t.platform}),l.jsx(Gl,{label:"状态",value:t.is_known?"已认识":"未认识"})]}),t.name_reason&&l.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[l.jsx(ue,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),l.jsx("p",{className:"mt-1 text-sm",children:t.name_reason})]}),t.memory_points&&l.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[l.jsx(ue,{className:"text-xs text-muted-foreground",children:"个人印象"}),l.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:t.memory_points})]}),t.group_nick_name&&t.group_nick_name.length>0&&l.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[l.jsx(ue,{className:"text-xs text-muted-foreground",children:"群昵称"}),l.jsx("div",{className:"mt-2 space-y-1",children:t.group_nick_name.map((s,i)=>l.jsxs("div",{className:"text-sm flex items-center gap-2",children:[l.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:s.group_id}),l.jsx("span",{children:"→"}),l.jsx("span",{children:s.group_nick_name})]},i))})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsx(Gl,{icon:Zd,label:"认识时间",value:r(t.know_times)}),l.jsx(Gl,{icon:Zd,label:"首次记录",value:r(t.know_since)}),l.jsx(Gl,{icon:Zd,label:"最后更新",value:r(t.last_know)})]})]}),l.jsx(as,{children:l.jsx(de,{onClick:()=>n(!1),children:"关闭"})})]})})}function Gl({icon:t,label:e,value:n,mono:r=!1}){return l.jsxs("div",{className:"space-y-1",children:[l.jsxs(ue,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[t&&l.jsx(t,{className:"h-3 w-3"}),e]}),l.jsx("div",{className:ve("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function Xwe({person:t,open:e,onOpenChange:n,onSuccess:r}){const[s,i]=b.useState({}),[a,o]=b.useState(!1),{toast:c}=ts();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 h=async()=>{if(t)try{o(!0),await Qwe(t.person_id,s),c({title:"保存成功",description:"人物信息已更新"}),r()}catch(f){c({title:"保存失败",description:f instanceof Error?f.message:"无法更新人物信息",variant:"destructive"})}finally{o(!1)}};return t?l.jsx(xr,{open:e,onOpenChange:n,children:l.jsxs(lr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"编辑人物信息"}),l.jsxs(Hr,{children:["修改 ",t.person_name||t.nickname||t.user_id," 的信息"]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"person_name",children:"人物名称"}),l.jsx(Pe,{id:"person_name",value:s.person_name||"",onChange:f=>i({...s,person_name:f.target.value}),placeholder:"为这个人设置一个名称"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"nickname",children:"昵称"}),l.jsx(Pe,{id:"nickname",value:s.nickname||"",onChange:f=>i({...s,nickname:f.target.value}),placeholder:"昵称"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"name_reason",children:"名称设定原因"}),l.jsx(pr,{id:"name_reason",value:s.name_reason||"",onChange:f=>i({...s,name_reason:f.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"memory_points",children:"个人印象"}),l.jsx(pr,{id:"memory_points",value:s.memory_points||"",onChange:f=>i({...s,memory_points:f.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),l.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[l.jsxs("div",{children:[l.jsx(ue,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),l.jsx(Pt,{id:"is_known",checked:s.is_known,onCheckedChange:f=>i({...s,is_known:f})})]})]}),l.jsxs(as,{children:[l.jsx(de,{variant:"outline",onClick:()=>n(!1),children:"取消"}),l.jsx(de,{onClick:h,disabled:a,children:a?"保存中...":"保存"})]})]})}):null}function Ss(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=(f,m)=>{const g=typeof f=="function"?f(e):f;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:()=>h,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(Ywe?"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()}},h=e=t(r,s,c);return c},Kwe=t=>t?BM(t):BM,{useDebugValue:Zwe}=he,{useSyncExternalStoreWithSelector:Jwe}=lY,e4e=t=>t;function ZQ(t,e=e4e,n){const r=Jwe(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Zwe(r),r}const qM=(t,e)=>{const n=Kwe(t),r=(s,i=e)=>ZQ(n,s,i);return Object.assign(r,n),r},t4e=(t,e)=>t?qM(t,e):qM;function os(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 n4e={value:()=>{}};function Ay(){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}})}b1.prototype=Ay.prototype={constructor:b1,on:function(t,e){var n=this._,r=r4e(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)),$M.hasOwnProperty(e)?{space:$M[e],local:t}:t}function i4e(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===wk&&e.documentElement.namespaceURI===wk?e.createElement(t):e.createElementNS(n,t)}}function a4e(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function JQ(t){var e=Ry(t);return(e.local?a4e:i4e)(e)}function l4e(){}function dO(t){return t==null?l4e:function(){return this.querySelector(t)}}function o4e(t){typeof t!="function"&&(t=dO(t));for(var e=this._groups,n=e.length,r=new Array(n),s=0;s=C&&(C=N+1);!(_=S[C])&&++C=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function R4e(t){t||(t=D4e);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 z4e(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function P4e(){return Array.from(this)}function L4e(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?G4e:typeof e=="function"?Y4e:X4e)(t,e,n??"")):Eh(this.node(),t)}function Eh(t,e){return t.style.getPropertyValue(e)||sH(t).getComputedStyle(t,null).getPropertyValue(e)}function Z4e(t){return function(){delete this[t]}}function J4e(t,e){return function(){this[t]=e}}function e5e(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function t5e(t,e){return arguments.length>1?this.each((e==null?Z4e:typeof e=="function"?e5e:J4e)(t,e)):this.node()[t]}function iH(t){return t.trim().split(/^|\s+/)}function hO(t){return t.classList||new aH(t)}function aH(t){this._node=t,this._names=iH(t.getAttribute("class")||"")}aH.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 lH(t,e){for(var n=hO(t),r=-1,s=e.length;++r=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function E5e(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,s=e.length,i;n()=>t;function Sk(t,{sourceEvent:e,subject:n,target:r,identifier:s,active:i,x:a,y:o,dx:c,dy:h,dispatch:f}){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:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:f}})}Sk.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function B5e(t){return!t.ctrlKey&&!t.button}function q5e(){return this.parentNode}function F5e(t,e){return e??{x:t.x,y:t.y}}function $5e(){return navigator.maxTouchPoints||"ontouchstart"in this}function Q5e(){var t=B5e,e=q5e,n=F5e,r=$5e,s={},i=Ay("start","drag","end"),a=0,o,c,h,f,m=0;function g(T){T.on("mousedown.drag",x).filter(r).on("touchstart.drag",S).on("touchmove.drag",k,I5e).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(T,_){if(!(f||!t.call(this,T,_))){var E=C(this,e.call(this,T,_),T,_,"mouse");E&&(Ki(T.view).on("mousemove.drag",y,j0).on("mouseup.drag",w,j0),dH(T.view),B4(T),h=!1,o=T.clientX,c=T.clientY,E("start",T))}}function y(T){if(dh(T),!h){var _=T.clientX-o,E=T.clientY-c;h=_*_+E*E>m}s.mouse("drag",T)}function w(T){Ki(T.view).on("mousemove.drag mouseup.drag",null),hH(T.view,h),dh(T),s.mouse("end",T)}function S(T,_){if(t.call(this,T,_)){var E=T.changedTouches,M=e.call(this,T,_),L=E.length,P,I;for(P=0;P=0&&t._call.call(void 0,e),t=t._next;--_h}function QM(){Bu=(xv=O0.now())+Dy,_h=bm=0;try{V5e()}finally{_h=0,W5e(),Bu=0}}function U5e(){var t=O0.now(),e=t-xv;e>fH&&(Dy-=e,xv=t)}function W5e(){for(var t,e=gv,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:gv=n);wm=t,kk(r)}function kk(t){if(!_h){bm&&(bm=clearTimeout(bm));var e=t-Bu;e>24?(t<1/0&&(bm=setTimeout(QM,t-O0.now()-Dy)),cm&&(cm=clearInterval(cm))):(cm||(xv=O0.now(),cm=setInterval(U5e,fH)),_h=1,mH(QM))}}function HM(t,e,n){var r=new vv;return e=e==null?0:+e,r.restart(s=>{r.stop(),t(s+e)},e,n),r}var G5e=Ay("start","end","cancel","interrupt"),X5e=[],gH=0,VM=1,jk=2,w1=3,UM=4,Ok=5,S1=6;function zy(t,e,n,r,s,i){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Y5e(t,n,{name:e,index:r,group:s,on:G5e,tween:X5e,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:gH})}function mO(t,e){var n=Ia(t,e);if(n.state>gH)throw new Error("too late; already scheduled");return n}function Sl(t,e){var n=Ia(t,e);if(n.state>w1)throw new Error("too late; already running");return n}function Ia(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Y5e(t,e,n){var r=t.__transition,s;r[e]=n,n.timer=pH(i,0,n.time);function i(h){n.state=VM,n.timer.restart(a,n.delay,n.time),n.delay<=h&&a(h-n.delay)}function a(h){var f,m,g,x;if(n.state!==VM)return c();for(f in r)if(x=r[f],x.name===n.name){if(x.state===w1)return HM(a);x.state===UM?(x.state=S1,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete r[f]):+fjk&&r.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function N3e(t,e,n){var r,s,i=O3e(e)?mO:Sl;return function(){var a=i(this,t),o=a.on;o!==r&&(s=(r=o).copy()).on(e,n),a.on=s}}function C3e(t,e){var n=this._id;return arguments.length<2?Ia(this.node(),n).on.on(t):this.each(N3e(n,t,e))}function T3e(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function E3e(){return this.on("end.remove",T3e(this._id))}function _3e(t){var e=this._name,n=this._id;typeof t!="function"&&(t=dO(t));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>t;function tSe(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 so(t,e,n){this.k=t,this.x=e,this.y=n}so.prototype={constructor:so,scale:function(t){return t===1?this:new so(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new so(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 ho=new so(1,0,0);so.prototype;function q4(t){t.stopImmediatePropagation()}function um(t){t.preventDefault(),t.stopImmediatePropagation()}function nSe(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function rSe(){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 WM(){return this.__zoom||ho}function sSe(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function iSe(){return navigator.maxTouchPoints||"ontouchstart"in this}function aSe(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 bH(){var t=nSe,e=rSe,n=aSe,r=sSe,s=iSe,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=_Y,h=Ay("start","zoom","end"),f,m,g,x=500,y=150,w=0,S=10;function k(z){z.property("__zoom",WM).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",Q).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",ee).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(z,H,B,X){var J=z.selection?z.selection():z;J.property("__zoom",WM),z!==J?_(z,H,B,X):J.interrupt().each(function(){E(this,arguments).event(X).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},k.scaleBy=function(z,H,B,X){k.scaleTo(z,function(){var J=this.__zoom.k,G=typeof H=="function"?H.apply(this,arguments):H;return J*G},B,X)},k.scaleTo=function(z,H,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,se=G.invert(R),W=typeof H=="function"?H.apply(this,arguments):H;return n(C(N(G,W),R,se),J,a)},B,X)},k.translateBy=function(z,H,B,X){k.transform(z,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof B=="function"?B.apply(this,arguments):B),e.apply(this,arguments),a)},null,X)},k.translateTo=function(z,H,B,X,J){k.transform(z,function(){var G=e.apply(this,arguments),R=this.__zoom,se=X==null?T(G):typeof X=="function"?X.apply(this,arguments):X;return n(ho.translate(se[0],se[1]).scale(R.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof B=="function"?-B.apply(this,arguments):-B),G,a)},X,J)};function N(z,H){return H=Math.max(i[0],Math.min(i[1],H)),H===z.k?z:new so(H,z.x,z.y)}function C(z,H,B){var X=H[0]-B[0]*z.k,J=H[1]-B[1]*z.k;return X===z.x&&J===z.y?z:new so(z.k,X,J)}function T(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function _(z,H,B,X){z.on("start.zoom",function(){E(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(X).end()}).tween("zoom",function(){var J=this,G=arguments,R=E(J,G).event(X),se=e.apply(J,G),W=B==null?T(se):typeof B=="function"?B.apply(J,G):B,F=Math.max(se[1][0]-se[0][0],se[1][1]-se[0][1]),V=J.__zoom,te=typeof H=="function"?H.apply(J,G):H,ne=c(V.invert(W).concat(F/V.k),te.invert(W).concat(F/te.k));return function(K){if(K===1)K=te;else{var ie=ne(K),re=F/ie[2];K=new so(re,W[0]-ie[0]*re,W[1]-ie[1]*re)}R.zoom(null,K)}})}function E(z,H,B){return!B&&z.__zooming||new M(z,H)}function M(z,H){this.that=z,this.args=H,this.active=0,this.sourceEvent=null,this.extent=e.apply(z,H),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,H){return this.mouse&&z!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var H=Ki(this.that).datum();h.call(z,this.that,new tSe(z,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:h}),H)}};function L(z,...H){if(!t.apply(this,arguments))return;var B=E(this,H).event(z),X=this.__zoom,J=Math.max(i[0],Math.min(i[1],X.k*Math.pow(2,r.apply(this,arguments)))),G=ka(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)],k1(this),B.start()}um(z),B.wheel=setTimeout(R,y),B.zoom("mouse",n(C(N(X,J),B.mouse[0],B.mouse[1]),B.extent,a));function R(){B.wheel=null,B.end()}}function P(z,...H){if(g||!t.apply(this,arguments))return;var B=z.currentTarget,X=E(this,H,!0).event(z),J=Ki(z.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",F,!0),G=ka(z,B),R=z.clientX,se=z.clientY;dH(z.view),q4(z),X.mouse=[G,this.__zoom.invert(G)],k1(this),X.start();function W(V){if(um(V),!X.moved){var te=V.clientX-R,ne=V.clientY-se;X.moved=te*te+ne*ne>w}X.event(V).zoom("mouse",n(C(X.that.__zoom,X.mouse[0]=ka(V,B),X.mouse[1]),X.extent,a))}function F(V){J.on("mousemove.zoom mouseup.zoom",null),hH(V.view,X.moved),um(V),X.event(V).end()}}function I(z,...H){if(t.apply(this,arguments)){var B=this.__zoom,X=ka(z.changedTouches?z.changedTouches[0]:z,this),J=B.invert(X),G=B.k*(z.shiftKey?.5:2),R=n(C(N(B,G),X,J),e.apply(this,H),a);um(z),o>0?Ki(this).transition().duration(o).call(_,R,X,z):Ki(this).call(k.transform,R,X,z)}}function Q(z,...H){if(t.apply(this,arguments)){var B=z.touches,X=B.length,J=E(this,H,z.changedTouches.length===X).event(z),G,R,se,W;for(q4(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.`},wH=bo.error001();function er(t,e){const n=b.useContext(Py);if(n===null)throw new Error(wH);return ZQ(n,t,e)}const ns=()=>{const t=b.useContext(Py);if(t===null)throw new Error(wH);return b.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy}),[t])},oSe=t=>t.userSelectionActive?"none":"all";function Ly({position:t,children:e,className:n,style:r,...s}){const i=er(oSe),a=`${t}`.split("-");return he.createElement("div",{className:Ss(["react-flow__panel",n,...a]),style:{...r,pointerEvents:i},...s},e)}function cSe({proOptions:t,position:e="bottom-right"}){return t?.hideAttribution?null:he.createElement(Ly,{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"},he.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const uSe=({x:t,y:e,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:i={},labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:h,...f})=>{const m=b.useRef(null),[g,x]=b.useState({x:0,y:0,width:0,height:0}),y=Ss(["react-flow__edge-textwrapper",h]);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:he.createElement("g",{transform:`translate(${t-g.width/2} ${e-g.height/2})`,className:y,visibility:g.width?"visible":"hidden",...f},s&&he.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:o,ry:o}),he.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:r},n),c)};var dSe=b.memo(uSe);const gO=t=>({width:t.offsetWidth,height:t.offsetHeight}),Mh=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),xO=(t={x:0,y:0},e)=>({x:Mh(t.x,e[0][0],e[1][0]),y:Mh(t.y,e[0][1],e[1][1])}),GM=(t,e,n)=>tn?-Mh(Math.abs(t-n),1,50)/50:0,SH=(t,e)=>{const n=GM(t.x,35,e.width-35)*20,r=GM(t.y,35,e.height-35)*20;return[n,r]},kH=t=>t.getRootNode?.()||window?.document,jH=(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)}),N0=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),OH=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),XM=t=>({...t.positionAbsolute||{x:0,y:0},width:t.width||0,height:t.height||0}),hSe=(t,e)=>OH(jH(N0(t),N0(e))),Nk=(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)},fSe=t=>na(t.width)&&na(t.height)&&na(t.x)&&na(t.y),na=t=>!isNaN(t)&&isFinite(t),Sr=Symbol.for("internals"),NH=["Enter"," ","Escape"],mSe=(t,e)=>{},pSe=t=>"nativeEvent"in t;function Ck(t){const n=(pSe(t)?t.nativeEvent:t).composedPath?.()?.[0]||t.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const CH=t=>"clientX"in t,pc=(t,e)=>{const n=CH(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)}},yv=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,xp=({id:t,path:e,labelX:n,labelY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,interactionWidth:x=20})=>he.createElement(he.Fragment,null,he.createElement("path",{id:t,style:f,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:m,markerStart:g}),x&&he.createElement("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),s&&na(n)&&na(r)?he.createElement(dSe,{x:n,y:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:h}):null);xp.displayName="BaseEdge";function dm(t,e,n){return n===void 0?n:r=>{const s=e().edges.find(i=>i.id===t);s&&n(r,{...s})}}function TH({sourceX:t,sourceY:e,targetX:n,targetY:r}){const s=Math.abs(n-t)/2,i=n{const[S,k,N]=_H({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i});return he.createElement(xp,{path:S,labelX:k,labelY:N,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:w})});vO.displayName="SimpleBezierEdge";const KM={[mt.Left]:{x:-1,y:0},[mt.Right]:{x:1,y:0},[mt.Top]:{x:0,y:-1},[mt.Bottom]:{x:0,y:1}},gSe=({source:t,sourcePosition:e=mt.Bottom,target:n})=>e===mt.Left||e===mt.Right?t.xMath.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function xSe({source:t,sourcePosition:e=mt.Bottom,target:n,targetPosition:r=mt.Top,center:s,offset:i}){const a=KM[e],o=KM[r],c={x:t.x+a.x*i,y:t.y+a.y*i},h={x:n.x+o.x*i,y:n.y+o.y*i},f=gSe({source:c,sourcePosition:e,target:h}),m=f.x!==0?"x":"y",g=f[m];let x=[],y,w;const S={x:0,y:0},k={x:0,y:0},[N,C,T,_]=TH({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[m]*o[m]===-1){y=s.x??N,w=s.y??C;const M=[{x:y,y:c.y},{x:y,y:h.y}],L=[{x:c.x,y:w},{x:h.x,y:w}];a[m]===g?x=m==="x"?M:L:x=m==="x"?L:M}else{const M=[{x:c.x,y:h.y}],L=[{x:h.x,y:c.y}];if(m==="x"?x=a.x===g?L:M:x=a.y===g?M:L,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]=(h[m]>n[m]?-1:1)*z}}if(e!==r){const ee=m==="x"?"y":"x",z=a[m]===o[ee],H=c[ee]>h[ee],B=c[ee]=U?(y=(P.x+I.x)/2,w=x[0].y):(y=x[0].x,w=(P.y+I.y)/2)}return[[t,{x:c.x+S.x,y:c.y+S.y},...x,{x:h.x+k.x,y:h.y+k.y},n],y,w,T,_]}function vSe(t,e,n,r){const s=Math.min(ZM(t,e)/2,ZM(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 h=t.x{let C="";return N>0&&N{const[k,N,C]=Tk({sourceX:t,sourceY:e,sourcePosition:m,targetX:n,targetY:r,targetPosition:g,borderRadius:w?.borderRadius,offset:w?.offset});return he.createElement(xp,{path:k,labelX:N,labelY:C,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:h,style:f,markerEnd:x,markerStart:y,interactionWidth:S})});Iy.displayName="SmoothStepEdge";const yO=b.memo(t=>he.createElement(Iy,{...t,pathOptions:b.useMemo(()=>({borderRadius:0,offset:t.pathOptions?.offset}),[t.pathOptions?.offset])}));yO.displayName="StepEdge";function ySe({sourceX:t,sourceY:e,targetX:n,targetY:r}){const[s,i,a,o]=TH({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,s,i,a,o]}const bO=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,interactionWidth:x})=>{const[y,w,S]=ySe({sourceX:t,sourceY:e,targetX:n,targetY:r});return he.createElement(xp,{path:y,labelX:w,labelY:S,label:s,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:h,style:f,markerEnd:m,markerStart:g,interactionWidth:x})});bO.displayName="StraightEdge";function qx(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function JM({pos:t,x1:e,y1:n,x2:r,y2:s,c:i}){switch(t){case mt.Left:return[e-qx(e-r,i),n];case mt.Right:return[e+qx(r-e,i),n];case mt.Top:return[e,n-qx(n-s,i)];case mt.Bottom:return[e,n+qx(s-n,i)]}}function MH({sourceX:t,sourceY:e,sourcePosition:n=mt.Bottom,targetX:r,targetY:s,targetPosition:i=mt.Top,curvature:a=.25}){const[o,c]=JM({pos:n,x1:t,y1:e,x2:r,y2:s,c:a}),[h,f]=JM({pos:i,x1:r,y1:s,x2:t,y2:e,c:a}),[m,g,x,y]=EH({sourceX:t,sourceY:e,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:h,targetControlY:f});return[`M${t},${e} C${o},${c} ${h},${f} ${r},${s}`,m,g,x,y]}const wv=b.memo(({sourceX:t,sourceY:e,targetX:n,targetY:r,sourcePosition:s=mt.Bottom,targetPosition:i=mt.Top,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,pathOptions:w,interactionWidth:S})=>{const[k,N,C]=MH({sourceX:t,sourceY:e,sourcePosition:s,targetX:n,targetY:r,targetPosition:i,curvature:w?.curvature});return he.createElement(xp,{path:k,labelX:N,labelY:C,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:m,style:g,markerEnd:x,markerStart:y,interactionWidth:S})});wv.displayName="BezierEdge";const wO=b.createContext(null),bSe=wO.Provider;wO.Consumer;const wSe=()=>b.useContext(wO),SSe=t=>"id"in t&&"source"in t&&"target"in t,kSe=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`reactflow__edge-${t}${e||""}-${n}${r||""}`,Ek=(t,e)=>typeof t>"u"?"":typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(r=>`${r}=${t[r]}`).join("&")}`,jSe=(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)),OSe=(t,e)=>{if(!t.source||!t.target)return e;let n;return SSe(t)?n={...t}:n={...t,id:kSe(t)},jSe(n,e)?e:e.concat(n)},_k=({x:t,y:e},[n,r,s],i,[a,o])=>{const c={x:(t-n)/s,y:(e-r)/s};return i?{x:a*Math.round(c.x/a),y:o*Math.round(c.y/o)}:c},AH=({x:t,y:e},[n,r,s])=>({x:t*s+n,y:e*s+r}),Nu=(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}},By=(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}=Nu(s,e).positionAbsolute;return jH(r,N0({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 OH(n)},RH=(t,e,[n,r,s]=[0,0,1],i=!1,a=!1,o=[0,0])=>{const c={x:(e.x-n)/s,y:(e.y-r)/s,width:e.width/s,height:e.height/s},h=[];return t.forEach(f=>{const{width:m,height:g,selectable:x=!0,hidden:y=!1}=f;if(a&&!x||y)return!1;const{positionAbsolute:w}=Nu(f,o),S={x:w.x,y:w.y,width:m||0,height:g||0},k=Nk(c,S),N=typeof m>"u"||typeof g>"u"||m===null||g===null,C=i&&k>0,T=(m||0)*(g||0);(N||C||k>=T||f.dragging)&&h.push(f)}),h},DH=(t,e)=>{const n=t.map(r=>r.id);return e.filter(r=>n.includes(r.source)||n.includes(r.target))},zH=(t,e,n,r,s,i=.1)=>{const a=e/(t.width*(1+i)),o=n/(t.height*(1+i)),c=Math.min(a,o),h=Mh(c,r,s),f=t.x+t.width/2,m=t.y+t.height/2,g=e/2-f*h,x=n/2-m*h;return{x:g,y:x,zoom:h}},cu=(t,e=0)=>t.transition().duration(e);function eA(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 NSe(t,e,n,r,s,i){const{x:a,y:o}=pc(t),h=e.elementsFromPoint(a,o).find(y=>y.classList.contains("react-flow__handle"));if(h){const y=h.getAttribute("data-nodeid");if(y){const w=SO(void 0,h),S=h.getAttribute("data-handleid"),k=i({nodeId:y,id:S,type:w});if(k){const N=s.find(C=>C.nodeId===y&&C.type===w&&C.id===S);return{handle:{id:S,type:w,nodeId:y,x:N?.x||n.x,y:N?.y||n.y},validHandleResult:k}}}}let f=[],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=f.some(({handle:y})=>y.type==="target");return f.find(({handle:y,validHandleResult:w})=>x?y.type==="target":g?w.isValid:!0)||f[0]}const CSe={source:null,target:null,sourceHandle:null,targetHandle:null},PH=()=>({handleDomNode:null,isValid:!1,connection:CSe,endHandle:null});function LH(t,e,n,r,s,i,a){const o=s==="target",c=a.querySelector(`.react-flow__handle[data-id="${t?.nodeId}-${t?.id}-${t?.type}"]`),h={...PH(),handleDomNode:c};if(c){const f=SO(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:o?m:n,sourceHandle:o?g:r,target:o?n:m,targetHandle:o?r:g};h.connection=w,x&&y&&(e===qu.Strict?o&&f==="source"||!o&&f==="target":m!==n||g!==r)&&(h.endHandle={nodeId:m,handleId:g,type:f},h.isValid=i(w))}return h}function TSe({nodes:t,nodeId:e,handleId:n,handleType:r}){return t.reduce((s,i)=>{if(i[Sr]){const{handleBounds:a}=i[Sr];let o=[],c=[];a&&(o=eA(i,a,"source",`${e}-${n}-${r}`),c=eA(i,a,"target",`${e}-${n}-${r}`)),s.push(...o,...c)}return s},[])}function SO(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function F4(t){t?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function ESe(t,e){let n=null;return e?n="valid":t&&!e&&(n="invalid"),n}function IH({event:t,handleId:e,nodeId:n,onConnect:r,isTarget:s,getState:i,setState:a,isValidConnection:o,edgeUpdaterType:c,onReconnectEnd:h}){const f=kH(t.target),{connectionMode:m,domNode:g,autoPanOnConnect:x,connectionRadius:y,onConnectStart:w,panBy:S,getNodes:k,cancelConnection:N}=i();let C=0,T;const{x:_,y:E}=pc(t),M=f?.elementFromPoint(_,E),L=SO(c,M),P=g?.getBoundingClientRect();if(!P||!L)return;let I,Q=pc(t,P),U=!1,ee=null,z=!1,H=null;const B=TSe({nodes:k(),nodeId:n,handleId:e,handleType:L}),X=()=>{if(!x)return;const[R,se]=SH(Q,P);S({x:R,y:se}),C=requestAnimationFrame(X)};a({connectionPosition:Q,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:se}=i();Q=pc(R,P);const{handle:W,validHandleResult:F}=NSe(R,f,_k(Q,se,!1,[1,1]),y,B,V=>LH(V,m,n,e,s?"target":"source",o,f));if(T=W,U||(X(),U=!0),H=F.handleDomNode,ee=F.connection,z=F.isValid,a({connectionPosition:T&&z?AH({x:T.x,y:T.y},se):Q,connectionStatus:ESe(!!T,z),connectionEndHandle:F.endHandle}),!T&&!z&&!H)return F4(I);ee.source!==ee.target&&H&&(F4(I),I=H,H.classList.add("connecting","react-flow__handle-connecting"),H.classList.toggle("valid",z),H.classList.toggle("react-flow__handle-valid",z))}function G(R){(T||H)&&ee&&z&&r?.(ee),i().onConnectEnd?.(R),c&&h?.(R),F4(I),N(),cancelAnimationFrame(C),U=!1,z=!1,ee=null,H=null,f.removeEventListener("mousemove",J),f.removeEventListener("mouseup",G),f.removeEventListener("touchmove",J),f.removeEventListener("touchend",G)}f.addEventListener("mousemove",J),f.addEventListener("mouseup",G),f.addEventListener("touchmove",J),f.addEventListener("touchend",G)}const tA=()=>!0,_Se=t=>({connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName}),MSe=(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}},BH=b.forwardRef(({type:t="source",position:e=mt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:h,onMouseDown:f,onTouchStart:m,...g},x)=>{const y=a||null,w=t==="target",S=ns(),k=wSe(),{connectOnClick:N,noPanClassName:C}=er(_Se,os),{connecting:T,clickConnecting:_}=er(MSe(k,y,t),os);k||S.getState().onError?.("010",bo.error010());const E=P=>{const{defaultEdgeOptions:I,onConnect:Q,hasDefaultEdges:U}=S.getState(),ee={...I,...P};if(U){const{edges:z,setEdges:H}=S.getState();H(OSe(ee,z))}Q?.(ee),o?.(ee)},M=P=>{if(!k)return;const I=CH(P);s&&(I&&P.button===0||!I)&&IH({event:P,handleId:y,nodeId:k,onConnect:E,isTarget:w,getState:S.getState,setState:S.setState,isValidConnection:n||S.getState().isValidConnection||tA}),I?f?.(P):m?.(P)},L=P=>{const{onClickConnectStart:I,onClickConnectEnd:Q,connectionClickStartHandle:U,connectionMode:ee,isValidConnection:z}=S.getState();if(!k||!U&&!s)return;if(!U){I?.(P,{nodeId:k,handleId:y,handleType:t}),S.setState({connectionClickStartHandle:{nodeId:k,type:t,handleId:y}});return}const H=kH(P.target),B=n||z||tA,{connection:X,isValid:J}=LH({nodeId:k,id:y,type:t},ee,U.nodeId,U.handleId||null,U.type,B,H);J&&E(X),Q?.(P),S.setState({connectionClickStartHandle:null})};return he.createElement("div",{"data-handleid":y,"data-nodeid":k,"data-handlepos":e,"data-id":`${k}-${y}-${t}`,className:Ss(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",C,h,{source:!w,target:w,connectable:r,connectablestart:s,connectableend:i,connecting:_,connectionindicator:r&&(s&&!T||i&&T)}]),onMouseDown:M,onTouchStart:M,onClick:N?L:void 0,ref:x,...g},c)});BH.displayName="Handle";var Tc=b.memo(BH);const qH=({data:t,isConnectable:e,targetPosition:n=mt.Top,sourcePosition:r=mt.Bottom})=>he.createElement(he.Fragment,null,he.createElement(Tc,{type:"target",position:n,isConnectable:e}),t?.label,he.createElement(Tc,{type:"source",position:r,isConnectable:e}));qH.displayName="DefaultNode";var Mk=b.memo(qH);const FH=({data:t,isConnectable:e,sourcePosition:n=mt.Bottom})=>he.createElement(he.Fragment,null,t?.label,he.createElement(Tc,{type:"source",position:n,isConnectable:e}));FH.displayName="InputNode";var $H=b.memo(FH);const QH=({data:t,isConnectable:e,targetPosition:n=mt.Top})=>he.createElement(he.Fragment,null,he.createElement(Tc,{type:"target",position:n,isConnectable:e}),t?.label);QH.displayName="OutputNode";var HH=b.memo(QH);const kO=()=>null;kO.displayName="GroupNode";const ASe=t=>({selectedNodes:t.getNodes().filter(e=>e.selected),selectedEdges:t.edges.filter(e=>e.selected).map(e=>({...e}))}),Fx=t=>t.id;function RSe(t,e){return os(t.selectedNodes.map(Fx),e.selectedNodes.map(Fx))&&os(t.selectedEdges.map(Fx),e.selectedEdges.map(Fx))}const VH=b.memo(({onSelectionChange:t})=>{const e=ns(),{selectedNodes:n,selectedEdges:r}=er(ASe,RSe);return b.useEffect(()=>{const s={nodes:n,edges:r};t?.(s),e.getState().onSelectionChange.forEach(i=>i(s))},[n,r,t]),null});VH.displayName="SelectionListener";const DSe=t=>!!t.onSelectionChange;function zSe({onSelectionChange:t}){const e=er(DSe);return t||e?he.createElement(VH,{onSelectionChange:t}):null}const PSe=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 Ad(t,e){b.useEffect(()=>{typeof t<"u"&&e(t)},[t])}function Kt(t,e,n){b.useEffect(()=>{typeof e<"u"&&n({[t]:e})},[e])}const LSe=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:s,onConnectStart:i,onConnectEnd:a,onClickConnectStart:o,onClickConnectEnd:c,nodesDraggable:h,nodesConnectable:f,nodesFocusable:m,edgesFocusable:g,edgesUpdatable:x,elevateNodesOnSelect:y,minZoom:w,maxZoom:S,nodeExtent:k,onNodesChange:N,onEdgesChange:C,elementsSelectable:T,connectionMode:_,snapGrid:E,snapToGrid:M,translateExtent:L,connectOnClick:P,defaultEdgeOptions:I,fitView:Q,fitViewOptions:U,onNodesDelete:ee,onEdgesDelete:z,onNodeDrag:H,onNodeDragStart:B,onNodeDragStop:X,onSelectionDrag:J,onSelectionDragStart:G,onSelectionDragStop:R,noPanClassName:se,nodeOrigin:W,rfId:F,autoPanOnConnect:V,autoPanOnNodeDrag:te,onError:ne,connectionRadius:K,isValidConnection:ie,nodeDragThreshold:re})=>{const{setNodes:ae,setEdges:_e,setDefaultNodesAndEdges:Ue,setMinZoom:Xe,setMaxZoom:Ze,setTranslateExtent:Oe,setNodeExtent:He,reset:Ve}=er(PSe,os),Be=ns();return b.useEffect(()=>{const ut=r?.map(rt=>({...rt,...I}));return Ue(n,ut),()=>{Ve()}},[]),Kt("defaultEdgeOptions",I,Be.setState),Kt("connectionMode",_,Be.setState),Kt("onConnect",s,Be.setState),Kt("onConnectStart",i,Be.setState),Kt("onConnectEnd",a,Be.setState),Kt("onClickConnectStart",o,Be.setState),Kt("onClickConnectEnd",c,Be.setState),Kt("nodesDraggable",h,Be.setState),Kt("nodesConnectable",f,Be.setState),Kt("nodesFocusable",m,Be.setState),Kt("edgesFocusable",g,Be.setState),Kt("edgesUpdatable",x,Be.setState),Kt("elementsSelectable",T,Be.setState),Kt("elevateNodesOnSelect",y,Be.setState),Kt("snapToGrid",M,Be.setState),Kt("snapGrid",E,Be.setState),Kt("onNodesChange",N,Be.setState),Kt("onEdgesChange",C,Be.setState),Kt("connectOnClick",P,Be.setState),Kt("fitViewOnInit",Q,Be.setState),Kt("fitViewOnInitOptions",U,Be.setState),Kt("onNodesDelete",ee,Be.setState),Kt("onEdgesDelete",z,Be.setState),Kt("onNodeDrag",H,Be.setState),Kt("onNodeDragStart",B,Be.setState),Kt("onNodeDragStop",X,Be.setState),Kt("onSelectionDrag",J,Be.setState),Kt("onSelectionDragStart",G,Be.setState),Kt("onSelectionDragStop",R,Be.setState),Kt("noPanClassName",se,Be.setState),Kt("nodeOrigin",W,Be.setState),Kt("rfId",F,Be.setState),Kt("autoPanOnConnect",V,Be.setState),Kt("autoPanOnNodeDrag",te,Be.setState),Kt("onError",ne,Be.setState),Kt("connectionRadius",K,Be.setState),Kt("isValidConnection",ie,Be.setState),Kt("nodeDragThreshold",re,Be.setState),Ad(t,ae),Ad(e,_e),Ad(w,Xe),Ad(S,Ze),Ad(L,Oe),Ad(k,He),null},nA={display:"none"},ISe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},UH="react-flow__node-desc",WH="react-flow__edge-desc",BSe="react-flow__aria-live",qSe=t=>t.ariaLiveMessage;function FSe({rfId:t}){const e=er(qSe);return he.createElement("div",{id:`${BSe}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:ISe},e)}function $Se({rfId:t,disableKeyboardA11y:e}){return he.createElement(he.Fragment,null,he.createElement("div",{id:`${UH}-${t}`,style:nA},"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."," "),he.createElement("div",{id:`${WH}-${t}`,style:nA},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!e&&he.createElement(FSe,{rfId:t}))}var T0=(t=null,e={actInsideInputWithModifier:!0})=>{const[n,r]=b.useState(!1),s=b.useRef(!1),i=b.useRef(new Set([])),[a,o]=b.useMemo(()=>{if(t!==null){const h=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.split("+")),f=h.reduce((m,g)=>m.concat(...g),[]);return[h,f]}return[[],[]]},[t]);return b.useEffect(()=>{const c=typeof document<"u"?document:null,h=e?.target||c;if(t!==null){const f=x=>{if(s.current=x.ctrlKey||x.metaKey||x.shiftKey,(!s.current||s.current&&!e.actInsideInputWithModifier)&&Ck(x))return!1;const w=sA(x.code,o);i.current.add(x[w]),rA(a,i.current,!1)&&(x.preventDefault(),r(!0))},m=x=>{if((!s.current||s.current&&!e.actInsideInputWithModifier)&&Ck(x))return!1;const w=sA(x.code,o);rA(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 h?.addEventListener("keydown",f),h?.addEventListener("keyup",m),window.addEventListener("blur",g),()=>{h?.removeEventListener("keydown",f),h?.removeEventListener("keyup",m),window.removeEventListener("blur",g)}}},[t,r]),n};function rA(t,e,n){return t.filter(r=>n||r.length===e.size).some(r=>r.every(s=>e.has(s)))}function sA(t,e){return e.includes(t)?"code":"key"}function GH(t,e,n,r){const s=t.parentNode||t.parentId;if(!s)return n;const i=e.get(s),a=Nu(i,r);return GH(i,e,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[Sr]?.z??0)>(n.z??0)?i[Sr]?.z??0:n.z??0},r)}function XH(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:o}=GH(r,t,{...r.position,z:r[Sr]?.z??0},e);r.positionAbsolute={x:i,y:a},r[Sr].z=o,n?.[r.id]&&(r[Sr].isParent=!0)}})}function $4(t,e,n,r){const s=new Map,i={},a=r?1e3:0;return t.forEach(o=>{const c=(na(o.zIndex)?o.zIndex:0)+(o.selected?a:0),h=e.get(o.id),f={...o,positionAbsolute:{x:o.position.x,y:o.position.y}},m=o.parentNode||o.parentId;m&&(i[m]=!0);const g=h?.type&&h?.type!==o.type;Object.defineProperty(f,Sr,{enumerable:!1,value:{handleBounds:g?void 0:h?.[Sr]?.handleBounds,z:c}}),s.set(o.id,f)}),XH(s,n,i),s}function YH(t,e={}){const{getNodes:n,width:r,height:s,minZoom:i,maxZoom:a,d3Zoom:o,d3Selection:c,fitViewOnInitDone:h,fitViewOnInit:f,nodeOrigin:m}=t(),g=e.initial&&!h&&f;if(o&&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(N=>N.id===S.id):k}),w=y.every(S=>S.width&&S.height);if(y.length>0&&w){const S=By(y,m),{x:k,y:N,zoom:C}=zH(S,r,s,e.minZoom??i,e.maxZoom??a,e.padding??.1),T=ho.translate(k,N).scale(C);return typeof e.duration=="number"&&e.duration>0?o.transform(cu(c,e.duration),T):o.transform(c,T),!0}}return!1}function QSe(t,e){return t.forEach(n=>{const r=e.get(n.id);r&&e.set(r.id,{...r,[Sr]:r[Sr],selected:n.selected})}),new Map(e)}function HSe(t,e){return e.map(n=>{const r=t.find(s=>s.id===n.id);return r&&(n.selected=r.selected),n})}function $x({changedNodes:t,changedEdges:e,get:n,set:r}){const{nodeInternals:s,edges:i,onNodesChange:a,onEdgesChange:o,hasDefaultNodes:c,hasDefaultEdges:h}=n();t?.length&&(c&&r({nodeInternals:QSe(t,s)}),a?.(t)),e?.length&&(h&&r({edges:HSe(e,i)}),o?.(e))}const Rd=()=>{},VSe={zoomIn:Rd,zoomOut:Rd,zoomTo:Rd,getZoom:()=>1,setViewport:Rd,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Rd,fitBounds:Rd,project:t=>t,screenToFlowPosition:t=>t,flowToScreenPosition:t=>t,viewportInitialized:!1},USe=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection}),WSe=()=>{const t=ns(),{d3Zoom:e,d3Selection:n}=er(USe,os);return b.useMemo(()=>n&&e?{zoomIn:s=>e.scaleBy(cu(n,s?.duration),1.2),zoomOut:s=>e.scaleBy(cu(n,s?.duration),1/1.2),zoomTo:(s,i)=>e.scaleTo(cu(n,i?.duration),s),getZoom:()=>t.getState().transform[2],setViewport:(s,i)=>{const[a,o,c]=t.getState().transform,h=ho.translate(s.x??a,s.y??o).scale(s.zoom??c);e.transform(cu(n,i?.duration),h)},getViewport:()=>{const[s,i,a]=t.getState().transform;return{x:s,y:i,zoom:a}},fitView:s=>YH(t.getState,s),setCenter:(s,i,a)=>{const{width:o,height:c,maxZoom:h}=t.getState(),f=typeof a?.zoom<"u"?a.zoom:h,m=o/2-s*f,g=c/2-i*f,x=ho.translate(m,g).scale(f);e.transform(cu(n,a?.duration),x)},fitBounds:(s,i)=>{const{width:a,height:o,minZoom:c,maxZoom:h}=t.getState(),{x:f,y:m,zoom:g}=zH(s,a,o,c,h,i?.padding??.1),x=ho.translate(f,m).scale(g);e.transform(cu(n,i?.duration),x)},project:s=>{const{transform:i,snapToGrid:a,snapGrid:o}=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"),_k(s,i,a,o)},screenToFlowPosition:s=>{const{transform:i,snapToGrid:a,snapGrid:o,domNode:c}=t.getState();if(!c)return s;const{x:h,y:f}=c.getBoundingClientRect(),m={x:s.x-h,y:s.y-f};return _k(m,i,a,o)},flowToScreenPosition:s=>{const{transform:i,domNode:a}=t.getState();if(!a)return s;const{x:o,y:c}=a.getBoundingClientRect(),h=AH(s,i);return{x:h.x+o,y:h.y+c}},viewportInitialized:!0}:VSe,[e,n])};function jO(){const t=WSe(),e=ns(),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:N,onNodesChange:C}=e.getState(),T=S(),_=typeof w=="function"?w(T):w;if(N)k(_);else if(C){const E=_.length===0?T.map(M=>({type:"remove",id:M.id})):_.map(M=>({item:M,type:"reset"}));C(E)}},[]),o=b.useCallback(w=>{const{edges:S=[],setEdges:k,hasDefaultEdges:N,onEdgesChange:C}=e.getState(),T=typeof w=="function"?w(S):w;if(N)k(T);else if(C){const _=T.length===0?S.map(E=>({type:"remove",id:E.id})):T.map(E=>({item:E,type:"reset"}));C(_)}},[]),c=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{getNodes:k,setNodes:N,hasDefaultNodes:C,onNodesChange:T}=e.getState();if(C){const E=[...k(),...S];N(E)}else if(T){const _=S.map(E=>({item:E,type:"add"}));T(_)}},[]),h=b.useCallback(w=>{const S=Array.isArray(w)?w:[w],{edges:k=[],setEdges:N,hasDefaultEdges:C,onEdgesChange:T}=e.getState();if(C)N([...k,...S]);else if(T){const _=S.map(E=>({item:E,type:"add"}));T(_)}},[]),f=b.useCallback(()=>{const{getNodes:w,edges:S=[],transform:k}=e.getState(),[N,C,T]=k;return{nodes:w().map(_=>({..._})),edges:S.map(_=>({..._})),viewport:{x:N,y:C,zoom:T}}},[]),m=b.useCallback(({nodes:w,edges:S})=>{const{nodeInternals:k,getNodes:N,edges:C,hasDefaultNodes:T,hasDefaultEdges:_,onNodesDelete:E,onEdgesDelete:M,onNodesChange:L,onEdgesChange:P}=e.getState(),I=(w||[]).map(H=>H.id),Q=(S||[]).map(H=>H.id),U=N().reduce((H,B)=>{const X=B.parentNode||B.parentId,J=!I.includes(B.id)&&X&&H.find(R=>R.id===X);return(typeof B.deletable=="boolean"?B.deletable:!0)&&(I.includes(B.id)||J)&&H.push(B),H},[]),ee=C.filter(H=>typeof H.deletable=="boolean"?H.deletable:!0),z=ee.filter(H=>Q.includes(H.id));if(U||z){const H=DH(U,ee),B=[...z,...H],X=B.reduce((J,G)=>(J.includes(G.id)||J.push(G.id),J),[]);if((_||T)&&(_&&e.setState({edges:C.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&&(E?.(U),L)){const J=U.map(G=>({id:G.id,type:"remove"}));L(J)}}},[]),g=b.useCallback(w=>{const S=fSe(w),k=S?null:e.getState().nodeInternals.get(w.id);return!S&&!k?[null,null,S]:[S?w:XM(k),k,S]},[]),x=b.useCallback((w,S=!0,k)=>{const[N,C,T]=g(w);return N?(k||e.getState().getNodes()).filter(_=>{if(!T&&(_.id===C.id||!_.positionAbsolute))return!1;const E=XM(_),M=Nk(E,N);return S&&M>0||M>=N.width*N.height}):[]},[]),y=b.useCallback((w,S,k=!0)=>{const[N]=g(w);if(!N)return!1;const C=Nk(N,S);return k&&C>0||C>=N.width*N.height},[]);return b.useMemo(()=>({...t,getNodes:n,getNode:r,getEdges:s,getEdge:i,setNodes:a,setEdges:o,addNodes:c,addEdges:h,toObject:f,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:y}),[t,n,r,s,i,a,o,c,h,f,m,x,y])}const GSe={actInsideInputWithModifier:!1};var XSe=({deleteKeyCode:t,multiSelectionKeyCode:e})=>{const n=ns(),{deleteElements:r}=jO(),s=T0(t,GSe),i=T0(e);b.useEffect(()=>{if(s){const{edges:a,getNodes:o}=n.getState(),c=o().filter(f=>f.selected),h=a.filter(f=>f.selected);r({nodes:c,edges:h}),n.setState({nodesSelectionActive:!1})}},[s]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function YSe(t){const e=ns();b.useEffect(()=>{let n;const r=()=>{if(!t.current)return;const s=gO(t.current);(s.height===0||s.width===0)&&e.getState().onError?.("004",bo.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 OO={position:"absolute",width:"100%",height:"100%",top:0,left:0},KSe=(t,e)=>t.x!==e.x||t.y!==e.y||t.zoom!==e.k,Qx=t=>({x:t.x,y:t.y,zoom:t.k}),Dd=(t,e)=>t.target.closest(`.${e}`),iA=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),aA=t=>{const e=t.ctrlKey&&yv()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e},ZSe=t=>({d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler,userSelectionActive:t.userSelectionActive}),JSe=({onMove:t,onMoveStart:e,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:s=!0,zoomOnPinch:i=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:c=vu.Free,zoomOnDoubleClick:h=!0,elementsSelectable:f,panOnDrag:m=!0,defaultViewport:g,translateExtent:x,minZoom:y,maxZoom:w,zoomActivationKeyCode:S,preventScrolling:k=!0,children:N,noWheelClassName:C,noPanClassName:T})=>{const _=b.useRef(),E=ns(),M=b.useRef(!1),L=b.useRef(!1),P=b.useRef(null),I=b.useRef({x:0,y:0,zoom:0}),{d3Zoom:Q,d3Selection:U,d3ZoomHandler:ee,userSelectionActive:z}=er(ZSe,os),H=T0(S),B=b.useRef(0),X=b.useRef(!1),J=b.useRef();return YSe(P),b.useEffect(()=>{if(P.current){const G=P.current.getBoundingClientRect(),R=bH().scaleExtent([y,w]).translateExtent(x),se=Ki(P.current).call(R),W=ho.translate(g.x,g.y).scale(Mh(g.zoom,y,w)),F=[[0,0],[G.width,G.height]],V=R.constrain()(W,F,x);R.transform(se,V),R.wheelDelta(aA),E.setState({d3Zoom:R,d3Selection:se,d3ZoomHandler:se.on("wheel.zoom"),transform:[V.x,V.y,V.k],domNode:P.current.closest(".react-flow")})}},[]),b.useEffect(()=>{U&&Q&&(a&&!H&&!z?U.on("wheel.zoom",G=>{if(Dd(G,C))return!1;G.preventDefault(),G.stopImmediatePropagation();const R=U.property("__zoom").k||1;if(G.ctrlKey&&i){const ie=ka(G),re=aA(G),ae=R*Math.pow(2,re);Q.scaleTo(U,ae,ie,G);return}const se=G.deltaMode===1?20:1;let W=c===vu.Vertical?0:G.deltaX*se,F=c===vu.Horizontal?0:G.deltaY*se;!yv()&&G.shiftKey&&c!==vu.Vertical&&(W=G.deltaY*se,F=0),Q.translateBy(U,-(W/R)*o,-(F/R)*o,{internal:!0});const V=Qx(U.property("__zoom")),{onViewportChangeStart:te,onViewportChange:ne,onViewportChangeEnd:K}=E.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||Dd(G,C))return null;G.preventDefault(),ee.call(this,G,R)},{passive:!1}))},[z,a,c,U,Q,ee,H,i,k,C,e,t,n]),b.useEffect(()=>{Q&&Q.on("start",G=>{if(!G.sourceEvent||G.sourceEvent.internal)return null;B.current=G.sourceEvent?.button;const{onViewportChangeStart:R}=E.getState(),se=Qx(G.transform);M.current=!0,I.current=se,G.sourceEvent?.type==="mousedown"&&E.setState({paneDragging:!0}),R?.(se),e?.(G.sourceEvent,se)})},[Q,e]),b.useEffect(()=>{Q&&(z&&!M.current?Q.on("zoom",null):z||Q.on("zoom",G=>{const{onViewportChange:R}=E.getState();if(E.setState({transform:[G.transform.x,G.transform.y,G.transform.k]}),L.current=!!(r&&iA(m,B.current??0)),(t||R)&&!G.sourceEvent?.internal){const se=Qx(G.transform);R?.(se),t?.(G.sourceEvent,se)}}))},[z,Q,t,m,r]),b.useEffect(()=>{Q&&Q.on("end",G=>{if(!G.sourceEvent||G.sourceEvent.internal)return null;const{onViewportChangeEnd:R}=E.getState();if(M.current=!1,E.setState({paneDragging:!1}),r&&iA(m,B.current??0)&&!L.current&&r(G.sourceEvent),L.current=!1,(n||R)&&KSe(I.current,G.transform)){const se=Qx(G.transform);I.current=se,clearTimeout(_.current),_.current=setTimeout(()=>{R?.(se),n?.(G.sourceEvent,se)},a?150:0)}})},[Q,a,m,n,r]),b.useEffect(()=>{Q&&Q.filter(G=>{const R=H||s,se=i&&G.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&G.button===1&&G.type==="mousedown"&&(Dd(G,"react-flow__node")||Dd(G,"react-flow__edge")))return!0;if(!m&&!R&&!a&&!h&&!i||z||!h&&G.type==="dblclick"||Dd(G,C)&&G.type==="wheel"||Dd(G,T)&&(G.type!=="wheel"||a&&G.type==="wheel"&&!H)||!i&&G.ctrlKey&&G.type==="wheel"||!R&&!a&&!se&&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,Q,s,i,a,h,m,f,H]),he.createElement("div",{className:"react-flow__renderer",ref:P,style:OO},N)},eke=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function tke(){const{userSelectionActive:t,userSelectionRect:e}=er(eke,os);return t&&e?he.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 lA(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 KH(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(o=>o.id===s.id);if(i.length===0)return r.push(s),r;const a={...s};for(const o of i)if(o)switch(o.type){case"select":{a.selected=o.selected;break}case"position":{typeof o.position<"u"&&(a.position=o.position),typeof o.positionAbsolute<"u"&&(a.positionAbsolute=o.positionAbsolute),typeof o.dragging<"u"&&(a.dragging=o.dragging),a.expandParent&&lA(r,a);break}case"dimensions":{typeof o.dimensions<"u"&&(a.width=o.dimensions.width,a.height=o.dimensions.height),typeof o.updateStyle<"u"&&(a.style={...a.style||{},...o.dimensions}),typeof o.resizing=="boolean"&&(a.resizing=o.resizing),a.expandParent&&lA(r,a);break}case"remove":return r}return r.push(a),r},n)}function ZH(t,e){return KH(t,e)}function nke(t,e){return KH(t,e)}const oc=(t,e)=>({id:t,type:"select",selected:e});function Kd(t,e){return t.reduce((n,r)=>{const s=e.includes(r.id);return!r.selected&&s?(r.selected=!0,n.push(oc(r.id,!0))):r.selected&&!s&&(r.selected=!1,n.push(oc(r.id,!1))),n},[])}const Q4=(t,e)=>n=>{n.target===e.current&&t?.(n)},rke=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging}),JH=b.memo(({isSelecting:t,selectionMode:e=C0.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:s,onPaneClick:i,onPaneContextMenu:a,onPaneScroll:o,onPaneMouseEnter:c,onPaneMouseMove:h,onPaneMouseLeave:f,children:m})=>{const g=b.useRef(null),x=ns(),y=b.useRef(0),w=b.useRef(0),S=b.useRef(),{userSelectionActive:k,elementsSelectable:N,dragging:C}=er(rke,os),T=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,w.current=0},_=ee=>{i?.(ee),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},E=ee=>{if(Array.isArray(n)&&n?.includes(2)){ee.preventDefault();return}a?.(ee)},M=o?ee=>o(ee):void 0,L=ee=>{const{resetSelectedElements:z,domNode:H}=x.getState();if(S.current=H?.getBoundingClientRect(),!N||!t||ee.button!==0||ee.target!==g.current||!S.current)return;const{x:B,y:X}=pc(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:H,edges:B,transform:X,onNodesChange:J,onEdgesChange:G,nodeOrigin:R,getNodes:se}=x.getState();if(!t||!S.current||!z)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const W=pc(ee,S.current),F=z.startX??0,V=z.startY??0,te={...z,x:W.xae.id),re=K.map(ae=>ae.id);if(y.current!==re.length){y.current=re.length;const ae=Kd(ne,re);ae.length&&J?.(ae)}if(w.current!==ie.length){w.current=ie.length;const ae=Kd(B,ie);ae.length&&G?.(ae)}x.setState({userSelectionRect:te})},I=ee=>{if(ee.button!==0)return;const{userSelectionRect:z}=x.getState();!k&&z&&ee.target===g.current&&_?.(ee),x.setState({nodesSelectionActive:y.current>0}),T(),s?.(ee)},Q=ee=>{k&&(x.setState({nodesSelectionActive:y.current>0}),s?.(ee)),T()},U=N&&(t||k);return he.createElement("div",{className:Ss(["react-flow__pane",{dragging:C,selection:t}]),onClick:U?void 0:Q4(_,g),onContextMenu:Q4(E,g),onWheel:Q4(M,g),onMouseEnter:U?void 0:c,onMouseDown:U?L:void 0,onMouseMove:U?P:h,onMouseUp:U?I:void 0,onMouseLeave:U?Q:f,ref:g,style:OO},m,he.createElement(tke,null))});JH.displayName="Pane";function eV(t,e){const n=t.parentNode||t.parentId;if(!n)return!1;const r=e.get(n);return r?r.selected?!0:eV(r,e):!1}function oA(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 ske(t,e,n,r){return Array.from(t.values()).filter(s=>(s.selected||s.id===r)&&(!s.parentNode||s.parentId||!eV(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 ike(t,e){return!e||e==="parent"?e:[e[0],[e[1][0]-(t.width||0),e[1][1]-(t.height||0)]]}function tV(t,e,n,r,s=[0,0],i){const a=ike(t,t.extent||r);let o=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}=Nu(m,s).positionAbsolute;o=m&&na(g)&&na(x)&&na(m.width)&&na(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]]]:o}else i?.("005",bo.error005()),o=a;else if(t.extent&&c&&t.extent!=="parent"){const m=n.get(c),{x:g,y:x}=Nu(m,s).positionAbsolute;o=[[t.extent[0][0]+g,t.extent[0][1]+x],[t.extent[1][0]+g,t.extent[1][1]+x]]}let h={x:0,y:0};if(c){const m=n.get(c);h=Nu(m,s).positionAbsolute}const f=o&&o!=="parent"?xO(e,o):e;return{position:{x:f.x-h.x,y:f.y-h.y},positionAbsolute:f}}function H4({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 cA=(t,e,n,r)=>{const s=e.querySelectorAll(t);if(!s||!s.length)return null;const i=Array.from(s),a=e.getBoundingClientRect(),o={x:a.width*r[0],y:a.height*r[1]};return i.map(c=>{const h=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(h.left-a.left-o.x)/n,y:(h.top-a.top-o.y)/n,...gO(c)}})};function hm(t,e,n){return n===void 0?n:r=>{const s=e().nodeInternals.get(t);s&&n(r,{...s})}}function Ak({id:t,store:e,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:o,onError:c}=e.getState(),h=o.get(t);if(!h){c?.("012",bo.error012(t));return}e.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&a)&&(i({nodes:[h],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):s([t])}function ake(){const t=ns();return b.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:s,snapToGrid:i}=t.getState(),a=n.touches?n.touches[0].clientX:n.clientX,o=n.touches?n.touches[0].clientY:n.clientY,c={x:(a-r[0])/r[2],y:(o-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 V4(t){return(e,n,r)=>t?.(e,r)}function nV({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:i,selectNodesOnDrag:a}){const o=ns(),[c,h]=b.useState(!1),f=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),N=b.useRef(!1),C=ake();return b.useEffect(()=>{if(t?.current){const T=Ki(t.current),_=({x:L,y:P})=>{const{nodeInternals:I,onNodeDrag:Q,onSelectionDrag:U,updateNodePositions:ee,nodeExtent:z,snapGrid:H,snapToGrid:B,nodeOrigin:X,onError:J}=o.getState();m.current={x:L,y:P};let G=!1,R={x:0,y:0,x2:0,y2:0};if(f.current.length>1&&z){const W=By(f.current,X);R=N0(W)}if(f.current=f.current.map(W=>{const F={x:L-W.distance.x,y:P-W.distance.y};B&&(F.x=H[0]*Math.round(F.x/H[0]),F.y=H[1]*Math.round(F.y/H[1]));const V=[[z[0][0],z[0][1]],[z[1][0],z[1][1]]];f.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=tV(W,F,I,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(f.current,!0,!0),h(!0);const se=s?Q:V4(U);if(se&&w.current){const[W,F]=H4({nodeId:s,dragItems:f.current,nodeInternals:I});se(w.current,W,F)}},E=()=>{if(!x.current)return;const[L,P]=SH(y.current,x.current);if(L!==0||P!==0){const{transform:I,panBy:Q}=o.getState();m.current.x=(m.current.x??0)-L/I[2],m.current.y=(m.current.y??0)-P/I[2],Q({x:L,y:P})&&_(m.current)}g.current=requestAnimationFrame(E)},M=L=>{const{nodeInternals:P,multiSelectionActive:I,nodesDraggable:Q,unselectNodesAndEdges:U,onNodeDragStart:ee,onSelectionDragStart:z}=o.getState();k.current=!0;const H=s?ee:V4(z);(!a||!i)&&!I&&s&&(P.get(s)?.selected||U()),s&&i&&a&&Ak({id:s,store:o,nodeRef:t});const B=C(L);if(m.current=B,f.current=ske(P,Q,B,s),H&&f.current){const[X,J]=H4({nodeId:s,dragItems:f.current,nodeInternals:P});H(L.sourceEvent,X,J)}};if(e)T.on(".drag",null);else{const L=Q5e().on("start",P=>{const{domNode:I,nodeDragThreshold:Q}=o.getState();Q===0&&M(P),N.current=!1;const U=C(P);m.current=U,x.current=I?.getBoundingClientRect()||null,y.current=pc(P.sourceEvent,x.current)}).on("drag",P=>{const I=C(P),{autoPanOnNodeDrag:Q,nodeDragThreshold:U}=o.getState();if(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1&&(N.current=!0),!N.current){if(!S.current&&k.current&&Q&&(S.current=!0,E()),!k.current){const ee=I.xSnapped-(m?.current?.x??0),z=I.ySnapped-(m?.current?.y??0);Math.sqrt(ee*ee+z*z)>U&&M(P)}(m.current.x!==I.xSnapped||m.current.y!==I.ySnapped)&&f.current&&k.current&&(w.current=P.sourceEvent,y.current=pc(P.sourceEvent,x.current),_(I))}}).on("end",P=>{if(!(!k.current||N.current)&&(h(!1),S.current=!1,k.current=!1,cancelAnimationFrame(g.current),f.current)){const{updateNodePositions:I,nodeInternals:Q,onNodeDragStop:U,onSelectionDragStop:ee}=o.getState(),z=s?U:V4(ee);if(I(f.current,!1,!1),z){const[H,B]=H4({nodeId:s,dragItems:f.current,nodeInternals:Q});z(P.sourceEvent,H,B)}}}).filter(P=>{const I=P.target;return!P.button&&(!n||!oA(I,`.${n}`,t))&&(!r||oA(I,r,t))});return T.call(L),()=>{T.on(".drag",null)}}}},[t,e,n,r,i,o,s,a,C]),c}function rV(){const t=ns();return b.useCallback(n=>{const{nodeInternals:r,nodeExtent:s,updateNodePositions:i,getNodes:a,snapToGrid:o,snapGrid:c,onError:h,nodesDraggable:f}=t.getState(),m=a().filter(N=>N.selected&&(N.draggable||f&&typeof N.draggable>"u")),g=o?c[0]:5,x=o?c[1]:5,y=n.isShiftPressed?4:1,w=n.x*g*y,S=n.y*x*y,k=m.map(N=>{if(N.positionAbsolute){const C={x:N.positionAbsolute.x+w,y:N.positionAbsolute.y+S};o&&(C.x=c[0]*Math.round(C.x/c[0]),C.y=c[1]*Math.round(C.y/c[1]));const{positionAbsolute:T,position:_}=tV(N,C,r,s,void 0,h);N.position=_,N.positionAbsolute=T}return N});i(k,!0,!1)},[])}const hh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var fm=t=>{const e=({id:n,type:r,data:s,xPos:i,yPos:a,xPosOrigin:o,yPosOrigin:c,selected:h,onClick:f,onMouseEnter:m,onMouseMove:g,onMouseLeave:x,onContextMenu:y,onDoubleClick:w,style:S,className:k,isDraggable:N,isSelectable:C,isConnectable:T,isFocusable:_,selectNodesOnDrag:E,sourcePosition:M,targetPosition:L,hidden:P,resizeObserver:I,dragHandle:Q,zIndex:U,isParent:ee,noDragClassName:z,noPanClassName:H,initialized:B,disableKeyboardA11y:X,ariaLabel:J,rfId:G,hasHandleBounds:R})=>{const se=ns(),W=b.useRef(null),F=b.useRef(null),V=b.useRef(M),te=b.useRef(L),ne=b.useRef(r),K=C||N||f||m||g||x,ie=rV(),re=hm(n,se.getState,m),ae=hm(n,se.getState,g),_e=hm(n,se.getState,x),Ue=hm(n,se.getState,y),Xe=hm(n,se.getState,w),Ze=Ve=>{const{nodeDragThreshold:Be}=se.getState();if(C&&(!E||!N||Be>0)&&Ak({id:n,store:se,nodeRef:W}),f){const ut=se.getState().nodeInternals.get(n);ut&&f(Ve,{...ut})}},Oe=Ve=>{if(!Ck(Ve)&&!X)if(NH.includes(Ve.key)&&C){const Be=Ve.key==="Escape";Ak({id:n,store:se,unselect:Be,nodeRef:W})}else N&&h&&Object.prototype.hasOwnProperty.call(hh,Ve.key)&&(se.setState({ariaLiveMessage:`Moved selected node ${Ve.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~a}`}),ie({x:hh[Ve.key].x,y:hh[Ve.key].y,isShiftPressed:Ve.shiftKey}))};b.useEffect(()=>()=>{F.current&&(I?.unobserve(F.current),F.current=null)},[]),b.useEffect(()=>{if(W.current&&!P){const Ve=W.current;(!B||!R||F.current!==Ve)&&(F.current&&I?.unobserve(F.current),I?.observe(Ve),F.current=Ve)}},[P,B,R]),b.useEffect(()=>{const Ve=ne.current!==r,Be=V.current!==M,ut=te.current!==L;W.current&&(Ve||Be||ut)&&(Ve&&(ne.current=r),Be&&(V.current=M),ut&&(te.current=L),se.getState().updateNodeDimensions([{id:n,nodeElement:W.current,forceUpdate:!0}]))},[n,r,M,L]);const He=nV({nodeRef:W,disabled:P||!N,noDragClassName:z,handleSelector:Q,nodeId:n,isSelectable:C,selectNodesOnDrag:E});return P?null:he.createElement("div",{className:Ss(["react-flow__node",`react-flow__node-${r}`,{[H]:N},k,{selected:h,selectable:C,parent:ee,dragging:He}]),ref:W,style:{zIndex:U,transform:`translate(${o}px,${c}px)`,pointerEvents:K?"all":"none",visibility:B?"visible":"hidden",...S},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:re,onMouseMove:ae,onMouseLeave:_e,onContextMenu:Ue,onClick:Ze,onDoubleClick:Xe,onKeyDown:_?Oe:void 0,tabIndex:_?0:void 0,role:_?"button":void 0,"aria-describedby":X?void 0:`${UH}-${G}`,"aria-label":J},he.createElement(bSe,{value:n},he.createElement(t,{id:n,data:s,type:r,xPos:i,yPos:a,selected:h,isConnectable:T,sourcePosition:M,targetPosition:L,dragging:He,dragHandle:Q,zIndex:U})))};return e.displayName="NodeWrapper",b.memo(e)};const lke=t=>{const e=t.getNodes().filter(n=>n.selected);return{...By(e,t.nodeOrigin),transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`,userSelectionActive:t.userSelectionActive}};function oke({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const r=ns(),{width:s,height:i,x:a,y:o,transformString:c,userSelectionActive:h}=er(lke,os),f=rV(),m=b.useRef(null);if(b.useEffect(()=>{n||m.current?.focus({preventScroll:!0})},[n]),nV({nodeRef:m}),h||!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(hh,y.key)&&f({x:hh[y.key].x,y:hh[y.key].y,isShiftPressed:y.shiftKey})};return he.createElement("div",{className:Ss(["react-flow__nodesselection","react-flow__container",e]),style:{transform:c}},he.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:o,left:a}}))}var cke=b.memo(oke);const uke=t=>t.nodesSelectionActive,sV=({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,deleteKeyCode:o,onMove:c,onMoveStart:h,onMoveEnd:f,selectionKeyCode:m,selectionOnDrag:g,selectionMode:x,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:N,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:_,panOnScroll:E,panOnScrollSpeed:M,panOnScrollMode:L,zoomOnDoubleClick:P,panOnDrag:I,defaultViewport:Q,translateExtent:U,minZoom:ee,maxZoom:z,preventScrolling:H,onSelectionContextMenu:B,noWheelClassName:X,noPanClassName:J,disableKeyboardA11y:G})=>{const R=er(uke),se=T0(m),W=T0(k),F=W||I,V=W||E,te=se||g&&F!==!0;return XSe({deleteKeyCode:o,multiSelectionKeyCode:S}),he.createElement(JSe,{onMove:c,onMoveStart:h,onMoveEnd:f,onPaneContextMenu:i,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:_,panOnScroll:V,panOnScrollSpeed:M,panOnScrollMode:L,zoomOnDoubleClick:P,panOnDrag:!se&&F,defaultViewport:Q,translateExtent:U,minZoom:ee,maxZoom:z,zoomActivationKeyCode:N,preventScrolling:H,noWheelClassName:X,noPanClassName:J},he.createElement(JH,{onSelectionStart:y,onSelectionEnd:w,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:F,isSelecting:!!te,selectionMode:x},t,R&&he.createElement(cke,{onSelectionContextMenu:B,noPanClassName:J,disableKeyboardA11y:G})))};sV.displayName="FlowRenderer";var dke=b.memo(sV);function hke(t){return er(b.useCallback(n=>t?RH(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[t]))}function fke(t){const e={input:fm(t.input||$H),default:fm(t.default||Mk),output:fm(t.output||HH),group:fm(t.group||kO)},n={},r=Object.keys(t).filter(s=>!["input","default","output","group"].includes(s)).reduce((s,i)=>(s[i]=fm(t[i]||Mk),s),n);return{...e,...r}}const mke=({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]},pke=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions,onError:t.onError}),iV=t=>{const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,updateNodeDimensions:i,onError:a}=er(pke,os),o=hke(t.onlyRenderVisibleElements),c=b.useRef(),h=b.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const f=new ResizeObserver(m=>{const g=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));i(g)});return c.current=f,f},[]);return b.useEffect(()=>()=>{c?.current?.disconnect()},[]),he.createElement("div",{className:"react-flow__nodes",style:OO},o.map(f=>{let m=f.type||"default";t.nodeTypes[m]||(a?.("003",bo.error003(m)),m="default");const g=t.nodeTypes[m]||t.nodeTypes.default,x=!!(f.draggable||e&&typeof f.draggable>"u"),y=!!(f.selectable||s&&typeof f.selectable>"u"),w=!!(f.connectable||n&&typeof f.connectable>"u"),S=!!(f.focusable||r&&typeof f.focusable>"u"),k=t.nodeExtent?xO(f.positionAbsolute,t.nodeExtent):f.positionAbsolute,N=k?.x??0,C=k?.y??0,T=mke({x:N,y:C,width:f.width??0,height:f.height??0,origin:t.nodeOrigin});return he.createElement(g,{key:f.id,id:f.id,className:f.className,style:f.style,type:m,data:f.data,sourcePosition:f.sourcePosition||mt.Bottom,targetPosition:f.targetPosition||mt.Top,hidden:f.hidden,xPos:N,yPos:C,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:!!f.selected,isDraggable:x,isSelectable:y,isConnectable:w,isFocusable:S,resizeObserver:h,dragHandle:f.dragHandle,zIndex:f[Sr]?.z??0,isParent:!!f[Sr]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!f.width&&!!f.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:f.ariaLabel,hasHandleBounds:!!f[Sr]?.handleBounds})}))};iV.displayName="NodeRenderer";var gke=b.memo(iV);const xke=(t,e,n)=>n===mt.Left?t-e:n===mt.Right?t+e:t,vke=(t,e,n)=>n===mt.Top?t-e:n===mt.Bottom?t+e:t,uA="react-flow__edgeupdater",dA=({position:t,centerX:e,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o})=>he.createElement("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Ss([uA,`${uA}-${o}`]),cx:xke(e,r,t),cy:vke(n,r,t),r,stroke:"transparent",fill:"transparent"}),yke=()=>!0;var zd=t=>{const e=({id:n,className:r,type:s,data:i,onClick:a,onEdgeDoubleClick:o,selected:c,animated:h,label:f,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,style:S,source:k,target:N,sourceX:C,sourceY:T,targetX:_,targetY:E,sourcePosition:M,targetPosition:L,elementsSelectable:P,hidden:I,sourceHandleId:Q,targetHandleId:U,onContextMenu:ee,onMouseEnter:z,onMouseMove:H,onMouseLeave:B,reconnectRadius:X,onReconnect:J,onReconnectStart:G,onReconnectEnd:R,markerEnd:se,markerStart:W,rfId:F,ariaLabel:V,isFocusable:te,isReconnectable:ne,pathOptions:K,interactionWidth:ie,disableKeyboardA11y:re})=>{const ae=b.useRef(null),[_e,Ue]=b.useState(!1),[Xe,Ze]=b.useState(!1),Oe=ns(),He=b.useMemo(()=>`url('#${Ek(W,F)}')`,[W,F]),Ve=b.useMemo(()=>`url('#${Ek(se,F)}')`,[se,F]);if(I)return null;const Be=Tt=>{const{edges:ke,addSelectedEdges:Te,unselectNodesAndEdges:qe,multiSelectionActive:Rt}=Oe.getState(),At=ke.find(vr=>vr.id===n);At&&(P&&(Oe.setState({nodesSelectionActive:!1}),At.selected&&Rt?(qe({nodes:[],edges:[At]}),ae.current?.blur()):Te([n])),a&&a(Tt,At))},ut=dm(n,Oe.getState,o),rt=dm(n,Oe.getState,ee),rn=dm(n,Oe.getState,z),Rn=dm(n,Oe.getState,H),Tn=dm(n,Oe.getState,B),Mt=(Tt,ke)=>{if(Tt.button!==0)return;const{edges:Te,isValidConnection:qe}=Oe.getState(),Rt=ke?N:k,At=(ke?U:Q)||null,vr=ke?"target":"source",ft=qe||yke,mn=ke,gt=Te.find(it=>it.id===n);Ze(!0),G?.(Tt,gt,vr);const Nt=it=>{Ze(!1),R?.(it,gt,vr)};IH({event:Tt,handleId:At,nodeId:Rt,onConnect:it=>J?.(gt,it),isTarget:mn,getState:Oe.getState,setState:Oe.setState,isValidConnection:ft,edgeUpdaterType:vr,onReconnectEnd:Nt})},vt=Tt=>Mt(Tt,!0),Ce=Tt=>Mt(Tt,!1),Le=()=>Ue(!0),Ge=()=>Ue(!1),lt=!P&&!a,jt=Tt=>{if(!re&&NH.includes(Tt.key)&&P){const{unselectNodesAndEdges:ke,addSelectedEdges:Te,edges:qe}=Oe.getState();Tt.key==="Escape"?(ae.current?.blur(),ke({edges:[qe.find(At=>At.id===n)]})):Te([n])}};return he.createElement("g",{className:Ss(["react-flow__edge",`react-flow__edge-${s}`,r,{selected:c,animated:h,inactive:lt,updating:_e}]),onClick:Be,onDoubleClick:ut,onContextMenu:rt,onMouseEnter:rn,onMouseMove:Rn,onMouseLeave:Tn,onKeyDown:te?jt: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 ${N}`,"aria-describedby":te?`${WH}-${F}`:void 0,ref:ae},!Xe&&he.createElement(t,{id:n,source:k,target:N,selected:c,animated:h,label:f,labelStyle:m,labelShowBg:g,labelBgStyle:x,labelBgPadding:y,labelBgBorderRadius:w,data:i,style:S,sourceX:C,sourceY:T,targetX:_,targetY:E,sourcePosition:M,targetPosition:L,sourceHandleId:Q,targetHandleId:U,markerStart:He,markerEnd:Ve,pathOptions:K,interactionWidth:ie}),ne&&he.createElement(he.Fragment,null,(ne==="source"||ne===!0)&&he.createElement(dA,{position:M,centerX:C,centerY:T,radius:X,onMouseDown:vt,onMouseEnter:Le,onMouseOut:Ge,type:"source"}),(ne==="target"||ne===!0)&&he.createElement(dA,{position:L,centerX:_,centerY:E,radius:X,onMouseDown:Ce,onMouseEnter:Le,onMouseOut:Ge,type:"target"})))};return e.displayName="EdgeWrapper",b.memo(e)};function bke(t){const e={default:zd(t.default||wv),straight:zd(t.bezier||bO),step:zd(t.step||yO),smoothstep:zd(t.step||Iy),simplebezier:zd(t.simplebezier||vO)},n={},r=Object.keys(t).filter(s=>!["default","bezier"].includes(s)).reduce((s,i)=>(s[i]=zd(t[i]||wv),s),n);return{...e,...r}}function hA(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 mt.Top:return{x:r+i/2,y:s};case mt.Right:return{x:r+i,y:s+a/2};case mt.Bottom:return{x:r+i/2,y:s+a};case mt.Left:return{x:r,y:s+a/2}}}function fA(t,e){return t?t.length===1||!e?t[0]:e&&t.find(n=>n.id===e)||null:null}const wke=(t,e,n,r,s,i)=>{const a=hA(n,t,e),o=hA(i,r,s);return{sourceX:a.x,sourceY:a.y,targetX:o.x,targetY:o.y}};function Ske({sourcePos:t,targetPos:e,sourceWidth:n,sourceHeight:r,targetWidth:s,targetHeight:i,width:a,height:o,transform:c}){const h={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)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const f=N0({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:a/c[2],height:o/c[2]}),m=Math.max(0,Math.min(f.x2,h.x2)-Math.max(f.x,h.x)),g=Math.max(0,Math.min(f.y2,h.y2)-Math.max(f.y,h.y));return Math.ceil(m*g)>0}function mA(t){const e=t?.[Sr]?.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 kke=[{level:0,isMaxLevel:!0,edges:[]}];function jke(t,e,n=!1){let r=-1;const s=t.reduce((a,o)=>{const c=na(o.zIndex);let h=c?o.zIndex:0;if(n){const f=e.get(o.target),m=e.get(o.source),g=o.selected||f?.selected||m?.selected,x=Math.max(m?.[Sr]?.z||0,f?.[Sr]?.z||0,1e3);h=(c?o.zIndex:0)+(g?x:0)}return a[h]?a[h].push(o):a[h]=[o],r=h>r?h:r,a},{}),i=Object.entries(s).map(([a,o])=>{const c=+a;return{edges:o,level:c,isMaxLevel:c===r}});return i.length===0?kke:i}function Oke(t,e,n){const r=er(b.useCallback(s=>t?s.edges.filter(i=>{const a=e.get(i.source),o=e.get(i.target);return a?.width&&a?.height&&o?.width&&o?.height&&Ske({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:o.width,targetHeight:o.height,width:s.width,height:s.height,transform:s.transform})}):s.edges,[t,e]));return jke(r,e,n)}const Nke=({color:t="none",strokeWidth:e=1})=>he.createElement("polyline",{style:{stroke:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Cke=({color:t="none",strokeWidth:e=1})=>he.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:e},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),pA={[bv.Arrow]:Nke,[bv.ArrowClosed]:Cke};function Tke(t){const e=ns();return b.useMemo(()=>Object.prototype.hasOwnProperty.call(pA,t)?pA[t]:(e.getState().onError?.("009",bo.error009(t)),null),[t])}const Eke=({id:t,type:e,color:n,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const c=Tke(e);return c?he.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0"},he.createElement(c,{color:n,strokeWidth:a})):null},_ke=({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 o=Ek(a,e);r.includes(o)||(s.push({id:o,color:a.color||t,...a}),r.push(o))}}),s),[]).sort((s,i)=>s.id.localeCompare(i.id))},aV=({defaultColor:t,rfId:e})=>{const n=er(b.useCallback(_ke({defaultColor:t,rfId:e}),[t,e]),(r,s)=>!(r.length!==s.length||r.some((i,a)=>i.id!==s[a].id)));return he.createElement("defs",null,n.map(r=>he.createElement(Eke,{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})))};aV.displayName="MarkerDefinitions";var Mke=b.memo(aV);const Ake=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}),lV=({defaultMarkerColor:t,onlyRenderVisibleElements:e,elevateEdgesOnSelect:n,rfId:r,edgeTypes:s,noPanClassName:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:h,onEdgeClick:f,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,children:S,disableKeyboardA11y:k})=>{const{edgesFocusable:N,edgesUpdatable:C,elementsSelectable:T,width:_,height:E,connectionMode:M,nodeInternals:L,onError:P}=er(Ake,os),I=Oke(e,L,n);return _?he.createElement(he.Fragment,null,I.map(({level:Q,edges:U,isMaxLevel:ee})=>he.createElement("svg",{key:Q,style:{zIndex:Q},width:_,height:E,className:"react-flow__edges react-flow__container"},ee&&he.createElement(Mke,{defaultColor:t,rfId:r}),he.createElement("g",null,U.map(z=>{const[H,B,X]=mA(L.get(z.source)),[J,G,R]=mA(L.get(z.target));if(!X||!R)return null;let se=z.type||"default";s[se]||(P?.("011",bo.error011(se)),se="default");const W=s[se]||s.default,F=M===qu.Strict?G.target:(G.target??[]).concat(G.source??[]),V=fA(B.source,z.sourceHandle),te=fA(F,z.targetHandle),ne=V?.position||mt.Bottom,K=te?.position||mt.Top,ie=!!(z.focusable||N&&typeof z.focusable>"u"),re=z.reconnectable||z.updatable,ae=typeof g<"u"&&(re||C&&typeof re>"u");if(!V||!te)return P?.("008",bo.error008(V,z)),null;const{sourceX:_e,sourceY:Ue,targetX:Xe,targetY:Ze}=wke(H,V,ne,J,te,K);return he.createElement(W,{key:z.id,id:z.id,className:Ss([z.className,i]),type:se,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:_e,sourceY:Ue,targetX:Xe,targetY:Ze,sourcePosition:ne,targetPosition:K,elementsSelectable:T,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:h,onClick:f,onEdgeDoubleClick:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:y,reconnectRadius:w,rfId:r,ariaLabel:z.ariaLabel,isFocusable:ie,isReconnectable:ae,pathOptions:"pathOptions"in z?z.pathOptions:void 0,interactionWidth:z.interactionWidth,disableKeyboardA11y:k})})))),S):null};lV.displayName="EdgeRenderer";var Rke=b.memo(lV);const Dke=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function zke({children:t}){const e=er(Dke);return he.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:e}},t)}function Pke(t){const e=jO(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const Lke={[mt.Left]:mt.Right,[mt.Right]:mt.Left,[mt.Top]:mt.Bottom,[mt.Bottom]:mt.Top},oV=({nodeId:t,handleType:e,style:n,type:r=uc.Bezier,CustomComponent:s,connectionStatus:i})=>{const{fromNode:a,handleId:o,toX:c,toY:h,connectionMode:f}=er(b.useCallback(E=>({fromNode:E.nodeInternals.get(t),handleId:E.connectionHandleId,toX:(E.connectionPosition.x-E.transform[0])/E.transform[2],toY:(E.connectionPosition.y-E.transform[1])/E.transform[2],connectionMode:E.connectionMode}),[t]),os),m=a?.[Sr]?.handleBounds;let g=m?.[e];if(f===qu.Loose&&(g=g||m?.[e==="source"?"target":"source"]),!a||!g)return null;const x=o?g.find(E=>E.id===o):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,N=x?.position,C=N?Lke[N]:null;if(!N||!C)return null;if(s)return he.createElement(s,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:x,fromX:S,fromY:k,toX:c,toY:h,fromPosition:N,toPosition:C,connectionStatus:i});let T="";const _={sourceX:S,sourceY:k,sourcePosition:N,targetX:c,targetY:h,targetPosition:C};return r===uc.Bezier?[T]=MH(_):r===uc.Step?[T]=Tk({..._,borderRadius:0}):r===uc.SmoothStep?[T]=Tk(_):r===uc.SimpleBezier?[T]=_H(_):T=`M${S},${k} ${c},${h}`,he.createElement("path",{d:T,fill:"none",className:"react-flow__connection-path",style:n})};oV.displayName="ConnectionLine";const Ike=t=>({nodeId:t.connectionNodeId,handleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,connectionStatus:t.connectionStatus,width:t.width,height:t.height});function Bke({containerStyle:t,style:e,type:n,component:r}){const{nodeId:s,handleType:i,nodesConnectable:a,width:o,height:c,connectionStatus:h}=er(Ike,os);return!(s&&i&&o&&a)?null:he.createElement("svg",{style:t,width:o,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},he.createElement("g",{className:Ss(["react-flow__connection",h])},he.createElement(oV,{nodeId:s,handleType:i,style:e,type:n,CustomComponent:r,connectionStatus:h})))}function gA(t,e){return b.useRef(null),ns(),b.useMemo(()=>e(t),[t])}const cV=({nodeTypes:t,edgeTypes:e,onMove:n,onMoveStart:r,onMoveEnd:s,onInit:i,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:c,onEdgeDoubleClick:h,onNodeMouseEnter:f,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,onSelectionContextMenu:y,onSelectionStart:w,onSelectionEnd:S,connectionLineType:k,connectionLineStyle:N,connectionLineComponent:C,connectionLineContainerStyle:T,selectionKeyCode:_,selectionOnDrag:E,selectionMode:M,multiSelectionKeyCode:L,panActivationKeyCode:P,zoomActivationKeyCode:I,deleteKeyCode:Q,onlyRenderVisibleElements:U,elementsSelectable:ee,selectNodesOnDrag:z,defaultViewport:H,translateExtent:B,minZoom:X,maxZoom:J,preventScrolling:G,defaultMarkerColor:R,zoomOnScroll:se,zoomOnPinch:W,panOnScroll:F,panOnScrollSpeed:V,panOnScrollMode:te,zoomOnDoubleClick:ne,panOnDrag:K,onPaneClick:ie,onPaneMouseEnter:re,onPaneMouseMove:ae,onPaneMouseLeave:_e,onPaneScroll:Ue,onPaneContextMenu:Xe,onEdgeContextMenu:Ze,onEdgeMouseEnter:Oe,onEdgeMouseMove:He,onEdgeMouseLeave:Ve,onReconnect:Be,onReconnectStart:ut,onReconnectEnd:rt,reconnectRadius:rn,noDragClassName:Rn,noWheelClassName:Tn,noPanClassName:Mt,elevateEdgesOnSelect:vt,disableKeyboardA11y:Ce,nodeOrigin:Le,nodeExtent:Ge,rfId:lt})=>{const jt=gA(t,fke),Tt=gA(e,bke);return Pke(i),he.createElement(dke,{onPaneClick:ie,onPaneMouseEnter:re,onPaneMouseMove:ae,onPaneMouseLeave:_e,onPaneContextMenu:Xe,onPaneScroll:Ue,deleteKeyCode:Q,selectionKeyCode:_,selectionOnDrag:E,selectionMode:M,onSelectionStart:w,onSelectionEnd:S,multiSelectionKeyCode:L,panActivationKeyCode:P,zoomActivationKeyCode:I,elementsSelectable:ee,onMove:n,onMoveStart:r,onMoveEnd:s,zoomOnScroll:se,zoomOnPinch:W,zoomOnDoubleClick:ne,panOnScroll:F,panOnScrollSpeed:V,panOnScrollMode:te,panOnDrag:K,defaultViewport:H,translateExtent:B,minZoom:X,maxZoom:J,onSelectionContextMenu:y,preventScrolling:G,noDragClassName:Rn,noWheelClassName:Tn,noPanClassName:Mt,disableKeyboardA11y:Ce},he.createElement(zke,null,he.createElement(Rke,{edgeTypes:Tt,onEdgeClick:o,onEdgeDoubleClick:h,onlyRenderVisibleElements:U,onEdgeContextMenu:Ze,onEdgeMouseEnter:Oe,onEdgeMouseMove:He,onEdgeMouseLeave:Ve,onReconnect:Be,onReconnectStart:ut,onReconnectEnd:rt,reconnectRadius:rn,defaultMarkerColor:R,noPanClassName:Mt,elevateEdgesOnSelect:!!vt,disableKeyboardA11y:Ce,rfId:lt},he.createElement(Bke,{style:N,type:k,component:C,containerStyle:T})),he.createElement("div",{className:"react-flow__edgelabel-renderer"}),he.createElement(gke,{nodeTypes:jt,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:f,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:x,selectNodesOnDrag:z,onlyRenderVisibleElements:U,noPanClassName:Mt,noDragClassName:Rn,disableKeyboardA11y:Ce,nodeOrigin:Le,nodeExtent:Ge,rfId:lt})))};cV.displayName="GraphView";var qke=b.memo(cV);const Rk=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nc={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:Rk,nodeExtent:Rk,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:qu.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:mSe,isValidConnection:void 0},Fke=()=>t4e((t,e)=>({...nc,setNodes:n=>{const{nodeInternals:r,nodeOrigin:s,elevateNodesOnSelect:i}=e();t({nodeInternals:$4(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?$4(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:o,domNode:c,nodeOrigin:h}=e(),f=c?.querySelector(".react-flow__viewport");if(!f)return;const m=window.getComputedStyle(f),{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,[Sr]:{...k[Sr],handleBounds:void 0}});else if(k){const N=gO(S.nodeElement);!!(N.width&&N.height&&(k.width!==N.width||k.height!==N.height||S.forceUpdate))&&(s.set(k.id,{...k,[Sr]:{...k[Sr],handleBounds:{source:cA(".source",S.nodeElement,g,h),target:cA(".target",S.nodeElement,g,h)}},...N}),w.push({id:k.id,type:"dimensions",dimensions:N}))}return w},[]);XH(s,h);const y=a||i&&!a&&YH(e,{initial:!0,...o});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(o=>{const c={id:o.id,type:"position",dragging:s};return r&&(c.positionAbsolute=o.positionAbsolute,c.position=o.position),c});i(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:s,hasDefaultNodes:i,nodeOrigin:a,getNodes:o,elevateNodesOnSelect:c}=e();if(n?.length){if(i){const h=ZH(n,o()),f=$4(h,s,a,c);t({nodeInternals:f})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,o=null;r?a=n.map(c=>oc(c,!0)):(a=Kd(i(),n),o=Kd(s,[])),$x({changedNodes:a,changedEdges:o,get:e,set:t})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:s,getNodes:i}=e();let a,o=null;r?a=n.map(c=>oc(c,!0)):(a=Kd(s,n),o=Kd(i(),[])),$x({changedNodes:o,changedEdges:a,get:e,set:t})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:s,getNodes:i}=e(),a=n||i(),o=r||s,c=a.map(f=>(f.selected=!1,oc(f.id,!1))),h=o.map(f=>oc(f.id,!1));$x({changedNodes:c,changedEdges:h,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(o=>o.selected).map(o=>oc(o.id,!1)),a=n.filter(o=>o.selected).map(o=>oc(o.id,!1));$x({changedNodes:i,changedEdges:a,get:e,set:t})},setNodeExtent:n=>{const{nodeInternals:r}=e();r.forEach(s=>{s.positionAbsolute=xO(s.position,n)}),t({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:s,height:i,d3Zoom:a,d3Selection:o,translateExtent:c}=e();if(!a||!o||!n.x&&!n.y)return!1;const h=ho.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),f=[[0,0],[s,i]],m=a?.constrain()(h,f,c);return a.transform(o,m),r[0]!==m.x||r[1]!==m.y||r[2]!==m.k},cancelConnection:()=>t({connectionNodeId:nc.connectionNodeId,connectionHandleId:nc.connectionHandleId,connectionHandleType:nc.connectionHandleType,connectionStatus:nc.connectionStatus,connectionStartHandle:nc.connectionStartHandle,connectionEndHandle:nc.connectionEndHandle}),reset:()=>t({...nc})}),Object.is),uV=({children:t})=>{const e=b.useRef(null);return e.current||(e.current=Fke()),he.createElement(lSe,{value:e.current},t)};uV.displayName="ReactFlowProvider";const dV=({children:t})=>b.useContext(Py)?he.createElement(he.Fragment,null,t):he.createElement(uV,null,t);dV.displayName="ReactFlowWrapper";const $ke={input:$H,default:Mk,output:HH,group:kO},Qke={default:wv,straight:bO,step:yO,smoothstep:Iy,simplebezier:vO},Hke=[0,0],Vke=[15,15],Uke={x:0,y:0,zoom:1},Wke={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},hV=b.forwardRef(({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:i=$ke,edgeTypes:a=Qke,onNodeClick:o,onEdgeClick:c,onInit:h,onMove:f,onMoveStart:m,onMoveEnd:g,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:N,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:_,onNodeDoubleClick:E,onNodeDragStart:M,onNodeDrag:L,onNodeDragStop:P,onNodesDelete:I,onEdgesDelete:Q,onSelectionChange:U,onSelectionDragStart:ee,onSelectionDrag:z,onSelectionDragStop:H,onSelectionContextMenu:B,onSelectionStart:X,onSelectionEnd:J,connectionMode:G=qu.Strict,connectionLineType:R=uc.Bezier,connectionLineStyle:se,connectionLineComponent:W,connectionLineContainerStyle:F,deleteKeyCode:V="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:ne=!1,selectionMode:K=C0.Full,panActivationKeyCode:ie="Space",multiSelectionKeyCode:re=yv()?"Meta":"Control",zoomActivationKeyCode:ae=yv()?"Meta":"Control",snapToGrid:_e=!1,snapGrid:Ue=Vke,onlyRenderVisibleElements:Xe=!1,selectNodesOnDrag:Ze=!0,nodesDraggable:Oe,nodesConnectable:He,nodesFocusable:Ve,nodeOrigin:Be=Hke,edgesFocusable:ut,edgesUpdatable:rt,elementsSelectable:rn,defaultViewport:Rn=Uke,minZoom:Tn=.5,maxZoom:Mt=2,translateExtent:vt=Rk,preventScrolling:Ce=!0,nodeExtent:Le,defaultMarkerColor:Ge="#b1b1b7",zoomOnScroll:lt=!0,zoomOnPinch:jt=!0,panOnScroll:Tt=!1,panOnScrollSpeed:ke=.5,panOnScrollMode:Te=vu.Free,zoomOnDoubleClick:qe=!0,panOnDrag:Rt=!0,onPaneClick:At,onPaneMouseEnter:vr,onPaneMouseMove:ft,onPaneMouseLeave:mn,onPaneScroll:gt,onPaneContextMenu:Nt,children:Ot,onEdgeContextMenu:it,onEdgeDoubleClick:Vn,onEdgeMouseEnter:jr,onEdgeMouseMove:Or,onEdgeMouseLeave:ge,onEdgeUpdate:ze,onEdgeUpdateStart:Et,onEdgeUpdateEnd:Gt,onReconnect:Mr,onReconnectStart:Wr,onReconnectEnd:Ar,reconnectRadius:Rr=10,edgeUpdaterRadius:ga=10,onNodesChange:mi,onEdgesChange:Ba,noDragClassName:Hs="nodrag",noWheelClassName:Gr="nowheel",noPanClassName:ds="nopan",fitView:No=!1,fitViewOptions:nf,connectOnClick:Uy=!0,attributionPosition:Wy,proOptions:Tp,defaultEdgeOptions:Bc,elevateNodesOnSelect:rf=!0,elevateEdgesOnSelect:Co=!1,disableKeyboardA11y:jl=!1,autoPanOnConnect:qc=!0,autoPanOnNodeDrag:To=!0,connectionRadius:Dr=20,isValidConnection:Ep,onError:_p,style:Ol,id:Nl,nodeDragThreshold:Gy,...Mp},Ap)=>{const sf=Nl||"1";return he.createElement("div",{...Mp,style:{...Ol,...Wke},ref:Ap,className:Ss(["react-flow",s]),"data-testid":"rf__wrapper",id:Nl},he.createElement(dV,null,he.createElement(qke,{onInit:h,onMove:f,onMoveStart:m,onMoveEnd:g,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:N,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:_,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:a,connectionLineType:R,connectionLineStyle:se,connectionLineComponent:W,connectionLineContainerStyle:F,selectionKeyCode:te,selectionOnDrag:ne,selectionMode:K,deleteKeyCode:V,multiSelectionKeyCode:re,panActivationKeyCode:ie,zoomActivationKeyCode:ae,onlyRenderVisibleElements:Xe,selectNodesOnDrag:Ze,defaultViewport:Rn,translateExtent:vt,minZoom:Tn,maxZoom:Mt,preventScrolling:Ce,zoomOnScroll:lt,zoomOnPinch:jt,zoomOnDoubleClick:qe,panOnScroll:Tt,panOnScrollSpeed:ke,panOnScrollMode:Te,panOnDrag:Rt,onPaneClick:At,onPaneMouseEnter:vr,onPaneMouseMove:ft,onPaneMouseLeave:mn,onPaneScroll:gt,onPaneContextMenu:Nt,onSelectionContextMenu:B,onSelectionStart:X,onSelectionEnd:J,onEdgeContextMenu:it,onEdgeDoubleClick:Vn,onEdgeMouseEnter:jr,onEdgeMouseMove:Or,onEdgeMouseLeave:ge,onReconnect:Mr??ze,onReconnectStart:Wr??Et,onReconnectEnd:Ar??Gt,reconnectRadius:Rr??ga,defaultMarkerColor:Ge,noDragClassName:Hs,noWheelClassName:Gr,noPanClassName:ds,elevateEdgesOnSelect:Co,rfId:sf,disableKeyboardA11y:jl,nodeOrigin:Be,nodeExtent:Le}),he.createElement(LSe,{nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:y,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:Oe,nodesConnectable:He,nodesFocusable:Ve,edgesFocusable:ut,edgesUpdatable:rt,elementsSelectable:rn,elevateNodesOnSelect:rf,minZoom:Tn,maxZoom:Mt,nodeExtent:Le,onNodesChange:mi,onEdgesChange:Ba,snapToGrid:_e,snapGrid:Ue,connectionMode:G,translateExtent:vt,connectOnClick:Uy,defaultEdgeOptions:Bc,fitView:No,fitViewOptions:nf,onNodesDelete:I,onEdgesDelete:Q,onNodeDragStart:M,onNodeDrag:L,onNodeDragStop:P,onSelectionDrag:z,onSelectionDragStart:ee,onSelectionDragStop:H,noPanClassName:ds,nodeOrigin:Be,rfId:sf,autoPanOnConnect:qc,autoPanOnNodeDrag:To,onError:_p,connectionRadius:Dr,isValidConnection:Ep,nodeDragThreshold:Gy}),he.createElement(zSe,{onSelectionChange:U}),Ot,he.createElement(cSe,{proOptions:Tp,position:Wy}),he.createElement($Se,{rfId:sf,disableKeyboardA11y:jl})))});hV.displayName="ReactFlow";function fV(t){return e=>{const[n,r]=b.useState(e),s=b.useCallback(i=>r(a=>t(i,a)),[]);return[n,r,s]}}const Gke=fV(ZH),Xke=fV(nke),mV=({id:t,x:e,y:n,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:h,borderRadius:f,shapeRendering:m,onClick:g,selected:x})=>{const{background:y,backgroundColor:w}=i||{},S=a||y||w;return he.createElement("rect",{className:Ss(["react-flow__minimap-node",{selected:x},h]),x:e,y:n,rx:f,ry:f,width:r,height:s,fill:S,stroke:o,strokeWidth:c,shapeRendering:m,onClick:g?k=>g(k,t):void 0})};mV.displayName="MiniMapNode";var Yke=b.memo(mV);const Kke=t=>t.nodeOrigin,Zke=t=>t.getNodes().filter(e=>!e.hidden&&e.width&&e.height),U4=t=>t instanceof Function?t:()=>t;function Jke({nodeStrokeColor:t="transparent",nodeColor:e="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s=2,nodeComponent:i=Yke,onClick:a}){const o=er(Zke,os),c=er(Kke),h=U4(e),f=U4(t),m=U4(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return he.createElement(he.Fragment,null,o.map(x=>{const{x:y,y:w}=Nu(x,c).positionAbsolute;return he.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:h(x),borderRadius:r,strokeColor:f(x),strokeWidth:s,shapeRendering:g,onClick:a,id:x.id})}))}var e6e=b.memo(Jke);const t6e=200,n6e=150,r6e=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?hSe(By(e,t.nodeOrigin),n):n,rfId:t.rfId}},s6e="react-flow__minimap-desc";function pV({style:t,className:e,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:o,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:h="none",maskStrokeWidth:f=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:N=10,offsetScale:C=5}){const T=ns(),_=b.useRef(null),{boundingRect:E,viewBB:M,rfId:L}=er(r6e,os),P=t?.width??t6e,I=t?.height??n6e,Q=E.width/P,U=E.height/I,ee=Math.max(Q,U),z=ee*P,H=ee*I,B=C*ee,X=E.x-(z-E.width)/2-B,J=E.y-(H-E.height)/2-B,G=z+B*2,R=H+B*2,se=`${s6e}-${L}`,W=b.useRef(0);W.current=ee,b.useEffect(()=>{if(_.current){const te=Ki(_.current),ne=re=>{const{transform:ae,d3Selection:_e,d3Zoom:Ue}=T.getState();if(re.sourceEvent.type!=="wheel"||!_e||!Ue)return;const Xe=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*N,Ze=ae[2]*Math.pow(2,Xe);Ue.scaleTo(_e,Ze)},K=re=>{const{transform:ae,d3Selection:_e,d3Zoom:Ue,translateExtent:Xe,width:Ze,height:Oe}=T.getState();if(re.sourceEvent.type!=="mousemove"||!_e||!Ue)return;const He=W.current*Math.max(1,ae[2])*(k?-1:1),Ve={x:ae[0]-re.sourceEvent.movementX*He,y:ae[1]-re.sourceEvent.movementY*He},Be=[[0,0],[Ze,Oe]],ut=ho.translate(Ve.x,Ve.y).scale(ae[2]),rt=Ue.constrain()(ut,Be,Xe);Ue.transform(_e,rt)},ie=bH().on("zoom",y?K:null).on("zoom.wheel",w?ne:null);return te.call(ie),()=>{te.on("zoom",null)}}},[y,w,k,N]);const F=g?te=>{const ne=ka(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 he.createElement(Ly,{position:m,style:t,className:Ss(["react-flow__minimap",e]),"data-testid":"rf__minimap"},he.createElement("svg",{width:P,height:I,viewBox:`${X} ${J} ${G} ${R}`,role:"img","aria-labelledby":se,ref:_,onClick:F},S&&he.createElement("title",{id:se},S),he.createElement(e6e,{onClick:V,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),he.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:h,strokeWidth:f,pointerEvents:"none"})))}pV.displayName="MiniMap";var i6e=b.memo(pV);function a6e(){return he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},he.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function l6e(){return he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},he.createElement("path",{d:"M0 0h32v4.2H0z"}))}function o6e(){return he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},he.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 c6e(){return he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},he.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 u6e(){return he.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},he.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 Sm=({children:t,className:e,...n})=>he.createElement("button",{type:"button",className:Ss(["react-flow__controls-button",e]),...n},t);Sm.displayName="ControlButton";const d6e=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),gV=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:h,children:f,position:m="bottom-left"})=>{const g=ns(),[x,y]=b.useState(!1),{isInteractive:w,minZoomReached:S,maxZoomReached:k}=er(d6e,os),{zoomIn:N,zoomOut:C,fitView:T}=jO();if(b.useEffect(()=>{y(!0)},[]),!x)return null;const _=()=>{N(),i?.()},E=()=>{C(),a?.()},M=()=>{T(s),o?.()},L=()=>{g.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c?.(!w)};return he.createElement(Ly,{className:Ss(["react-flow__controls",h]),position:m,style:t,"data-testid":"rf__controls"},e&&he.createElement(he.Fragment,null,he.createElement(Sm,{onClick:_,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k},he.createElement(a6e,null)),he.createElement(Sm,{onClick:E,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},he.createElement(l6e,null))),n&&he.createElement(Sm,{className:"react-flow__controls-fitview",onClick:M,title:"fit view","aria-label":"fit view"},he.createElement(o6e,null)),r&&he.createElement(Sm,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity"},w?he.createElement(u6e,null):he.createElement(c6e,null)),f)};gV.displayName="Controls";var h6e=b.memo(gV),aa;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(aa||(aa={}));function f6e({color:t,dimensions:e,lineWidth:n}){return he.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function m6e({color:t,radius:e}){return he.createElement("circle",{cx:e,cy:e,r:e,fill:t})}const p6e={[aa.Dots]:"#91919a",[aa.Lines]:"#eee",[aa.Cross]:"#e2e2e2"},g6e={[aa.Dots]:1,[aa.Lines]:1,[aa.Cross]:6},x6e=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function xV({id:t,variant:e=aa.Dots,gap:n=20,size:r,lineWidth:s=1,offset:i=2,color:a,style:o,className:c}){const h=b.useRef(null),{transform:f,patternId:m}=er(x6e,os),g=a||p6e[e],x=r||g6e[e],y=e===aa.Dots,w=e===aa.Cross,S=Array.isArray(n)?n:[n,n],k=[S[0]*f[2]||1,S[1]*f[2]||1],N=x*f[2],C=w?[N,N]:k,T=y?[N/i,N/i]:[C[0]/i,C[1]/i];return he.createElement("svg",{className:Ss(["react-flow__background",c]),style:{...o,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:h,"data-testid":"rf__background"},he.createElement("pattern",{id:m+t,x:f[0]%k[0],y:f[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`},y?he.createElement(m6e,{color:g,radius:N/i}):he.createElement(f6e,{dimensions:C,color:g,lineWidth:s})),he.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+t})`}))}xV.displayName="Background";var v6e=b.memo(xV);function NO(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 W4,xA;function y6e(){if(xA)return W4;xA=1;var t=ND(),e=4;function n(r){return t(r,e)}return W4=n,W4}var G4,vA;function vV(){if(vA)return G4;vA=1;var t=MY();function e(n){return typeof n=="function"?n:t}return G4=e,G4}var X4,yA;function yV(){if(yA)return X4;yA=1;var t=CD(),e=$k(),n=vV(),r=Fu();function s(i,a){var o=r(i)?t:e;return o(i,n(a))}return X4=s,X4}var Y4,bA;function bV(){return bA||(bA=1,Y4=yV()),Y4}var K4,wA;function b6e(){if(wA)return K4;wA=1;var t=$k();function e(n,r){var s=[];return t(n,function(i,a,o){r(i,a,o)&&s.push(i)}),s}return K4=e,K4}var Z4,SA;function wV(){if(SA)return Z4;SA=1;var t=AY(),e=b6e(),n=Qk(),r=Fu();function s(i,a){var o=r(i)?t:e;return o(i,n(a,3))}return Z4=s,Z4}var J4,kA;function w6e(){if(kA)return J4;kA=1;var t=Object.prototype,e=t.hasOwnProperty;function n(r,s){return r!=null&&e.call(r,s)}return J4=n,J4}var e5,jA;function SV(){if(jA)return e5;jA=1;var t=w6e(),e=RY();function n(r,s){return r!=null&&e(r,s,t)}return e5=n,e5}var t5,OA;function S6e(){if(OA)return t5;OA=1;var t=TD(),e=ED(),n=_D(),r=Fu(),s=Hk(),i=Vk(),a=DY(),o=Uk(),c="[object Map]",h="[object Set]",f=Object.prototype,m=f.hasOwnProperty;function g(x){if(x==null)return!0;if(s(x)&&(r(x)||typeof x=="string"||typeof x.splice=="function"||i(x)||o(x)||n(x)))return!x.length;var y=e(x);if(y==c||y==h)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 t5=g,t5}var n5,NA;function kV(){if(NA)return n5;NA=1;function t(e){return e===void 0}return n5=t,n5}var r5,CA;function k6e(){if(CA)return r5;CA=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(f,m){return t.has(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=m),this):(this._nodes[f]=arguments.length>1?m:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]=n,this._children[f]={},this._children[n][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)},s.prototype.node=function(f){return this._nodes[f]},s.prototype.hasNode=function(f){return t.has(this._nodes,f)},s.prototype.removeNode=function(f){var m=this;if(t.has(this._nodes,f)){var g=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],t.each(this.children(f),function(x){m.setParent(x)}),delete this._children[f]),t.each(t.keys(this._in[f]),g),delete this._in[f],delete this._preds[f],t.each(t.keys(this._out[f]),g),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this},s.prototype.setParent=function(f,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===f)throw new Error("Setting "+m+" as parent of "+f+" would create a cycle");this.setNode(m)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=m,this._children[m][f]=!0,this},s.prototype._removeFromParentsChildList=function(f){delete this._children[this._parent[f]][f]},s.prototype.parent=function(f){if(this._isCompound){var m=this._parent[f];if(m!==n)return m}},s.prototype.children=function(f){if(t.isUndefined(f)&&(f=n),this._isCompound){var m=this._children[f];if(m)return t.keys(m)}else{if(f===n)return this.nodes();if(this.hasNode(f))return[]}},s.prototype.predecessors=function(f){var m=this._preds[f];if(m)return t.keys(m)},s.prototype.successors=function(f){var m=this._sucs[f];if(m)return t.keys(m)},s.prototype.neighbors=function(f){var m=this.predecessors(f);if(m)return t.union(m,this.successors(f))},s.prototype.isLeaf=function(f){var m;return this.isDirected()?m=this.successors(f):m=this.neighbors(f),m.length===0},s.prototype.filterNodes=function(f){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){f(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(f){return t.isFunction(f)||(f=t.constant(f)),this._defaultEdgeLabelFn=f,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return t.values(this._edgeObjs)},s.prototype.setPath=function(f,m){var g=this,x=arguments;return t.reduce(f,function(y,w){return x.length>1?g.setEdge(y,w,m):g.setEdge(y,w),w}),this},s.prototype.setEdge=function(){var f,m,g,x,y=!1,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(f=w.v,m=w.w,g=w.name,arguments.length===2&&(x=arguments[1],y=!0)):(f=w,m=arguments[1],g=arguments[3],arguments.length>2&&(x=arguments[2],y=!0)),f=""+f,m=""+m,t.isUndefined(g)||(g=""+g);var S=o(this._isDirected,f,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(f),this.setNode(m),this._edgeLabels[S]=y?x:this._defaultEdgeLabelFn(f,m,g);var k=c(this._isDirected,f,m,g);return f=k.v,m=k.w,Object.freeze(k),this._edgeObjs[S]=k,i(this._preds[m],f),i(this._sucs[f],m),this._in[m][S]=k,this._out[f][S]=k,this._edgeCount++,this},s.prototype.edge=function(f,m,g){var x=arguments.length===1?h(this._isDirected,arguments[0]):o(this._isDirected,f,m,g);return this._edgeLabels[x]},s.prototype.hasEdge=function(f,m,g){var x=arguments.length===1?h(this._isDirected,arguments[0]):o(this._isDirected,f,m,g);return t.has(this._edgeLabels,x)},s.prototype.removeEdge=function(f,m,g){var x=arguments.length===1?h(this._isDirected,arguments[0]):o(this._isDirected,f,m,g),y=this._edgeObjs[x];return y&&(f=y.v,m=y.w,delete this._edgeLabels[x],delete this._edgeObjs[x],a(this._preds[m],f),a(this._sucs[f],m),delete this._in[m][x],delete this._out[f][x],this._edgeCount--),this},s.prototype.inEdges=function(f,m){var g=this._in[f];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.v===m}):x}},s.prototype.outEdges=function(f,m){var g=this._out[f];if(g){var x=t.values(g);return m?t.filter(x,function(y){return y.w===m}):x}},s.prototype.nodeEdges=function(f,m){var g=this.inEdges(f,m);if(g)return g.concat(this.outEdges(f,m))};function i(f,m){f[m]?f[m]++:f[m]=1}function a(f,m){--f[m]||delete f[m]}function o(f,m,g,x){var y=""+m,w=""+g;if(!f&&y>w){var S=y;y=w,w=S}return y+r+w+r+(t.isUndefined(x)?e:x)}function c(f,m,g,x){var y=""+m,w=""+g;if(!f&&y>w){var S=y;y=w,w=S}var k={v:y,w};return x&&(k.name=x),k}function h(f,m){return o(f,m.v,m.w,m.name)}return g5}var x5,FA;function A6e(){return FA||(FA=1,x5="2.1.8"),x5}var v5,$A;function R6e(){return $A||($A=1,v5={Graph:CO(),version:A6e()}),v5}var y5,QA;function D6e(){if(QA)return y5;QA=1;var t=pa(),e=CO();y5={write:n,read:i};function n(a){var o={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:r(a),edges:s(a)};return t.isUndefined(a.graph())||(o.value=t.clone(a.graph())),o}function r(a){return t.map(a.nodes(),function(o){var c=a.node(o),h=a.parent(o),f={v:o};return t.isUndefined(c)||(f.value=c),t.isUndefined(h)||(f.parent=h),f})}function s(a){return t.map(a.edges(),function(o){var c=a.edge(o),h={v:o.v,w:o.w};return t.isUndefined(o.name)||(h.name=o.name),t.isUndefined(c)||(h.value=c),h})}function i(a){var o=new e(a.options).setGraph(a.value);return t.each(a.nodes,function(c){o.setNode(c.v,c.value),c.parent&&o.setParent(c.v,c.parent)}),t.each(a.edges,function(c){o.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),o}return y5}var b5,HA;function z6e(){if(HA)return b5;HA=1;var t=pa();b5=e;function e(n){var r={},s=[],i;function a(o){t.has(r,o)||(r[o]=!0,i.push(o),t.each(n.successors(o),a),t.each(n.predecessors(o),a))}return t.each(n.nodes(),function(o){i=[],a(o),i.length&&s.push(i)}),s}return b5}var w5,VA;function CV(){if(VA)return w5;VA=1;var t=pa();w5=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=f.removeMin(),g=h[m],g.distance!==Number.POSITIVE_INFINITY);)c(m).forEach(x);return h}return S5}var k5,WA;function P6e(){if(WA)return k5;WA=1;var t=TV(),e=pa();k5=n;function n(r,s,i){return e.transform(r.nodes(),function(a,o){a[o]=t(r,o,s,i)},{})}return k5}var j5,GA;function EV(){if(GA)return j5;GA=1;var t=pa();j5=e;function e(n){var r=0,s=[],i={},a=[];function o(c){var h=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&&(h.lowlink=Math.min(h.lowlink,i[g].index)):(o(g),h.lowlink=Math.min(h.lowlink,i[g].lowlink))}),h.lowlink===h.index){var f=[],m;do m=s.pop(),i[m].onStack=!1,f.push(m);while(c!==m);a.push(f)}}return n.nodes().forEach(function(c){t.has(i,c)||o(c)}),a}return j5}var O5,XA;function L6e(){if(XA)return O5;XA=1;var t=pa(),e=EV();O5=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 O5}var N5,YA;function I6e(){if(YA)return N5;YA=1;var t=pa();N5=n;var e=t.constant(1);function n(s,i,a){return r(s,i||e,a||function(o){return s.outEdges(o)})}function r(s,i,a){var o={},c=s.nodes();return c.forEach(function(h){o[h]={},o[h][h]={distance:0},c.forEach(function(f){h!==f&&(o[h][f]={distance:Number.POSITIVE_INFINITY})}),a(h).forEach(function(f){var m=f.v===h?f.w:f.v,g=i(f);o[h][m]={distance:g,predecessor:h}})}),c.forEach(function(h){var f=o[h];c.forEach(function(m){var g=o[m];c.forEach(function(x){var y=g[h],w=f[x],S=g[x],k=y.distance+w.distance;k0;){if(h=c.removeMin(),t.has(o,h))a.setEdge(h,o[h]);else{if(m)throw new Error("Input graph is not connected: "+s);m=!0}s.nodeEdges(h).forEach(f)}return a}return A5}var R5,rR;function Q6e(){return rR||(rR=1,R5={components:z6e(),dijkstra:TV(),dijkstraAll:P6e(),findCycles:L6e(),floydWarshall:I6e(),isAcyclic:B6e(),postorder:q6e(),preorder:F6e(),prim:$6e(),tarjan:EV(),topsort:_V()}),R5}var D5,sR;function H6e(){if(sR)return D5;sR=1;var t=R6e();return D5={Graph:t.Graph,json:D6e(),alg:Q6e(),version:t.version},D5}var z5,iR;function Ra(){if(iR)return z5;iR=1;var t;if(typeof NO=="function")try{t=H6e()}catch{}return t||(t=window.graphlib),z5=t,z5}var P5,aR;function V6e(){if(aR)return P5;aR=1;var t=ND(),e=1,n=4;function r(s){return t(s,e|n)}return P5=r,P5}var L5,lR;function U6e(){if(lR)return L5;lR=1;var t=Gk(),e=zD(),n=DD(),r=Nv(),s=Object.prototype,i=s.hasOwnProperty,a=t(function(o,c){o=Object(o);var h=-1,f=c.length,m=f>2?c[2]:void 0;for(m&&n(c[0],c[1],m)&&(f=1);++h1?i[o-1]:void 0,h=o>2?i[2]:void 0;for(c=r.length>3&&typeof c=="function"?(o--,c):void 0,h&&e(i[0],i[1],h)&&(c=o<3?void 0:c,o=1),s=Object(s);++a0;--S)if(w=f[S].dequeue(),w){g=g.concat(a(h,f,m,w,!0));break}}}return g}function a(h,f,m,g,x){var y=x?[]:void 0;return t.forEach(h.inEdges(g.v),function(w){var S=h.edge(w),k=h.node(w.v);x&&y.push({v:w.v,w:w.w}),k.out-=S,c(f,m,k)}),t.forEach(h.outEdges(g.v),function(w){var S=h.edge(w),k=w.w,N=h.node(k);N.in-=S,c(f,m,N)}),h.removeNode(g.v),y}function o(h,f){var m=new e,g=0,x=0;t.forEach(h.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),t.forEach(h.edges(),function(S){var k=m.edge(S.v,S.w)||0,N=f(S),C=k+N;m.setEdge(S.v,S.w,C),x=Math.max(x,m.node(S.v).out+=N),g=Math.max(g,m.node(S.w).in+=N)});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(h,f,m){m.out?m.in?h[m.out-m.in+f].enqueue(m):h[h.length-1].enqueue(m):h[0].enqueue(m)}return t3}var n3,NR;function oje(){if(NR)return n3;NR=1;var t=dr(),e=lje();n3={run:n,undo:s};function n(i){var a=i.graph().acyclicer==="greedy"?e(i,o(i)):r(i);t.forEach(a,function(c){var h=i.edge(c);i.removeEdge(c),h.forwardName=c.name,h.reversed=!0,i.setEdge(c.w,c.v,h,t.uniqueId("rev"))});function o(c){return function(h){return c.edge(h).weight}}}function r(i){var a=[],o={},c={};function h(f){t.has(c,f)||(c[f]=!0,o[f]=!0,t.forEach(i.outEdges(f),function(m){t.has(o,m.w)?a.push(m):h(m.w)}),delete o[f])}return t.forEach(i.nodes(),h),a}function s(i){t.forEach(i.edges(),function(a){var o=i.edge(a);if(o.reversed){i.removeEdge(a);var c=o.forwardName;delete o.reversed,delete o.forwardName,i.setEdge(a.w,a.v,o,c)}})}return n3}var r3,CR;function oi(){if(CR)return r3;CR=1;var t=dr(),e=Ra().Graph;r3={addDummyNode:n,simplify:r,asNonCompoundGraph:s,successorWeights:i,predecessorWeights:a,intersectRect:o,buildLayerMatrix:c,normalizeRanks:h,removeEmptyRanks:f,addBorderNode:m,maxRank:g,partition:x,time:y,notime:w};function n(S,k,N,C){var T;do T=t.uniqueId(C);while(S.hasNode(T));return N.dummy=k,S.setNode(T,N),T}function r(S){var k=new e().setGraph(S.graph());return t.forEach(S.nodes(),function(N){k.setNode(N,S.node(N))}),t.forEach(S.edges(),function(N){var C=k.edge(N.v,N.w)||{weight:0,minlen:1},T=S.edge(N);k.setEdge(N.v,N.w,{weight:C.weight+T.weight,minlen:Math.max(C.minlen,T.minlen)})}),k}function s(S){var k=new e({multigraph:S.isMultigraph()}).setGraph(S.graph());return t.forEach(S.nodes(),function(N){S.children(N).length||k.setNode(N,S.node(N))}),t.forEach(S.edges(),function(N){k.setEdge(N,S.edge(N))}),k}function i(S){var k=t.map(S.nodes(),function(N){var C={};return t.forEach(S.outEdges(N),function(T){C[T.w]=(C[T.w]||0)+S.edge(T).weight}),C});return t.zipObject(S.nodes(),k)}function a(S){var k=t.map(S.nodes(),function(N){var C={};return t.forEach(S.inEdges(N),function(T){C[T.v]=(C[T.v]||0)+S.edge(T).weight}),C});return t.zipObject(S.nodes(),k)}function o(S,k){var N=S.x,C=S.y,T=k.x-N,_=k.y-C,E=S.width/2,M=S.height/2;if(!T&&!_)throw new Error("Not possible to find intersection inside of the rectangle");var L,P;return Math.abs(_)*E>Math.abs(T)*M?(_<0&&(M=-M),L=M*T/_,P=M):(T<0&&(E=-E),L=E,P=E*_/T),{x:N+L,y:C+P}}function c(S){var k=t.map(t.range(g(S)+1),function(){return[]});return t.forEach(S.nodes(),function(N){var C=S.node(N),T=C.rank;t.isUndefined(T)||(k[T][C.order]=N)}),k}function h(S){var k=t.min(t.map(S.nodes(),function(N){return S.node(N).rank}));t.forEach(S.nodes(),function(N){var C=S.node(N);t.has(C,"rank")&&(C.rank-=k)})}function f(S){var k=t.min(t.map(S.nodes(),function(_){return S.node(_).rank})),N=[];t.forEach(S.nodes(),function(_){var E=S.node(_).rank-k;N[E]||(N[E]=[]),N[E].push(_)});var C=0,T=S.graph().nodeRankFactor;t.forEach(N,function(_,E){t.isUndefined(_)&&E%T!==0?--C:C&&t.forEach(_,function(M){S.node(M).rank+=C})})}function m(S,k,N,C){var T={width:0,height:0};return arguments.length>=4&&(T.rank=N,T.order=C),n(S,"border",T,k)}function g(S){return t.max(t.map(S.nodes(),function(k){var N=S.node(k).rank;if(!t.isUndefined(N))return N}))}function x(S,k){var N={lhs:[],rhs:[]};return t.forEach(S,function(C){k(C)?N.lhs.push(C):N.rhs.push(C)}),N}function y(S,k){var N=t.now();try{return k()}finally{console.log(S+" time: "+(t.now()-N)+"ms")}}function w(S,k){return k()}return r3}var s3,TR;function cje(){if(TR)return s3;TR=1;var t=dr(),e=oi();s3={run:n,undo:s};function n(i){i.graph().dummyChains=[],t.forEach(i.edges(),function(a){r(i,a)})}function r(i,a){var o=a.v,c=i.node(o).rank,h=a.w,f=i.node(h).rank,m=a.name,g=i.edge(a),x=g.labelRank;if(f!==c+1){i.removeEdge(a);var y,w,S;for(S=0,++c;cP.lim&&(I=P,Q=!0);var U=t.filter(T.edges(),function(ee){return Q===N(C,C.node(ee.v),I)&&Q!==N(C,C.node(ee.w),I)});return t.minBy(U,function(ee){return n(T,ee)})}function w(C,T,_,E){var M=_.v,L=_.w;C.removeEdge(M,L),C.setEdge(E.v,E.w,{}),m(C),c(C,T),S(C,T)}function S(C,T){var _=t.find(C.nodes(),function(M){return!T.node(M).parent}),E=s(C,_);E=E.slice(1),t.forEach(E,function(M){var L=C.node(M).parent,P=T.edge(M,L),I=!1;P||(P=T.edge(L,M),I=!0),T.node(M).rank=T.node(L).rank+(I?P.minlen:-P.minlen)})}function k(C,T,_){return C.hasEdge(T,_)}function N(C,T,_){return _.low<=T.lim&&T.lim<=_.lim}return l3}var o3,AR;function dje(){if(AR)return o3;AR=1;var t=Sv(),e=t.longestPath,n=DV(),r=uje();o3=s;function s(c){switch(c.graph().ranker){case"network-simplex":o(c);break;case"tight-tree":a(c);break;case"longest-path":i(c);break;default:o(c)}}var i=e;function a(c){e(c),n(c)}function o(c){r(c)}return o3}var c3,RR;function hje(){if(RR)return c3;RR=1;var t=dr();c3=e;function e(s){var i=r(s);t.forEach(s.graph().dummyChains,function(a){for(var o=s.node(a),c=o.edgeObj,h=n(s,i,c.v,c.w),f=h.path,m=h.lca,g=0,x=f[g],y=!0;a!==c.w;){if(o=s.node(a),y){for(;(x=f[g])!==m&&s.node(x).maxRankf||m>i[g].lim));for(x=g,g=o;(g=s.parent(g))!==x;)h.push(g);return{path:c.concat(h.reverse()),lca:x}}function r(s){var i={},a=0;function o(c){var h=a;t.forEach(s.children(c),o),i[c]={low:h,lim:a++}}return t.forEach(s.children(),o),i}return c3}var u3,DR;function fje(){if(DR)return u3;DR=1;var t=dr(),e=oi();u3={run:n,cleanup:a};function n(o){var c=e.addDummyNode(o,"root",{},"_root"),h=s(o),f=t.max(t.values(h))-1,m=2*f+1;o.graph().nestingRoot=c,t.forEach(o.edges(),function(x){o.edge(x).minlen*=m});var g=i(o)+1;t.forEach(o.children(),function(x){r(o,c,m,g,f,h,x)}),o.graph().nodeRankFactor=m}function r(o,c,h,f,m,g,x){var y=o.children(x);if(!y.length){x!==c&&o.setEdge(c,x,{weight:0,minlen:h});return}var w=e.addBorderNode(o,"_bt"),S=e.addBorderNode(o,"_bb"),k=o.node(x);o.setParent(w,x),k.borderTop=w,o.setParent(S,x),k.borderBottom=S,t.forEach(y,function(N){r(o,c,h,f,m,g,N);var C=o.node(N),T=C.borderTop?C.borderTop:N,_=C.borderBottom?C.borderBottom:N,E=C.borderTop?f:2*f,M=T!==_?1:m-g[x]+1;o.setEdge(w,T,{weight:E,minlen:M,nestingEdge:!0}),o.setEdge(_,S,{weight:E,minlen:M,nestingEdge:!0})}),o.parent(x)||o.setEdge(c,w,{weight:0,minlen:m+g[x]})}function s(o){var c={};function h(f,m){var g=o.children(f);g&&g.length&&t.forEach(g,function(x){h(x,m+1)}),c[f]=m}return t.forEach(o.children(),function(f){h(f,1)}),c}function i(o){return t.reduce(o.edges(),function(c,h){return c+o.edge(h).weight},0)}function a(o){var c=o.graph();o.removeNode(c.nestingRoot),delete c.nestingRoot,t.forEach(o.edges(),function(h){var f=o.edge(h);f.nestingEdge&&o.removeEdge(h)})}return u3}var d3,zR;function mje(){if(zR)return d3;zR=1;var t=dr(),e=oi();d3=n;function n(s){function i(a){var o=s.children(a),c=s.node(a);if(o.length&&t.forEach(o,i),t.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var h=c.minRank,f=c.maxRank+1;h0;)x%2&&(y+=f[x+1]),x=x-1>>1,f[x]+=g.weight;m+=g.weight*y})),m}return m3}var p3,BR;function vje(){if(BR)return p3;BR=1;var t=dr();p3=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(o,c){var h=n.edge(c),f=n.node(c.v);return{sum:o.sum+h.weight*f.order,weight:o.weight+h.weight}},{sum:0,weight:0});return{v:s,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:s}})}return p3}var g3,qR;function yje(){if(qR)return g3;qR=1;var t=dr();g3=e;function e(s,i){var a={};t.forEach(s,function(c,h){var f=a[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:h};t.isUndefined(c.barycenter)||(f.barycenter=c.barycenter,f.weight=c.weight)}),t.forEach(i.edges(),function(c){var h=a[c.v],f=a[c.w];!t.isUndefined(h)&&!t.isUndefined(f)&&(f.indegree++,h.out.push(a[c.w]))});var o=t.filter(a,function(c){return!c.indegree});return n(o)}function n(s){var i=[];function a(h){return function(f){f.merged||(t.isUndefined(f.barycenter)||t.isUndefined(h.barycenter)||f.barycenter>=h.barycenter)&&r(h,f)}}function o(h){return function(f){f.in.push(h),--f.indegree===0&&s.push(f)}}for(;s.length;){var c=s.pop();i.push(c),t.forEach(c.in.reverse(),a(c)),t.forEach(c.out,o(c))}return t.map(t.filter(i,function(h){return!h.merged}),function(h){return t.pick(h,["vs","i","barycenter","weight"])})}function r(s,i){var a=0,o=0;s.weight&&(a+=s.barycenter*s.weight,o+=s.weight),i.weight&&(a+=i.barycenter*i.weight,o+=i.weight),s.vs=i.vs.concat(s.vs),s.barycenter=a/o,s.weight=o,s.i=Math.min(i.i,s.i),i.merged=!0}return g3}var x3,FR;function bje(){if(FR)return x3;FR=1;var t=dr(),e=oi();x3=n;function n(i,a){var o=e.partition(i,function(w){return t.has(w,"barycenter")}),c=o.lhs,h=t.sortBy(o.rhs,function(w){return-w.i}),f=[],m=0,g=0,x=0;c.sort(s(!!a)),x=r(f,h,x),t.forEach(c,function(w){x+=w.vs.length,f.push(w.vs),m+=w.barycenter*w.weight,g+=w.weight,x=r(f,h,x)});var y={vs:t.flatten(f,!0)};return g&&(y.barycenter=m/g,y.weight=g),y}function r(i,a,o){for(var c;a.length&&(c=t.last(a)).i<=o;)a.pop(),i.push(c.vs),o++;return o}function s(i){return function(a,o){return a.barycentero.barycenter?1:i?o.i-a.i:a.i-o.i}}return x3}var v3,$R;function wje(){if($R)return v3;$R=1;var t=dr(),e=vje(),n=yje(),r=bje();v3=s;function s(o,c,h,f){var m=o.children(c),g=o.node(c),x=g?g.borderLeft:void 0,y=g?g.borderRight:void 0,w={};x&&(m=t.filter(m,function(_){return _!==x&&_!==y}));var S=e(o,m);t.forEach(S,function(_){if(o.children(_.v).length){var E=s(o,_.v,h,f);w[_.v]=E,t.has(E,"barycenter")&&a(_,E)}});var k=n(S,h);i(k,w);var N=r(k,f);if(x&&(N.vs=t.flatten([x,N.vs,y],!0),o.predecessors(x).length)){var C=o.node(o.predecessors(x)[0]),T=o.node(o.predecessors(y)[0]);t.has(N,"barycenter")||(N.barycenter=0,N.weight=0),N.barycenter=(N.barycenter*N.weight+C.order+T.order)/(N.weight+2),N.weight+=2}return N}function i(o,c){t.forEach(o,function(h){h.vs=t.flatten(h.vs.map(function(f){return c[f]?c[f].vs:f}),!0)})}function a(o,c){t.isUndefined(o.barycenter)?(o.barycenter=c.barycenter,o.weight=c.weight):(o.barycenter=(o.barycenter*o.weight+c.barycenter*c.weight)/(o.weight+c.weight),o.weight+=c.weight)}return v3}var y3,QR;function Sje(){if(QR)return y3;QR=1;var t=dr(),e=Ra().Graph;y3=n;function n(s,i,a){var o=r(s),c=new e({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(h){return s.node(h)});return t.forEach(s.nodes(),function(h){var f=s.node(h),m=s.parent(h);(f.rank===i||f.minRank<=i&&i<=f.maxRank)&&(c.setNode(h),c.setParent(h,m||o),t.forEach(s[a](h),function(g){var x=g.v===h?g.w:g.v,y=c.edge(x,h),w=t.isUndefined(y)?0:y.weight;c.setEdge(x,h,{weight:s.edge(g).weight+w})}),t.has(f,"minRank")&&c.setNode(h,{borderLeft:f.borderLeft[i],borderRight:f.borderRight[i]}))}),c}function r(s){for(var i;s.hasNode(i=t.uniqueId("_root")););return i}return y3}var b3,HR;function kje(){if(HR)return b3;HR=1;var t=dr();b3=e;function e(n,r,s){var i={},a;t.forEach(s,function(o){for(var c=n.parent(o),h,f;c;){if(h=n.parent(c),h?(f=i[h],i[h]=c):(f=a,a=c),f&&f!==c){r.setEdge(f,c);return}c=h}})}return b3}var w3,VR;function jje(){if(VR)return w3;VR=1;var t=dr(),e=gje(),n=xje(),r=wje(),s=Sje(),i=kje(),a=Ra().Graph,o=oi();w3=c;function c(g){var x=o.maxRank(g),y=h(g,t.range(1,x+1),"inEdges"),w=h(g,t.range(x-1,-1,-1),"outEdges"),S=e(g);m(g,S);for(var k=Number.POSITIVE_INFINITY,N,C=0,T=0;T<4;++C,++T){f(C%2?y:w,C%4>=2),S=o.buildLayerMatrix(g);var _=n(g,S);_I)&&a(C,ee,Q)})})}function _(E,M){var L=-1,P,I=0;return t.forEach(M,function(Q,U){if(k.node(Q).dummy==="border"){var ee=k.predecessors(Q);ee.length&&(P=k.node(ee[0]).order,T(M,I,U,L,P),I=U,L=P)}T(M,I,M.length,P,E.length)}),M}return t.reduce(N,_),C}function i(k,N){if(k.node(N).dummy)return t.find(k.predecessors(N),function(C){return k.node(C).dummy})}function a(k,N,C){if(N>C){var T=N;N=C,C=T}var _=k[N];_||(k[N]=_={}),_[C]=!0}function o(k,N,C){if(N>C){var T=N;N=C,C=T}return t.has(k[N],C)}function c(k,N,C,T){var _={},E={},M={};return t.forEach(N,function(L){t.forEach(L,function(P,I){_[P]=P,E[P]=P,M[P]=I})}),t.forEach(N,function(L){var P=-1;t.forEach(L,function(I){var Q=T(I);if(Q.length){Q=t.sortBy(Q,function(B){return M[B]});for(var U=(Q.length-1)/2,ee=Math.floor(U),z=Math.ceil(U);ee<=z;++ee){var H=Q[ee];E[I]===I&&Pl.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:[l.jsx(Tc,{type:"target",position:mt.Top}),l.jsx("div",{className:"font-semibold text-white text-sm truncate max-w-[200px]",title:t.content,children:t.label}),l.jsx(Tc,{type:"source",position:mt.Bottom})]}));zV.displayName="EntityNode";const PV=b.memo(({data:t})=>l.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:[l.jsx(Tc,{type:"target",position:mt.Top}),l.jsx("div",{className:"font-medium text-white text-xs truncate max-w-[150px]",title:t.content,children:t.label}),l.jsx(Tc,{type:"source",position:mt.Bottom})]}));PV.displayName="ParagraphNode";const zje={entity:zV,paragraph:PV};function Pje(t,e){const n=new ZR.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)}),ZR.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 o={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&&(o.label=`${i.weight.toFixed(0)}`),s.push(o)}),{nodes:r,edges:s}}function Lje(){const t=Da(),[e,n]=b.useState(!1),[r,s]=b.useState(null),[i,a]=b.useState(""),[o,c]=b.useState("all"),[h,f]=b.useState(50),[m,g]=b.useState("50"),[x,y]=b.useState(!1),[w,S]=b.useState(!0),[k,N]=b.useState(!1),[C,T]=b.useState(!1),[_,E,M]=Gke([]),[L,P,I]=Xke([]),[Q,U]=b.useState(0),[ee,z]=b.useState(null),[H,B]=b.useState(null),{toast:X}=ts(),J=b.useCallback(ne=>ne.type==="entity"?"#6366f1":ne.type==="paragraph"?"#10b981":"#6b7280",[]),G=b.useCallback(async(ne=!1)=>{try{if(!ne&&h>200){T(!0);return}n(!0);const[K,ie]=await Promise.all([Aje(h,o),Rje()]);if(s(ie),K.nodes.length===0){X({title:"提示",description:"知识库为空,请先导入知识数据"}),E([]),P([]);return}const{nodes:re,edges:ae}=Pje(K.nodes,K.edges);E(re),P(ae),U(re.length),ie&&ie.total_nodes>h&&X({title:"提示",description:`知识图谱包含 ${ie.total_nodes} 个节点,当前显示 ${re.length} 个`}),X({title:"加载成功",description:`已加载 ${re.length} 个节点,${ae.length} 条边`})}catch(K){console.error("加载知识图谱失败:",K),X({title:"加载失败",description:K instanceof Error?K.message:"未知错误",variant:"destructive"})}finally{n(!1)}},[h,o,X]),R=b.useCallback(async()=>{if(!i.trim()){X({title:"提示",description:"请输入搜索关键词"});return}try{const ne=await Dje(i);if(ne.length===0){X({title:"未找到",description:"没有找到匹配的节点"});return}const K=new Set(ne.map(ie=>ie.id));E(ie=>ie.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]),se=b.useCallback(()=>{E(ne=>ne.map(K=>({...K,style:{...K.style,opacity:1,filter:"brightness(1)"}})))},[]),W=b.useCallback(()=>{S(!1),N(!0),G()},[G]),F=b.useCallback(()=>{T(!1),setTimeout(()=>{G(!0)},0)},[G]),V=b.useCallback((ne,K)=>{_.find(re=>re.id===K.id)&&z({id:K.id,type:K.type,content:K.data.content})},[_]);b.useEffect(()=>{w||k&&G()},[h,o,w,k]);const te=b.useCallback((ne,K)=>{const ie=_.find(_e=>_e.id===K.source),re=_.find(_e=>_e.id===K.target),ae=L.find(_e=>_e.id===K.id);ie&&re&&ae&&B({source:{id:ie.id,type:ie.type,content:ie.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")}})},[_,L]);return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsxs("div",{className:"flex-shrink-0 p-4 border-b bg-background",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦知识库图谱"}),l.jsx("p",{className:"text-muted-foreground mt-1",children:"可视化知识实体与关系网络"})]}),r&&l.jsxs("div",{className:"flex gap-2 flex-wrap",children:[l.jsxs(In,{variant:"outline",className:"gap-1",children:[l.jsx(A3,{className:"h-3 w-3"}),"节点: ",r.total_nodes]}),l.jsxs(In,{variant:"outline",className:"gap-1",children:[l.jsx(oz,{className:"h-3 w-3"}),"边: ",r.total_edges]}),l.jsxs(In,{variant:"outline",className:"gap-1",children:[l.jsx(ra,{className:"h-3 w-3"}),"实体: ",r.entity_nodes]}),l.jsxs(In,{variant:"outline",className:"gap-1",children:[l.jsx(lo,{className:"h-3 w-3"}),"段落: ",r.paragraph_nodes]})]})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 mt-4",children:[l.jsxs("div",{className:"flex-1 flex gap-2",children:[l.jsx(Pe,{placeholder:"搜索节点内容...",value:i,onChange:ne=>a(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&R(),className:"flex-1"}),l.jsx(de,{onClick:R,size:"sm",children:l.jsx(ci,{className:"h-4 w-4"})}),l.jsx(de,{onClick:se,variant:"outline",size:"sm",children:"重置"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(qt,{value:o,onValueChange:ne=>c(ne),children:[l.jsx(It,{className:"w-[120px]",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"all",children:"全部节点"}),l.jsx(De,{value:"entity",children:"仅实体"}),l.jsx(De,{value:"paragraph",children:"仅段落"})]})]}),l.jsxs(qt,{value:h===1e4?"all":x?"custom":h.toString(),onValueChange:ne=>{ne==="custom"?(y(!0),g(h.toString())):ne==="all"?(y(!1),f(1e4)):(y(!1),f(Number(ne)))},children:[l.jsx(It,{className:"w-[120px]",children:l.jsx(Ft,{})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"50",children:"50 节点"}),l.jsx(De,{value:"100",children:"100 节点"}),l.jsx(De,{value:"200",children:"200 节点"}),l.jsx(De,{value:"500",children:"500 节点"}),l.jsx(De,{value:"1000",children:"1000 节点"}),l.jsx(De,{value:"all",children:"全部 (最多10000)"}),l.jsx(De,{value:"custom",children:"自定义..."})]})]}),x&&l.jsx(Pe,{type:"number",min:"50",value:m,onChange:ne=>g(ne.target.value),onBlur:()=>{const ne=parseInt(m);!isNaN(ne)&&ne>=50?f(ne):(g("50"),f(50))},onKeyDown:ne=>{if(ne.key==="Enter"){const K=parseInt(m);!isNaN(K)&&K>=50?f(K):(g("50"),f(50))}},placeholder:"最少50个",className:"w-[120px]"}),l.jsx(de,{onClick:()=>G(),variant:"outline",size:"sm",disabled:e,children:l.jsx(Ls,{className:ve("h-4 w-4",e&&"animate-spin")})})]})]})]}),l.jsx("div",{className:"flex-1 relative",children:e?l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx(Ls,{className:"h-8 w-8 animate-spin mx-auto mb-2 text-muted-foreground"}),l.jsx("p",{className:"text-muted-foreground",children:"加载知识图谱中..."})]})}):_.length===0?l.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l.jsxs("div",{className:"text-center",children:[l.jsx(A3,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"知识库为空"}),l.jsx("p",{className:"text-muted-foreground",children:"请先导入知识数据"})]})}):l.jsxs(hV,{nodes:_,edges:L,onNodesChange:M,onEdgesChange:I,onNodeClick:V,onEdgeClick:te,nodeTypes:zje,fitView:!0,minZoom:.05,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.5},elevateNodesOnSelect:Q<=500,nodesDraggable:Q<=1e3,attributionPosition:"bottom-left",children:[l.jsx(v6e,{variant:aa.Dots,gap:12,size:1}),l.jsx(h6e,{}),Q<=500&&l.jsx(i6e,{nodeColor:J,nodeBorderRadius:8,pannable:!0,zoomable:!0}),l.jsxs(Ly,{position:"top-right",className:"bg-background/95 backdrop-blur-sm rounded-lg border p-3 shadow-lg",children:[l.jsx("div",{className:"text-sm font-semibold mb-2",children:"图例"}),l.jsxs("div",{className:"space-y-2 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-blue-500 to-blue-600 border-2 border-blue-700"}),l.jsx("span",{children:"实体节点"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-4 h-4 rounded bg-gradient-to-br from-green-500 to-green-600 border-2 border-green-700"}),l.jsx("span",{children:"段落节点"})]}),Q>200&&l.jsxs("div",{className:"mt-2 pt-2 border-t text-yellow-600 dark:text-yellow-500",children:[l.jsx("div",{className:"font-semibold",children:"性能模式"}),l.jsx("div",{children:"已禁用动画"}),Q>500&&l.jsx("div",{children:"已禁用缩略图"})]})]})]})]})}),l.jsx(xr,{open:!!ee,onOpenChange:ne=>!ne&&z(null),children:l.jsxs(lr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsx(or,{children:l.jsx(cr,{children:"节点详情"})}),ee&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"grid grid-cols-2 gap-4",children:l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"类型"}),l.jsx("div",{className:"mt-1",children:l.jsx(In,{variant:ee.type==="entity"?"default":"secondary",children:ee.type==="entity"?"🏷️ 实体":"📄 段落"})})]})}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),l.jsx("code",{className:"mt-1 block p-2 bg-muted rounded text-xs break-all",children:ee.id})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"内容"}),l.jsx(hn,{className:"mt-1 h-40 p-3 bg-muted rounded",children:l.jsx("p",{className:"text-sm whitespace-pre-wrap",children:ee.content})})]})]})]})}),l.jsx(xr,{open:!!H,onOpenChange:ne=>!ne&&B(null),children:l.jsxs(lr,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col",children:[l.jsx(or,{children:l.jsx(cr,{children:"边详情"})}),H&&l.jsx(hn,{className:"flex-1 pr-4",children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.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:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"源节点"}),l.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:H.source.content}),l.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[H.source.id.slice(0,40),"..."]})]}),l.jsx("div",{className:"text-2xl text-muted-foreground flex-shrink-0",children:"→"}),l.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:[l.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"目标节点"}),l.jsx("div",{className:"font-medium text-sm mb-2 truncate",children:H.target.content}),l.jsxs("code",{className:"text-xs text-muted-foreground truncate block",children:[H.target.id.slice(0,40),"..."]})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"权重"}),l.jsx("div",{className:"mt-1",children:l.jsx(In,{variant:"outline",className:"text-base font-mono",children:H.edge.weight.toFixed(4)})})]})]})})]})}),l.jsx(Nn,{open:w,onOpenChange:S,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"加载知识图谱"}),l.jsxs(bn,{children:["知识图谱的动态展示会消耗较多系统资源。",l.jsx("br",{}),"确定要加载知识图谱吗?"]})]}),l.jsxs(vn,{children:[l.jsx(Sn,{onClick:()=>t({to:"/"}),children:"取消 (返回首页)"}),l.jsx(wn,{onClick:W,children:"确认加载"})]})]})}),l.jsx(Nn,{open:C,onOpenChange:T,children:l.jsxs(gn,{children:[l.jsxs(xn,{children:[l.jsx(yn,{children:"⚠️ 节点数量较多"}),l.jsx(bn,{asChild:!0,children:l.jsxs("div",{children:[l.jsxs("p",{children:["您正在尝试加载 ",l.jsx("strong",{className:"text-orange-600",children:h>=1e4?"全部 (最多10000个)":h})," 个节点。"]}),l.jsx("p",{className:"mt-4",children:"节点数量过多可能导致:"}),l.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[l.jsx("li",{children:"页面加载时间较长"}),l.jsx("li",{children:"浏览器卡顿或崩溃"}),l.jsx("li",{children:"系统资源占用过高"})]}),l.jsx("p",{className:"mt-4",children:"建议先选择较少的节点数量 (50-200 个)。"})]})})]}),l.jsxs(vn,{children:[l.jsx(Sn,{onClick:()=>{T(!1),h>200&&(f(50),y(!1))},children:"取消"}),l.jsx(wn,{onClick:F,className:"bg-orange-600 hover:bg-orange-700",children:"我了解风险,继续加载"})]})]})})]})}function Pd(t,e,n){let r=n.initialDeps??[],s;function i(){var a,o,c,h;let f;n.key&&((a=n.debug)!=null&&a.call(n))&&(f=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&&((o=n.debug)!=null&&o.call(n))&&(x=Date.now()),s=e(...m),n.key&&((c=n.debug)!=null&&c.call(n))){const y=Math.round((Date.now()-f)*100)/100,w=Math.round((Date.now()-x)*100)/100,S=w/16,k=(N,C)=>{for(N=String(N);N.length{r=a},i}function JR(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const Ije=(t,e)=>Math.abs(t-e)<1.01,Bje=(t,e,n)=>{let r;return function(...s){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,s),n)}},eD=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},qje=t=>t,Fje=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},$je=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const s=a=>{const{width:o,height:c}=a;e({width:Math.round(o),height:Math.round(c)})};if(s(eD(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const c=a[0];if(c?.borderBoxSize){const h=c.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(eD(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},tD={passive:!0},nD=typeof window>"u"?!0:"onscrollend"in window,Qje=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let s=0;const i=t.options.useScrollendEvent&&nD?()=>{}:Bje(r,()=>{e(s,!1)},t.options.isScrollingResetDelay),a=f=>()=>{const{horizontal:m,isRtl:g}=t.options;s=m?n.scrollLeft*(g&&-1||1):n.scrollTop,i(),e(s,f)},o=a(!0),c=a(!1);c(),n.addEventListener("scroll",o,tD);const h=t.options.useScrollendEvent&&nD;return h&&n.addEventListener("scrollend",c,tD),()=>{n.removeEventListener("scroll",o),h&&n.removeEventListener("scrollend",c)}},Hje=(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"]},Vje=(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 Uje{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:qje,rangeExtractor:Fje,onChange:()=>{},measureElement:Hje,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=Pd(()=>(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 o=n[a];if(s.has(o.lane))continue;const c=i.get(o.lane);if(c==null||o.end>c.end?i.set(o.lane,o):o.enda.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=Pd(()=>[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=Pd(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const h=this.measurementsCache.slice(0,c);for(let f=c;fthis.options.debug}),this.calculateRange=Pd(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,i)=>this.range=n.length>0&&r>0?Wje({measurements:n,outerSize:r,scrollOffset:s,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Pd(()=>{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,o=this.elementsCache.get(a);o!==n&&(o&&this.observer.unobserve(o),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=Pd(()=>[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 JR(r[LV(0,r.length-1,s=>JR(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 o=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(o,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 o=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,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,o=h=>{if(!this.targetWindow)return;const f=this.getOffsetForIndex(n,h);if(!f){console.warn("Failed to get offset for index:",n);return}const[m,g]=f;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}Ije(y[0],x)||c(g)})},c=h=>{this.targetWindow&&(i++,io(h)):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};o(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(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==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 LV=(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 Wje({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=LV(0,s,i,n),o=a;if(r===1)for(;o1){const c=Array(r).fill(0);for(;of=0&&h.some(f=>f>=n);){const f=t[a];h[f.lane]=f.start,a--}a=Math.max(0,a-a%r),o=Math.min(s,o+(r-1-o%r))}return{startIndex:a,endIndex:o}}const rD=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Gje(t){const e=b.useReducer(()=>({}),{})[1],n={...t,onChange:(s,i)=>{var a;i?fu.flushSync(e):e(),(a=t.onChange)==null||a.call(t,s,i)}},[r]=b.useState(()=>new Uje(n));return r.setOptions(n),rD(()=>r._didMount(),[]),rD(()=>r._willUpdate()),r}function Xje(t){return Gje({observeElementRect:$je,observeElementOffset:Qje,scrollToFn:Vje,...t})}function Yje(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 Kje={},km={};function yu(t,e){try{const r=(Kje[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return r in km?km[r]:sD(r,r.split(":"))}catch{if(t in km)return km[t];const n=t?.match(Zje);return n?sD(t,n.slice(1)):NaN}}const Zje=/([+-]\d\d):?(\d\d)?/;function sD(t,e){const n=+(e[0]||0),r=+(e[1]||0),s=+(e[2]||0)/60;return km[t]=n*60+r>0?n*60+r+s:n*60-r-s}class ll extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(yu(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)),IV(this),Dk(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new ll(...n,e):new ll(Date.now(),e)}withTimeZone(e){return new ll(+this,e)}getTimezoneOffset(){const e=-yu(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Dk(this),+this}[Symbol.for("constructDateFrom")](e){return new ll(+new Date(e),this.timeZone)}}const iD=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!iD.test(t))return;const e=t.replace(iD,"$1UTC");ll.prototype[e]&&(t.startsWith("get")?ll.prototype[t]=function(){return this.internal[e]()}:(ll.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),Jje(this),+this},ll.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Dk(this),+this}))});function Dk(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-yu(t.timeZone,t)*60))}function Jje(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()),IV(t)}function IV(t){const e=yu(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,o=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();a&&o&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+a);const c=s-n;c&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+c);const h=new Date(+t);h.setUTCSeconds(0);const f=s>0?h.getSeconds():(h.getSeconds()-60)%60,m=Math.round(-(yu(t.timeZone,t)*60))%60;(m||f)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+f));const g=yu(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 N=yu(t.timeZone,t),C=N>0?Math.floor(N):Math.ceil(N),T=x-C;T&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+T),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+T))}}class ks extends ll{static tz(e,...n){return n.length?new ks(...n,e):new ks(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} (${Yje(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 ks(+this,e)}[Symbol.for("constructDateFrom")](e){return new ks(+new Date(e),this.timeZone)}}const BV=6048e5,eOe=864e5,aD=Symbol.for("constructDateFrom");function Vr(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&aD in t?t[aD](e):t instanceof Date?new t.constructor(e):new Date(e)}function Hn(t,e){return Vr(e||t,t)}function qV(t,e,n){const r=Hn(t,n?.in);return isNaN(e)?Vr(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function FV(t,e,n){const r=Hn(t,n?.in);if(isNaN(e))return Vr(t,NaN);if(!e)return r;const s=r.getDate(),i=Vr(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 tOe={};function vp(){return tOe}function Ec(t,e){const n=vp(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Hn(t,e?.in),i=s.getDay(),a=(i=i.getTime()?r+1:n.getTime()>=o.getTime()?r:r-1}function lD(t){const e=Hn(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 Wu(t,...e){const n=Vr.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function _0(t,e){const n=Hn(t,e?.in);return n.setHours(0,0,0,0),n}function QV(t,e,n){const[r,s]=Wu(n?.in,t,e),i=_0(r),a=_0(s),o=+i-lD(i),c=+a-lD(a);return Math.round((o-c)/eOe)}function nOe(t,e){const n=$V(t,e),r=Vr(t,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),E0(r)}function rOe(t,e,n){return qV(t,e*7,n)}function sOe(t,e,n){return FV(t,e*12,n)}function iOe(t,e){let n,r=e?.in;return t.forEach(s=>{!r&&typeof s=="object"&&(r=Vr.bind(null,s));const i=Hn(s,r);(!n||n{!r&&typeof s=="object"&&(r=Vr.bind(null,s));const i=Hn(s,r);(!n||n>i||isNaN(+i))&&(n=i)}),Vr(r,n||NaN)}function lOe(t,e,n){const[r,s]=Wu(n?.in,t,e);return+_0(r)==+_0(s)}function HV(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function oOe(t){return!(!HV(t)&&typeof t!="number"||isNaN(+Hn(t)))}function cOe(t,e,n){const[r,s]=Wu(n?.in,t,e),i=r.getFullYear()-s.getFullYear(),a=r.getMonth()-s.getMonth();return i*12+a}function uOe(t,e){const n=Hn(t,e?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function VV(t,e){const[n,r]=Wu(t,e.start,e.end);return{start:n,end:r}}function dOe(t,e){const{start:n,end:r}=VV(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 o=1;const c=[];for(;+a<=i;)c.push(Vr(n,a)),a.setMonth(a.getMonth()+o);return s?c.reverse():c}function hOe(t,e){const n=Hn(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function fOe(t,e){const n=Hn(t,e?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function UV(t,e){const n=Hn(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function mOe(t,e){const{start:n,end:r}=VV(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 o=1;const c=[];for(;+a<=i;)c.push(Vr(n,a)),a.setFullYear(a.getFullYear()+o);return s?c.reverse():c}function WV(t,e){const n=vp(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Hn(t,e?.in),i=s.getDay(),a=(i{let r;const s=gOe[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 fh(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const vOe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yOe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bOe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wOe={date:fh({formats:vOe,defaultWidth:"full"}),time:fh({formats:yOe,defaultWidth:"full"}),dateTime:fh({formats:bOe,defaultWidth:"full"})},SOe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kOe=(t,e,n,r)=>SOe[t];function el(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,o=n?.width?String(n.width):a;s=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=n?.width?String(n.width):t.defaultWidth;s=t.values[o]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const jOe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},OOe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},NOe={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"]},COe={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"]},TOe={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"}},EOe={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"}},_Oe=(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"},MOe={ordinalNumber:_Oe,era:el({values:jOe,defaultWidth:"wide"}),quarter:el({values:OOe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:el({values:NOe,defaultWidth:"wide"}),day:el({values:COe,defaultWidth:"wide"}),dayPeriod:el({values:TOe,defaultWidth:"wide",formattingValues:EOe,defaultFormattingWidth:"wide"})};function tl(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],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(o)?ROe(o,m=>m.test(a)):AOe(o,m=>m.test(a));let h;h=t.valueCallback?t.valueCallback(c):c,h=n.valueCallback?n.valueCallback(h):h;const f=e.slice(a.length);return{value:h,rest:f}}}function AOe(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function ROe(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 o=e.slice(s.length);return{value:a,rest:o}}}const DOe=/^(\d+)(th|st|nd|rd)?/i,zOe=/\d+/i,POe={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},LOe={any:[/^b/i,/^(a|c)/i]},IOe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},BOe={any:[/1/i,/2/i,/3/i,/4/i]},qOe={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},FOe={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]},$Oe={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},QOe={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]},HOe={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},VOe={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}},UOe={ordinalNumber:GV({matchPattern:DOe,parsePattern:zOe,valueCallback:t=>parseInt(t,10)}),era:tl({matchPatterns:POe,defaultMatchWidth:"wide",parsePatterns:LOe,defaultParseWidth:"any"}),quarter:tl({matchPatterns:IOe,defaultMatchWidth:"wide",parsePatterns:BOe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:tl({matchPatterns:qOe,defaultMatchWidth:"wide",parsePatterns:FOe,defaultParseWidth:"any"}),day:tl({matchPatterns:$Oe,defaultMatchWidth:"wide",parsePatterns:QOe,defaultParseWidth:"any"}),dayPeriod:tl({matchPatterns:HOe,defaultMatchWidth:"any",parsePatterns:VOe,defaultParseWidth:"any"})},EO={code:"en-US",formatDistance:xOe,formatLong:wOe,formatRelative:kOe,localize:MOe,match:UOe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function WOe(t,e){const n=Hn(t,e?.in);return QV(n,UV(n))+1}function XV(t,e){const n=Hn(t,e?.in),r=+E0(n)-+nOe(n);return Math.round(r/BV)+1}function YV(t,e){const n=Hn(t,e?.in),r=n.getFullYear(),s=vp(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=Vr(e?.in||t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const o=Ec(a,e),c=Vr(e?.in||t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const h=Ec(c,e);return+n>=+o?r+1:+n>=+h?r:r-1}function GOe(t,e){const n=vp(),r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=YV(t,e),i=Vr(e?.in||t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),Ec(i,e)}function KV(t,e){const n=Hn(t,e?.in),r=+Ec(n,e)-+GOe(n,e);return Math.round(r/BV)+1}function Ln(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const rc={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return Ln(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Ln(n+1,2)},d(t,e){return Ln(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 Ln(t.getHours()%12||12,e.length)},H(t,e){return Ln(t.getHours(),e.length)},m(t,e){return Ln(t.getMinutes(),e.length)},s(t,e){return Ln(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return Ln(s,e.length)}},Ld={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},oD={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 rc.y(t,e)},Y:function(t,e,n,r){const s=YV(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return Ln(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Ln(i,e.length)},R:function(t,e){const n=$V(t);return Ln(n,e.length)},u:function(t,e){const n=t.getFullYear();return Ln(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 Ln(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 Ln(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 rc.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 Ln(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=KV(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):Ln(s,e.length)},I:function(t,e,n){const r=XV(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):Ln(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):rc.d(t,e)},D:function(t,e,n){const r=WOe(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ln(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 Ln(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 Ln(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 Ln(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=Ld.noon:r===0?s=Ld.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=Ld.evening:r>=12?s=Ld.afternoon:r>=4?s=Ld.morning:s=Ld.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 rc.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):rc.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ln(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ln(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):rc.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):rc.s(t,e)},S:function(t,e){return rc.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return uD(r);case"XXXX":case"XX":return uu(r);case"XXXXX":case"XXX":default:return uu(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return uD(r);case"xxxx":case"xx":return uu(r);case"xxxxx":case"xxx":default:return uu(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+cD(r,":");case"OOOO":default:return"GMT"+uu(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+cD(r,":");case"zzzz":default:return"GMT"+uu(r,":")}},t:function(t,e,n){const r=Math.trunc(+t/1e3);return Ln(r,e.length)},T:function(t,e,n){return Ln(+t,e.length)}};function cD(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+Ln(i,2)}function uD(t,e){return t%60===0?(t>0?"-":"+")+Ln(Math.abs(t)/60,2):uu(t,e)}function uu(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Ln(Math.trunc(r/60),2),i=Ln(r%60,2);return n+s+e+i}const dD=(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"})}},ZV=(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"})}},XOe=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return dD(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}}",dD(r,e)).replace("{{time}}",ZV(s,e))},YOe={p:ZV,P:XOe},KOe=/^D+$/,ZOe=/^Y+$/,JOe=["D","DD","YY","YYYY"];function eNe(t){return KOe.test(t)}function tNe(t){return ZOe.test(t)}function nNe(t,e,n){const r=rNe(t,e,n);if(console.warn(r),JOe.includes(t))throw new RangeError(r)}function rNe(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 sNe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,iNe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aNe=/^'([^]*?)'?$/,lNe=/''/g,oNe=/[a-zA-Z]/;function j1(t,e,n){const r=vp(),s=n?.locale??r.locale??EO,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,o=Hn(t,n?.in);if(!oOe(o))throw new RangeError("Invalid time value");let c=e.match(iNe).map(f=>{const m=f[0];if(m==="p"||m==="P"){const g=YOe[m];return g(f,s.formatLong)}return f}).join("").match(sNe).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const m=f[0];if(m==="'")return{isToken:!1,value:cNe(f)};if(oD[m])return{isToken:!0,value:f};if(m.match(oNe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:f}});s.localize.preprocessor&&(c=s.localize.preprocessor(o,c));const h={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return c.map(f=>{if(!f.isToken)return f.value;const m=f.value;(!n?.useAdditionalWeekYearTokens&&tNe(m)||!n?.useAdditionalDayOfYearTokens&&eNe(m))&&nNe(m,e,String(t));const g=oD[m[0]];return g(o,m,s.localize,h)}).join("")}function cNe(t){const e=t.match(aNe);return e?e[1].replace(lNe,"'"):t}function uNe(t,e){const n=Hn(t,e?.in),r=n.getFullYear(),s=n.getMonth(),i=Vr(n,0);return i.setFullYear(r,s+1,0),i.setHours(0,0,0,0),i.getDate()}function dNe(t,e){return Hn(t,e?.in).getMonth()}function hNe(t,e){return Hn(t,e?.in).getFullYear()}function fNe(t,e){return+Hn(t)>+Hn(e)}function mNe(t,e){return+Hn(t)<+Hn(e)}function pNe(t,e,n){const[r,s]=Wu(n?.in,t,e);return+Ec(r,n)==+Ec(s,n)}function gNe(t,e,n){const[r,s]=Wu(n?.in,t,e);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function xNe(t,e,n){const[r,s]=Wu(n?.in,t,e);return r.getFullYear()===s.getFullYear()}function vNe(t,e,n){const r=Hn(t,n?.in),s=r.getFullYear(),i=r.getDate(),a=Vr(t,0);a.setFullYear(s,e,15),a.setHours(0,0,0,0);const o=uNe(a);return r.setMonth(e,Math.min(i,o)),r}function yNe(t,e,n){const r=Hn(t,n?.in);return isNaN(+r)?Vr(t,NaN):(r.setFullYear(e),r)}const hD=5,bNe=4;function wNe(t,e){const n=e.startOfMonth(t),r=n.getDay()>0?n.getDay():7,s=e.addDays(t,-r+1),i=e.addDays(s,hD*7-1);return e.getMonth(t)===e.getMonth(i)?hD:bNe}function JV(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 SNe(t,e){const n=JV(t,e),r=wNe(t,e);return e.addDays(n,r*7-1)}class zi{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?ks.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 ks(r,s,i,this.options.timeZone):new Date(r,s,i),this.addDays=(r,s)=>this.overrides?.addDays?this.overrides.addDays(r,s):qV(r,s),this.addMonths=(r,s)=>this.overrides?.addMonths?this.overrides.addMonths(r,s):FV(r,s),this.addWeeks=(r,s)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,s):rOe(r,s),this.addYears=(r,s)=>this.overrides?.addYears?this.overrides.addYears(r,s):sOe(r,s),this.differenceInCalendarDays=(r,s)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):QV(r,s),this.differenceInCalendarMonths=(r,s)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):cOe(r,s),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):dOe(r),this.eachYearOfInterval=r=>{const s=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):mOe(r),i=new Set(s.map(o=>this.getYear(o)));if(i.size===s.length)return s;const a=[];return i.forEach(o=>{a.push(new Date(o,0,1))}),a},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):SNe(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):pOe(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):uOe(r),this.endOfWeek=(r,s)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,s):WV(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):fOe(r),this.format=(r,s,i)=>{const a=this.overrides?.format?this.overrides.format(r,s,this.options):j1(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):XV(r),this.getMonth=(r,s)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):dNe(r,this.options),this.getYear=(r,s)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):hNe(r,this.options),this.getWeek=(r,s)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):KV(r,this.options),this.isAfter=(r,s)=>this.overrides?.isAfter?this.overrides.isAfter(r,s):fNe(r,s),this.isBefore=(r,s)=>this.overrides?.isBefore?this.overrides.isBefore(r,s):mNe(r,s),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):HV(r),this.isSameDay=(r,s)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,s):lOe(r,s),this.isSameMonth=(r,s)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,s):gNe(r,s),this.isSameYear=(r,s)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,s):xNe(r,s),this.max=r=>this.overrides?.max?this.overrides.max(r):iOe(r),this.min=r=>this.overrides?.min?this.overrides.min(r):aOe(r),this.setMonth=(r,s)=>this.overrides?.setMonth?this.overrides.setMonth(r,s):vNe(r,s),this.setYear=(r,s)=>this.overrides?.setYear?this.overrides.setYear(r,s):yNe(r,s),this.startOfBroadcastWeek=(r,s)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):JV(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):_0(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):E0(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):hOe(r),this.startOfWeek=(r,s)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):Ec(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):UV(r),this.options={locale:EO,...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&&zi.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:r,numerals:s}=this.options,i=n?.code;if(i&&zi.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)}}zi.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 kl=new zi;class eU{constructor(e,n,r=kl){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 kNe{constructor(e,n){this.date=e,this.weeks=n}}class jNe{constructor(e,n){this.days=n,this.weekNumber=e}}function ONe(t){return he.createElement("button",{...t})}function NNe(t){return he.createElement("span",{...t})}function CNe(t){const{size:e=24,orientation:n="left",className:r}=t;return he.createElement("svg",{className:r,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&he.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&he.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&he.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&he.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function TNe(t){const{day:e,modifiers:n,...r}=t;return he.createElement("td",{...r})}function ENe(t){const{day:e,modifiers:n,...r}=t,s=he.useRef(null);return he.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),he.createElement("button",{ref:s,...r})}var yt;(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"})(yt||(yt={}));var mr;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(mr||(mr={}));var ja;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(ja||(ja={}));var Ci;(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"})(Ci||(Ci={}));function _Ne(t){const{options:e,className:n,components:r,classNames:s,...i}=t,a=[s[yt.Dropdown],n].join(" "),o=e?.find(({value:c})=>c===i.value);return he.createElement("span",{"data-disabled":i.disabled,className:s[yt.DropdownRoot]},he.createElement(r.Select,{className:a,...i},e?.map(({value:c,label:h,disabled:f})=>he.createElement(r.Option,{key:c,value:c,disabled:f},h))),he.createElement("span",{className:s[yt.CaptionLabel],"aria-hidden":!0},o?.label,he.createElement(r.Chevron,{orientation:"down",size:18,className:s[yt.Chevron]})))}function MNe(t){return he.createElement("div",{...t})}function ANe(t){return he.createElement("div",{...t})}function RNe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return he.createElement("div",{...r},t.children)}function DNe(t){const{calendarMonth:e,displayIndex:n,...r}=t;return he.createElement("div",{...r})}function zNe(t){return he.createElement("table",{...t})}function PNe(t){return he.createElement("div",{...t})}const tU=b.createContext(void 0);function yp(){const t=b.useContext(tU);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function LNe(t){const{components:e}=yp();return he.createElement(e.Dropdown,{...t})}function INe(t){const{onPreviousClick:e,onNextClick:n,previousMonth:r,nextMonth:s,...i}=t,{components:a,classNames:o,labels:{labelPrevious:c,labelNext:h}}=yp(),f=b.useCallback(g=>{s&&n?.(g)},[s,n]),m=b.useCallback(g=>{r&&e?.(g)},[r,e]);return he.createElement("nav",{...i},he.createElement(a.PreviousMonthButton,{type:"button",className:o[yt.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:m},he.createElement(a.Chevron,{disabled:r?void 0:!0,className:o[yt.Chevron],orientation:"left"})),he.createElement(a.NextMonthButton,{type:"button",className:o[yt.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":h(s),onClick:f},he.createElement(a.Chevron,{disabled:s?void 0:!0,orientation:"right",className:o[yt.Chevron]})))}function BNe(t){const{components:e}=yp();return he.createElement(e.Button,{...t})}function qNe(t){return he.createElement("option",{...t})}function FNe(t){const{components:e}=yp();return he.createElement(e.Button,{...t})}function $Ne(t){const{rootRef:e,...n}=t;return he.createElement("div",{...n,ref:e})}function QNe(t){return he.createElement("select",{...t})}function HNe(t){const{week:e,...n}=t;return he.createElement("tr",{...n})}function VNe(t){return he.createElement("th",{...t})}function UNe(t){return he.createElement("thead",{"aria-hidden":!0},he.createElement("tr",{...t}))}function WNe(t){const{week:e,...n}=t;return he.createElement("th",{...n})}function GNe(t){return he.createElement("th",{...t})}function XNe(t){return he.createElement("tbody",{...t})}function YNe(t){const{components:e}=yp();return he.createElement(e.Dropdown,{...t})}const KNe=Object.freeze(Object.defineProperty({__proto__:null,Button:ONe,CaptionLabel:NNe,Chevron:CNe,Day:TNe,DayButton:ENe,Dropdown:_Ne,DropdownNav:MNe,Footer:ANe,Month:RNe,MonthCaption:DNe,MonthGrid:zNe,Months:PNe,MonthsDropdown:LNe,Nav:INe,NextMonthButton:BNe,Option:qNe,PreviousMonthButton:FNe,Root:$Ne,Select:QNe,Week:HNe,WeekNumber:WNe,WeekNumberHeader:GNe,Weekday:VNe,Weekdays:UNe,Weeks:XNe,YearsDropdown:YNe},Symbol.toStringTag,{value:"Module"}));function io(t,e,n=!1,r=kl){let{from:s,to:i}=t;const{differenceInCalendarDays:a,isSameDay:o}=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?o(i,e):!n&&s?o(s,e):!1}function nU(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function _O(t){return!!(t&&typeof t=="object"&&"from"in t)}function rU(t){return!!(t&&typeof t=="object"&&"after"in t)}function sU(t){return!!(t&&typeof t=="object"&&"before"in t)}function iU(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function aU(t,e){return Array.isArray(t)&&t.every(e.isDate)}function ao(t,e,n=kl){const r=Array.isArray(e)?e:[e],{isSameDay:s,differenceInCalendarDays:i,isAfter:a}=n;return r.some(o=>{if(typeof o=="boolean")return o;if(n.isDate(o))return s(t,o);if(aU(o,n))return o.includes(t);if(_O(o))return io(o,t,!1,n);if(iU(o))return Array.isArray(o.dayOfWeek)?o.dayOfWeek.includes(t.getDay()):o.dayOfWeek===t.getDay();if(nU(o)){const c=i(o.before,t),h=i(o.after,t),f=c>0,m=h<0;return a(o.before,o.after)?m&&f:f||m}return rU(o)?i(t,o.after)>0:sU(o)?i(o.before,t)>0:typeof o=="function"?o(t):!1})}function ZNe(t,e,n,r,s){const{disabled:i,hidden:a,modifiers:o,showOutsideDays:c,broadcastCalendar:h,today:f}=e,{isSameDay:m,isSameMonth:g,startOfMonth:x,isBefore:y,endOfMonth:w,isAfter:S}=s,k=n&&x(n),N=r&&w(r),C={[mr.focused]:[],[mr.outside]:[],[mr.disabled]:[],[mr.hidden]:[],[mr.today]:[]},T={};for(const _ of t){const{date:E,displayMonth:M}=_,L=!!(M&&!g(E,M)),P=!!(k&&y(E,k)),I=!!(N&&S(E,N)),Q=!!(i&&ao(E,i,s)),U=!!(a&&ao(E,a,s))||P||I||!h&&!c&&L||h&&c===!1&&L,ee=m(E,f??s.today());L&&C.outside.push(_),Q&&C.disabled.push(_),U&&C.hidden.push(_),ee&&C.today.push(_),o&&Object.keys(o).forEach(z=>{const H=o?.[z];H&&ao(E,H,s)&&(T[z]?T[z].push(_):T[z]=[_])})}return _=>{const E={[mr.focused]:!1,[mr.disabled]:!1,[mr.hidden]:!1,[mr.outside]:!1,[mr.today]:!1},M={};for(const L in C){const P=C[L];E[L]=P.some(I=>I===_)}for(const L in T)M[L]=T[L].some(P=>P===_);return{...E,...M}}}function JNe(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[ja[i]]&&s.push(e[ja[i]]),s),[e[yt.Day]])}function e7e(t){return{...KNe,...t}}function t7e(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 MO(){const t={};for(const e in yt)t[yt[e]]=`rdp-${yt[e]}`;for(const e in mr)t[mr[e]]=`rdp-${mr[e]}`;for(const e in ja)t[ja[e]]=`rdp-${ja[e]}`;for(const e in Ci)t[Ci[e]]=`rdp-${Ci[e]}`;return t}function lU(t,e,n){return(n??new zi(e)).formatMonthYear(t)}const n7e=lU;function r7e(t,e,n){return(n??new zi(e)).format(t,"d")}function s7e(t,e=kl){return e.format(t,"LLLL")}function i7e(t,e,n){return(n??new zi(e)).format(t,"cccccc")}function a7e(t,e=kl){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function l7e(){return""}function oU(t,e=kl){return e.format(t,"yyyy")}const o7e=oU,c7e=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:lU,formatDay:r7e,formatMonthCaption:n7e,formatMonthDropdown:s7e,formatWeekNumber:a7e,formatWeekNumberHeader:l7e,formatWeekdayName:i7e,formatYearCaption:o7e,formatYearDropdown:oU},Symbol.toStringTag,{value:"Module"}));function u7e(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...c7e,...t}}function d7e(t,e,n,r,s){const{startOfMonth:i,startOfYear:a,endOfYear:o,eachMonthOfInterval:c,getMonth:h}=s;return c({start:a(t),end:o(t)}).map(g=>{const x=r.formatMonthDropdown(g,s),y=h(g),w=e&&gi(n)||!1;return{value:y,label:x,disabled:w}})}function h7e(t,e={},n={}){let r={...e?.[yt.Day]};return Object.entries(t).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n?.[s]}}),r}function f7e(t,e,n){const r=t.today(),s=e?t.startOfISOWeek(r):t.startOfWeek(r),i=[];for(let a=0;a<7;a++){const o=t.addDays(s,a);i.push(o)}return i}function m7e(t,e,n,r,s=!1){if(!t||!e)return;const{startOfYear:i,endOfYear:a,eachYearOfInterval:o,getYear:c}=r,h=i(t),f=a(e),m=o({start:h,end:f});return s&&m.reverse(),m.map(g=>{const x=n.formatYearDropdown(g,r);return{value:c(g),label:x,disabled:!1}})}function cU(t,e,n,r){let s=(r??new zi(n)).format(t,"PPPP");return e.today&&(s=`Today, ${s}`),e.selected&&(s=`${s}, selected`),s}const p7e=cU;function uU(t,e,n){return(n??new zi(e)).formatMonthYear(t)}const g7e=uU;function x7e(t,e,n,r){let s=(r??new zi(n)).format(t,"PPPP");return e?.today&&(s=`Today, ${s}`),s}function v7e(t){return"Choose the Month"}function y7e(){return""}function b7e(t){return"Go to the Next Month"}function w7e(t){return"Go to the Previous Month"}function S7e(t,e,n){return(n??new zi(e)).format(t,"cccc")}function k7e(t,e){return`Week ${t}`}function j7e(t){return"Week Number"}function O7e(t){return"Choose the Year"}const N7e=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:g7e,labelDay:p7e,labelDayButton:cU,labelGrid:uU,labelGridcell:x7e,labelMonthDropdown:v7e,labelNav:y7e,labelNext:b7e,labelPrevious:w7e,labelWeekNumber:k7e,labelWeekNumberHeader:j7e,labelWeekday:S7e,labelYearDropdown:O7e},Symbol.toStringTag,{value:"Module"})),bp=t=>t instanceof HTMLElement?t:null,T3=t=>[...t.querySelectorAll("[data-animated-month]")??[]],C7e=t=>bp(t.querySelector("[data-animated-month]")),E3=t=>bp(t.querySelector("[data-animated-caption]")),_3=t=>bp(t.querySelector("[data-animated-weeks]")),T7e=t=>bp(t.querySelector("[data-animated-nav]")),E7e=t=>bp(t.querySelector("[data-animated-weekdays]"));function _7e(t,e,{classNames:n,months:r,focused:s,dateLib:i}){const a=b.useRef(null),o=b.useRef(r),c=b.useRef(!1);b.useLayoutEffect(()=>{const h=o.current;if(o.current=r,!e||!t.current||!(t.current instanceof HTMLElement)||r.length===0||h.length===0||r.length!==h.length)return;const f=i.isSameMonth(r[0].date,h[0].date),m=i.isAfter(r[0].date,h[0].date),g=m?n[Ci.caption_after_enter]:n[Ci.caption_before_enter],x=m?n[Ci.weeks_after_enter]:n[Ci.weeks_before_enter],y=a.current,w=t.current.cloneNode(!0);if(w instanceof HTMLElement?(T3(w).forEach(C=>{if(!(C instanceof HTMLElement))return;const T=C7e(C);T&&C.contains(T)&&C.removeChild(T);const _=E3(C);_&&_.classList.remove(g);const E=_3(C);E&&E.classList.remove(x)}),a.current=w):a.current=null,c.current||f||s)return;const S=y instanceof HTMLElement?T3(y):[],k=T3(t.current);if(k?.every(N=>N instanceof HTMLElement)&&S&&S.every(N=>N instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const N=T7e(t.current);N&&(N.style.zIndex="1"),k.forEach((C,T)=>{const _=S[T];if(!_)return;C.style.position="relative",C.style.overflow="hidden";const E=E3(C);E&&E.classList.add(g);const M=_3(C);M&&M.classList.add(x);const L=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),N&&(N.style.zIndex=""),E&&E.classList.remove(g),M&&M.classList.remove(x),C.style.position="",C.style.overflow="",C.contains(_)&&C.removeChild(_)};_.style.pointerEvents="none",_.style.position="absolute",_.style.overflow="hidden",_.setAttribute("aria-hidden","true");const P=E7e(_);P&&(P.style.opacity="0");const I=E3(_);I&&(I.classList.add(m?n[Ci.caption_before_exit]:n[Ci.caption_after_exit]),I.addEventListener("animationend",L));const Q=_3(_);Q&&Q.classList.add(m?n[Ci.weeks_before_exit]:n[Ci.weeks_after_exit]),C.insertBefore(_,C.firstChild)})}})}function M7e(t,e,n,r){const s=t[0],i=t[t.length-1],{ISOWeek:a,fixedWeeks:o,broadcastCalendar:c}=n??{},{addDays:h,differenceInCalendarDays:f,differenceInCalendarMonths:m,endOfBroadcastWeek:g,endOfISOWeek:x,endOfMonth:y,endOfWeek:w,isAfter:S,startOfBroadcastWeek:k,startOfISOWeek:N,startOfWeek:C}=r,T=c?k(s,r):a?N(s):C(s),_=c?g(i):a?x(y(i)):w(y(i)),E=f(_,T),M=m(i,s)+1,L=[];for(let Q=0;Q<=E;Q++){const U=h(T,Q);if(e&&S(U,e))break;L.push(U)}const I=(c?35:42)*M;if(o&&L.length{const s=r.weeks.reduce((i,a)=>i.concat(a.days.slice()),e.slice());return n.concat(s.slice())},e.slice())}function R7e(t,e,n,r){const{numberOfMonths:s=1}=n,i=[];for(let a=0;ae)break;i.push(o)}return i}function fD(t,e,n,r){const{month:s,defaultMonth:i,today:a=r.today(),numberOfMonths:o=1}=t;let c=s||i||a;const{differenceInCalendarMonths:h,addMonths:f,startOfMonth:m}=r;if(n&&h(n,c){const k=n.broadcastCalendar?m(S,r):n.ISOWeek?g(S):x(S),N=n.broadcastCalendar?i(S):n.ISOWeek?a(o(S)):c(o(S)),C=e.filter(M=>M>=k&&M<=N),T=n.broadcastCalendar?35:42;if(n.fixedWeeks&&C.length{const P=T-C.length;return L>N&&L<=s(N,P)});C.push(...M)}const _=C.reduce((M,L)=>{const P=n.ISOWeek?h(L):f(L),I=M.find(U=>U.weekNumber===P),Q=new eU(L,S,r);return I?I.days.push(Q):M.push(new jNe(P,[Q])),M},[]),E=new kNe(S,_);return w.push(E),w},[]);return n.reverseMonths?y.reverse():y}function z7e(t,e){let{startMonth:n,endMonth:r}=t;const{startOfYear:s,startOfDay:i,startOfMonth:a,endOfMonth:o,addYears:c,endOfYear:h,newDate:f,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=f(x,11,31));const S=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=a(n):g?n=f(g,0,1):!n&&S&&(n=s(c(t.today??m(),-100))),r?r=o(r):x?r=f(x,11,31):!r&&S&&(r=h(t.today??m())),[n&&i(n),r&&i(r)]}function P7e(t,e,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:i=1}=n,{startOfMonth:a,addMonths:o,differenceInCalendarMonths:c}=r,h=s?i:1,f=a(t);if(!e)return o(f,h);if(!(c(e,t)n.concat(r.weeks.slice()),e.slice())}function qy(t,e){const[n,r]=b.useState(t);return[e===void 0?n:e,r]}function B7e(t,e){const[n,r]=z7e(t,e),{startOfMonth:s,endOfMonth:i}=e,a=fD(t,n,r,e),[o,c]=qy(a,t.month?a:void 0);b.useEffect(()=>{const E=fD(t,n,r,e);c(E)},[t.timeZone]);const h=R7e(o,r,t,e),f=M7e(h,t.endMonth?i(t.endMonth):void 0,t,e),m=D7e(h,f,t,e),g=I7e(m),x=A7e(m),y=L7e(o,n,t,e),w=P7e(o,r,t,e),{disableNavigation:S,onMonthChange:k}=t,N=E=>g.some(M=>M.days.some(L=>L.isEqualTo(E))),C=E=>{if(S)return;let M=s(E);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:C,goToDay:E=>{N(E)||C(E.date)}}}var Ya;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(Ya||(Ya={}));function mD(t){return!t[mr.disabled]&&!t[mr.hidden]&&!t[mr.outside]}function q7e(t,e,n,r){let s,i=-1;for(const a of t){const o=e(a);mD(o)&&(o[mr.focused]&&imD(e(a)))),s}function F7e(t,e,n,r,s,i,a){const{ISOWeek:o,broadcastCalendar:c}=i,{addDays:h,addMonths:f,addWeeks:m,addYears:g,endOfBroadcastWeek:x,endOfISOWeek:y,endOfWeek:w,max:S,min:k,startOfBroadcastWeek:N,startOfISOWeek:C,startOfWeek:T}=a;let E={day:h,week:m,month:f,year:g,startOfWeek:M=>c?N(M,a):o?C(M):T(M),endOfWeek:M=>c?x(M):o?y(M):w(M)}[t](n,e==="after"?1:-1);return e==="before"&&r?E=S([r,E]):e==="after"&&s&&(E=k([s,E])),E}function dU(t,e,n,r,s,i,a,o=0){if(o>365)return;const c=F7e(t,e,n.date,r,s,i,a),h=!!(i.disabled&&ao(c,i.disabled,a)),f=!!(i.hidden&&ao(c,i.hidden,a)),m=c,g=new eU(c,m,a);return!h&&!f?g:dU(t,e,g,r,s,i,a,o+1)}function $7e(t,e,n,r,s){const{autoFocus:i}=t,[a,o]=b.useState(),c=q7e(e.days,n,r||(()=>!1),a),[h,f]=b.useState(i?c:void 0);return{isFocusTarget:w=>!!c?.isEqualTo(w),setFocused:f,focused:h,blur:()=>{o(h),f(void 0)},moveFocus:(w,S)=>{if(!h)return;const k=dU(w,S,h,e.navStart,e.navEnd,t,s);k&&(t.disableNavigation&&!e.days.some(C=>C.isEqualTo(k))||(e.goToDay(k),f(k)))}}}function Q7e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=qy(n,s?n:void 0),o=s?n:i,{isSameDay:c}=e,h=x=>o?.some(y=>c(y,x))??!1,{min:f,max:m}=t;return{selected:o,select:(x,y,w)=>{let S=[...o??[]];if(h(x)){if(o?.length===f||r&&o?.length===1)return;S=o?.filter(k=>!c(k,x))}else o?.length===m?S=[x]:S=[...S,x];return s||a(S),s?.(S,x,y,w),S},isSelected:h}}function H7e(t,e,n=0,r=0,s=!1,i=kl){const{from:a,to:o}=e||{},{isSameDay:c,isAfter:h,isBefore:f}=i;let m;if(!a&&!o)m={from:t,to:n>0?void 0:t};else if(a&&!o)c(a,t)?n===0?m={from:a,to:t}:s?m={from:a,to:void 0}:m=void 0:f(t,a)?m={from:t,to:a}:m={from:a,to:t};else if(a&&o)if(c(a,t)&&c(o,t))s?m={from:a,to:o}:m=void 0;else if(c(a,t))m={from:a,to:n>0?void 0:t};else if(c(o,t))m={from:t,to:n>0?void 0:t};else if(f(t,a))m={from:t,to:o};else if(h(t,a))m={from:a,to:t};else if(h(t,o))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 o!="function").some(o=>typeof o=="boolean"?o:n.isDate(o)?io(t,o,!1,n):aU(o,n)?o.some(c=>io(t,c,!1,n)):_O(o)?o.from&&o.to?pD(t,{from:o.from,to:o.to},n):!1:iU(o)?V7e(t,o.dayOfWeek,n):nU(o)?n.isAfter(o.before,o.after)?pD(t,{from:n.addDays(o.after,1),to:n.addDays(o.before,-1)},n):ao(t.from,o,n)||ao(t.to,o,n):rU(o)||sU(o)?ao(t.from,o,n)||ao(t.to,o,n):!1))return!0;const a=r.filter(o=>typeof o=="function");if(a.length){let o=t.from;const c=n.differenceInCalendarDays(t.to,t.from);for(let h=0;h<=c;h++){if(a.some(f=>f(o)))return!0;o=n.addDays(o,1)}}return!1}function W7e(t,e){const{disabled:n,excludeDisabled:r,selected:s,required:i,onSelect:a}=t,[o,c]=qy(s,a?s:void 0),h=a?s:o;return{selected:h,select:(g,x,y)=>{const{min:w,max:S}=t,k=g?H7e(g,h,w,S,i,e):void 0;return r&&n&&k?.from&&k.to&&U7e({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=>h&&io(h,g,!1,e)}}function G7e(t,e){const{selected:n,required:r,onSelect:s}=t,[i,a]=qy(n,s?n:void 0),o=s?n:i,{isSameDay:c}=e;return{selected:o,select:(m,g,x)=>{let y=m;return!r&&o&&o&&c(m,o)&&(y=void 0),s||a(y),s?.(y,m,g,x),y},isSelected:m=>o?c(o,m):!1}}function X7e(t,e){const n=G7e(t,e),r=Q7e(t,e),s=W7e(t,e);switch(t.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function Y7e(t){let e=t;e.timeZone&&(e={...t},e.today&&(e.today=new ks(e.today,e.timeZone)),e.month&&(e.month=new ks(e.month,e.timeZone)),e.defaultMonth&&(e.defaultMonth=new ks(e.defaultMonth,e.timeZone)),e.startMonth&&(e.startMonth=new ks(e.startMonth,e.timeZone)),e.endMonth&&(e.endMonth=new ks(e.endMonth,e.timeZone)),e.mode==="single"&&e.selected?e.selected=new ks(e.selected,e.timeZone):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(ft=>new ks(ft,e.timeZone)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?new ks(e.selected.from,e.timeZone):void 0,to:e.selected.to?new ks(e.selected.to,e.timeZone):void 0}));const{components:n,formatters:r,labels:s,dateLib:i,locale:a,classNames:o}=b.useMemo(()=>{const ft={...EO,...e.locale};return{dateLib:new zi({locale:ft,weekStartsOn:e.broadcastCalendar?1:e.weekStartsOn,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},e.dateLib),components:e7e(e.components),formatters:u7e(e.formatters),labels:{...N7e,...e.labels},locale:ft,classNames:{...MO(),...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:h,navLayout:f,numberOfMonths:m=1,onDayBlur:g,onDayClick:x,onDayFocus:y,onDayKeyDown:w,onDayMouseEnter:S,onDayMouseLeave:k,onNextClick:N,onPrevClick:C,showWeekNumber:T,styles:_}=e,{formatCaption:E,formatDay:M,formatMonthDropdown:L,formatWeekNumber:P,formatWeekNumberHeader:I,formatWeekdayName:Q,formatYearDropdown:U}=r,ee=B7e(e,i),{days:z,months:H,navStart:B,navEnd:X,previousMonth:J,nextMonth:G,goToMonth:R}=ee,se=ZNe(z,e,B,X,i),{isSelected:W,select:F,selected:V}=X7e(e,i)??{},{blur:te,focused:ne,isFocusTarget:K,moveFocus:ie,setFocused:re}=$7e(e,ee,se,W??(()=>!1),i),{labelDayButton:ae,labelGridcell:_e,labelGrid:Ue,labelMonthDropdown:Xe,labelNav:Ze,labelPrevious:Oe,labelNext:He,labelWeekday:Ve,labelWeekNumber:Be,labelWeekNumberHeader:ut,labelYearDropdown:rt}=s,rn=b.useMemo(()=>f7e(i,e.ISOWeek),[i,e.ISOWeek]),Rn=h!==void 0||x!==void 0,Tn=b.useCallback(()=>{J&&(R(J),C?.(J))},[J,R,C]),Mt=b.useCallback(()=>{G&&(R(G),N?.(G))},[R,G,N]),vt=b.useCallback((ft,mn)=>gt=>{gt.preventDefault(),gt.stopPropagation(),re(ft),F?.(ft.date,mn,gt),x?.(ft.date,mn,gt)},[F,x,re]),Ce=b.useCallback((ft,mn)=>gt=>{re(ft),y?.(ft.date,mn,gt)},[y,re]),Le=b.useCallback((ft,mn)=>gt=>{te(),g?.(ft.date,mn,gt)},[te,g]),Ge=b.useCallback((ft,mn)=>gt=>{const Nt={ArrowLeft:[gt.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[gt.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[gt.shiftKey?"year":"week","after"],ArrowUp:[gt.shiftKey?"year":"week","before"],PageUp:[gt.shiftKey?"year":"month","before"],PageDown:[gt.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Nt[gt.key]){gt.preventDefault(),gt.stopPropagation();const[Ot,it]=Nt[gt.key];ie(Ot,it)}w?.(ft.date,mn,gt)},[ie,w,e.dir]),lt=b.useCallback((ft,mn)=>gt=>{S?.(ft.date,mn,gt)},[S]),jt=b.useCallback((ft,mn)=>gt=>{k?.(ft.date,mn,gt)},[k]),Tt=b.useCallback(ft=>mn=>{const gt=Number(mn.target.value),Nt=i.setMonth(i.startOfMonth(ft),gt);R(Nt)},[i,R]),ke=b.useCallback(ft=>mn=>{const gt=Number(mn.target.value),Nt=i.setYear(i.startOfMonth(ft),gt);R(Nt)},[i,R]),{className:Te,style:qe}=b.useMemo(()=>({className:[o[yt.Root],e.className].filter(Boolean).join(" "),style:{..._?.[yt.Root],...e.style}}),[o,e.className,e.style,_]),Rt=t7e(e),At=b.useRef(null);_7e(At,!!e.animate,{classNames:o,months:H,focused:ne,dateLib:i});const vr={dayPickerProps:e,selected:V,select:F,isSelected:W,months:H,nextMonth:G,previousMonth:J,goToMonth:R,getModifiers:se,components:n,classNames:o,styles:_,labels:s,formatters:r};return he.createElement(tU.Provider,{value:vr},he.createElement(n.Root,{rootRef:e.animate?At:void 0,className:Te,style:qe,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"],...Rt},he.createElement(n.Months,{className:o[yt.Months],style:_?.[yt.Months]},!e.hideNavigation&&!f&&he.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:o[yt.Nav],style:_?.[yt.Nav],"aria-label":Ze(),onPreviousClick:Tn,onNextClick:Mt,previousMonth:J,nextMonth:G}),H.map((ft,mn)=>he.createElement(n.Month,{"data-animated-month":e.animate?"true":void 0,className:o[yt.Month],style:_?.[yt.Month],key:mn,displayIndex:mn,calendarMonth:ft},f==="around"&&!e.hideNavigation&&mn===0&&he.createElement(n.PreviousMonthButton,{type:"button",className:o[yt.PreviousMonthButton],tabIndex:J?void 0:-1,"aria-disabled":J?void 0:!0,"aria-label":Oe(J),onClick:Tn,"data-animated-button":e.animate?"true":void 0},he.createElement(n.Chevron,{disabled:J?void 0:!0,className:o[yt.Chevron],orientation:e.dir==="rtl"?"right":"left"})),he.createElement(n.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:o[yt.MonthCaption],style:_?.[yt.MonthCaption],calendarMonth:ft,displayIndex:mn},c?.startsWith("dropdown")?he.createElement(n.DropdownNav,{className:o[yt.Dropdowns],style:_?.[yt.Dropdowns]},(()=>{const gt=c==="dropdown"||c==="dropdown-months"?he.createElement(n.MonthsDropdown,{key:"month",className:o[yt.MonthsDropdown],"aria-label":Xe(),classNames:o,components:n,disabled:!!e.disableNavigation,onChange:Tt(ft.date),options:d7e(ft.date,B,X,r,i),style:_?.[yt.Dropdown],value:i.getMonth(ft.date)}):he.createElement("span",{key:"month"},L(ft.date,i)),Nt=c==="dropdown"||c==="dropdown-years"?he.createElement(n.YearsDropdown,{key:"year",className:o[yt.YearsDropdown],"aria-label":rt(i.options),classNames:o,components:n,disabled:!!e.disableNavigation,onChange:ke(ft.date),options:m7e(B,X,r,i,!!e.reverseYears),style:_?.[yt.Dropdown],value:i.getYear(ft.date)}):he.createElement("span",{key:"year"},U(ft.date,i));return i.getMonthYearOrder()==="year-first"?[Nt,gt]:[gt,Nt]})(),he.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},E(ft.date,i.options,i))):he.createElement(n.CaptionLabel,{className:o[yt.CaptionLabel],role:"status","aria-live":"polite"},E(ft.date,i.options,i))),f==="around"&&!e.hideNavigation&&mn===m-1&&he.createElement(n.NextMonthButton,{type:"button",className:o[yt.NextMonthButton],tabIndex:G?void 0:-1,"aria-disabled":G?void 0:!0,"aria-label":He(G),onClick:Mt,"data-animated-button":e.animate?"true":void 0},he.createElement(n.Chevron,{disabled:G?void 0:!0,className:o[yt.Chevron],orientation:e.dir==="rtl"?"left":"right"})),mn===m-1&&f==="after"&&!e.hideNavigation&&he.createElement(n.Nav,{"data-animated-nav":e.animate?"true":void 0,className:o[yt.Nav],style:_?.[yt.Nav],"aria-label":Ze(),onPreviousClick:Tn,onNextClick:Mt,previousMonth:J,nextMonth:G}),he.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":h==="multiple"||h==="range","aria-label":Ue(ft.date,i.options,i)||void 0,className:o[yt.MonthGrid],style:_?.[yt.MonthGrid]},!e.hideWeekdays&&he.createElement(n.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:o[yt.Weekdays],style:_?.[yt.Weekdays]},T&&he.createElement(n.WeekNumberHeader,{"aria-label":ut(i.options),className:o[yt.WeekNumberHeader],style:_?.[yt.WeekNumberHeader],scope:"col"},I()),rn.map(gt=>he.createElement(n.Weekday,{"aria-label":Ve(gt,i.options,i),className:o[yt.Weekday],key:String(gt),style:_?.[yt.Weekday],scope:"col"},Q(gt,i.options,i)))),he.createElement(n.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:o[yt.Weeks],style:_?.[yt.Weeks]},ft.weeks.map(gt=>he.createElement(n.Week,{className:o[yt.Week],key:gt.weekNumber,style:_?.[yt.Week],week:gt},T&&he.createElement(n.WeekNumber,{week:gt,style:_?.[yt.WeekNumber],"aria-label":Be(gt.weekNumber,{locale:a}),className:o[yt.WeekNumber],scope:"row",role:"rowheader"},P(gt.weekNumber,i)),gt.days.map(Nt=>{const{date:Ot}=Nt,it=se(Nt);if(it[mr.focused]=!it.hidden&&!!ne?.isEqualTo(Nt),it[ja.selected]=W?.(Ot)||it.selected,_O(V)){const{from:ge,to:ze}=V;it[ja.range_start]=!!(ge&&ze&&i.isSameDay(Ot,ge)),it[ja.range_end]=!!(ge&&ze&&i.isSameDay(Ot,ze)),it[ja.range_middle]=io(V,Ot,!0,i)}const Vn=h7e(it,_,e.modifiersStyles),jr=JNe(it,o,e.modifiersClassNames),Or=!Rn&&!it.hidden?_e(Ot,it,i.options,i):void 0;return he.createElement(n.Day,{key:`${i.format(Ot,"yyyy-MM-dd")}_${i.format(Nt.displayMonth,"yyyy-MM")}`,day:Nt,modifiers:it,className:jr.join(" "),style:Vn,role:"gridcell","aria-selected":it.selected||void 0,"aria-label":Or,"data-day":i.format(Ot,"yyyy-MM-dd"),"data-month":Nt.outside?i.format(Ot,"yyyy-MM"):void 0,"data-selected":it.selected||void 0,"data-disabled":it.disabled||void 0,"data-hidden":it.hidden||void 0,"data-outside":Nt.outside||void 0,"data-focused":it.focused||void 0,"data-today":it.today||void 0},!it.hidden&&Rn?he.createElement(n.DayButton,{className:o[yt.DayButton],style:_?.[yt.DayButton],type:"button",day:Nt,modifiers:it,disabled:it.disabled||void 0,tabIndex:K(Nt)?0:-1,"aria-label":ae(Ot,it,i.options,i),onClick:vt(Nt,it),onBlur:Le(Nt,it),onFocus:Ce(Nt,it),onKeyDown:Ge(Nt,it),onMouseEnter:lt(Nt,it),onMouseLeave:jt(Nt,it)},M(Ot,i.options,i)):!it.hidden&&M(Nt.date,i.options,i))})))))))),e.footer&&he.createElement(n.Footer,{className:o[yt.Footer],style:_?.[yt.Footer],role:"status","aria-live":"polite"},e.footer)))}function gD({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:i,components:a,...o}){const c=MO();return l.jsx(Y7e,{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:h=>h.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(Hm({variant:s}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:ve(Hm({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:h,rootRef:f,...m})=>l.jsx("div",{"data-slot":"calendar",ref:f,className:ve(h),...m}),Chevron:({className:h,orientation:f,...m})=>f==="left"?l.jsx($u,{className:ve("size-4",h),...m}):f==="right"?l.jsx(Qu,{className:ve("size-4",h),...m}):l.jsx(Tu,{className:ve("size-4",h),...m}),DayButton:K7e,WeekNumber:({children:h,...f})=>l.jsx("td",{...f,children:l.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:h})}),...a},...o})}function K7e({className:t,day:e,modifiers:n,...r}){const s=MO(),i=b.useRef(null);return b.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),l.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: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 Z7e{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 Ud=new Z7e;typeof window<"u"&&Ud.connect();const J7e={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}} 年"}},e8e=(t,e,n)=>{let r;const s=J7e[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},t8e={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},n8e={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},r8e={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},s8e={date:fh({formats:t8e,defaultWidth:"full"}),time:fh({formats:n8e,defaultWidth:"full"}),dateTime:fh({formats:r8e,defaultWidth:"full"})};function xD(t,e,n){const r="eeee p";return pNe(t,e,n)?r:t.getTime()>e.getTime()?"'下个'"+r:"'上个'"+r}const i8e={lastWeek:xD,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:xD,other:"PP p"},a8e=(t,e,n,r)=>{const s=i8e[t];return typeof s=="function"?s(e,n,r):s},l8e={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},o8e={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},c8e={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},u8e={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},d8e={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:"夜间"}},h8e={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:"夜间"}},f8e=(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()}},m8e={ordinalNumber:f8e,era:el({values:l8e,defaultWidth:"wide"}),quarter:el({values:o8e,defaultWidth:"wide",argumentCallback:t=>t-1}),month:el({values:c8e,defaultWidth:"wide"}),day:el({values:u8e,defaultWidth:"wide"}),dayPeriod:el({values:d8e,defaultWidth:"wide",formattingValues:h8e,defaultFormattingWidth:"wide"})},p8e=/^(第\s*)?\d+(日|时|分|秒)?/i,g8e=/\d+/i,x8e={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},v8e={any:[/^(前)/i,/^(公元)/i]},y8e={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},b8e={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},w8e={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},S8e={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]},k8e={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},j8e={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},O8e={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},N8e={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},C8e={ordinalNumber:GV({matchPattern:p8e,parsePattern:g8e,valueCallback:t=>parseInt(t,10)}),era:tl({matchPatterns:x8e,defaultMatchWidth:"wide",parsePatterns:v8e,defaultParseWidth:"any"}),quarter:tl({matchPatterns:y8e,defaultMatchWidth:"wide",parsePatterns:b8e,defaultParseWidth:"any",valueCallback:t=>t+1}),month:tl({matchPatterns:w8e,defaultMatchWidth:"wide",parsePatterns:S8e,defaultParseWidth:"any"}),day:tl({matchPatterns:k8e,defaultMatchWidth:"wide",parsePatterns:j8e,defaultParseWidth:"any"}),dayPeriod:tl({matchPatterns:O8e,defaultMatchWidth:"any",parsePatterns:N8e,defaultParseWidth:"any"})},Hx={code:"zh-CN",formatDistance:e8e,formatLong:s8e,formatRelative:a8e,localize:m8e,match:C8e,options:{weekStartsOn:1,firstWeekContainsDate:4}},Vx={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 T8e(){const[t,e]=b.useState([]),[n,r]=b.useState(""),[s,i]=b.useState("all"),[a,o]=b.useState("all"),[c,h]=b.useState(void 0),[f,m]=b.useState(void 0),[g,x]=b.useState(!0),[y,w]=b.useState(!1),[S,k]=b.useState("xs"),[N,C]=b.useState(4),T=b.useRef(null);b.useEffect(()=>{const B=Ud.getAllLogs();e(B);const X=Ud.onLog(()=>{e(Ud.getAllLogs())}),J=Ud.onConnectionChange(G=>{w(G)});return()=>{X(),J()}},[]);const _=b.useMemo(()=>{const B=new Set(t.map(X=>X.module));return Array.from(B).sort()},[t]),E=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"}},L=()=>{window.location.reload()},P=()=>{Ud.clearLogs(),e([])},I=()=>{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-${j1(new Date,"yyyy-MM-dd-HHmmss")}.txt`,G.click(),URL.revokeObjectURL(J)},Q=()=>{x(!g)},U=()=>{h(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||f){const se=new Date(B.timestamp);if(c){const W=new Date(c);W.setHours(0,0,0,0),R=R&&se>=W}if(f){const W=new Date(f);W.setHours(23,59,59,999),R=R&&se<=W}}return X&&J&&G&&R}),[t,n,s,a,c,f]),z=Vx[S].rowHeight+N,H=Xje({count:ee.length,getScrollElement:()=>T.current,estimateSize:()=>z,overscan:15});return b.useEffect(()=>{g&&ee.length>0&&H.scrollToIndex(ee.length-1,{align:"end",behavior:"auto"})},[ee.length,g,H]),l.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex-shrink-0 space-y-4 p-3 sm:p-4 lg:p-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl sm:text-2xl lg:text-3xl font-bold",children:"日志查看器"}),l.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.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")}),l.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:y?"已连接":"未连接"})]})]}),l.jsx(Dt,{className:"p-3 sm:p-4",children:l.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[l.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:gap-4",children:[l.jsxs("div",{className:"flex-1 relative",children:[l.jsx(ci,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(Pe,{placeholder:"搜索日志...",value:n,onChange:B=>r(B.target.value),className:"pl-9 h-9 text-sm"})]}),l.jsxs(qt,{value:s,onValueChange:i,children:[l.jsxs(It,{className:"w-full sm:w-[140px] lg:w-[180px] h-9 text-sm",children:[l.jsx(P3,{className:"h-4 w-4 mr-2"}),l.jsx(Ft,{placeholder:"级别"})]}),l.jsxs(Bt,{children:[l.jsx(De,{value:"all",children:"全部级别"}),l.jsx(De,{value:"DEBUG",children:"DEBUG"}),l.jsx(De,{value:"INFO",children:"INFO"}),l.jsx(De,{value:"WARNING",children:"WARNING"}),l.jsx(De,{value:"ERROR",children:"ERROR"}),l.jsx(De,{value:"CRITICAL",children:"CRITICAL"})]})]}),l.jsxs(qt,{value:a,onValueChange:o,children:[l.jsxs(It,{className:"w-full sm:w-[160px] lg:w-[200px] h-9 text-sm",children:[l.jsx(P3,{className:"h-4 w-4 mr-2"}),l.jsx(Ft,{placeholder:"模块"})]}),l.jsxs(Bt,{children:[l.jsx(De,{value:"all",children:"全部模块"}),_.map(B=>l.jsx(De,{value:B,children:B},B))]})]})]}),l.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:gap-4",children:[l.jsxs(ul,{children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{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:[l.jsx(BC,{className:"mr-2 h-4 w-4"}),l.jsx("span",{className:"text-xs sm:text-sm",children:c?j1(c,"PPP",{locale:Hx}):"开始日期"})]})}),l.jsx(Ea,{className:"w-auto p-0",align:"start",children:l.jsx(gD,{mode:"single",selected:c,onSelect:h,initialFocus:!0,locale:Hx})})]}),l.jsxs(ul,{children:[l.jsx(dl,{asChild:!0,children:l.jsxs(de,{variant:"outline",size:"sm",className:ve("w-full sm:w-[200px] lg:w-[240px] justify-start text-left font-normal h-9",!f&&"text-muted-foreground"),children:[l.jsx(BC,{className:"mr-2 h-4 w-4"}),l.jsx("span",{className:"text-xs sm:text-sm",children:f?j1(f,"PPP",{locale:Hx}):"结束日期"})]})}),l.jsx(Ea,{className:"w-auto p-0",align:"start",children:l.jsx(gD,{mode:"single",selected:f,onSelect:m,initialFocus:!0,locale:Hx})})]}),(c||f)&&l.jsxs(de,{variant:"outline",size:"sm",onClick:U,className:"w-full sm:w-auto h-9",children:[l.jsx(P0,{className:"h-4 w-4 sm:mr-2"}),l.jsx("span",{className:"hidden sm:inline text-sm",children:"清除时间筛选"}),l.jsx("span",{className:"sm:hidden text-sm",children:"清除"})]})]}),l.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[l.jsxs("div",{className:"flex gap-2 flex-wrap",children:[l.jsxs(de,{variant:g?"default":"outline",size:"sm",onClick:Q,className:"flex-1 sm:flex-none h-9",children:[g?l.jsx(UK,{className:"h-4 w-4"}):l.jsx(WK,{className:"h-4 w-4"}),l.jsx("span",{className:"ml-2 text-sm",children:g?"自动滚动":"已暂停"})]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:L,className:"flex-1 sm:flex-none h-9",children:[l.jsx(Ls,{className:"h-4 w-4"}),l.jsx("span",{className:"ml-2 text-sm",children:"刷新"})]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:P,className:"flex-1 sm:flex-none h-9",children:[l.jsx(fn,{className:"h-4 w-4"}),l.jsx("span",{className:"ml-2 text-sm",children:"清空"})]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:I,className:"flex-1 sm:flex-none h-9",children:[l.jsx(Su,{className:"h-4 w-4"}),l.jsx("span",{className:"ml-2 text-sm",children:"导出"})]})]}),l.jsx("div",{className:"flex-1 hidden sm:block"}),l.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground flex items-center justify-center sm:justify-end",children:[l.jsxs("span",{className:"font-mono",children:[ee.length," / ",t.length]}),l.jsx("span",{className:"ml-1",children:"条日志"})]})]}),l.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:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[l.jsx(GK,{className:"h-4 w-4"}),l.jsx("span",{children:"字号"})]}),l.jsx("div",{className:"flex gap-1",children:Object.keys(Vx).map(B=>l.jsx(de,{variant:S===B?"default":"outline",size:"sm",onClick:()=>k(B),className:"h-7 px-3 text-xs",children:Vx[B].label},B))})]}),l.jsxs("div",{className:"flex items-center gap-3 flex-1 max-w-xs",children:[l.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:"行距"}),l.jsx(V0,{value:[N],onValueChange:([B])=>C(B),min:0,max:12,step:2,className:"flex-1"}),l.jsxs("span",{className:"text-xs text-muted-foreground w-8",children:[N,"px"]})]})]})]})})]}),l.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:l.jsx(Dt,{className:"bg-black dark:bg-gray-950 border-gray-800 dark:border-gray-900 h-full",children:l.jsx(hn,{viewportRef:T,className:"h-full",children:l.jsx("div",{className:ve("p-2 sm:p-3 font-mono relative",Vx[S].class),style:{height:`${H.getTotalSize()}px`},children:ee.length===0?l.jsx("div",{className:"text-gray-500 dark:text-gray-600 text-center py-8 text-sm",children:"暂无日志数据"}):H.getVirtualItems().map(B=>{const X=ee[B.index];return l.jsxs("div",{"data-index":B.index,ref:H.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:`${N/2}px`,paddingBottom:`${N/2}px`},children:[l.jsxs("div",{className:"flex flex-col gap-0.5 sm:hidden",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-gray-500 dark:text-gray-600",children:X.timestamp}),l.jsxs("span",{className:ve("font-semibold",E(X.level)),children:["[",X.level,"]"]})]}),l.jsx("div",{className:"text-cyan-400 dark:text-cyan-500 truncate",children:X.module}),l.jsx("div",{className:"text-gray-300 dark:text-gray-400 whitespace-pre-wrap break-words",children:X.message})]}),l.jsxs("div",{className:"hidden sm:flex gap-2 items-start",children:[l.jsx("span",{className:"text-gray-500 dark:text-gray-600 flex-shrink-0 w-[130px] lg:w-[160px]",children:X.timestamp}),l.jsxs("span",{className:ve("flex-shrink-0 w-[65px] lg:w-[75px] font-semibold",E(X.level)),children:["[",X.level,"]"]}),l.jsx("span",{className:"text-cyan-400 dark:text-cyan-500 flex-shrink-0 w-[100px] lg:w-[130px] truncate",children:X.module}),l.jsx("span",{className:"text-gray-300 dark:text-gray-400 flex-1 whitespace-pre-wrap break-words",children:X.message})]})]},B.key)})})})})})]})}const E8e="Mai-with-u",_8e="plugin-repo",M8e="main",A8e="plugin_details.json";async function R8e(){try{const t=await pt("/api/webui/plugins/fetch-raw",{method:"POST",headers:Ct(),body:JSON.stringify({owner:E8e,repo:_8e,branch:M8e,file_path:A8e})});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 D8e(){try{const t=await pt("/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 z8e(){try{const t=await pt("/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 P8e(t,e,n){const r=t.split(".").map(o=>parseInt(o)||0),s=r[0]||0,i=r[1]||0,a=r[2]||0;if(n.version_majorparseInt(m)||0),c=o[0]||0,h=o[1]||0,f=o[2]||0;if(n.version_major>c||n.version_major===c&&n.version_minor>h||n.version_major===c&&n.version_minor===h&&n.version_patch>f)return!1}return!0}function L8e(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 Ux(){try{const t=await pt("/api/webui/plugins/installed",{headers:Ct()});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 Wx(t,e){return e.some(n=>n.id===t)}function Gx(t,e){const n=e.find(r=>r.id===t);if(n)return n.manifest?.version||n.version}async function I8e(t,e,n="main"){const r=await pt("/api/webui/plugins/install",{method:"POST",headers:Ct(),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 B8e(t){const e=await pt("/api/webui/plugins/uninstall",{method:"POST",headers:Ct(),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 q8e(t,e,n="main"){const r=await pt("/api/webui/plugins/update",{method:"POST",headers:Ct(),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 wp="https://maibot-plugin-stats.maibot-webui.workers.dev";async function hU(t){try{const e=await fetch(`${wp}/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 F8e(t,e){try{const n=e||AO(),r=await fetch(`${wp}/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 $8e(t,e){try{const n=e||AO(),r=await fetch(`${wp}/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 Q8e(t,e,n,r){if(e<1||e>5)return{success:!1,error:"评分必须在 1-5 之间"};try{const s=r||AO(),i=await fetch(`${wp}/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 H8e(t){try{const e=await fetch(`${wp}/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 V8e(){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 hU(t);k&&r(k),i(!1)};b.useEffect(()=>{x()},[t]);const y=async()=>{const k=await F8e(t);k.success?(g({title:"已点赞",description:"感谢你的支持!"}),x()):g({title:"点赞失败",description:k.error||"未知错误",variant:"destructive"})},w=async()=>{const k=await $8e(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 Q8e(t,a,c||void 0);k.success?(g({title:"评分成功",description:"感谢你的评价!"}),m(!1),o(0),h(""),x()):g({title:"评分失败",description:k.error||"未知错误",variant:"destructive"})};return s?l.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Su,{className:"h-4 w-4"}),l.jsx("span",{children:"-"})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(sc,{className:"h-4 w-4"}),l.jsx("span",{children:"-"})]})]}):n?e?l.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-1",title:`下载量: ${n.downloads.toLocaleString()}`,children:[l.jsx(Su,{className:"h-4 w-4"}),l.jsx("span",{children:n.downloads.toLocaleString()})]}),l.jsxs("div",{className:"flex items-center gap-1",title:`评分: ${n.rating.toFixed(1)} (${n.rating_count} 条评价)`,children:[l.jsx(sc,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),l.jsx("span",{children:n.rating.toFixed(1)})]}),l.jsxs("div",{className:"flex items-center gap-1",title:`点赞数: ${n.likes}`,children:[l.jsx(rw,{className:"h-4 w-4"}),l.jsx("span",{children:n.likes})]})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[l.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[l.jsx(Su,{className:"h-5 w-5 text-muted-foreground mb-1"}),l.jsx("span",{className:"text-2xl font-bold",children:n.downloads.toLocaleString()}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"下载量"})]}),l.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[l.jsx(sc,{className:"h-5 w-5 text-yellow-400 mb-1 fill-yellow-400"}),l.jsx("span",{className:"text-2xl font-bold",children:n.rating.toFixed(1)}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.rating_count," 条评价"]})]}),l.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[l.jsx(rw,{className:"h-5 w-5 text-green-500 mb-1"}),l.jsx("span",{className:"text-2xl font-bold",children:n.likes}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"点赞"})]}),l.jsxs("div",{className:"flex flex-col items-center p-3 rounded-lg border bg-card",children:[l.jsx(qC,{className:"h-5 w-5 text-red-500 mb-1"}),l.jsx("span",{className:"text-2xl font-bold",children:n.dislikes}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"点踩"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(de,{variant:"outline",size:"sm",onClick:y,children:[l.jsx(rw,{className:"h-4 w-4 mr-1"}),"点赞"]}),l.jsxs(de,{variant:"outline",size:"sm",onClick:w,children:[l.jsx(qC,{className:"h-4 w-4 mr-1"}),"点踩"]}),l.jsxs(xr,{open:f,onOpenChange:m,children:[l.jsx(Bh,{asChild:!0,children:l.jsxs(de,{variant:"default",size:"sm",children:[l.jsx(sc,{className:"h-4 w-4 mr-1"}),"评分"]})}),l.jsxs(lr,{children:[l.jsxs(or,{children:[l.jsx(cr,{children:"为插件评分"}),l.jsx(Hr,{children:"分享你的使用体验,帮助其他用户"})]}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsxs("div",{className:"flex flex-col items-center gap-2",children:[l.jsx("div",{className:"flex gap-2",children:[1,2,3,4,5].map(k=>l.jsx("button",{onClick:()=>o(k),className:"focus:outline-none",children:l.jsx(sc,{className:`h-8 w-8 transition-colors ${k<=a?"fill-yellow-400 text-yellow-400":"text-muted-foreground hover:text-yellow-300"}`})},k))}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:[a===0&&"点击星星进行评分",a===1&&"很差",a===2&&"一般",a===3&&"还行",a===4&&"不错",a===5&&"非常好"]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium mb-2 block",children:"评论(可选)"}),l.jsx(pr,{value:c,onChange:k=>h(k.target.value),placeholder:"分享你的使用体验...",rows:4,maxLength:500}),l.jsxs("div",{className:"text-xs text-muted-foreground mt-1 text-right",children:[c.length," / 500"]})]})]}),l.jsxs(as,{children:[l.jsx(de,{variant:"outline",onClick:()=>m(!1),children:"取消"}),l.jsx(de,{onClick:S,disabled:a===0,children:"提交评分"})]})]})]})]}),n.recent_ratings&&n.recent_ratings.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-sm font-semibold",children:"最近评价"}),l.jsx("div",{className:"space-y-3",children:n.recent_ratings.map((k,N)=>l.jsxs("div",{className:"p-3 rounded-lg border bg-muted/50",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(C=>l.jsx(sc,{className:`h-3 w-3 ${C<=k.rating?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`},C))}),l.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(k.created_at).toLocaleDateString()})]}),k.comment&&l.jsx("p",{className:"text-sm text-muted-foreground",children:k.comment})]},N))})]})]}):null}const vD={"Group Management":"群组管理","Entertainment & Interaction":"娱乐互动","Utility Tools":"实用工具","Content Generation":"内容生成",Multimedia:"多媒体","External Integration":"外部集成","Data Analysis & Insights":"数据分析与洞察",Other:"其他"};function W8e(){const t=Da(),[e,n]=b.useState(null),[r,s]=b.useState(""),[i,a]=b.useState("all"),[o,c]=b.useState("all"),[h,f]=b.useState(!0),[m,g]=b.useState([]),[x,y]=b.useState(!0),[w,S]=b.useState(null),[k,N]=b.useState(null),[C,T]=b.useState(null),[_,E]=b.useState(null),[,M]=b.useState([]),[L,P]=b.useState({}),{toast:I}=ts(),Q=async R=>{const se=R.map(async V=>{try{const te=await hU(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(se),F={};W.forEach(({id:V,stats:te})=>{te&&(F[V]=te)}),P(F)};b.useEffect(()=>{let R=null,se=!1;return(async()=>{if(R=L8e(F=>{se||(T(F),F.stage==="success"?setTimeout(()=>{se||T(null)},2e3):F.stage==="error"&&(y(!1),S(F.error||"加载失败")))},F=>{console.error("WebSocket error:",F),se||I({title:"WebSocket 连接失败",description:"无法实时显示加载进度",variant:"destructive"})}),await new Promise(F=>{if(!R){F();return}const V=()=>{R&&R.readyState===WebSocket.OPEN?(console.log("WebSocket connected, starting to load plugins"),F()):R&&R.readyState===WebSocket.CLOSED?(console.warn("WebSocket closed before loading plugins"),F()):setTimeout(V,100)};V()}),!se){const F=await D8e();N(F),F.installed||I({title:"Git 未安装",description:F.error||"请先安装 Git 才能使用插件安装功能",variant:"destructive"})}if(!se){const F=await z8e();E(F)}if(!se)try{y(!0),S(null);const F=await R8e();if(!se){const V=await Ux();M(V);const te=F.map(ne=>{const K=Wx(ne.id,V),ie=Gx(ne.id,V);return{...ne,installed:K,installed_version:ie}});for(const ne of V)!te.some(ie=>ie.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),Q(te)}}catch(F){if(!se){const V=F instanceof Error?F.message:"加载插件列表失败";S(V),I({title:"加载失败",description:V,variant:"destructive"})}}finally{se||y(!1)}})(),()=>{se=!0,R&&R.close()}},[I]);const U=R=>{if(!R.installed&&_&&!ee(R))return l.jsxs(In,{variant:"destructive",className:"gap-1",children:[l.jsx(Cu,{className:"h-3 w-3"}),"不兼容"]});if(R.installed){const se=R.installed_version?.trim(),W=R.manifest.version?.trim();if(se!==W){const F=se?.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)>(F[te]||0))return l.jsxs(In,{variant:"outline",className:"gap-1 text-orange-600 border-orange-600",children:[l.jsx(Cu,{className:"h-3 w-3"}),"可更新"]});if((V[te]||0)<(F[te]||0))break}}return l.jsxs(In,{variant:"default",className:"gap-1",children:[l.jsx(xc,{className:"h-3 w-3"}),"已安装"]})}return null},ee=R=>!_||!R.manifest?.host_application?!0:P8e(R.manifest.host_application.min_version,R.manifest.host_application.max_version,_),z=R=>{if(!R.installed||!R.installed_version||!R.manifest?.version)return!1;const se=R.installed_version.trim(),W=R.manifest.version.trim();if(se===W)return!1;const F=se.split(".").map(Number),V=W.split(".").map(Number);for(let te=0;te<3;te++){if((V[te]||0)>(F[te]||0))return!0;if((V[te]||0)<(F[te]||0))return!1}return!1},H=m.filter(R=>{if(!R.manifest)return console.warn("[过滤] 跳过无 manifest 的插件:",R.id),!1;const se=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 F=!0;o==="installed"?F=R.installed===!0:o==="updates"&&(F=R.installed===!0&&z(R));const V=!h||!_||ee(R);return se&&W&&F&&V}),B=()=>{n(null)},X=async R=>{if(!k?.installed){I({title:"无法安装",description:"Git 未安装",variant:"destructive"});return}if(_&&!ee(R)){I({title:"无法安装",description:"插件与当前麦麦版本不兼容",variant:"destructive"});return}try{await I8e(R.id,R.manifest.repository_url||"","main"),H8e(R.id).catch(W=>{console.warn("Failed to record download:",W)}),I({title:"安装成功",description:`${R.manifest.name} 已成功安装`});const se=await Ux();M(se),g(W=>W.map(F=>{if(F.id===R.id){const V=Wx(F.id,se),te=Gx(F.id,se);return{...F,installed:V,installed_version:te}}return F}))}catch(se){I({title:"安装失败",description:se instanceof Error?se.message:"未知错误",variant:"destructive"})}},J=async R=>{try{await B8e(R.id),I({title:"卸载成功",description:`${R.manifest.name} 已成功卸载`});const se=await Ux();M(se),g(W=>W.map(F=>{if(F.id===R.id){const V=Wx(F.id,se),te=Gx(F.id,se);return{...F,installed:V,installed_version:te}}return F}))}catch(se){I({title:"卸载失败",description:se instanceof Error?se.message:"未知错误",variant:"destructive"})}},G=async R=>{if(!k?.installed){I({title:"无法更新",description:"Git 未安装",variant:"destructive"});return}try{const se=await q8e(R.id,R.manifest.repository_url||"","main");I({title:"更新成功",description:`${R.manifest.name} 已从 ${se.old_version} 更新到 ${se.new_version}`});const W=await Ux();M(W),g(F=>F.map(V=>{if(V.id===R.id){const te=Wx(V.id,W),ne=Gx(V.id,W);return{...V,installed:te,installed_version:ne}}return V}))}catch(se){I({title:"更新失败",description:se instanceof Error?se.message:"未知错误",variant:"destructive"})}};return l.jsx(hn,{className:"h-full",children:l.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),l.jsx("p",{className:"text-muted-foreground mt-2",children:"浏览和管理麦麦的插件"})]}),l.jsxs(de,{onClick:()=>t({to:"/plugin-mirrors"}),children:[l.jsx(XK,{className:"h-4 w-4 mr-2"}),"配置镜像源"]})]}),k&&!k.installed&&l.jsxs(Dt,{className:"border-orange-600 bg-orange-50 dark:bg-orange-950/20",children:[l.jsx(kn,{children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Oa,{className:"h-5 w-5 text-orange-600"}),l.jsxs("div",{children:[l.jsx(jn,{className:"text-lg text-orange-900 dark:text-orange-100",children:"Git 未安装"}),l.jsx(Fr,{className:"text-orange-800 dark:text-orange-200",children:k.error||"请先安装 Git 才能使用插件安装功能"})]})]})}),l.jsx(Dn,{children:l.jsxs("p",{className:"text-sm text-orange-800 dark:text-orange-200",children:["您可以从 ",l.jsx("a",{href:"https://git-scm.com/downloads",target:"_blank",rel:"noopener noreferrer",className:"underline font-medium",children:"git-scm.com"})," 下载并安装 Git。 安装完成后,请重启麦麦应用。"]})})]}),l.jsx(Dt,{className:"p-4",children:l.jsxs("div",{className:"flex flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[l.jsxs("div",{className:"flex-1 relative",children:[l.jsx(ci,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),l.jsx(Pe,{placeholder:"搜索插件...",value:r,onChange:R=>s(R.target.value),className:"pl-9"})]}),l.jsxs(qt,{value:i,onValueChange:a,children:[l.jsx(It,{className:"w-full sm:w-[200px]",children:l.jsx(Ft,{placeholder:"选择分类"})}),l.jsxs(Bt,{children:[l.jsx(De,{value:"all",children:"全部分类"}),l.jsx(De,{value:"Group Management",children:"群组管理"}),l.jsx(De,{value:"Entertainment & Interaction",children:"娱乐互动"}),l.jsx(De,{value:"Utility Tools",children:"实用工具"}),l.jsx(De,{value:"Content Generation",children:"内容生成"}),l.jsx(De,{value:"Multimedia",children:"多媒体"}),l.jsx(De,{value:"External Integration",children:"外部集成"}),l.jsx(De,{value:"Data Analysis & Insights",children:"数据分析与洞察"}),l.jsx(De,{value:"Other",children:"其他"})]})]})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(li,{id:"compatible-only",checked:h,onCheckedChange:R=>f(R===!0)}),l.jsx("label",{htmlFor:"compatible-only",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:"只显示兼容当前版本的插件"})]})]})}),l.jsx(sa,{value:o,onValueChange:c,className:"w-full",children:l.jsxs(Mi,{className:"grid w-full grid-cols-3",children:[l.jsxs(zt,{value:"all",children:["全部插件 (",m.filter(R=>{if(!R.manifest)return!1;const se=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),F=!h||!_||ee(R);return se&&W&&F}).length,")"]}),l.jsxs(zt,{value:"installed",children:["已安装 (",m.filter(R=>{if(!R.manifest)return!1;const se=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),F=!h||!_||ee(R);return R.installed&&se&&W&&F}).length,")"]}),l.jsxs(zt,{value:"updates",children:["可更新 (",m.filter(R=>{if(!R.manifest)return!1;const se=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),F=!h||!_||ee(R);return R.installed&&z(R)&&se&&W&&F}).length,")"]})]})}),C&&C.stage==="loading"&&l.jsx(Dt,{className:"p-4",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(vc,{className:"h-4 w-4 animate-spin"}),l.jsxs("span",{className:"text-sm font-medium",children:[C.operation==="fetch"&&"加载插件列表",C.operation==="install"&&`安装插件${C.plugin_id?`: ${C.plugin_id}`:""}`,C.operation==="uninstall"&&`卸载插件${C.plugin_id?`: ${C.plugin_id}`:""}`,C.operation==="update"&&`更新插件${C.plugin_id?`: ${C.plugin_id}`:""}`]})]}),l.jsxs("span",{className:"text-sm font-medium",children:[C.progress,"%"]})]}),l.jsx(H0,{value:C.progress,className:"h-2"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:C.message}),C.operation==="fetch"&&C.total_plugins>0&&l.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["已加载 ",C.loaded_plugins," / ",C.total_plugins," 个插件"]})]})}),C&&C.stage==="error"&&C.error&&l.jsx(Dt,{className:"border-destructive bg-destructive/10",children:l.jsx(kn,{children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Oa,{className:"h-5 w-5 text-destructive"}),l.jsxs("div",{children:[l.jsx(jn,{className:"text-lg text-destructive",children:"加载失败"}),l.jsx(Fr,{className:"text-destructive/80",children:C.error})]})]})})}),x?l.jsxs("div",{className:"flex items-center justify-center py-12",children:[l.jsx(vc,{className:"h-8 w-8 animate-spin text-muted-foreground"}),l.jsx("span",{className:"ml-3 text-muted-foreground",children:"加载插件列表中..."})]}):w?l.jsx(Dt,{className:"p-6",children:l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx(Oa,{className:"h-12 w-12 text-destructive mb-4"}),l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:w}),l.jsx(de,{onClick:()=>window.location.reload(),children:"重新加载"})]})}):H.length===0?l.jsx(Dt,{className:"p-6",children:l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx(ci,{className:"h-12 w-12 text-muted-foreground mb-4"}),l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"未找到插件"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:r||i!=="all"?"尝试调整搜索条件或筛选器":"暂无可用插件"})]})}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:H.map(R=>l.jsxs(Dt,{className:"flex flex-col hover:shadow-lg transition-shadow h-full",children:[l.jsxs(kn,{children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsx(jn,{className:"text-xl",children:R.manifest?.name||R.id}),l.jsxs("div",{className:"flex flex-col gap-1",children:[R.manifest?.categories&&R.manifest.categories[0]&&l.jsx(In,{variant:"secondary",className:"text-xs whitespace-nowrap",children:vD[R.manifest.categories[0]]||R.manifest.categories[0]}),U(R)]})]}),l.jsx(Fr,{className:"line-clamp-2",children:R.manifest?.description||"无描述"})]}),l.jsx(Dn,{className:"flex-1",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Su,{className:"h-4 w-4"}),l.jsx("span",{children:(L[R.id]?.downloads??R.downloads??0).toLocaleString()})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(sc,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),l.jsx("span",{children:(L[R.id]?.rating??R.rating??0).toFixed(1)})]})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[R.manifest?.keywords&&R.manifest.keywords.slice(0,3).map(se=>l.jsx(In,{variant:"outline",className:"text-xs",children:se},se)),R.manifest?.keywords&&R.manifest.keywords.length>3&&l.jsxs(In,{variant:"outline",className:"text-xs",children:["+",R.manifest.keywords.length-3]})]}),l.jsxs("div",{className:"text-xs text-muted-foreground pt-2 border-t space-y-1",children:[l.jsxs("div",{children:["v",R.manifest?.version||"unknown"," · ",R.manifest?.author?.name||"Unknown"]}),R.manifest?.host_application&&l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{children:"支持:"}),l.jsxs("span",{className:"font-medium",children:[R.manifest.host_application.min_version,R.manifest.host_application.max_version?` - ${R.manifest.host_application.max_version}`:" - 最新版本"]})]})]})]})}),l.jsx(Gz,{className:"pt-4",children:l.jsxs("div",{className:"flex items-center justify-end gap-2 w-full",children:[l.jsx(de,{variant:"outline",size:"sm",onClick:()=>n(R),children:"查看详情"}),R.installed?z(R)?l.jsxs(de,{size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>G(R),children:[l.jsx(Ls,{className:"h-4 w-4 mr-1"}),"更新"]}):l.jsxs(de,{variant:"destructive",size:"sm",disabled:!k?.installed,title:k?.installed?void 0:"Git 未安装",onClick:()=>J(R),children:[l.jsx(fn,{className:"h-4 w-4 mr-1"}),"卸载"]}):l.jsxs(de,{size:"sm",disabled:!k?.installed||C?.operation==="install"||_!==null&&!ee(R),title:k?.installed?_!==null&&!ee(R)?`不兼容当前版本 (需要 ${R.manifest?.host_application?.min_version||"未知"}${R.manifest?.host_application?.max_version?` - ${R.manifest.host_application.max_version}`:"+"},当前 ${_?.version})`:void 0:"Git 未安装",onClick:()=>X(R),children:[l.jsx(Su,{className:"h-4 w-4 mr-1"}),C?.operation==="install"&&C?.plugin_id===R.id?"安装中...":"安装"]})]})})]},R.id))}),l.jsx(xr,{open:e!==null,onOpenChange:B,children:e&&e.manifest&&l.jsxs(lr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[l.jsx(or,{children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-2 flex-1",children:[l.jsx(cr,{className:"text-2xl",children:e.manifest.name}),l.jsxs(Hr,{children:["作者: ",e.manifest.author?.name||"Unknown",e.manifest.author?.url&&l.jsx("a",{href:e.manifest.author.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-primary hover:underline",children:l.jsx(Jd,{className:"h-3 w-3 inline"})})]})]}),l.jsxs("div",{className:"flex flex-col gap-2",children:[e.manifest.categories&&e.manifest.categories[0]&&l.jsx(In,{variant:"secondary",children:vD[e.manifest.categories[0]]||e.manifest.categories[0]}),U(e)]})]})}),l.jsxs("div",{className:"space-y-6",children:[l.jsx(U8e,{pluginId:e.id}),l.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"版本"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["v",e.manifest?.version||"unknown"]}),e.installed&&e.installed_version&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:["已安装: v",e.installed_version]})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"下载量"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:(L[e.id]?.downloads??e.downloads??0).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"评分"}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(sc,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),l.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,")"]})]})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:"许可证"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.license||"Unknown"})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("p",{className:"text-sm font-medium",children:"支持版本"}),l.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}`:" - 最新版本"]})]})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium mb-2",children:"关键词"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:e.manifest.keywords&&e.manifest.keywords.map(R=>l.jsx(In,{variant:"outline",children:R},R))})]}),e.detailed_description&&l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium mb-2",children:"详细说明"}),l.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:e.detailed_description})]}),!e.detailed_description&&l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium mb-2",children:"说明"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:e.manifest.description||"无描述"})]}),l.jsxs("div",{className:"space-y-2",children:[e.manifest.homepage_url&&l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"font-medium",children:"主页: "}),l.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&&l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"font-medium",children:"仓库: "}),l.jsx("a",{href:e.manifest.repository_url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:e.manifest.repository_url})]})]})]}),l.jsxs(as,{children:[e.manifest.homepage_url&&l.jsxs(de,{onClick:()=>window.open(e.manifest.homepage_url,"_blank"),children:[l.jsx(Jd,{className:"h-4 w-4 mr-2"}),"访问主页"]}),e.manifest.repository_url&&l.jsxs(de,{variant:"outline",onClick:()=>window.open(e.manifest.repository_url,"_blank"),children:[l.jsx(Jd,{className:"h-4 w-4 mr-2"}),"查看仓库"]})]})]})})]})})}function G8e(){return l.jsx(hn,{className:"h-full",children:l.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件配置"}),l.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理和配置已安装的插件"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(de,{variant:"outline",size:"sm",children:[l.jsx(Ls,{className:"h-4 w-4 mr-2"}),"刷新"]}),l.jsxs(de,{size:"sm",children:[l.jsx(bu,{className:"h-4 w-4 mr-2"}),"全局设置"]})]})]}),l.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"已安装插件"}),l.jsx(mh,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(Dn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:"0"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"正在加载..."})]})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"已启用"}),l.jsx(xc,{className:"h-4 w-4 text-green-600"})]}),l.jsxs(Dn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:"0"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"运行中的插件"})]})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"已禁用"}),l.jsx(Cu,{className:"h-4 w-4 text-orange-600"})]}),l.jsxs(Dn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:"0"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"未激活的插件"})]})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx(jn,{className:"text-sm font-medium",children:"可更新"}),l.jsx(Ls,{className:"h-4 w-4 text-blue-600"})]}),l.jsxs(Dn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:"0"}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"有新版本可用"})]})]})]}),l.jsxs(Dt,{children:[l.jsxs(kn,{children:[l.jsx(jn,{children:"已安装的插件"}),l.jsx(Fr,{children:"查看和管理已安装插件的配置"})]}),l.jsx(Dn,{children:l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[l.jsx(mh,{className:"h-16 w-16 text-muted-foreground/50"}),l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"插件配置功能开发中"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"即将支持插件的启用/禁用、参数配置等功能"})]}),l.jsx("div",{className:"flex gap-2",children:l.jsx(de,{variant:"outline",asChild:!0,children:l.jsxs("a",{href:"/plugins",children:[l.jsx(Jd,{className:"h-4 w-4 mr-2"}),"前往插件市场"]})})})]})})]}),l.jsx(Dt,{className:"border-blue-200 bg-blue-50 dark:bg-blue-950/20 dark:border-blue-900",children:l.jsx(Dn,{className:"pt-6",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(Cu,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-blue-900 dark:text-blue-100",children:"开发进行中"}),l.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["插件配置功能正在积极开发中。目前您可以通过",l.jsx("strong",{children:"插件市场"}),"安装和卸载插件,完整的配置管理功能即将推出。"]})]})]})})})]})})}function X8e(){const t=Da(),{toast:e}=ts(),[n,r]=b.useState([]),[s,i]=b.useState(!0),[a,o]=b.useState(null),[c,h]=b.useState(null),[f,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),o(null);const M=localStorage.getItem("access-token"),L=await fetch("/api/webui/plugins/mirrors",{headers:{Authorization:`Bearer ${M}`}});if(!L.ok)throw new Error("获取镜像源列表失败");const P=await L.json();r(P.mirrors||[])}catch(M){const L=M instanceof Error?M.message:"加载镜像源失败";o(L),e({title:"加载失败",description:L,variant:"destructive"})}finally{i(!1)}},[e]);b.useEffect(()=>{S()},[S]);const k=async()=>{try{const M=localStorage.getItem("access-token"),L=await fetch("/api/webui/plugins/mirrors",{method:"POST",headers:{Authorization:`Bearer ${M}`,"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(M){e({title:"添加失败",description:M instanceof Error?M.message:"未知错误",variant:"destructive"})}},N=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),h(null),S()}catch(M){e({title:"更新失败",description:M instanceof Error?M.message:"未知错误",variant:"destructive"})}},C=async M=>{if(confirm("确定要删除这个镜像源吗?"))try{const L=localStorage.getItem("access-token");if(!(await fetch(`/api/webui/plugins/mirrors/${M}`,{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 M=>{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({enabled:!M.enabled})})).ok)throw new Error("更新状态失败");S()}catch(L){e({title:"更新失败",description:L instanceof Error?L.message:"未知错误",variant:"destructive"})}},_=M=>{h(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)},E=async(M,L)=>{const P=L==="up"?M.priority-1:M.priority+1;if(!(P<1))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({priority:P})})).ok)throw new Error("更新优先级失败");S()}catch(I){e({title:"更新失败",description:I instanceof Error?I.message:"未知错误",variant:"destructive"})}};return l.jsx(hn,{className:"h-full",children:l.jsxs("div",{className:"space-y-6 p-4 sm:p-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(de,{variant:"ghost",size:"icon",onClick:()=>t({to:"/plugins"}),children:l.jsx(lz,{className:"h-5 w-5"})}),l.jsxs("div",{children:[l.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"镜像源配置"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理 Git 克隆和文件下载的镜像源"})]})]}),l.jsxs(de,{onClick:()=>m(!0),children:[l.jsx(ws,{className:"h-4 w-4 mr-2"}),"添加镜像源"]})]}),s?l.jsx(Dt,{className:"p-6",children:l.jsx("div",{className:"flex items-center justify-center py-8",children:l.jsx(vc,{className:"h-8 w-8 animate-spin text-primary"})})}):a?l.jsx(Dt,{className:"p-6",children:l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx(Oa,{className:"h-12 w-12 text-destructive mb-4"}),l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"加载失败"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:a}),l.jsx(de,{onClick:S,children:"重新加载"})]})}):l.jsxs(Dt,{children:[l.jsx("div",{className:"hidden md:block",children:l.jsxs(Vh,{children:[l.jsx(Uh,{children:l.jsxs(bs,{children:[l.jsx(ln,{children:"状态"}),l.jsx(ln,{children:"名称"}),l.jsx(ln,{children:"ID"}),l.jsx(ln,{children:"优先级"}),l.jsx(ln,{className:"text-right",children:"操作"})]})}),l.jsx(Wh,{children:n.map(M=>l.jsxs(bs,{children:[l.jsx(Qt,{children:l.jsx(Pt,{checked:M.enabled,onCheckedChange:()=>T(M)})}),l.jsx(Qt,{children:l.jsxs("div",{children:[l.jsx("div",{className:"font-medium",children:M.name}),l.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Raw: ",M.raw_prefix]})]})}),l.jsx(Qt,{children:l.jsx(In,{variant:"outline",children:M.id})}),l.jsx(Qt,{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-mono",children:M.priority}),l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx(de,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(M,"up"),disabled:M.priority===1,children:l.jsx($m,{className:"h-3 w-3"})}),l.jsx(de,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:()=>E(M,"down"),children:l.jsx(Tu,{className:"h-3 w-3"})})]})]})}),l.jsx(Qt,{className:"text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(de,{variant:"ghost",size:"icon",onClick:()=>_(M),children:l.jsx(wu,{className:"h-4 w-4"})}),l.jsx(de,{variant:"ghost",size:"icon",onClick:()=>C(M.id),children:l.jsx(fn,{className:"h-4 w-4 text-destructive"})})]})})]},M.id))})]})}),l.jsx("div",{className:"md:hidden p-4 space-y-4",children:n.map(M=>l.jsx(Dt,{className:"p-4",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"font-semibold",children:M.name}),M.enabled&&l.jsx(In,{variant:"default",className:"text-xs",children:"启用"})]}),l.jsx(In,{variant:"outline",className:"mt-1 text-xs",children:M.id})]}),l.jsx(Pt,{checked:M.enabled,onCheckedChange:()=>T(M)})]}),l.jsxs("div",{className:"text-sm space-y-1",children:[l.jsxs("div",{className:"text-muted-foreground",children:[l.jsx("span",{className:"font-medium",children:"Raw: "}),l.jsx("span",{className:"break-all",children:M.raw_prefix})]}),l.jsxs("div",{className:"text-muted-foreground",children:[l.jsx("span",{className:"font-medium",children:"优先级: "}),l.jsx("span",{className:"font-mono",children:M.priority})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t",children:[l.jsxs(de,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>_(M),children:[l.jsx(wu,{className:"h-4 w-4 mr-1"}),"编辑"]}),l.jsx(de,{variant:"outline",size:"sm",onClick:()=>E(M,"up"),disabled:M.priority===1,children:l.jsx($m,{className:"h-4 w-4"})}),l.jsx(de,{variant:"outline",size:"sm",onClick:()=>E(M,"down"),children:l.jsx(Tu,{className:"h-4 w-4"})}),l.jsx(de,{variant:"destructive",size:"sm",onClick:()=>C(M.id),children:l.jsx(fn,{className:"h-4 w-4"})})]})]})},M.id))})]}),l.jsx(xr,{open:f,onOpenChange:m,children:l.jsxs(lr,{className:"max-w-lg",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"添加镜像源"}),l.jsx(Hr,{children:"添加新的 Git 镜像源配置"})]}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"add-id",children:"镜像源 ID *"}),l.jsx(Pe,{id:"add-id",placeholder:"例如: my-mirror",value:y.id,onChange:M=>w({...y,id:M.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"add-name",children:"名称 *"}),l.jsx(Pe,{id:"add-name",placeholder:"例如: 我的镜像源",value:y.name,onChange:M=>w({...y,name:M.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"add-raw",children:"Raw 文件前缀 *"}),l.jsx(Pe,{id:"add-raw",placeholder:"https://example.com/raw",value:y.raw_prefix,onChange:M=>w({...y,raw_prefix:M.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"add-clone",children:"克隆前缀 *"}),l.jsx(Pe,{id:"add-clone",placeholder:"https://example.com/clone",value:y.clone_prefix,onChange:M=>w({...y,clone_prefix:M.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"add-priority",children:"优先级"}),l.jsx(Pe,{id:"add-priority",type:"number",min:"1",value:y.priority,onChange:M=>w({...y,priority:parseInt(M.target.value)||1})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"add-enabled",checked:y.enabled,onCheckedChange:M=>w({...y,enabled:M})}),l.jsx(ue,{htmlFor:"add-enabled",children:"启用此镜像源"})]})]}),l.jsxs(as,{children:[l.jsx(de,{variant:"outline",onClick:()=>m(!1),children:"取消"}),l.jsx(de,{onClick:k,children:"添加"})]})]})}),l.jsx(xr,{open:g,onOpenChange:x,children:l.jsxs(lr,{className:"max-w-lg",children:[l.jsxs(or,{children:[l.jsx(cr,{children:"编辑镜像源"}),l.jsx(Hr,{children:"修改镜像源配置"})]}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"镜像源 ID"}),l.jsx(Pe,{value:y.id,disabled:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"edit-name",children:"名称 *"}),l.jsx(Pe,{id:"edit-name",value:y.name,onChange:M=>w({...y,name:M.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"edit-raw",children:"Raw 文件前缀 *"}),l.jsx(Pe,{id:"edit-raw",value:y.raw_prefix,onChange:M=>w({...y,raw_prefix:M.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"edit-clone",children:"克隆前缀 *"}),l.jsx(Pe,{id:"edit-clone",value:y.clone_prefix,onChange:M=>w({...y,clone_prefix:M.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{htmlFor:"edit-priority",children:"优先级"}),l.jsx(Pe,{id:"edit-priority",type:"number",min:"1",value:y.priority,onChange:M=>w({...y,priority:parseInt(M.target.value)||1})}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"数字越小优先级越高"})]}),l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Pt,{id:"edit-enabled",checked:y.enabled,onCheckedChange:M=>w({...y,enabled:M})}),l.jsx(ue,{htmlFor:"edit-enabled",children:"启用此镜像源"})]})]}),l.jsxs(as,{children:[l.jsx(de,{variant:"outline",onClick:()=>x(!1),children:"取消"}),l.jsx(de,{onClick:N,children:"保存"})]})]})})]})})}const Y8e=Ih("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"}}),fU=b.forwardRef(({className:t,size:e,abbrTitle:n,children:r,...s},i)=>l.jsx("kbd",{className:ve(Y8e({size:e,className:t})),ref:i,...s,children:n?l.jsx("abbr",{title:n,children:r}):r}));fU.displayName="Kbd";const K8e=[{icon:Fm,title:"首页",description:"查看仪表板概览",path:"/",category:"概览"},{icon:lo,title:"麦麦主程序配置",description:"配置麦麦的核心设置",path:"/config/bot",category:"配置"},{icon:cz,title:"麦麦模型提供商配置",description:"配置模型提供商",path:"/config/modelProvider",category:"配置"},{icon:uz,title:"麦麦模型配置",description:"配置模型参数",path:"/config/model",category:"配置"},{icon:i6,title:"表情包管理",description:"管理麦麦的表情包",path:"/resource/emoji",category:"资源"},{icon:z0,title:"表达方式管理",description:"管理麦麦的表达方式",path:"/resource/expression",category:"资源"},{icon:dz,title:"人物信息管理",description:"管理人物信息",path:"/resource/person",category:"资源"},{icon:YK,title:"统计信息",description:"查看使用统计",path:"/statistics",category:"监控"},{icon:mh,title:"插件市场",description:"浏览和安装插件",path:"/plugins",category:"扩展"},{icon:C1,title:"日志查看器",description:"查看系统日志",path:"/logs",category:"监控"},{icon:bu,title:"系统设置",description:"配置系统参数",path:"/settings",category:"系统"}];function Z8e({open:t,onOpenChange:e}){const[n,r]=b.useState(""),[s,i]=b.useState(0),a=Da(),o=K8e.filter(f=>f.title.toLowerCase().includes(n.toLowerCase())||f.description.toLowerCase().includes(n.toLowerCase())||f.category.toLowerCase().includes(n.toLowerCase()));b.useEffect(()=>{t&&(r(""),i(0))},[t]);const c=b.useCallback(f=>{a({to:f}),e(!1)},[a,e]),h=b.useCallback(f=>{f.key==="ArrowDown"?(f.preventDefault(),i(m=>(m+1)%o.length)):f.key==="ArrowUp"?(f.preventDefault(),i(m=>(m-1+o.length)%o.length)):f.key==="Enter"&&o[s]&&(f.preventDefault(),c(o[s].path))},[o,s,c]);return l.jsx(xr,{open:t,onOpenChange:e,children:l.jsxs(lr,{className:"max-w-2xl p-0 gap-0",children:[l.jsxs(or,{className:"px-4 pt-4 pb-0",children:[l.jsx(cr,{className:"sr-only",children:"搜索"}),l.jsxs("div",{className:"relative",children:[l.jsx(ci,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),l.jsx(Pe,{value:n,onChange:f=>{r(f.target.value),i(0)},onKeyDown:h,placeholder:"搜索页面...",className:"h-12 pl-11 text-base border-0 focus-visible:ring-0 shadow-none",autoFocus:!0})]})]}),l.jsx("div",{className:"border-t",children:l.jsx(hn,{className:"h-[400px]",children:o.length>0?l.jsx("div",{className:"p-2",children:o.map((f,m)=>{const g=f.icon;return l.jsxs("button",{onClick:()=>c(f.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:[l.jsx(g,{className:"h-5 w-5 flex-shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"font-medium text-sm",children:f.title}),l.jsx("div",{className:"text-xs text-muted-foreground truncate",children:f.description})]}),l.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1 bg-muted rounded",children:f.category})]},f.path)})}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[l.jsx(ci,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:n?"未找到匹配的页面":"输入关键词开始搜索"})]})})}),l.jsx("div",{className:"border-t px-4 py-3 flex items-center justify-between text-xs text-muted-foreground",children:l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↑"}),l.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"↓"}),"导航"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Enter"}),"选择"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded border",children:"Esc"}),"关闭"]})]})})]})})}function J8e(t){const e=eCe(t),n=b.forwardRef((r,s)=>{const{children:i,...a}=r,o=b.Children.toArray(i),c=o.find(nCe);if(c){const h=c.props.children,f=o.map(m=>m===c?b.Children.count(h)>1?b.Children.only(null):b.isValidElement(h)?h.props.children:null:m);return l.jsx(e,{...a,ref:s,children:b.isValidElement(h)?b.cloneElement(h,void 0,f):null})}return l.jsx(e,{...a,ref:s,children:i})});return n.displayName=`${t}.Slot`,n}function eCe(t){const e=b.forwardRef((n,r)=>{const{children:s,...i}=n;if(b.isValidElement(s)){const a=sCe(s),o=rCe(i,s.props);return s.type!==b.Fragment&&(o.ref=r?gc(r,a):a),b.cloneElement(s,o)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var tCe=Symbol("radix.slottable");function nCe(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===tCe}function rCe(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]=(...o)=>{const c=i(...o);return s(...o),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function sCe(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 zk=["Enter"," "],iCe=["ArrowDown","PageUp","Home"],mU=["ArrowUp","PageDown","End"],aCe=[...iCe,...mU],lCe={ltr:[...zk,"ArrowRight"],rtl:[...zk,"ArrowLeft"]},oCe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sp="Menu",[M0,cCe,uCe]=Cv(Sp),[Gu,pU]=ha(Sp,[uCe,Rh,Fv]),kp=Rh(),gU=Fv(),[xU,Ic]=Gu(Sp),[dCe,jp]=Gu(Sp),vU=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,o=kp(e),[c,h]=b.useState(null),f=b.useRef(!1),m=Os(i),g=D0(s);return b.useEffect(()=>{const x=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.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})}},[]),l.jsx(Av,{...o,children:l.jsx(xU,{scope:e,open:n,onOpenChange:m,content:c,onContentChange:h,children:l.jsx(dCe,{scope:e,onClose:b.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:f,dir:g,modal:a,children:r})})})};vU.displayName=Sp;var hCe="MenuAnchor",RO=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=kp(n);return l.jsx(Rv,{...s,...r,ref:e})});RO.displayName=hCe;var DO="MenuPortal",[fCe,yU]=Gu(DO,{forceMount:void 0}),bU=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=Ic(DO,e);return l.jsx(fCe,{scope:e,forceMount:n,children:l.jsx(Fs,{present:n||i.open,children:l.jsx(Mv,{asChild:!0,container:s,children:r})})})};bU.displayName=DO;var la="MenuContent",[mCe,zO]=Gu(la),wU=b.forwardRef((t,e)=>{const n=yU(la,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=Ic(la,t.__scopeMenu),a=jp(la,t.__scopeMenu);return l.jsx(M0.Provider,{scope:t.__scopeMenu,children:l.jsx(Fs,{present:r||i.open,children:l.jsx(M0.Slot,{scope:t.__scopeMenu,children:a.modal?l.jsx(pCe,{...s,ref:e}):l.jsx(gCe,{...s,ref:e})})})})}),pCe=b.forwardRef((t,e)=>{const n=Ic(la,t.__scopeMenu),r=b.useRef(null),s=Bn(e,r);return b.useEffect(()=>{const i=r.current;if(i)return KD(i)},[]),l.jsx(PO,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:tt(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),gCe=b.forwardRef((t,e)=>{const n=Ic(la,t.__scopeMenu);return l.jsx(PO,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),xCe=J8e("MenuContent.ScrollLock"),PO=b.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:g,onDismiss:x,disableOutsideScroll:y,...w}=t,S=Ic(la,n),k=jp(la,n),N=kp(n),C=gU(n),T=cCe(n),[_,E]=b.useState(null),M=b.useRef(null),L=Bn(e,M,S.onContentChange),P=b.useRef(0),I=b.useRef(""),Q=b.useRef(0),U=b.useRef(null),ee=b.useRef("right"),z=b.useRef(0),H=y?ZD:b.Fragment,B=y?{as:xCe,allowPinchZoom:!0}:void 0,X=G=>{const R=I.current+G,se=T().filter(K=>!K.disabled),W=document.activeElement,F=se.find(K=>K.ref.current===W)?.textValue,V=se.map(K=>K.textValue),te=ECe(V,R,F),ne=se.find(K=>K.textValue===te)?.ref.current;(function K(ie){I.current=ie,window.clearTimeout(P.current),ie!==""&&(P.current=window.setTimeout(()=>K(""),1e3))})(R),ne&&setTimeout(()=>ne.focus())};b.useEffect(()=>()=>window.clearTimeout(P.current),[]),JD();const J=b.useCallback(G=>ee.current===U.current?.side&&MCe(G,U.current?.area),[]);return l.jsx(mCe,{scope:n,searchRef:I,onItemEnter:b.useCallback(G=>{J(G)&&G.preventDefault()},[J]),onItemLeave:b.useCallback(G=>{J(G)||(M.current?.focus(),E(null))},[J]),onTriggerLeave:b.useCallback(G=>{J(G)&&G.preventDefault()},[J]),pointerGraceTimerRef:Q,onPointerGraceIntentChange:b.useCallback(G=>{U.current=G},[]),children:l.jsx(H,{...B,children:l.jsx(ez,{asChild:!0,trapped:s,onMountAutoFocus:tt(i,G=>{G.preventDefault(),M.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:l.jsx(n6,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:g,onDismiss:x,children:l.jsx(eP,{asChild:!0,...C,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:E,onEntryFocus:tt(c,G=>{k.isUsingKeyboardRef.current||G.preventDefault()}),preventScrollOnEntryFocus:!0,children:l.jsx(r6,{role:"menu","aria-orientation":"vertical","data-state":IU(S.open),"data-radix-menu-content":"",dir:k.dir,...N,...w,ref:L,style:{outline:"none",...w.style},onKeyDown:tt(w.onKeyDown,G=>{const se=G.target.closest("[data-radix-menu-content]")===G.currentTarget,W=G.ctrlKey||G.altKey||G.metaKey,F=G.key.length===1;se&&(G.key==="Tab"&&G.preventDefault(),!W&&F&&X(G.key));const V=M.current;if(G.target!==V||!aCe.includes(G.key))return;G.preventDefault();const ne=T().filter(K=>!K.disabled).map(K=>K.ref.current);mU.includes(G.key)&&ne.reverse(),CCe(ne)}),onBlur:tt(t.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(P.current),I.current="")}),onPointerMove:tt(t.onPointerMove,A0(G=>{const R=G.target,se=z.current!==G.clientX;if(G.currentTarget.contains(R)&&se){const W=G.clientX>z.current?"right":"left";ee.current=W,z.current=G.clientX}}))})})})})})})});wU.displayName=la;var vCe="MenuGroup",LO=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return l.jsx(on.div,{role:"group",...r,ref:e})});LO.displayName=vCe;var yCe="MenuLabel",SU=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return l.jsx(on.div,{...r,ref:e})});SU.displayName=yCe;var kv="MenuItem",yD="menu.itemSelect",Fy=b.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=b.useRef(null),a=jp(kv,t.__scopeMenu),o=zO(kv,t.__scopeMenu),c=Bn(e,i),h=b.useRef(!1),f=()=>{const m=i.current;if(!n&&m){const g=new CustomEvent(yD,{bubbles:!0,cancelable:!0});m.addEventListener(yD,x=>r?.(x),{once:!0}),nz(m,g),g.defaultPrevented?h.current=!1:a.onClose()}};return l.jsx(kU,{...s,ref:c,disabled:n,onClick:tt(t.onClick,f),onPointerDown:m=>{t.onPointerDown?.(m),h.current=!0},onPointerUp:tt(t.onPointerUp,m=>{h.current||m.currentTarget?.click()}),onKeyDown:tt(t.onKeyDown,m=>{const g=o.searchRef.current!=="";n||g&&m.key===" "||zk.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Fy.displayName=kv;var kU=b.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=zO(kv,n),o=gU(n),c=b.useRef(null),h=Bn(e,c),[f,m]=b.useState(!1),[g,x]=b.useState("");return b.useEffect(()=>{const y=c.current;y&&x((y.textContent??"").trim())},[i.children]),l.jsx(M0.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:l.jsx(tP,{asChild:!0,...o,focusable:!r,children:l.jsx(on.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:h,onPointerMove:tt(t.onPointerMove,A0(y=>{r?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:tt(t.onPointerLeave,A0(y=>a.onItemLeave(y))),onFocus:tt(t.onFocus,()=>m(!0)),onBlur:tt(t.onBlur,()=>m(!1))})})})}),bCe="MenuCheckboxItem",jU=b.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return l.jsx(EU,{scope:t.__scopeMenu,checked:n,children:l.jsx(Fy,{role:"menuitemcheckbox","aria-checked":jv(n)?"mixed":n,...s,ref:e,"data-state":qO(n),onSelect:tt(s.onSelect,()=>r?.(jv(n)?!0:!n),{checkForDefaultPrevented:!1})})})});jU.displayName=bCe;var OU="MenuRadioGroup",[wCe,SCe]=Gu(OU,{value:void 0,onValueChange:()=>{}}),NU=b.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=Os(r);return l.jsx(wCe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:l.jsx(LO,{...s,ref:e})})});NU.displayName=OU;var CU="MenuRadioItem",TU=b.forwardRef((t,e)=>{const{value:n,...r}=t,s=SCe(CU,t.__scopeMenu),i=n===s.value;return l.jsx(EU,{scope:t.__scopeMenu,checked:i,children:l.jsx(Fy,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":qO(i),onSelect:tt(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});TU.displayName=CU;var IO="MenuItemIndicator",[EU,kCe]=Gu(IO,{checked:!1}),_U=b.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=kCe(IO,n);return l.jsx(Fs,{present:r||jv(i.checked)||i.checked===!0,children:l.jsx(on.span,{...s,ref:e,"data-state":qO(i.checked)})})});_U.displayName=IO;var jCe="MenuSeparator",MU=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return l.jsx(on.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});MU.displayName=jCe;var OCe="MenuArrow",AU=b.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=kp(n);return l.jsx(s6,{...s,...r,ref:e})});AU.displayName=OCe;var BO="MenuSub",[NCe,RU]=Gu(BO),DU=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:s}=t,i=Ic(BO,e),a=kp(e),[o,c]=b.useState(null),[h,f]=b.useState(null),m=Os(s);return b.useEffect(()=>(i.open===!1&&m(!1),()=>m(!1)),[i.open,m]),l.jsx(Av,{...a,children:l.jsx(xU,{scope:e,open:r,onOpenChange:m,content:h,onContentChange:f,children:l.jsx(NCe,{scope:e,contentId:_i(),triggerId:_i(),trigger:o,onTriggerChange:c,children:n})})})};DU.displayName=BO;var jm="MenuSubTrigger",zU=b.forwardRef((t,e)=>{const n=Ic(jm,t.__scopeMenu),r=jp(jm,t.__scopeMenu),s=RU(jm,t.__scopeMenu),i=zO(jm,t.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=i,h={__scopeMenu:t.__scopeMenu},f=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return b.useEffect(()=>f,[f]),b.useEffect(()=>{const m=o.current;return()=>{window.clearTimeout(m),c(null)}},[o,c]),l.jsx(RO,{asChild:!0,...h,children:l.jsx(kU,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":IU(n.open),...t,ref:gc(e,s.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:tt(t.onPointerMove,A0(m=>{i.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:tt(t.onPointerLeave,A0(m=>{f();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(o.current),o.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:tt(t.onKeyDown,m=>{const g=i.searchRef.current!=="";t.disabled||g&&m.key===" "||lCe[r.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});zU.displayName=jm;var PU="MenuSubContent",LU=b.forwardRef((t,e)=>{const n=yU(la,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=Ic(la,t.__scopeMenu),a=jp(la,t.__scopeMenu),o=RU(PU,t.__scopeMenu),c=b.useRef(null),h=Bn(e,c);return l.jsx(M0.Provider,{scope:t.__scopeMenu,children:l.jsx(Fs,{present:r||i.open,children:l.jsx(M0.Slot,{scope:t.__scopeMenu,children:l.jsx(PO,{id:o.contentId,"aria-labelledby":o.triggerId,...s,ref:h,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&c.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:tt(t.onFocusOutside,f=>{f.target!==o.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:tt(t.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:tt(t.onKeyDown,f=>{const m=f.currentTarget.contains(f.target),g=oCe[a.dir].includes(f.key);m&&g&&(i.onOpenChange(!1),o.trigger?.focus(),f.preventDefault())})})})})})});LU.displayName=PU;function IU(t){return t?"open":"closed"}function jv(t){return t==="indeterminate"}function qO(t){return jv(t)?"indeterminate":t?"checked":"unchecked"}function CCe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function TCe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function ECe(t,e,n){const s=e.length>1&&Array.from(e).every(h=>h===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=TCe(t,Math.max(i,0));s.length===1&&(a=a.filter(h=>h!==n));const c=a.find(h=>h.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function _Ce(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=g>r&&n<(m-h)*(r-f)/(g-f)+h&&(s=!s)}return s}function MCe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return _Ce(n,e)}function A0(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ACe=vU,RCe=RO,DCe=bU,zCe=wU,PCe=LO,LCe=SU,ICe=Fy,BCe=jU,qCe=NU,FCe=TU,$Ce=_U,QCe=MU,HCe=AU,VCe=DU,UCe=zU,WCe=LU,FO="ContextMenu",[GCe]=ha(FO,[pU]),Ms=pU(),[XCe,BU]=GCe(FO),qU=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:s,modal:i=!0}=t,[a,o]=b.useState(!1),c=Ms(e),h=Os(r),f=b.useCallback(m=>{o(m),h(m)},[h]);return l.jsx(XCe,{scope:e,open:a,onOpenChange:f,modal:i,children:l.jsx(ACe,{...c,dir:s,open:a,onOpenChange:f,modal:i,children:n})})};qU.displayName=FO;var FU="ContextMenuTrigger",$U=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=BU(FU,n),a=Ms(n),o=b.useRef({x:0,y:0}),c=b.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...o.current})}),h=b.useRef(0),f=b.useCallback(()=>window.clearTimeout(h.current),[]),m=g=>{o.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return b.useEffect(()=>f,[f]),b.useEffect(()=>void(r&&f()),[r,f]),l.jsxs(l.Fragment,{children:[l.jsx(RCe,{...a,virtualRef:c}),l.jsx(on.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:tt(t.onContextMenu,g=>{f(),m(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:tt(t.onPointerDown,Xx(g=>{f(),h.current=window.setTimeout(()=>m(g),700)})),onPointerMove:r?t.onPointerMove:tt(t.onPointerMove,Xx(f)),onPointerCancel:r?t.onPointerCancel:tt(t.onPointerCancel,Xx(f)),onPointerUp:r?t.onPointerUp:tt(t.onPointerUp,Xx(f))})]})});$U.displayName=FU;var YCe="ContextMenuPortal",QU=t=>{const{__scopeContextMenu:e,...n}=t,r=Ms(e);return l.jsx(DCe,{...r,...n})};QU.displayName=YCe;var HU="ContextMenuContent",VU=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=BU(HU,n),i=Ms(n),a=b.useRef(!1);return l.jsx(zCe,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:o=>{t.onCloseAutoFocus?.(o),!o.defaultPrevented&&a.current&&o.preventDefault(),a.current=!1},onInteractOutside:o=>{t.onInteractOutside?.(o),!o.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)"}})});VU.displayName=HU;var KCe="ContextMenuGroup",ZCe=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(PCe,{...s,...r,ref:e})});ZCe.displayName=KCe;var JCe="ContextMenuLabel",UU=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(LCe,{...s,...r,ref:e})});UU.displayName=JCe;var e9e="ContextMenuItem",WU=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(ICe,{...s,...r,ref:e})});WU.displayName=e9e;var t9e="ContextMenuCheckboxItem",GU=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(BCe,{...s,...r,ref:e})});GU.displayName=t9e;var n9e="ContextMenuRadioGroup",r9e=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(qCe,{...s,...r,ref:e})});r9e.displayName=n9e;var s9e="ContextMenuRadioItem",XU=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(FCe,{...s,...r,ref:e})});XU.displayName=s9e;var i9e="ContextMenuItemIndicator",YU=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx($Ce,{...s,...r,ref:e})});YU.displayName=i9e;var a9e="ContextMenuSeparator",KU=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(QCe,{...s,...r,ref:e})});KU.displayName=a9e;var l9e="ContextMenuArrow",o9e=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(HCe,{...s,...r,ref:e})});o9e.displayName=l9e;var ZU="ContextMenuSub",JU=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:s,defaultOpen:i}=t,a=Ms(e),[o,c]=wo({prop:s,defaultProp:i??!1,onChange:r,caller:ZU});return l.jsx(VCe,{...a,open:o,onOpenChange:c,children:n})};JU.displayName=ZU;var c9e="ContextMenuSubTrigger",eW=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(UCe,{...s,...r,ref:e})});eW.displayName=c9e;var u9e="ContextMenuSubContent",tW=b.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ms(n);return l.jsx(WCe,{...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)"}})});tW.displayName=u9e;function Xx(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var d9e=qU,h9e=$U,f9e=QU,nW=VU,rW=UU,sW=WU,iW=GU,aW=XU,lW=YU,oW=KU,m9e=JU,cW=eW,uW=tW;const p9e=d9e,g9e=h9e,x9e=m9e,dW=b.forwardRef(({className:t,inset:e,children:n,...r},s)=>l.jsxs(cW,{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,l.jsx(Qu,{className:"ml-auto h-4 w-4"})]}));dW.displayName=cW.displayName;const hW=b.forwardRef(({className:t,...e},n)=>l.jsx(uW,{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}));hW.displayName=uW.displayName;const fW=b.forwardRef(({className:t,...e},n)=>l.jsx(f9e,{children:l.jsx(nW,{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})}));fW.displayName=nW.displayName;const wa=b.forwardRef(({className:t,inset:e,...n},r)=>l.jsx(sW,{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}));wa.displayName=sW.displayName;const v9e=b.forwardRef(({className:t,children:e,checked:n,...r},s)=>l.jsxs(iW,{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:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(lW,{children:l.jsx(ol,{className:"h-4 w-4"})})}),e]}));v9e.displayName=iW.displayName;const y9e=b.forwardRef(({className:t,children:e,...n},r)=>l.jsxs(aW,{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:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(lW,{children:l.jsx(KK,{className:"h-2 w-2 fill-current"})})}),e]}));y9e.displayName=aW.displayName;const b9e=b.forwardRef(({className:t,inset:e,...n},r)=>l.jsx(rW,{ref:r,className:ve("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));b9e.displayName=rW.displayName;const Om=b.forwardRef(({className:t,...e},n)=>l.jsx(oW,{ref:n,className:ve("-mx-1 my-1 h-px bg-border",t),...e}));Om.displayName=oW.displayName;const Wd=({className:t,...e})=>l.jsx("span",{className:ve("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});Wd.displayName="ContextMenuShortcut";var w9e=Symbol("radix.slottable");function S9e(t){const e=({children:n})=>l.jsx(l.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=w9e,e}var[$y]=ha("Tooltip",[Rh]),Qy=Rh(),mW="TooltipProvider",k9e=700,Pk="tooltip.open",[j9e,$O]=$y(mW),pW=t=>{const{__scopeTooltip:e,delayDuration:n=k9e,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,a=b.useRef(!0),o=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const h=c.current;return()=>window.clearTimeout(h)},[]),l.jsx(j9e,{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:o,onPointerInTransitChange:b.useCallback(h=>{o.current=h},[]),disableHoverableContent:s,children:i})};pW.displayName=mW;var R0="Tooltip",[O9e,Op]=$y(R0),gW=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:o}=t,c=$O(R0,t.__scopeTooltip),h=Qy(e),[f,m]=b.useState(null),g=_i(),x=b.useRef(0),y=a??c.disableHoverableContent,w=o??c.delayDuration,S=b.useRef(!1),[k,N]=wo({prop:r,defaultProp:s??!1,onChange:M=>{M?(c.onOpen(),document.dispatchEvent(new CustomEvent(Pk))):c.onClose(),i?.(M)},caller:R0}),C=b.useMemo(()=>k?S.current?"delayed-open":"instant-open":"closed",[k]),T=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,S.current=!1,N(!0)},[N]),_=b.useCallback(()=>{window.clearTimeout(x.current),x.current=0,N(!1)},[N]),E=b.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{S.current=!0,N(!0),x.current=0},w)},[w,N]);return b.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),l.jsx(Av,{...h,children:l.jsx(O9e,{scope:e,contentId:g,open:k,stateAttribute:C,trigger:f,onTriggerChange:m,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?E():T()},[c.isOpenDelayedRef,E,T]),onTriggerLeave:b.useCallback(()=>{y?_():(window.clearTimeout(x.current),x.current=0)},[_,y]),onOpen:T,onClose:_,disableHoverableContent:y,children:n})})};gW.displayName=R0;var Lk="TooltipTrigger",xW=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Op(Lk,n),i=$O(Lk,n),a=Qy(n),o=b.useRef(null),c=Bn(e,o,s.onTriggerChange),h=b.useRef(!1),f=b.useRef(!1),m=b.useCallback(()=>h.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),l.jsx(Rv,{asChild:!0,...a,children:l.jsx(on.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:tt(t.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:tt(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:tt(t.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:tt(t.onFocus,()=>{h.current||s.onOpen()}),onBlur:tt(t.onBlur,s.onClose),onClick:tt(t.onClick,s.onClose)})})});xW.displayName=Lk;var QO="TooltipPortal",[N9e,C9e]=$y(QO,{forceMount:void 0}),vW=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:s}=t,i=Op(QO,e);return l.jsx(N9e,{scope:e,forceMount:n,children:l.jsx(Fs,{present:n||i.open,children:l.jsx(Mv,{asChild:!0,container:s,children:r})})})};vW.displayName=QO;var Ah="TooltipContent",yW=b.forwardRef((t,e)=>{const n=C9e(Ah,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=Op(Ah,t.__scopeTooltip);return l.jsx(Fs,{present:r||a.open,children:a.disableHoverableContent?l.jsx(bW,{side:s,...i,ref:e}):l.jsx(T9e,{side:s,...i,ref:e})})}),T9e=b.forwardRef((t,e)=>{const n=Op(Ah,t.__scopeTooltip),r=$O(Ah,t.__scopeTooltip),s=b.useRef(null),i=Bn(e,s),[a,o]=b.useState(null),{trigger:c,onClose:h}=n,f=s.current,{onPointerInTransitChange:m}=r,g=b.useCallback(()=>{o(null),m(!1)},[m]),x=b.useCallback((y,w)=>{const S=y.currentTarget,k={x:y.clientX,y:y.clientY},N=R9e(k,S.getBoundingClientRect()),C=D9e(k,N),T=z9e(w.getBoundingClientRect()),_=L9e([...C,...T]);o(_),m(!0)},[m]);return b.useEffect(()=>()=>g(),[g]),b.useEffect(()=>{if(c&&f){const y=S=>x(S,f),w=S=>x(S,c);return c.addEventListener("pointerleave",y),f.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",y),f.removeEventListener("pointerleave",w)}}},[c,f,x,g]),b.useEffect(()=>{if(a){const y=w=>{const S=w.target,k={x:w.clientX,y:w.clientY},N=c?.contains(S)||f?.contains(S),C=!P9e(k,a);N?g():C&&(g(),h())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,f,a,h,g]),l.jsx(bW,{...t,ref:i})}),[E9e,_9e]=$y(R0,{isInside:!1}),M9e=S9e("TooltipContent"),bW=b.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...o}=t,c=Op(Ah,n),h=Qy(n),{onClose:f}=c;return b.useEffect(()=>(document.addEventListener(Pk,f),()=>document.removeEventListener(Pk,f)),[f]),b.useEffect(()=>{if(c.trigger){const m=g=>{g.target?.contains(c.trigger)&&f()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,f]),l.jsx(n6,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:f,children:l.jsxs(r6,{"data-state":c.stateAttribute,...h,...o,ref:e,style:{...o.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:[l.jsx(M9e,{children:r}),l.jsx(E9e,{scope:n,isInside:!0,children:l.jsx(OK,{id:c.contentId,role:"tooltip",children:s||r})})]})})});yW.displayName=Ah;var wW="TooltipArrow",A9e=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=Qy(n);return _9e(wW,n).isInside?null:l.jsx(s6,{...s,...r,ref:e})});A9e.displayName=wW;function R9e(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 D9e(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 z9e(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 P9e(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=g>r&&n<(m-h)*(r-f)/(g-f)+h&&(s=!s)}return s}function L9e(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),I9e(e)}function I9e(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 B9e=pW,q9e=gW,F9e=xW,$9e=vW,SW=yW;const Q9e=B9e,H9e=q9e,V9e=F9e,kW=b.forwardRef(({className:t,sideOffset:e=4,...n},r)=>l.jsx($9e,{children:l.jsx(SW,{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})}));kW.displayName=SW.displayName;function U9e({children:t}){Yte();const[e,n]=b.useState(!0),[r,s]=b.useState(!1),[i,a]=b.useState(!1),{theme:o,setTheme:c}=b6(),h=oY(),f=Da();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:Fm,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:lo,label:"麦麦主程序配置",path:"/config/bot"},{icon:cz,label:"AI模型厂商配置",path:"/config/modelProvider"},{icon:uz,label:"模型管理与分配",path:"/config/model"},{icon:FC,label:"麦麦适配器配置",path:"/config/adapter"}]},{title:"麦麦资源管理",items:[{icon:i6,label:"表情包管理",path:"/resource/emoji"},{icon:z0,label:"表达方式管理",path:"/resource/expression"},{icon:dz,label:"人物信息管理",path:"/resource/person"},{icon:oz,label:"知识库图谱可视化",path:"/resource/knowledge-graph"}]},{title:"扩展与监控",items:[{icon:mh,label:"插件市场",path:"/plugins"},{icon:FC,label:"插件配置",path:"/plugin-config"},{icon:C1,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:bu,label:"系统设置",path:"/settings"}]}],x=o==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o,y=()=>{localStorage.removeItem("access-token"),f({to:"/auth"})};return l.jsx(Q9e,{delayDuration:300,children:l.jsxs("div",{className:"flex h-screen overflow-hidden",children:[l.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:[l.jsx("div",{className:"flex h-16 items-center border-b px-4",children:l.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:[l.jsxs("div",{className:ve("flex items-baseline gap-2",!e&&"lg:hidden"),children:[l.jsx("span",{className:"font-bold text-xl text-primary-gradient whitespace-nowrap",children:"MaiBot WebUI"}),l.jsx("span",{className:"text-xs text-primary/60 whitespace-nowrap",children:Nte()})]}),!e&&l.jsx("span",{className:"hidden lg:block font-bold text-primary-gradient text-2xl",children:"M"})]})}),l.jsx(hn,{className:ve("flex-1 overflow-x-hidden",!e&&"lg:w-16"),children:l.jsx("nav",{className:ve("p-4",!e&&"lg:p-2 lg:w-16"),children:l.jsx("ul",{className:ve("space-y-6",!e&&"lg:space-y-3 lg:w-full"),children:m.map((w,S)=>l.jsxs("li",{children:[l.jsx("div",{className:ve("px-3 h-[1.25rem]","mb-2",!e&&"lg:mb-1 lg:invisible"),children:l.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:w.title})}),!e&&S>0&&l.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),l.jsx("ul",{className:"space-y-1",children:w.items.map(k=>{const N=h({to:k.path}),C=k.icon,T=l.jsxs(l.Fragment,{children:[N&&l.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"}),l.jsxs("div",{className:ve("flex items-center transition-all duration-300",e?"gap-3":"gap-3 lg:gap-0"),children:[l.jsx(C,{className:ve("h-5 w-5 flex-shrink-0",N&&"text-primary"),strokeWidth:2,fill:"none"}),l.jsx("span",{className:ve("text-sm font-medium whitespace-nowrap transition-all duration-300",N&&"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 l.jsx("li",{className:"relative",children:l.jsxs(H9e,{children:[l.jsx(V9e,{asChild:!0,children:l.jsx(cY,{to:k.path,className:ve("relative flex items-center rounded-lg py-2 transition-all duration-300","hover:bg-accent hover:text-accent-foreground",N?"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&&l.jsx(kW,{side:"right",className:"hidden lg:block",children:l.jsx("p",{children:k.label})})]})},k.path)})})]},w.title))})})})]}),r&&l.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>s(!1)}),l.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[l.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:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("button",{onClick:()=>s(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:l.jsx(ZK,{className:"h-5 w-5"})}),l.jsx("button",{onClick:()=>n(!e),className:"hidden rounded-lg p-2 hover:bg-accent lg:block",title:e?"收起侧边栏":"展开侧边栏",children:l.jsx($u,{className:ve("h-5 w-5 transition-transform",!e&&"rotate-180")})})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.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:[l.jsx(ci,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),l.jsx("span",{className:"text-sm text-muted-foreground",children:"搜索..."}),l.jsxs(fU,{size:"sm",className:"absolute right-2 top-1/2 -translate-y-1/2",children:[l.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),l.jsx(Z8e,{open:i,onOpenChange:a}),l.jsxs(de,{variant:"ghost",size:"sm",onClick:()=>window.open("https://docs.mai-mai.org","_blank"),className:"gap-2",title:"查看麦麦文档",children:[l.jsx(JK,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:"麦麦文档"})]}),l.jsx("button",{onClick:w=>{dte(x==="dark"?"light":"dark",c,w)},className:"rounded-lg p-2 hover:bg-accent",title:x==="dark"?"切换到浅色模式":"切换到深色模式",children:x==="dark"?l.jsx(D3,{className:"h-5 w-5"}):l.jsx(z3,{className:"h-5 w-5"})}),l.jsx("div",{className:"h-6 w-px bg-border"}),l.jsxs(de,{variant:"ghost",size:"sm",onClick:y,className:"gap-2",title:"登出系统",children:[l.jsx($C,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),l.jsxs(p9e,{children:[l.jsx(g9e,{asChild:!0,children:l.jsx("main",{className:"flex-1 overflow-hidden bg-background",children:t})}),l.jsxs(fW,{className:"w-64",children:[l.jsxs(wa,{onClick:()=>f({to:"/"}),children:[l.jsx(Fm,{className:"mr-2 h-4 w-4"}),"首页"]}),l.jsxs(wa,{onClick:()=>f({to:"/settings"}),children:[l.jsx(bu,{className:"mr-2 h-4 w-4"}),"系统设置"]}),l.jsxs(wa,{onClick:()=>f({to:"/logs"}),children:[l.jsx(C1,{className:"mr-2 h-4 w-4"}),"日志查看器"]}),l.jsx(Om,{}),l.jsxs(x9e,{children:[l.jsxs(dW,{children:[l.jsx(sz,{className:"mr-2 h-4 w-4"}),"切换主题"]}),l.jsxs(hW,{className:"w-48",children:[l.jsxs(wa,{onClick:()=>c("light"),disabled:o==="light",children:[l.jsx(D3,{className:"mr-2 h-4 w-4"}),"浅色",o==="light"&&l.jsx(Wd,{children:"✓"})]}),l.jsxs(wa,{onClick:()=>c("dark"),disabled:o==="dark",children:[l.jsx(z3,{className:"mr-2 h-4 w-4"}),"深色",o==="dark"&&l.jsx(Wd,{children:"✓"})]}),l.jsxs(wa,{onClick:()=>c("system"),disabled:o==="system",children:[l.jsx(bu,{className:"mr-2 h-4 w-4"}),"跟随系统",o==="system"&&l.jsx(Wd,{children:"✓"})]})]})]}),l.jsx(Om,{}),l.jsxs(wa,{onClick:()=>window.location.reload(),children:[l.jsx(eZ,{className:"mr-2 h-4 w-4"}),"刷新页面",l.jsx(Wd,{children:"⌘R"})]}),l.jsxs(wa,{onClick:()=>a(!0),children:[l.jsx(ci,{className:"mr-2 h-4 w-4"}),"搜索",l.jsx(Wd,{children:"⌘K"})]}),l.jsx(Om,{}),l.jsxs(wa,{onClick:()=>window.open("https://docs.mai-mai.org","_blank"),children:[l.jsx(Jd,{className:"mr-2 h-4 w-4"}),"麦麦文档"]}),l.jsx(Om,{}),l.jsxs(wa,{onClick:y,className:"text-destructive focus:text-destructive",children:[l.jsx($C,{className:"mr-2 h-4 w-4"}),"登出系统"]})]})]})]})]})})}var Hy="Collapsible",[W9e]=ha(Hy),[G9e,HO]=W9e(Hy),jW=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...o}=t,[c,h]=wo({prop:r,defaultProp:s??!1,onChange:a,caller:Hy});return l.jsx(G9e,{scope:n,disabled:i,contentId:_i(),open:c,onOpenToggle:b.useCallback(()=>h(f=>!f),[h]),children:l.jsx(on.div,{"data-state":UO(c),"data-disabled":i?"":void 0,...o,ref:e})})});jW.displayName=Hy;var OW="CollapsibleTrigger",NW=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=HO(OW,n);return l.jsx(on.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":UO(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:tt(t.onClick,s.onOpenToggle)})});NW.displayName=OW;var VO="CollapsibleContent",CW=b.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=HO(VO,t.__scopeCollapsible);return l.jsx(Fs,{present:n||s.open,children:({present:i})=>l.jsx(X9e,{...r,ref:e,present:i})})});CW.displayName=VO;var X9e=b.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=HO(VO,n),[o,c]=b.useState(r),h=b.useRef(null),f=Bn(e,h),m=b.useRef(0),g=m.current,x=b.useRef(0),y=x.current,w=a.open||o,S=b.useRef(w),k=b.useRef(void 0);return b.useEffect(()=>{const N=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(N)},[]),Xk(()=>{const N=h.current;if(N){k.current=k.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const C=N.getBoundingClientRect();m.current=C.height,x.current=C.width,S.current||(N.style.transitionDuration=k.current.transitionDuration,N.style.animationName=k.current.animationName),c(r)}},[a.open,r]),l.jsx(on.div,{"data-state":UO(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!w,...i,ref:f,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 UO(t){return t?"open":"closed"}var Y9e=jW;const bD=Y9e,wD=NW,SD=CW;function K9e(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 Z9e({error:t,errorInfo:e}){const[n,r]=b.useState(!0),[s,i]=b.useState(!1),[a,o]=b.useState(!1),c=t.stack?K9e(t.stack):[],h=async()=>{const f=` -Error: ${t.name} -Message: ${t.message} - -Stack Trace: -${t.stack||"No stack trace available"} - -Component Stack: -${e?.componentStack||"No component stack available"} - -URL: ${window.location.href} -User Agent: ${navigator.userAgent} -Time: ${new Date().toISOString()} - `.trim();try{await navigator.clipboard.writeText(f),o(!0),setTimeout(()=>o(!1),2e3)}catch(m){console.error("Failed to copy:",m)}};return l.jsxs("div",{className:"space-y-4",children:[l.jsxs(Na,{variant:"destructive",className:"border-red-500/50 bg-red-500/10",children:[l.jsx(Oa,{className:"h-4 w-4"}),l.jsxs(Ca,{className:"font-mono text-sm",children:[l.jsxs("span",{className:"font-semibold",children:[t.name,":"]})," ",t.message]})]}),c.length>0&&l.jsxs(bD,{open:n,onOpenChange:r,children:[l.jsx(wD,{asChild:!0,children:l.jsxs(de,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[l.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[l.jsx(tZ,{className:"h-4 w-4"}),"Stack Trace (",c.length," frames)"]}),n?l.jsx($m,{className:"h-4 w-4"}):l.jsx(Tu,{className:"h-4 w-4"})]})}),l.jsx(SD,{children:l.jsx(hn,{className:"h-[280px] rounded-md border bg-muted/30",children:l.jsx("div",{className:"p-3 space-y-1",children:c.map((f,m)=>l.jsx("div",{className:"font-mono text-xs p-2 rounded hover:bg-muted/50 transition-colors",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsxs("span",{className:"text-muted-foreground w-6 text-right flex-shrink-0",children:[m+1,"."]}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:"text-primary font-medium",children:f.functionName}),f.fileName&&l.jsxs("div",{className:"text-muted-foreground mt-0.5 break-all",children:[f.fileName,f.lineNumber&&l.jsxs("span",{className:"text-yellow-600 dark:text-yellow-400",children:[":",f.lineNumber,":",f.columnNumber]})]})]})]})},m))})})})]}),e?.componentStack&&l.jsxs(bD,{open:s,onOpenChange:i,children:[l.jsx(wD,{asChild:!0,children:l.jsxs(de,{variant:"ghost",className:"w-full justify-between p-3 h-auto",children:[l.jsxs("span",{className:"font-semibold text-sm flex items-center gap-2",children:[l.jsx(Oa,{className:"h-4 w-4"}),"Component Stack"]}),s?l.jsx($m,{className:"h-4 w-4"}):l.jsx(Tu,{className:"h-4 w-4"})]})}),l.jsx(SD,{children:l.jsx(hn,{className:"h-[200px] rounded-md border bg-muted/30",children:l.jsx("pre",{className:"p-3 font-mono text-xs whitespace-pre-wrap text-muted-foreground",children:e.componentStack})})})]}),l.jsx(de,{variant:"outline",size:"sm",onClick:h,className:"w-full",children:a?l.jsxs(l.Fragment,{children:[l.jsx(ol,{className:"mr-2 h-4 w-4 text-green-500"}),"已复制到剪贴板"]}):l.jsxs(l.Fragment,{children:[l.jsx(O1,{className:"mr-2 h-4 w-4"}),"复制错误信息"]})})]})}function TW({error:t,errorInfo:e}){const n=()=>{window.location.href="/"},r=()=>{window.location.reload()};return l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:l.jsxs(Dt,{className:"w-full max-w-2xl shadow-lg",children:[l.jsxs(kn,{className:"text-center pb-2",children:[l.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:l.jsx(Oa,{className:"h-8 w-8 text-red-600 dark:text-red-400"})}),l.jsx(jn,{className:"text-2xl font-bold",children:"页面出现了问题"}),l.jsx(Fr,{className:"text-base mt-2",children:"应用程序遇到了意外错误。您可以尝试刷新页面或返回首页。"})]}),l.jsxs(Dn,{className:"space-y-4",children:[l.jsx(Z9e,{error:t,errorInfo:e}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 pt-2",children:[l.jsxs(de,{onClick:r,className:"flex-1",children:[l.jsx(Ls,{className:"mr-2 h-4 w-4"}),"刷新页面"]}),l.jsxs(de,{onClick:n,variant:"outline",className:"flex-1",children:[l.jsx(Fm,{className:"mr-2 h-4 w-4"}),"返回首页"]})]}),l.jsx("p",{className:"text-xs text-center text-muted-foreground pt-2",children:"如果问题持续存在,请将错误信息复制并反馈给开发者"})]})]})})}class J9e 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:l.jsx(TW,{error:this.state.error,errorInfo:this.state.errorInfo}):this.props.children}}function EW({error:t}){return l.jsx(TW,{error:t,errorInfo:null})}const Np=uY({component:()=>l.jsxs(l.Fragment,{children:[l.jsx(jD,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!fL())throw hY({to:"/auth"})}}),eTe=cs({getParentRoute:()=>Np,path:"/auth",component:Kte}),tTe=cs({getParentRoute:()=>Np,path:"/setup",component:bne}),Qs=cs({getParentRoute:()=>Np,id:"protected",component:()=>l.jsx(U9e,{children:l.jsx(jD,{})}),errorComponent:({error:t})=>l.jsx(EW,{error:t})}),nTe=cs({getParentRoute:()=>Qs,path:"/",component:cte}),rTe=cs({getParentRoute:()=>Qs,path:"/config/bot",component:vhe}),sTe=cs({getParentRoute:()=>Qs,path:"/config/modelProvider",component:ofe}),iTe=cs({getParentRoute:()=>Qs,path:"/config/model",component:Jme}),aTe=cs({getParentRoute:()=>Qs,path:"/config/adapter",component:t0e}),lTe=cs({getParentRoute:()=>Qs,path:"/resource/emoji",component:Owe}),oTe=cs({getParentRoute:()=>Qs,path:"/resource/expression",component:Pwe}),cTe=cs({getParentRoute:()=>Qs,path:"/resource/person",component:Wwe}),uTe=cs({getParentRoute:()=>Qs,path:"/resource/knowledge-graph",component:Lje}),dTe=cs({getParentRoute:()=>Qs,path:"/logs",component:T8e}),hTe=cs({getParentRoute:()=>Qs,path:"/plugins",component:W8e}),fTe=cs({getParentRoute:()=>Qs,path:"/plugin-config",component:G8e}),mTe=cs({getParentRoute:()=>Qs,path:"/plugin-mirrors",component:X8e}),pTe=cs({getParentRoute:()=>Qs,path:"/settings",component:Qte}),gTe=cs({getParentRoute:()=>Np,path:"*",component:gL}),xTe=Np.addChildren([eTe,tTe,Qs.addChildren([nTe,rTe,sTe,iTe,aTe,lTe,oTe,cTe,uTe,hTe,fTe,mTe,dTe,pTe]),gTe]),vTe=dY({routeTree:xTe,defaultNotFoundComponent:gL,defaultErrorComponent:({error:t})=>l.jsx(EW,{error:t})});function yTe({children:t,defaultTheme:e="system",storageKey:n="ui-theme",...r}){const[s,i]=b.useState(()=>localStorage.getItem(n)||e);b.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),s==="system"){const c=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";o.classList.add(c);return}o.classList.add(s)},[s]),b.useEffect(()=>{const o=localStorage.getItem("accent-color");if(o){const c=document.documentElement,f={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%)"}}[o];f&&(c.style.setProperty("--primary",f.hsl),f.gradient?(c.style.setProperty("--primary-gradient",f.gradient),c.classList.add("has-gradient")):(c.style.removeProperty("--primary-gradient"),c.classList.remove("has-gradient")))}},[]);const a={theme:s,setTheme:o=>{localStorage.setItem(n,o),i(o)}};return l.jsx(LP.Provider,{...r,value:a,children:t})}function bTe({children:t,defaultEnabled:e=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:s="enable-waves-background"}){const[i,a]=b.useState(()=>{const f=localStorage.getItem(r);return f!==null?f==="true":e}),[o,c]=b.useState(()=>{const f=localStorage.getItem(s);return f!==null?f==="true":n});b.useEffect(()=>{const f=document.documentElement;i?f.classList.remove("no-animations"):f.classList.add("no-animations"),localStorage.setItem(r,String(i))},[i,r]),b.useEffect(()=>{localStorage.setItem(s,String(o))},[o,s]);const h={enableAnimations:i,setEnableAnimations:a,enableWavesBackground:o,setEnableWavesBackground:c};return l.jsx(IP.Provider,{value:h,children:t})}var WO="ToastProvider",[GO,wTe,STe]=Cv("Toast"),[_W]=ha("Toast",[STe]),[kTe,Vy]=_W(WO),MW=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[o,c]=b.useState(null),[h,f]=b.useState(0),m=b.useRef(!1),g=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${WO}\`. Expected non-empty \`string\`.`),l.jsx(GO.Provider,{scope:e,children:l.jsx(kTe,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:h,viewport:o,onViewportChange:c,onToastAdd:b.useCallback(()=>f(x=>x+1),[]),onToastRemove:b.useCallback(()=>f(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:g,children:a})})};MW.displayName=WO;var AW="ToastViewport",jTe=["F8"],Ik="toast.viewportPause",Bk="toast.viewportResume",RW=b.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=jTe,label:s="Notifications ({hotkey})",...i}=t,a=Vy(AW,n),o=wTe(n),c=b.useRef(null),h=b.useRef(null),f=b.useRef(null),m=b.useRef(null),g=Bn(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(C=>k[C]||k.code===C)&&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 N=()=>{if(!a.isClosePausedRef.current){const E=new CustomEvent(Ik);k.dispatchEvent(E),a.isClosePausedRef.current=!0}},C=()=>{if(a.isClosePausedRef.current){const E=new CustomEvent(Bk);k.dispatchEvent(E),a.isClosePausedRef.current=!1}},T=E=>{!S.contains(E.relatedTarget)&&C()},_=()=>{S.contains(document.activeElement)||C()};return S.addEventListener("focusin",N),S.addEventListener("focusout",T),S.addEventListener("pointermove",N),S.addEventListener("pointerleave",_),window.addEventListener("blur",N),window.addEventListener("focus",C),()=>{S.removeEventListener("focusin",N),S.removeEventListener("focusout",T),S.removeEventListener("pointermove",N),S.removeEventListener("pointerleave",_),window.removeEventListener("blur",N),window.removeEventListener("focus",C)}}},[y,a.isClosePausedRef]);const w=b.useCallback(({tabbingDirection:S})=>{const N=o().map(C=>{const T=C.ref.current,_=[T,...LTe(T)];return S==="forwards"?_:_.reverse()});return(S==="forwards"?N.reverse():N).flat()},[o]);return b.useEffect(()=>{const S=m.current;if(S){const k=N=>{const C=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!C){const _=document.activeElement,E=N.shiftKey;if(N.target===S&&E){h.current?.focus();return}const P=w({tabbingDirection:E?"backwards":"forwards"}),I=P.findIndex(Q=>Q===_);M3(P.slice(I+1))?N.preventDefault():E?h.current?.focus():f.current?.focus()}};return S.addEventListener("keydown",k),()=>S.removeEventListener("keydown",k)}},[o,w]),l.jsxs(NK,{ref:c,role:"region","aria-label":s.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&l.jsx(qk,{ref:h,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"forwards"});M3(S)}}),l.jsx(GO.Slot,{scope:n,children:l.jsx(on.ol,{tabIndex:-1,...i,ref:g})}),y&&l.jsx(qk,{ref:f,onFocusFromOutsideViewport:()=>{const S=w({tabbingDirection:"backwards"});M3(S)}})]})});RW.displayName=AW;var DW="ToastFocusProxy",qk=b.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=Vy(DW,n);return l.jsx(rz,{tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{const o=a.relatedTarget;!i.viewport?.contains(o)&&r()}})});qk.displayName=DW;var Cp="Toast",OTe="toast.swipeStart",NTe="toast.swipeMove",CTe="toast.swipeCancel",TTe="toast.swipeEnd",zW=b.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[o,c]=wo({prop:r,defaultProp:s??!0,onChange:i,caller:Cp});return l.jsx(Fs,{present:n||o,children:l.jsx(MTe,{open:o,...a,ref:e,onClose:()=>c(!1),onPause:Os(t.onPause),onResume:Os(t.onResume),onSwipeStart:tt(t.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:tt(t.onSwipeMove,h=>{const{x:f,y:m}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:tt(t.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:tt(t.onSwipeEnd,h=>{const{x:f,y:m}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),c(!1)})})})});zW.displayName=Cp;var[ETe,_Te]=_W(Cp,{onClose(){}}),MTe=b.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:o,onPause:c,onResume:h,onSwipeStart:f,onSwipeMove:m,onSwipeCancel:g,onSwipeEnd:x,...y}=t,w=Vy(Cp,n),[S,k]=b.useState(null),N=Bn(e,z=>k(z)),C=b.useRef(null),T=b.useRef(null),_=s||w.duration,E=b.useRef(0),M=b.useRef(_),L=b.useRef(0),{onToastAdd:P,onToastRemove:I}=w,Q=Os(()=>{S?.contains(document.activeElement)&&w.viewport?.focus(),a()}),U=b.useCallback(z=>{!z||z===1/0||(window.clearTimeout(L.current),E.current=new Date().getTime(),L.current=window.setTimeout(Q,z))},[Q]);b.useEffect(()=>{const z=w.viewport;if(z){const H=()=>{U(M.current),h?.()},B=()=>{const X=new Date().getTime()-E.current;M.current=M.current-X,window.clearTimeout(L.current),c?.()};return z.addEventListener(Ik,B),z.addEventListener(Bk,H),()=>{z.removeEventListener(Ik,B),z.removeEventListener(Bk,H)}}},[w.viewport,_,c,h,U]),b.useEffect(()=>{i&&!w.isClosePausedRef.current&&U(_)},[i,_,w.isClosePausedRef,U]),b.useEffect(()=>(P(),()=>I()),[P,I]);const ee=b.useMemo(()=>S?$W(S):null,[S]);return w.viewport?l.jsxs(l.Fragment,{children:[ee&&l.jsx(ATe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:ee}),l.jsx(ETe,{scope:n,onClose:Q,children:fu.createPortal(l.jsx(GO.ItemSlot,{scope:n,children:l.jsx(CK,{asChild:!0,onEscapeKeyDown:tt(o,()=>{w.isFocusedToastEscapeKeyDownRef.current||Q(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(on.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":w.swipeDirection,...y,ref:N,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:tt(t.onKeyDown,z=>{z.key==="Escape"&&(o?.(z.nativeEvent),z.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,Q()))}),onPointerDown:tt(t.onPointerDown,z=>{z.button===0&&(C.current={x:z.clientX,y:z.clientY})}),onPointerMove:tt(t.onPointerMove,z=>{if(!C.current)return;const H=z.clientX-C.current.x,B=z.clientY-C.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,H):0,se=J?0:G(0,B),W=z.pointerType==="touch"?10:2,F={x:R,y:se},V={originalEvent:z,delta:F};X?(T.current=F,Yx(NTe,m,V,{discrete:!1})):kD(F,w.swipeDirection,W)?(T.current=F,Yx(OTe,f,V,{discrete:!1}),z.target.setPointerCapture(z.pointerId)):(Math.abs(H)>W||Math.abs(B)>W)&&(C.current=null)}),onPointerUp:tt(t.onPointerUp,z=>{const H=T.current,B=z.target;if(B.hasPointerCapture(z.pointerId)&&B.releasePointerCapture(z.pointerId),T.current=null,C.current=null,H){const X=z.currentTarget,J={originalEvent:z,delta:H};kD(H,w.swipeDirection,w.swipeThreshold)?Yx(TTe,x,J,{discrete:!0}):Yx(CTe,g,J,{discrete:!0}),X.addEventListener("click",G=>G.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),ATe=t=>{const{__scopeToast:e,children:n,...r}=t,s=Vy(Cp,e),[i,a]=b.useState(!1),[o,c]=b.useState(!1);return zTe(()=>a(!0)),b.useEffect(()=>{const h=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(h)},[]),o?null:l.jsx(Mv,{asChild:!0,children:l.jsx(rz,{...r,children:i&&l.jsxs(l.Fragment,{children:[s.label," ",n]})})})},RTe="ToastTitle",PW=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return l.jsx(on.div,{...r,ref:e})});PW.displayName=RTe;var DTe="ToastDescription",LW=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return l.jsx(on.div,{...r,ref:e})});LW.displayName=DTe;var IW="ToastAction",BW=b.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?l.jsx(FW,{altText:n,asChild:!0,children:l.jsx(XO,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${IW}\`. Expected non-empty \`string\`.`),null)});BW.displayName=IW;var qW="ToastClose",XO=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=_Te(qW,n);return l.jsx(FW,{asChild:!0,children:l.jsx(on.button,{type:"button",...r,ref:e,onClick:tt(t.onClick,s.onClose)})})});XO.displayName=qW;var FW=b.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return l.jsx(on.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function $W(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),PTe(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(...$W(r))}}),e}function Yx(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?nz(s,i):s.dispatchEvent(i)}var kD=(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 zTe(t=()=>{}){const e=Os(t);Xk(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function PTe(t){return t.nodeType===t.ELEMENT_NODE}function LTe(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 M3(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var ITe=MW,QW=RW,HW=zW,VW=PW,UW=LW,WW=BW,GW=XO;const BTe=ITe,XW=b.forwardRef(({className:t,...e},n)=>l.jsx(QW,{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}));XW.displayName=QW.displayName;const qTe=Ih("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"}}),YW=b.forwardRef(({className:t,variant:e,...n},r)=>l.jsx(HW,{ref:r,className:ve(qTe({variant:e}),t),...n}));YW.displayName=HW.displayName;const FTe=b.forwardRef(({className:t,...e},n)=>l.jsx(WW,{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}));FTe.displayName=WW.displayName;const KW=b.forwardRef(({className:t,...e},n)=>l.jsx(GW,{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:l.jsx(P0,{className:"h-4 w-4"})}));KW.displayName=GW.displayName;const ZW=b.forwardRef(({className:t,...e},n)=>l.jsx(VW,{ref:n,className:ve("text-sm font-semibold [&+div]:text-xs",t),...e}));ZW.displayName=VW.displayName;const JW=b.forwardRef(({className:t,...e},n)=>l.jsx(UW,{ref:n,className:ve("text-sm opacity-90",t),...e}));JW.displayName=UW.displayName;function $Te(){const{toasts:t}=ts();return l.jsxs(BTe,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return l.jsxs(YW,{...i,children:[l.jsxs("div",{className:"grid gap-1",children:[n&&l.jsx(ZW,{children:n}),r&&l.jsx(JW,{children:r})]}),s,l.jsx(KW,{})]},e)}),l.jsx(XW,{})]})}aZ.createRoot(document.getElementById("root")).render(l.jsx(b.StrictMode,{children:l.jsx(J9e,{children:l.jsx(yTe,{defaultTheme:"system",children:l.jsxs(bTe,{children:[l.jsx(fY,{router:vTe}),l.jsx($Te,{})]})})})})); diff --git a/webui/dist/index.html b/webui/dist/index.html index 12fade0d..e0ee1d7f 100644 --- a/webui/dist/index.html +++ b/webui/dist/index.html @@ -7,13 +7,13 @@ MaiBot Dashboard - + - + - - + +