mysql-dashboard 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -283,7 +283,7 @@ html body {
283
283
  > ${t}-wrapper:only-child,
284
284
  > ${t}-expanded-row-fixed > ${t}-wrapper:only-child
285
285
  `]:{[t]:{marginBlock:Q(h(n).mul(-1).equal()),marginInline:`${Q(h(a).sub(o).equal())}
286
- ${Q(h(o).mul(-1).equal())}`,[`${t}-tbody > tr:last-child > td`]:{borderBottomWidth:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:d,fontWeight:r,textAlign:"start",background:p,borderBottom:y,transition:`background-color ${m} ease`},[`& > ${t}-measure-cell`]:{paddingBlock:"0 !important",borderBlock:"0 !important",[`${t}-measure-cell-content`]:{height:0,overflow:"hidden",pointerEvents:"none"}}}},[`${t}-footer`]:{padding:`${Q(n)} ${Q(o)}`,color:b,background:g}}}},hpe=e=>{let{colorFillAlter:t,colorBgContainer:r,colorTextHeading:n,colorFillSecondary:o,colorFillContent:a,controlItemBgActive:i,controlItemBgActiveHover:l,padding:s,paddingSM:c,paddingXS:u,colorBorderSecondary:f,borderRadiusLG:d,controlHeight:m,colorTextPlaceholder:p,fontSize:x,fontSizeSM:b,lineHeight:g,lineWidth:h,colorIcon:y,colorIconHover:v,opacityLoading:S,controlInteractiveSize:R}=e,C=new yt(o).onBackground(r).toHexString(),N=new yt(a).onBackground(r).toHexString(),E=new yt(t).onBackground(r).toHexString(),O=new yt(y),w=new yt(v),A=R/2-h,T=A*2+h*3;return{headerBg:E,headerColor:n,headerSortActiveBg:C,headerSortHoverBg:N,bodySortBg:E,rowHoverBg:E,rowSelectedBg:i,rowSelectedHoverBg:l,rowExpandedBg:t,cellPaddingBlock:s,cellPaddingInline:s,cellPaddingBlockMD:c,cellPaddingInlineMD:u,cellPaddingBlockSM:u,cellPaddingInlineSM:u,borderColor:f,headerBorderRadius:d,footerBg:E,footerColor:n,cellFontSize:x,cellFontSizeMD:x,cellFontSizeSM:x,headerSplitColor:f,fixedHeaderSortActiveBg:C,headerFilterHoverBg:a,filterDropdownMenuBg:r,filterDropdownBg:r,expandIconBg:r,selectionColumnWidth:m,stickyScrollBarBg:p,stickyScrollBarBorderRadius:100,expandIconMarginTop:(x*g-h*3)/2-Math.ceil((b*1.4-h*3)/2),headerIconColor:O.clone().setA(O.a*S).toRgbString(),headerIconHoverColor:w.clone().setA(w.a*S).toRgbString(),expandIconHalfInner:A,expandIconSize:T,expandIconScale:R/T}},gpe=2,$q=ft("Table",e=>{let{colorTextHeading:t,colorSplit:r,colorBgContainer:n,controlInteractiveSize:o,headerBg:a,headerColor:i,headerSortActiveBg:l,headerSortHoverBg:s,bodySortBg:c,rowHoverBg:u,rowSelectedBg:f,rowSelectedHoverBg:d,rowExpandedBg:m,cellPaddingBlock:p,cellPaddingInline:x,cellPaddingBlockMD:b,cellPaddingInlineMD:g,cellPaddingBlockSM:h,cellPaddingInlineSM:y,borderColor:v,footerBg:S,footerColor:R,headerBorderRadius:C,cellFontSize:N,cellFontSizeMD:E,cellFontSizeSM:O,headerSplitColor:w,fixedHeaderSortActiveBg:A,headerFilterHoverBg:T,filterDropdownBg:k,expandIconBg:L,selectionColumnWidth:H,stickyScrollBarBg:_,calc:F}=e,z=nt(e,{tableFontSize:N,tableBg:n,tableRadius:C,tablePaddingVertical:p,tablePaddingHorizontal:x,tablePaddingVerticalMiddle:b,tablePaddingHorizontalMiddle:g,tablePaddingVerticalSmall:h,tablePaddingHorizontalSmall:y,tableBorderColor:v,tableHeaderTextColor:i,tableHeaderBg:a,tableFooterTextColor:R,tableFooterBg:S,tableHeaderCellSplitColor:w,tableHeaderSortBg:l,tableHeaderSortHoverBg:s,tableBodySortBg:c,tableFixedHeaderSortActiveBg:A,tableHeaderFilterActiveBg:T,tableFilterDropdownBg:k,tableRowHoverBg:u,tableSelectedRowBg:f,tableSelectedRowHoverBg:d,zIndexTableFixed:gpe,tableFontSizeMiddle:E,tableFontSizeSmall:O,tableSelectionColumnWidth:H,tableExpandIconBg:L,tableExpandColumnWidth:F(o).add(F(e.padding).mul(2)).equal(),tableExpandedRowBg:m,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:_,tableScrollThumbBgHover:t,tableScrollBg:r});return[ppe(z),Cq(z),cD(z),Nq(z),bq(z),hq(z),Sq(z),xq(z),cD(z),yq(z),Eq(z),vq(z),Tq(z),gq(z),wq(z),Rq(z),Oq(z)]},hpe,{resetFont:!1,unitless:{expandIconScale:!0}});var Mq=[],ype=(e,t)=>{var Ut,Ar;let{prefixCls:r,className:n,rootClassName:o,style:a,classNames:i,styles:l,size:s,bordered:c,dropdownPrefixCls:u,dataSource:f,pagination:d,rowSelection:m,rowKey:p,rowClassName:x,columns:b,children:g,childrenColumnName:h,onChange:y,getPopupContainer:v,loading:S,expandIcon:R,expandable:C,expandedRowRender:N,expandIconColumnIndex:E,indentSize:O,scroll:w,sortDirections:A,locale:T,showSorterTooltip:k={target:"full-header"},virtual:L}=e,H=wa("Table"),_=xr.useMemo(()=>b||JE(g),[b,g]),F=xr.useMemo(()=>_.some(Xe=>Xe.responsive),[_]),z=rh(F),M=xr.useMemo(()=>{let Xe=new Set(Object.keys(z).filter(dt=>z[dt]));return _.filter(dt=>!dt.responsive||dt.responsive.some(Ft=>Xe.has(Ft)))},[_,z]),U=gt(e,["className","style","columns"]),{locale:B=go,table:I}=xr.useContext(Ie),{getPrefixCls:j,direction:W,renderEmpty:K,getPopupContainer:Y,className:Z,style:ne,classNames:te,styles:de}=pt("table"),q=lr(Xe=>s==="middle"?"medium":s!=null?s:Xe),X={...e,size:q,bordered:c},[re,V]=ht([te,i],[de,l],{props:X},{pagination:{_default:"root"},header:{_default:"wrapper"},body:{_default:"wrapper"}}),G={...B.Table,...T},[J]=In("global",go.global),ee=f||Mq,ae=j("table",r),ue=j("dropdown",u),[,se]=qt(),Se=Xt(ae),[ye,Pe]=$q(ae,Se),Ne={childrenColumnName:h,expandIconColumnIndex:E,...C,expandIcon:(Ar=C==null?void 0:C.expandIcon)!=null?Ar:(Ut=I==null?void 0:I.expandable)==null?void 0:Ut.expandIcon},{childrenColumnName:oe="children"}=Ne,ce=xr.useMemo(()=>ee.some(Xe=>Xe==null?void 0:Xe[oe])?"nest":N||C!=null&&C.expandedRowRender?"row":null,[oe,ee]),be={body:xr.useRef(null)},me=zA(ae),xe=xr.useRef(null),Ee=xr.useRef(null);R6(t,()=>({...Ee.current,nativeElement:xe.current}));let pe=p||(I==null?void 0:I.rowKey)||"key",Te=w!=null?w:I==null?void 0:I.scroll,Oe=xr.useMemo(()=>typeof pe=="function"?pe:Xe=>Xe==null?void 0:Xe[pe],[pe]),[ge]=QK(ee,oe,Oe),ve={},De=(Xe,dt,Ft=!1)=>{var io,Wr,cn,Wo;let rr={...ve,...Xe};Ft&&((io=ve.resetPagination)==null||io.call(ve),(Wr=rr.pagination)!=null&&Wr.current&&(rr.pagination.current=1),d&&((Wo=d.onChange)==null||Wo.call(d,1,(cn=rr.pagination)==null?void 0:cn.pageSize))),w&&w.scrollToFirstRowOnChange!==!1&&be.body.current&&u2(0,{getContainer:()=>be.body.current}),y==null||y(rr.pagination,rr.filters,rr.sorter,{currentDataSource:Rw(Ow(ee,rr.sorterStates,oe),rr.filterStates,oe),action:dt})},$e=(Xe,dt)=>{De({sorter:Xe,sorterStates:dt},"sort",!1)},[at,He,ie,he]=cq({prefixCls:ae,mergedColumns:M,onSorterChange:$e,sortDirections:A||["ascend","descend"],tableLocale:G,showSorterTooltip:k,globalLocale:J}),ze=xr.useMemo(()=>Ow(ee,He,oe),[oe,ee,He]);ve.sorter=he(),ve.sorterStates=He;let ut=(Xe,dt)=>{De({filters:Xe,filterStates:dt},"filter",!0)},[Be,tt,et]=XK({prefixCls:ae,locale:G,dropdownPrefixCls:ue,mergedColumns:M,onFilterChange:ut,getPopupContainer:v||Y,rootClassName:D(o,Se)}),We=Rw(ze,tt,oe);ve.filters=et,ve.filterStates=tt;let fe=xr.useMemo(()=>{let Xe={};return Object.keys(et).forEach(dt=>{et[dt]!==null&&(Xe[dt]=et[dt])}),{...ie,filters:Xe}},[ie,et]),[Re]=dq(fe),Fe=(Xe,dt)=>{De({pagination:{...ve.pagination,current:Xe,pageSize:dt}},"paginate")},[Ce,Ae]=eq(We.length,Fe,d);ve.pagination=d===!1?{}:JK(Ce,d),ve.resetPagination=Ae;let ke=xr.useMemo(()=>{if(d===!1||!Ce.pageSize)return We;let{current:Xe=1,total:dt,pageSize:Ft=nD}=Ce;return We.length<dt?We.length>Ft?We.slice((Xe-1)*Ft,Xe*Ft):We:We.slice((Xe-1)*Ft,Xe*Ft)},[!!d,We,Ce==null?void 0:Ce.current,Ce==null?void 0:Ce.pageSize,Ce==null?void 0:Ce.total]),[Ve,Qe]=JW({prefixCls:ae,data:We,pageData:ke,getRowKey:Oe,getRecordByKey:ge,expandType:ce,childrenColumnName:oe,locale:G,getPopupContainer:v||Y},m),Zt=(Xe,dt,Ft)=>{let rr=typeof x=="function"?x(Xe,dt,Ft):x;return D({[`${ae}-row-selected`]:Qe.has(Oe(Xe,dt))},rr)};Ne.__PARENT_RENDER_ICON__=Ne.expandIcon,Ne.expandIcon=Ne.expandIcon||R||tK(G),ce==="nest"&&Ne.expandIconColumnIndex===void 0?Ne.expandIconColumnIndex=m?1:0:Ne.expandIconColumnIndex>0&&m&&(Ne.expandIconColumnIndex-=1),typeof Ne.indentSize!="number"&&(Ne.indentSize=typeof O=="number"?O:15);let jt=xr.useCallback(Xe=>Re(Ve(Be(at(Xe)))),[at,Be,Ve]),Rt,vr;if(d!==!1&&(Ce!=null&&Ce.total)){let Xe;Ce.size?Xe=Ce.size:Xe=q==="small"||q==="medium"?"small":void 0;let dt=(cn="end")=>xr.createElement(YU,{...Ce,classNames:re.pagination,styles:V.pagination,className:D(`${ae}-pagination ${ae}-pagination-${cn}`,Ce.className),size:Xe}),{placement:Ft,position:rr}=Ce,io=Ft!=null?Ft:rr,Wr=cn=>{let Wo=cn.toLowerCase();return Wo.includes("center")?"center":Wo.includes("left")||Wo.includes("start")?"start":"end"};if(Array.isArray(io)){let[cn,Wo]=["top","bottom"].map(Pl=>io.find(Al=>Al.includes(Pl))),gf=io.every(Pl=>`${Pl}`=="none");!cn&&!Wo&&!gf&&(vr=dt()),cn&&(Rt=dt(Wr(cn))),Wo&&(vr=dt(Wr(Wo)))}else vr=dt()}let gr=xr.useMemo(()=>typeof S=="boolean"?{spinning:S}:typeof S=="object"&&S!==null?{spinning:!0,...S}:void 0,[S]),zt=D(Pe,Se,`${ae}-wrapper`,Z,{[`${ae}-wrapper-rtl`]:W==="rtl"},n,o,re.root,ye),bt={...V.root,...ne,...a},Le=xr.useMemo(()=>gr!=null&&gr.spinning&&ee===Mq?null:typeof(T==null?void 0:T.emptyText)<"u"?T.emptyText:(K==null?void 0:K("Table"))||xr.createElement(fR,{componentName:"Table"}),[gr==null?void 0:gr.spinning,ee,T==null?void 0:T.emptyText,K]),qe=L?pq:mq,it={},wt=xr.useMemo(()=>{let{fontSize:Xe,lineHeight:dt,lineWidth:Ft,padding:rr,paddingXS:io,paddingSM:Wr}=se,cn=Math.floor(Xe*dt);switch(q){case"medium":return Wr*2+cn+Ft;case"small":return io*2+cn+Ft;default:return rr*2+cn+Ft}},[se,q]);return L&&(it.listItemHeight=wt),xr.createElement("div",{ref:xe,className:zt,style:bt},xr.createElement(Dx,{spinning:!1,...gr},Rt,xr.createElement(qe,{...it,...U,scroll:Te,classNames:re,styles:V,ref:Ee,columns:M,direction:W,expandable:Ne,prefixCls:ae,className:D({[`${ae}-medium`]:q==="medium",[`${ae}-small`]:q==="small",[`${ae}-bordered`]:c,[`${ae}-empty`]:ee.length===0},Pe,Se,ye),data:ke,rowKey:Oe,rowClassName:Zt,emptyText:Le,internalHooks:ps,internalRefs:be,transformColumns:jt,getContainerWidth:me,measureRowRender:Xe=>xr.createElement(ih.Provider,{value:!0},xr.createElement(gl,{getPopupContainer:dt=>dt},Xe))}),vr))},Iq=xr.forwardRef(ype);var xpe=(e,t)=>{let r=Dh.useRef(0);return r.current+=1,Dh.createElement(Iq,{...e,ref:t,_renderTimes:r.current})},bc=Dh.forwardRef(xpe);bc.SELECTION_COLUMN=yc;bc.EXPAND_COLUMN=Ji;bc.SELECTION_ALL=iw;bc.SELECTION_INVERT=lw;bc.SELECTION_NONE=sw;bc.Column=WW;bc.ColumnGroup=KW;bc.Summary=Fx;var Pq=bc;var of=Pq;var kn=$(P());var af=$(P());var bpe=e=>{let{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:o,calc:a}=e,i=a(n).sub(r).equal(),l=a(t).sub(r).equal();return{[o]:{...At(e),display:"inline-block",height:"auto",paddingInline:i,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",backgroundColor:e.defaultBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${o}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${o}-close-icon`]:{marginInlineStart:l,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${o}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive},"&-disabled":{cursor:"not-allowed",[`&:not(${o}-checkable-checked)`]:{color:e.colorTextDisabled,"&:hover":{backgroundColor:"transparent"}},[`&${o}-checkable-checked`]:{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled},"&:hover, &:active":{backgroundColor:e.colorBgContainerDisabled,color:e.colorTextDisabled},[`&:not(${o}-checkable-checked):hover`]:{color:e.colorTextDisabled}},"&-group":{display:"flex",flexWrap:"wrap",gap:e.paddingXS}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:i}},[`&${e.componentCls}-solid`]:{borderColor:"transparent",color:e.colorTextLightSolid,backgroundColor:e.colorBgSolid,[`&${o}-default`]:{color:e.solidTextColor}},[`${o}-filled`]:{borderColor:"transparent",backgroundColor:e.tagBorderlessBg},[`&${o}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",backgroundColor:e.colorBgContainerDisabled,a:{cursor:"not-allowed",pointerEvents:"none",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}},"a&":{"&:hover, &:active":{color:e.colorTextDisabled}},[`&${o}-outlined`]:{borderColor:e.colorBorderDisabled},[`&${o}-solid, &${o}-filled`]:{color:e.colorTextDisabled,[`${o}-close-icon`]:{color:e.colorTextDisabled}},[`${o}-close-icon`]:{cursor:"not-allowed",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}}}}},Xx=e=>{let{lineWidth:t,fontSizeIcon:r,calc:n}=e,o=e.fontSizeSM;return nt(e,{tagFontSize:o,tagLineHeight:Q(n(e.lineHeightSM).mul(o).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},Yx=e=>{let t=sS(new yd(e.colorBgSolid),"#fff")?"#000":"#fff";return{defaultBg:new yt(e.colorFillTertiary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText,solidTextColor:t}},kh=ft("Tag",e=>{let t=Xx(e);return bpe(t)},Yx);var vpe=af.forwardRef((e,t)=>{let{prefixCls:r,style:n,className:o,checked:a,children:i,icon:l,onChange:s,onClick:c,disabled:u,...f}=e,{getPrefixCls:d,tag:m}=af.useContext(Ie),p=af.useContext(mn),x=u!=null?u:p,b=S=>{x||(s==null||s(!a),c==null||c(S))},g=d("tag",r),[h,y]=kh(g),v=D(g,`${g}-checkable`,{[`${g}-checkable-checked`]:a,[`${g}-checkable-disabled`]:x},m==null?void 0:m.className,o,h,y);return af.createElement("span",{...f,ref:t,style:{...n,...m==null?void 0:m.style},className:v,onClick:b},l,af.createElement("span",null,i))}),$w=vpe;var vc=$(P());var Cpe=vc.default.forwardRef((e,t)=>{let{id:r,prefixCls:n,rootClassName:o,className:a,style:i,classNames:l,styles:s,disabled:c,options:u,value:f,defaultValue:d,onChange:m,multiple:p,...x}=e,{getPrefixCls:b,direction:g,className:h,style:y,classNames:v,styles:S}=pt("tag"),R=b("tag",n),C=`${R}-checkable-group`,N=Xt(R),[E,O]=kh(R,N),[w,A]=ht([v,l],[S,s],{props:e}),T=(0,vc.useMemo)(()=>Array.isArray(u)?u.map(z=>z&&typeof z=="object"?z:{value:z,label:z}):[],[u]),[k,L]=Lt(d,f),H=(z,M)=>{let U=null;if(p){let B=k||[];U=z?[].concat(Ke(B),[M.value]):B.filter(I=>I!==M.value)}else U=z?M.value:null;L(U),m==null||m(U)},_=vc.default.useRef(null);(0,vc.useImperativeHandle)(t,()=>({nativeElement:_.current}));let F=mr(x,{aria:!0,data:!0});return vc.default.createElement("div",{...F,className:D(C,h,o,{[`${C}-disabled`]:c,[`${C}-rtl`]:g==="rtl"},E,O,a,w.root),style:{...y,...A.root,...i},id:r,ref:_},T.map(z=>vc.default.createElement($w,{key:z.value,className:D(`${C}-item`,w.item),style:A.item,checked:p?(k||[]).includes(z.value):k===z.value,onChange:M=>H(M,z),disabled:c},z.label)))}),Aq=Cpe;var Dq=$(P());function uD(e,t){let{color:r,variant:n,bordered:o}=e;return Dq.useMemo(()=>{let a=r==null?void 0:r.endsWith("-inverse"),i;n?i=n:a?i="solid":o===!1?i="filled":i=t||"filled";let l=a?r==null?void 0:r.replace("-inverse",""):r,s=RR(r),c=w7(r),u={};if(!s&&!c&&l)if(i==="solid")u.backgroundColor=r;else{let f=new yt(l).toHsl();f.l=.95,u.backgroundColor=new yt(f).toHexString(),u.color=r,i==="outlined"&&(u.borderColor=r)}return[i,l,s,c,u]},[r,n,o,t])}var Spe=e=>yp(e,(t,{textColor:r,lightBorderColor:n,lightColor:o,darkColor:a})=>({[`${e.componentCls}${e.componentCls}-${t}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:o,borderColor:n,color:r},[`&${e.componentCls}-solid`]:{backgroundColor:a,borderColor:a,color:e.colorTextLightSolid},[`&${e.componentCls}-filled`]:{backgroundColor:o,color:r}}})),kq=ai(["Tag","preset"],e=>{let t=Xx(e);return Spe(t)},Yx);function fD(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}var Mw=(e,t,r)=>{let n=fD(r);return{[`${e.componentCls}${e.componentCls}-${t}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:e[`color${n}Bg`],borderColor:e[`color${n}Border`],color:e[`color${r}`]},[`&${e.componentCls}-solid`]:{backgroundColor:e[`color${r}`],borderColor:e[`color${r}`]},[`&${e.componentCls}-filled`]:{backgroundColor:e[`color${n}Bg`],color:e[`color${r}`]}}}},Lq=ai(["Tag","status"],e=>{let t=Xx(e);return[Mw(t,"success","Success"),Mw(t,"processing","Info"),Mw(t,"error","Error"),Mw(t,"warning","Warning")]},Yx);var Rpe=kn.forwardRef((e,t)=>{var G;let{prefixCls:r,className:n,rootClassName:o,style:a,children:i,icon:l,color:s,variant:c,onClose:u,bordered:f,disabled:d,href:m,target:p,styles:x,classNames:b,...g}=e,{getPrefixCls:h,direction:y,className:v,variant:S,style:R,classNames:C,styles:N}=pt("tag"),[E,O,w,A,T]=uD(e,S),k=w||A,L=kn.useContext(mn),H=d!=null?d:L,{tag:_}=kn.useContext(Ie),[F,z]=kn.useState(!0),M=gt(g,["closeIcon","closable"]),U={...e,color:O,variant:E,disabled:H},[B,I]=ht([C,b],[N,x],{props:U}),j=kn.useMemo(()=>{let J={...I.root,...R,...a};return H||(J={...T,...J}),J},[I.root,R,a,T,H]),W=h("tag",r),[K,Y]=kh(W),Z=D(W,v,B.root,`${W}-${E}`,{[`${W}-${O}`]:k,[`${W}-hidden`]:!F,[`${W}-rtl`]:y==="rtl",[`${W}-disabled`]:H},n,o,K,Y),ne=J=>{H||(J.stopPropagation(),u==null||u(J),!J.defaultPrevented&&z(!1))},[,te]=NC(Sp(e),Sp(_),{closable:!1,closeIconRender:J=>{let ee=kn.createElement("span",{className:`${W}-close-icon`,onClick:ne},J);return $2(J,ee,ae=>({onClick:ue=>{var se;(se=ae==null?void 0:ae.onClick)==null||se.call(ae,ue),ne(ue)},className:D(ae==null?void 0:ae.className,`${W}-close-icon`)}))}}),de=typeof g.onClick=="function"||i&&i.type==="a",q=Er(l,{className:D(kn.isValidElement(l)?(G=l.props)==null?void 0:G.className:void 0,B.icon),style:I.icon}),X=q?kn.createElement(kn.Fragment,null,q,i&&kn.createElement("span",{className:B.content,style:I.content},i)):i,V=kn.createElement(m?"a":"span",{...M,ref:t,className:Z,style:j,href:H?void 0:m,target:p,onClick:H?void 0:M.onClick,...m&&H?{"aria-disabled":!0}:{}},X,te,w&&kn.createElement(kq,{key:"preset",prefixCls:W}),A&&kn.createElement(Lq,{key:"status",prefixCls:W}));return de?kn.createElement(gu,{component:"Tag"},V):V}),dD=Rpe;dD.CheckableTag=$w;dD.CheckableTagGroup=Aq;var mD=dD;var Epe=e=>{let t=e!=null&&e.algorithm?Kl(e.algorithm):Qf,r={...hl,...e==null?void 0:e.token};return Tv(r,{override:e==null?void 0:e.token},t,my)},_q=Epe;function pD(e){let{sizeUnit:t,sizeStep:r}=e,n=r-2;return{sizeXXL:t*(n+10),sizeXL:t*(n+6),sizeLG:t*(n+2),sizeMD:t*(n+2),sizeMS:t*(n+1),size:t*n,sizeSM:t*n,sizeXS:t*(n-1),sizeXXS:t*(n-1)}}var wpe=(e,t)=>{let r=t!=null?t:Us(e),n=r.fontSizeSM,o=r.controlHeight-4;return{...r,...pD(t!=null?t:e),...Gv(n),controlHeight:o,...qv({...r,controlHeight:o})}},zq=wpe;var vi=(e,t)=>new yt(e).setA(t).toRgbString(),lf=(e,t)=>new yt(e).lighten(t).toHexString();var hD=e=>{let t=Vi(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},Bq=(e,t)=>{let r=e||"#000",n=t||"#fff";return{colorBgBase:r,colorTextBase:n,colorText:vi(n,.85),colorTextSecondary:vi(n,.65),colorTextTertiary:vi(n,.45),colorTextQuaternary:vi(n,.25),colorFill:vi(n,.18),colorFillSecondary:vi(n,.12),colorFillTertiary:vi(n,.08),colorFillQuaternary:vi(n,.04),colorBgSolid:vi(n,.95),colorBgSolidHover:vi(n,1),colorBgSolidActive:vi(n,.9),colorBgElevated:lf(r,12),colorBgContainer:lf(r,8),colorBgLayout:lf(r,0),colorBgSpotlight:lf(r,26),colorBgBlur:vi(n,.04),colorBorder:lf(r,26),colorBorderDisabled:lf(r,26),colorBorderSecondary:lf(r,19)}};var Npe=(e,t)=>{let r=Object.keys(cy).map(i=>{let l=Vi(e[i],{theme:"dark"});return Array.from({length:10},()=>1).reduce((s,c,u)=>(s[`${i}-${u+1}`]=l[u],s[`${i}${u+1}`]=l[u],s),{})}).reduce((i,l)=>(i={...i,...l},i),{}),n=t!=null?t:Us(e),o=dy(e,{generateColorPalettes:hD,generateNeutralColorPalettes:Bq}),a=Ao.reduce((i,l)=>{let s=e[l];if(s){let c=hD(s);i[`${l}Hover`]=c[7],i[`${l}Active`]=c[5]}return i},{});return{...n,...r,...o,...a,colorPrimaryBg:o.colorPrimaryBorder,colorPrimaryBgHover:o.colorPrimaryBorderHover}},Fq=Npe;function Tpe(){let[e,t,r,n]=qt();return{theme:e,token:t,hashId:r,cssVar:n}}var Iw={defaultSeed:lu.token,useToken:Tpe,defaultAlgorithm:Us,darkAlgorithm:Fq,compactAlgorithm:zq,getDesignToken:_q,defaultConfig:lu,_internalContext:Zf};var Pw=$(P());var Ope={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},Hq=Ope;function gD(){return gD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gD.apply(this,arguments)}var $pe=(e,t)=>Pw.createElement(Ge,gD({},e,{ref:t,icon:Hq})),Mpe=Pw.forwardRef($pe),Qx=Mpe;var Aw=$(P());var Ipe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},Vq=Ipe;function yD(){return yD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yD.apply(this,arguments)}var Ppe=(e,t)=>Aw.createElement(Ge,yD({},e,{ref:t,icon:Vq})),Ape=Aw.forwardRef(Ppe),xD=Ape;var sf=$(P()),Xq=$(sr()),qq=(0,sf.createContext)(void 0),Kq="mysql-dashboard-theme",Gq=({children:e})=>{let[t,r]=(0,sf.useState)(()=>typeof window<"u"&&localStorage.getItem(Kq)||"dark");(0,sf.useEffect)(()=>{let a=document.documentElement;t==="dark"?a.classList.add("dark"):a.classList.remove("dark"),localStorage.setItem(Kq,t)},[t]);let n=()=>{r(a=>a==="dark"?"light":"dark")},o=a=>{r(a)};return(0,Xq.jsx)(qq.Provider,{value:{theme:t,toggleTheme:n,setTheme:o},children:e})},kw=()=>{let e=(0,sf.useContext)(qq);if(e===void 0)throw new Error("useTheme \u5FC5\u987B\u5728 ThemeProvider \u5185\u4F7F\u7528");return e};var uf=$(P());var Zx="/api";async function cf(){return(await fetch(`${Zx}/connection/list`,{method:"POST",headers:{"Content-Type":"application/json"}})).json()}async function Yq(e){return(await fetch(`${Zx}/connection/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()}async function Qq(e,t){return(await fetch(`${Zx}/connection/update/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()}async function Zq(e){return(await fetch(`${Zx}/connection/delete/${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})).json()}async function Lw(e){return(await fetch(`${Zx}/connection/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()}var Lh=$(P());var cr=$(sr()),Jq=({connection:e,onSuccess:t,onCancel:r})=>{let[n,o]=(0,Lh.useState)({name:"",host:"localhost",port:3306,username:"",password:"",database:"",connectionString:""}),[a,i]=(0,Lh.useState)(!1),[l,s]=(0,Lh.useState)(!1);(0,Lh.useEffect)(()=>{e&&o({name:e.name,host:e.host,port:e.port||3306,username:e.username||"",password:e.password||"",database:e.database||"",connectionString:e.connectionString||""})},[e]);let c=async f=>{f.preventDefault(),i(!0);try{let d;e!=null&&e._id?d=await Qq(e._id,n):d=await Yq(n),d.success?t():alert(d.message||"\u4FDD\u5B58\u5931\u8D25")}catch{alert("\u4FDD\u5B58\u5931\u8D25")}finally{i(!1)}},u=async()=>{s(!0);try{let f={...n,_id:e==null?void 0:e._id},d=await Lw(f);d.success&&d.data?alert(d.data.message):alert(d.message||"\u6D4B\u8BD5\u5931\u8D25")}catch{alert("\u6D4B\u8BD5\u5931\u8D25")}finally{s(!1)}};return(0,cr.jsxs)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-6 dark:border-gray-700 dark:bg-gray-800/50",children:[(0,cr.jsx)("h3",{className:"mb-4 text-lg font-semibold text-gray-900 dark:text-white",children:e?"\u7F16\u8F91\u8FDE\u63A5":"\u65B0\u5EFA\u8FDE\u63A5"}),(0,cr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-name",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u8FDE\u63A5\u540D\u79F0"}),(0,cr.jsx)("input",{id:"connection-name",type:"text",required:!0,value:n.name,onChange:f=>o({...n,name:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"\u4F8B\u5982: \u672C\u5730 MySQL"})]}),(0,cr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-host",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u4E3B\u673A\u5730\u5740"}),(0,cr.jsx)("input",{id:"connection-host",type:"text",required:!0,value:n.host,onChange:f=>o({...n,host:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"localhost"})]}),(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-port",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u7AEF\u53E3"}),(0,cr.jsx)("input",{id:"connection-port",type:"number",value:n.port,onChange:f=>o({...n,port:parseInt(f.target.value,10)||3306}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"3306"})]})]}),(0,cr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-username",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u7528\u6237\u540D"}),(0,cr.jsx)("input",{id:"connection-username",type:"text",value:n.username,onChange:f=>o({...n,username:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"\u53EF\u9009"})]}),(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-password",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u5BC6\u7801"}),(0,cr.jsx)("input",{id:"connection-password",type:"password",value:n.password,onChange:f=>o({...n,password:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"\u53EF\u9009"})]})]}),(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-database",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u9ED8\u8BA4\u6570\u636E\u5E93"}),(0,cr.jsx)("input",{id:"connection-database",type:"text",value:n.database,onChange:f=>o({...n,database:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"\u53EF\u9009\uFF0C\u8FDE\u63A5\u540E\u53EF\u6D4F\u89C8\u6240\u6709\u5E93"})]}),(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-string",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u8FDE\u63A5 URI\uFF08\u53EF\u9009\uFF0C\u4F18\u5148\u7EA7\u9AD8\u4E8E\u4EE5\u4E0A\u914D\u7F6E\uFF09"}),(0,cr.jsx)("input",{id:"connection-string",type:"text",value:n.connectionString,onChange:f=>o({...n,connectionString:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"mysql://user:password@localhost:3306/dbname"})]}),(0,cr.jsxs)("div",{className:"flex gap-2",children:[(0,cr.jsx)("button",{type:"submit",disabled:a,className:"flex-1 rounded-md bg-blue-600 px-3 py-1.5 font-medium text-white transition hover:bg-blue-700 disabled:opacity-50",children:a?"\u4FDD\u5B58\u4E2D...":"\u4FDD\u5B58"}),(0,cr.jsx)("button",{type:"button",onClick:u,disabled:l,className:"rounded-md border border-gray-300 bg-white px-3 py-1.5 font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:l?"\u6D4B\u8BD5\u4E2D...":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,cr.jsx)("button",{type:"button",onClick:r,className:"rounded-md border border-gray-300 bg-white px-3 py-1.5 font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:"\u53D6\u6D88"})]})]})]})};var _w=$(P());var Lpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},eG=Lpe;function bD(){return bD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bD.apply(this,arguments)}var _pe=(e,t)=>_w.createElement(Ge,bD({},e,{ref:t,icon:eG})),zpe=_w.forwardRef(_pe),vD=zpe;var zw=$(P());var Bpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"},tG=Bpe;function CD(){return CD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CD.apply(this,arguments)}var Fpe=(e,t)=>zw.createElement(Ge,CD({},e,{ref:t,icon:tG})),Hpe=zw.forwardRef(Fpe),SD=Hpe;var Bw=$(P());var Vpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"},rG=Vpe;function RD(){return RD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RD.apply(this,arguments)}var jpe=(e,t)=>Bw.createElement(Ge,RD({},e,{ref:t,icon:rG})),Upe=Bw.forwardRef(jpe),ED=Upe;var Fw=$(P());var Wpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},nG=Wpe;function wD(){return wD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wD.apply(this,arguments)}var Kpe=(e,t)=>Fw.createElement(Ge,wD({},e,{ref:t,icon:nG})),qpe=Fw.forwardRef(Kpe),ND=qpe;var Hw=$(P());var Gpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},oG=Gpe;function TD(){return TD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TD.apply(this,arguments)}var Xpe=(e,t)=>Hw.createElement(Ge,TD({},e,{ref:t,icon:oG})),Ype=Hw.forwardRef(Xpe),OD=Ype;var Vw=$(P());var Qpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 208H676V232h212v136zm0 224H676V432h212v160zM412 432h200v160H412V432zm200-64H412V232h200v136zm-476 64h212v160H136V432zm0-200h212v136H136V232zm0 424h212v136H136V656zm276 0h200v136H412V656zm476 136H676V656h212v136z"}}]},name:"table",theme:"outlined"},aG=Qpe;function $D(){return $D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$D.apply(this,arguments)}var Zpe=(e,t)=>Vw.createElement(Ge,$D({},e,{ref:t,icon:aG})),Jpe=Vw.forwardRef(Zpe),jw=Jpe;var _h=$(sr()),iG=()=>{let{theme:e,toggleTheme:t}=kw();return(0,_h.jsx)("button",{type:"button",onClick:t,className:"rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm font-medium text-gray-700 transition hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700","aria-label":e==="dark"?"\u5207\u6362\u5230\u4EAE\u8272\u4E3B\u9898":"\u5207\u6362\u5230\u6697\u8272\u4E3B\u9898",children:e==="dark"?(0,_h.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,_h.jsx)("path",{fillRule:"evenodd",d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z",clipRule:"evenodd"})}):(0,_h.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,_h.jsx)("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"})})})};var gn=$(sr()),Ci=({children:e,breadcrumbs:t})=>(0,gn.jsxs)("div",{className:"min-h-screen bg-white text-gray-900 dark:bg-slate-950 dark:text-slate-100",children:[(0,gn.jsx)("header",{className:"border-b border-gray-200 bg-gray-50/50 dark:border-gray-800 dark:bg-gray-900/50",children:(0,gn.jsxs)("div",{className:"container mx-auto px-6 py-4",children:[(0,gn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,gn.jsx)(eu,{to:"/",className:"text-2xl font-bold text-gray-900 dark:text-white hover:opacity-80",children:"MySQL Dashboard"}),(0,gn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,gn.jsx)(dc,{menu:{items:[{key:"readme",label:(0,gn.jsx)(eu,{to:"/help/readme",children:"\u5E2E\u52A9\u624B\u518C"})},{key:"development",label:(0,gn.jsx)(eu,{to:"/help/development",children:"\u5F00\u53D1\u624B\u518C"})}]},placement:"bottomRight",children:(0,gn.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm font-medium text-gray-700 transition hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700","aria-label":"\u5E2E\u52A9\u624B\u518C",children:[(0,gn.jsx)(Px,{className:"text-base"}),(0,gn.jsx)("span",{className:"hidden sm:inline",children:"\u5E2E\u52A9"})]})}),(0,gn.jsxs)("a",{href:"https://gitee.com/shy9120/mysql-dashboard",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm font-medium text-gray-700 transition hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700","aria-label":"\u67E5\u770B\u9879\u76EE\u6E90\u7801",children:[(0,gn.jsx)(ND,{className:"text-base"}),(0,gn.jsx)("span",{className:"hidden sm:inline",children:"Gitee"})]}),(0,gn.jsx)(iG,{})]})]}),t&&t.length>0&&(0,gn.jsx)("nav",{className:"mt-2 flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:t.map((n,o)=>(0,gn.jsxs)("span",{className:"flex items-center gap-2",children:[o>0&&(0,gn.jsx)("span",{className:"text-gray-400",children:">"}),n.path?(0,gn.jsx)(eu,{to:n.path,className:"hover:text-gray-900 dark:hover:text-white",children:n.label}):(0,gn.jsx)("span",{className:"text-gray-900 dark:text-white",children:n.label})]},o))})]})}),(0,gn.jsx)("main",{className:"container mx-auto px-6 py-8",children:e})]});var Ur=$(sr()),lG=()=>{let e=ri(),[t,r]=(0,uf.useState)([]),[n,o]=(0,uf.useState)(!1),[a,i]=(0,uf.useState)(!1),[l,s]=(0,uf.useState)(null),[c,u]=(0,uf.useState)(null);(0,uf.useEffect)(()=>{f()},[]);let f=async()=>{o(!0);try{let h=await cf();h.success&&h.data&&r(h.data)}catch(h){console.error("\u52A0\u8F7D\u8FDE\u63A5\u5217\u8868\u5931\u8D25:",h)}finally{o(!1)}},d=async h=>{bn.confirm({title:"\u5220\u9664\u8FDE\u63A5",content:"\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u4E2A\u8FDE\u63A5\u5417\uFF1F",okText:"\u786E\u8BA4\u5220\u9664",cancelText:"\u53D6\u6D88",okType:"danger",onOk:async()=>{try{let y=await Zq(h);y.success?await f():bn.error({title:"\u5220\u9664\u5931\u8D25",content:y.message||"\u5220\u9664\u5931\u8D25"})}catch{bn.error({title:"\u5220\u9664\u5931\u8D25",content:"\u5220\u9664\u5931\u8D25"})}}})},m=async h=>{u(h._id||null);try{let y=await Lw(h);y.success&&y.data?alert(y.data.message):alert(y.message||"\u6D4B\u8BD5\u5931\u8D25")}catch{alert("\u6D4B\u8BD5\u5931\u8D25")}finally{u(null)}},p=h=>{s(h),i(!0)},x=()=>{i(!1),s(null),f()},b=()=>{i(!1),s(null)},g=h=>{h._id&&e(`/connection/${h._id}`)};return(0,Ur.jsx)(Ci,{children:(0,Ur.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,Ur.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ur.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"MySQL \u8FDE\u63A5"}),(0,Ur.jsx)("button",{type:"button",onClick:()=>{s(null),i(!0)},className:"rounded-md bg-blue-600 px-3 py-1.5 text-sm font-medium text-white transition hover:bg-blue-700",children:"\u65B0\u5EFA\u8FDE\u63A5"})]}),a&&(0,Ur.jsx)(Jq,{connection:l||void 0,onSuccess:x,onCancel:b}),n?(0,Ur.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."}):t.length===0?(0,Ur.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:"\u6682\u65E0\u8FDE\u63A5\uFF0C\u8BF7\u521B\u5EFA\u65B0\u8FDE\u63A5"}):(0,Ur.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:t.map(h=>(0,Ur.jsxs)("div",{className:"group rounded-md border border-gray-200 bg-gray-50/50 p-4 transition hover:border-gray-300 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800",children:[(0,Ur.jsxs)("div",{className:"mb-3 flex items-start justify-between",children:[(0,Ur.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:h.name}),(0,Ur.jsxs)("div",{className:"flex gap-2 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,Ur.jsx)("button",{type:"button",onClick:()=>p(h),className:"rounded px-1.5 py-0.5 text-xs text-blue-600 transition hover:bg-blue-100 dark:text-blue-400 dark:hover:bg-blue-500/20",children:"\u7F16\u8F91"}),(0,Ur.jsx)("button",{type:"button",onClick:()=>h._id&&d(h._id),className:"rounded px-1.5 py-0.5 text-xs text-red-600 transition hover:bg-red-100 dark:text-red-400 dark:hover:bg-red-500/20",children:"\u5220\u9664"})]})]}),(0,Ur.jsxs)("div",{className:"mb-3 space-y-1 text-sm text-gray-700 dark:text-gray-300",children:[(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("span",{className:"text-gray-500 dark:text-gray-500",children:"\u5730\u5740:"})," ",h.host,":",h.port||3306]}),h.database&&(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("span",{className:"text-gray-500 dark:text-gray-500",children:"\u9ED8\u8BA4\u5E93:"})," ",h.database]}),h.username&&(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("span",{className:"text-gray-500 dark:text-gray-500",children:"\u7528\u6237:"})," ",h.username]})]}),(0,Ur.jsxs)("div",{className:"flex gap-2",children:[(0,Ur.jsx)("button",{type:"button",onClick:()=>g(h),className:"flex-1 rounded-md bg-green-600 px-2.5 py-1.5 text-sm font-medium text-white transition hover:bg-green-700",children:"\u8FDE\u63A5"}),(0,Ur.jsx)("button",{type:"button",onClick:()=>m(h),disabled:c===h._id,className:"rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:c===h._id?"\u6D4B\u8BD5\u4E2D...":"\u6D4B\u8BD5"})]})]},h._id))})]})})};var Vo=$(P());var Uw="/api";async function sG(e){return(await fetch(`${Uw}/database/list`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e})})).json()}async function cG(e,t){return(await fetch(`${Uw}/database/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t})})).json()}async function uG(e,t){return(await fetch(`${Uw}/database/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t})})).json()}async function fG(e,t,r){return(await fetch(`${Uw}/database/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,oldDatabaseName:t,newDatabaseName:r})})).json()}var St=$(sr()),Ww=["mysql","information_schema","performance_schema","sys"],dG=()=>{let{connectionId:e}=Bs(),t=ri(),[r,n]=(0,Vo.useState)(null),[o,a]=(0,Vo.useState)([]),[i,l]=(0,Vo.useState)(!1),[s,c]=(0,Vo.useState)(!1),[u,f]=(0,Vo.useState)(!1),[d,m]=(0,Vo.useState)(!1),[p,x]=(0,Vo.useState)(""),[b,g]=(0,Vo.useState)(null),[h,y]=(0,Vo.useState)(""),[v,S]=(0,Vo.useState)(null),[R,C]=(0,Vo.useState)(!1),[N,E]=(0,Vo.useState)(!1),[O,w]=(0,Vo.useState)(!1),[A,T]=(0,Vo.useState)(null);(0,Vo.useEffect)(()=>{e&&(k(),L())},[e]);let k=async()=>{if(e)try{let j=await cf();if(j.success&&j.data){let W=j.data.find(K=>K._id===e);W?n(W):(alert("\u8FDE\u63A5\u4E0D\u5B58\u5728"),t("/"))}}catch{alert("\u52A0\u8F7D\u8FDE\u63A5\u4FE1\u606F\u5931\u8D25"),t("/")}},L=async()=>{if(e){l(!0);try{let j=await sG(e);j.success&&j.data?a(j.data):alert(j.message||"\u83B7\u53D6\u6570\u636E\u5E93\u5217\u8868\u5931\u8D25")}catch{alert("\u83B7\u53D6\u6570\u636E\u5E93\u5217\u8868\u5931\u8D25")}finally{l(!1)}}},H=j=>{e&&t(`/connection/${e}/database/${encodeURIComponent(j.name)}`)},_=async()=>{if(!e||!p.trim()){T("\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u540D\u79F0");return}let j=p.trim();if(!/^[a-zA-Z0-9_]+$/.test(j)){T("\u6570\u636E\u5E93\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF");return}if(Ww.includes(j.toLowerCase())){T("\u4E0D\u80FD\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u5E93\u540D");return}C(!0),T(null);try{let K=await cG(e,j);K.success?(c(!1),x(""),L()):T(K.message||"\u521B\u5EFA\u6570\u636E\u5E93\u5931\u8D25")}catch(K){T(K instanceof Error?K.message:"\u521B\u5EFA\u6570\u636E\u5E93\u5931\u8D25")}finally{C(!1)}},F=async()=>{if(!e||!b||!h.trim()){T("\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u540D\u79F0");return}let j=h.trim();if(!/^[a-zA-Z0-9_]+$/.test(j)){T("\u6570\u636E\u5E93\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF");return}if(j===b.name){T("\u65B0\u540D\u79F0\u4E0D\u80FD\u4E0E\u5F53\u524D\u540D\u79F0\u76F8\u540C");return}if(Ww.includes(j.toLowerCase())){T("\u4E0D\u80FD\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u5E93\u540D");return}E(!0),T(null);try{let K=await fG(e,b.name,j);K.success?(f(!1),g(null),y(""),L()):T(K.message||"\u91CD\u547D\u540D\u6570\u636E\u5E93\u5931\u8D25")}catch(K){T(K instanceof Error?K.message:"\u91CD\u547D\u540D\u6570\u636E\u5E93\u5931\u8D25")}finally{E(!1)}},z=async()=>{if(!(!e||!v)){w(!0),T(null);try{let j=await uG(e,v.name);j.success?(m(!1),S(null),L()):T(j.message||"\u5220\u9664\u6570\u636E\u5E93\u5931\u8D25")}catch(j){T(j instanceof Error?j.message:"\u5220\u9664\u6570\u636E\u5E93\u5931\u8D25")}finally{w(!1)}}},M=j=>{g(j),y(j.name),T(null),f(!0)},U=j=>{S(j),T(null),m(!0)},B=j=>j<1024?`${j} B`:j<1024*1024?`${(j/1024).toFixed(2)} KB`:j<1024*1024*1024?`${(j/(1024*1024)).toFixed(2)} MB`:`${(j/(1024*1024*1024)).toFixed(2)} GB`,I=r?[{label:"\u8FDE\u63A5\u5217\u8868",path:"/"},{label:r.name}]:[];return i&&!r?(0,St.jsx)(Ci,{breadcrumbs:I,children:(0,St.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."})}):(0,St.jsx)(Ci,{breadcrumbs:I,children:(0,St.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,St.jsxs)("div",{className:"flex items-center justify-between",children:[(0,St.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"\u6570\u636E\u5E93\u5217\u8868"}),(0,St.jsxs)("div",{className:"flex gap-2",children:[(0,St.jsx)("button",{type:"button",onClick:()=>{c(!0),T(null),x("")},className:"rounded-md bg-green-600 px-2.5 py-1 text-sm font-medium text-white transition hover:bg-green-700 dark:bg-green-700 dark:hover:bg-green-800",children:"\u65B0\u5EFA\u6570\u636E\u5E93"}),(0,St.jsx)("button",{type:"button",onClick:L,className:"rounded-md border border-gray-300 bg-white px-2.5 py-1 text-sm font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:"\u5237\u65B0"})]})]}),i?(0,St.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."}):o.length===0?(0,St.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:"\u6682\u65E0\u6570\u636E\u5E93"}):(0,St.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:o.map(j=>(0,St.jsxs)("div",{onClick:()=>H(j),className:"group relative cursor-pointer rounded-md border border-gray-200 bg-gray-50/50 p-4 transition hover:border-gray-300 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800",children:[(0,St.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,St.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:j.name}),j.empty&&(0,St.jsx)("span",{className:"rounded-full bg-gray-200 px-2 py-0.5 text-xs text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"\u7A7A"})]}),(0,St.jsx)("div",{className:"mb-3 text-sm text-gray-600 dark:text-gray-400",children:(0,St.jsxs)("div",{children:["\u4F30\u7B97\u5927\u5C0F: ",B(j.sizeOnDisk)]})}),(0,St.jsxs)("div",{className:"absolute right-2 top-2 flex gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,St.jsx)("button",{type:"button",onClick:W=>{W.stopPropagation(),M(j)},disabled:Ww.includes(j.name.toLowerCase()),className:"rounded-md bg-white/90 p-1.5 text-gray-700 shadow-md transition hover:bg-white disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-700/90 dark:text-gray-300 dark:hover:bg-gray-700",title:"\u91CD\u547D\u540D",children:(0,St.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,St.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,St.jsx)("button",{type:"button",onClick:W=>{W.stopPropagation(),U(j)},disabled:Ww.includes(j.name.toLowerCase()),className:"rounded-md bg-white/90 p-1.5 text-red-600 shadow-md transition hover:bg-white disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-700/90 dark:text-red-400 dark:hover:bg-gray-700",title:"\u5220\u9664",children:(0,St.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,St.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]},j.name))}),(0,St.jsx)(bn,{title:"\u65B0\u5EFA\u6570\u636E\u5E93",open:s,onOk:_,onCancel:()=>{c(!1),x(""),T(null)},confirmLoading:R,okText:"\u521B\u5EFA",cancelText:"\u53D6\u6D88",children:(0,St.jsxs)("div",{className:"mb-4",children:[(0,St.jsx)("label",{htmlFor:"database-name-input",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u6570\u636E\u5E93\u540D\u79F0"}),(0,St.jsx)(on,{id:"database-name-input",value:p,onChange:j=>{x(j.target.value),T(null)},onPressEnter:_,placeholder:"\u4F8B\u5982 my_app"}),A&&(0,St.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:A}),(0,St.jsx)("div",{className:"mt-2 text-xs text-gray-500 dark:text-gray-400",children:"\u4EC5\u652F\u6301\u5B57\u6BCD\u3001\u6570\u5B57\u4E0E\u4E0B\u5212\u7EBF"})]})}),(0,St.jsx)(bn,{title:"\u91CD\u547D\u540D\u6570\u636E\u5E93",open:u&&!!b,onOk:F,onCancel:()=>{f(!1),g(null),y(""),T(null)},confirmLoading:N,okText:"\u91CD\u547D\u540D",cancelText:"\u53D6\u6D88",children:(0,St.jsxs)("div",{className:"mb-4",children:[(0,St.jsx)("label",{htmlFor:"rename-database-input",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u65B0\u6570\u636E\u5E93\u540D\u79F0"}),(0,St.jsx)(on,{id:"rename-database-input",value:h,onChange:j=>{y(j.target.value),T(null)},onPressEnter:F}),A&&(0,St.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:A}),(0,St.jsx)("div",{className:"mt-1 text-xs text-amber-600 dark:text-amber-400",children:"\u5C06\u901A\u8FC7\u65B0\u5EFA\u5E93\u5E76 RENAME TABLE \u7684\u65B9\u5F0F\u8FC1\u79FB\u5168\u90E8\u8868\uFF0C\u6570\u636E\u91CF\u5927\u65F6\u8BF7\u8C28\u614E\u64CD\u4F5C\u3002"})]})}),(0,St.jsx)(bn,{title:"\u5220\u9664\u6570\u636E\u5E93",open:d&&!!v,onOk:z,onCancel:()=>{m(!1),S(null),T(null)},confirmLoading:O,okText:"\u786E\u8BA4\u5220\u9664",cancelText:"\u53D6\u6D88",okType:"danger",children:(0,St.jsxs)("div",{className:"mb-4",children:[(0,St.jsxs)("div",{className:"mb-2 text-sm text-gray-700 dark:text-gray-300",children:["\u786E\u5B9A\u8981\u5220\u9664\u6570\u636E\u5E93 ",(0,St.jsx)("span",{className:"font-semibold text-gray-900 dark:text-white",children:v==null?void 0:v.name})," \u5417\uFF1F"]}),(0,St.jsxs)("div",{className:"mb-2 text-sm text-gray-600 dark:text-gray-400",children:["\u4F30\u7B97\u5927\u5C0F: ",v?B(v.sizeOnDisk):""]}),A&&(0,St.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:A}),(0,St.jsxs)("div",{className:"mt-4 rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-500/10 dark:text-red-400",children:[(0,St.jsx)("strong",{children:"\u8B66\u544A\uFF1A"}),"\u6B64\u64CD\u4F5C\u5C06\u6C38\u4E45\u5220\u9664\u6570\u636E\u5E93\u53CA\u5176\u6240\u6709\u6570\u636E\uFF0C\u4E14\u65E0\u6CD5\u6062\u590D\u3002"]})]})})]})})};var Dt=$(P());function mG(e){let t=e.toLowerCase();return["tinyint","smallint","mediumint","int","integer","bigint"].includes(t)?"integer":["decimal","numeric","float","double","real"].includes(t)?"decimal":["char","varchar"].includes(t)?"string":["tinytext","text","mediumtext","longtext"].includes(t)?"text":["binary","varbinary","blob","tinyblob","mediumblob","longblob"].includes(t)?"binary":["date","datetime","timestamp","time","year"].includes(t)?"temporal":t==="json"?"json":t==="enum"||t==="set"?"enum":"other"}function pG(e){switch(e){case"integer":return"border-0 bg-blue-100 text-blue-900 dark:bg-blue-500/25 dark:text-blue-200";case"decimal":return"border-0 bg-amber-100 text-amber-950 dark:bg-amber-500/20 dark:text-amber-200";case"string":return"border-0 bg-emerald-100 text-emerald-950 dark:bg-emerald-500/20 dark:text-emerald-200";case"text":return"border-0 bg-teal-100 text-teal-950 dark:bg-teal-500/20 dark:text-teal-200";case"binary":return"border-0 bg-slate-200 text-slate-900 dark:bg-slate-500/30 dark:text-slate-100";case"temporal":return"border-0 bg-violet-100 text-violet-950 dark:bg-violet-500/25 dark:text-violet-200";case"json":return"border-0 bg-cyan-100 text-cyan-950 dark:bg-cyan-500/20 dark:text-cyan-200";case"enum":return"border-0 bg-fuchsia-100 text-fuchsia-950 dark:bg-fuchsia-500/20 dark:text-fuchsia-200";default:return"border-0 bg-gray-100 text-gray-900 dark:bg-gray-600/40 dark:text-gray-100"}}var Cc="/api";async function Kw(e,t){return(await fetch(`${Cc}/collection/list`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t})})).json()}async function MD(e,t,r){return(await fetch(`${Cc}/collection/schema`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r})})).json()}async function hG(e,t,r,n=1,o=20){return(await fetch(`${Cc}/collection/documents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,page:n,pageSize:o})})).json()}async function gG(e,t,r,n,o){return(await fetch(`${Cc}/collection/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,filter:n,update:o})})).json()}async function yG(e,t,r,n){return(await fetch(`${Cc}/collection/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,filter:n})})).json()}async function xG(e,t,r,n){return(await fetch(`${Cc}/collection/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,columns:n})})).json()}async function Jx(e,t,r,n){return(await fetch(`${Cc}/collection/alter-schema`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,...n})})).json()}async function bG(e,t,r){return(await fetch(`${Cc}/collection/delete-collection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r})})).json()}async function vG(e,t,r,n){return(await fetch(`${Cc}/collection/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,oldCollectionName:r,newCollectionName:n})})).json()}var CG=$(P());var br=$(sr()),ehe=[{value:"INT",label:"INT"},{value:"BIGINT",label:"BIGINT"},{value:"TINYINT",label:"TINYINT"},{value:"VARCHAR(64)",label:"VARCHAR(64)"},{value:"VARCHAR(255)",label:"VARCHAR(255)"},{value:"TEXT",label:"TEXT"},{value:"DATETIME",label:"DATETIME"},{value:"DATE",label:"DATE"},{value:"TIMESTAMP",label:"TIMESTAMP"},{value:"DECIMAL(10,2)",label:"DECIMAL(10,2)"},{value:"DOUBLE",label:"DOUBLE"},{value:"BOOLEAN",label:"BOOLEAN"}];function SG({open:e,mode:t,existingColumnNames:r,editTarget:n,onCancel:o,onSubmit:a,submitting:i}){var f,d;let[l]=oa.useForm(),s=(f=oa.useWatch("autoIncrement",l))!=null?f:!1;(0,CG.useEffect)(()=>{var m;e&&(t==="add"?l.setFieldsValue({name:"",newName:"",columnType:"VARCHAR(255)",nullable:!0,defaultValue:"",comment:"",autoIncrement:!1,afterColumn:void 0}):n&&l.setFieldsValue({name:n.name,newName:n.name,columnType:n.columnType,nullable:n.nullable,defaultValue:(m=n.defaultValue)!=null?m:"",comment:n.comment||"",autoIncrement:/auto_increment/i.test(n.extra),afterColumn:"__keep__"}))},[e,t,n,l]);let c=[{label:"\u8868\u5C3E\uFF08\u9ED8\u8BA4\uFF09",value:"__end__"},...r.map(m=>({label:`\u5728\u300C${m}\u300D\u4E4B\u540E`,value:m}))],u=n!=null?[{label:"\u4FDD\u6301\u539F\u4F4D\u7F6E",value:"__keep__"},{label:"\u79FB\u5230\u7B2C\u4E00\u5217",value:"__first__"},...r.filter(m=>m!==n.name).map(m=>({label:`\u5728\u300C${m}\u300D\u4E4B\u540E`,value:m}))]:[];return(0,br.jsx)(bn,{title:t==="add"?"\u6DFB\u52A0\u5B57\u6BB5":`\u4FEE\u6539\u5B57\u6BB5 \u2014 ${(d=n==null?void 0:n.name)!=null?d:""}`,open:e,onCancel:o,onOk:()=>l.submit(),confirmLoading:i,okText:"\u4FDD\u5B58",destroyOnClose:!0,width:520,children:(0,br.jsxs)(oa,{form:l,layout:"vertical",onFinish:async m=>{await a(m,t)},children:[t==="add"&&(0,br.jsx)(oa.Item,{name:"name",label:"\u5B57\u6BB5\u540D",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B57\u6BB5\u540D"},{pattern:/^[a-zA-Z0-9_]+$/,message:"\u4EC5\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF"}],children:(0,br.jsx)(on,{placeholder:"\u4EC5\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF"})}),t==="edit"&&(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(oa.Item,{label:"\u5F53\u524D\u5B57\u6BB5\u540D",children:(0,br.jsx)(on,{value:n==null?void 0:n.name,disabled:!0})}),(0,br.jsx)(oa.Item,{name:"newName",label:"\u65B0\u5B57\u6BB5\u540D",tooltip:"\u4E0E\u5F53\u524D\u540D\u79F0\u76F8\u540C\u8868\u793A\u4E0D\u91CD\u547D\u540D",rules:[{pattern:/^[a-zA-Z0-9_]*$/,message:"\u4EC5\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF"}],children:(0,br.jsx)(on,{placeholder:n==null?void 0:n.name})})]}),(0,br.jsx)(oa.Item,{label:"\u7C7B\u578B",children:(0,br.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,br.jsx)(oa.Item,{name:"columnType",noStyle:!0,rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7C7B\u578B"}],children:(0,br.jsx)(on,{className:"min-w-[200px] flex-1",placeholder:"\u5982 VARCHAR(255)"})}),(0,br.jsx)(Cl,{placeholder:"\u5E38\u7528\u7C7B\u578B",className:"min-w-[140px] flex-1",allowClear:!0,options:ehe,onChange:m=>{m&&l.setFieldValue("columnType",m)}})]})}),(0,br.jsx)(oa.Item,{name:"nullable",valuePropName:"checked",label:null,children:(0,br.jsx)(na,{disabled:t==="edit"?s:!1,children:"\u5141\u8BB8 NULL"})}),t==="edit"&&(0,br.jsx)(oa.Item,{name:"autoIncrement",valuePropName:"checked",label:null,children:(0,br.jsx)(na,{onChange:m=>{m.target.checked&&l.setFieldValue("nullable",!1)},children:"AUTO_INCREMENT"})}),(0,br.jsx)(oa.Item,{name:"defaultValue",label:"\u9ED8\u8BA4\u503C",children:(0,br.jsx)(on,{placeholder:"\u7559\u7A7A\u8868\u793A\u4E0D\u8BBE\u7F6E\uFF1BNULL\u3001\u6570\u5B57\u3001CURRENT_TIMESTAMP \u7B49",disabled:t==="edit"&&s})}),(0,br.jsx)(oa.Item,{name:"comment",label:"\u6CE8\u91CA",children:(0,br.jsx)(on,{})}),t==="add"&&(0,br.jsx)(oa.Item,{name:"afterColumn",label:"\u4F4D\u7F6E",children:(0,br.jsx)(Cl,{allowClear:!0,placeholder:"\u9ED8\u8BA4\u6DFB\u52A0\u5230\u8868\u5C3E",options:c})}),t==="edit"&&(0,br.jsx)(oa.Item,{name:"afterColumn",label:"\u4F4D\u7F6E",children:(0,br.jsx)(Cl,{options:u})})]})})}var jo=$(sr()),the=[{value:"INT",label:"INT"},{value:"BIGINT",label:"BIGINT"},{value:"TINYINT",label:"TINYINT"},{value:"VARCHAR(64)",label:"VARCHAR(64)"},{value:"VARCHAR(255)",label:"VARCHAR(255)"},{value:"TEXT",label:"TEXT"},{value:"DATETIME",label:"DATETIME"},{value:"DATE",label:"DATE"},{value:"TIMESTAMP",label:"TIMESTAMP"},{value:"DECIMAL(10,2)",label:"DECIMAL(10,2)"},{value:"DOUBLE",label:"DOUBLE"},{value:"BOOLEAN",label:"BOOLEAN"}];function eb(){return[{id:crypto.randomUUID(),name:"id",columnType:"INT",nullable:!1,defaultValue:"",primaryKey:!0,autoIncrement:!0,comment:""}]}function rhe(){return{id:crypto.randomUUID(),name:"",columnType:"VARCHAR(255)",nullable:!0,defaultValue:"",primaryKey:!1,autoIncrement:!1,comment:""}}function RG({value:e,onChange:t,disabled:r}){let n=(a,i)=>{t(e.map(l=>{if(l.id!==a)return l;let s={...l,...i};return i.primaryKey===!1&&(s.autoIncrement=!1),i.autoIncrement===!0&&(s.primaryKey=!0,s.nullable=!1),s}))};return(0,jo.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,jo.jsx)(of,{size:"small",rowKey:"id",columns:[{title:"\u5B57\u6BB5\u540D",key:"name",width:120,render:(a,i)=>(0,jo.jsx)(on,{size:"small",value:i.name,onChange:l=>n(i.id,{name:l.target.value}),disabled:r,placeholder:"name"})},{title:"\u7C7B\u578B",key:"columnType",width:268,render:(a,i)=>(0,jo.jsxs)(fc,{size:4,wrap:!0,className:"w-full",children:[(0,jo.jsx)(on,{size:"small",value:i.columnType,onChange:l=>n(i.id,{columnType:l.target.value}),disabled:r,className:"min-w-[120px] flex-1"}),(0,jo.jsx)(Cl,{size:"small",disabled:r,placeholder:"\u5E38\u7528",className:"min-w-[116px]",allowClear:!0,options:the,onChange:l=>{l&&n(i.id,{columnType:l})}})]})},{title:"\u53EF\u7A7A",key:"nullable",width:56,render:(a,i)=>(0,jo.jsx)(na,{checked:i.nullable,disabled:r||i.primaryKey||i.autoIncrement,onChange:l=>n(i.id,{nullable:l.target.checked})})},{title:"\u4E3B\u952E",key:"pk",width:52,render:(a,i)=>(0,jo.jsx)(na,{checked:i.primaryKey,disabled:r,onChange:l=>{let s=l.target.checked;n(i.id,{primaryKey:s,autoIncrement:s?i.autoIncrement:!1,nullable:!s})}})},{title:"\u81EA\u589E",key:"ai",width:52,render:(a,i)=>(0,jo.jsx)(na,{checked:i.autoIncrement,disabled:r||!i.primaryKey,onChange:l=>n(i.id,{autoIncrement:l.target.checked,nullable:l.target.checked?!1:i.nullable})})},{title:"\u9ED8\u8BA4",key:"def",width:108,render:(a,i)=>(0,jo.jsx)(on,{size:"small",value:i.defaultValue,onChange:l=>n(i.id,{defaultValue:l.target.value}),disabled:r||i.autoIncrement,placeholder:"\u53EF\u9009"})},{title:"\u6CE8\u91CA",key:"comment",width:100,render:(a,i)=>(0,jo.jsx)(on,{size:"small",value:i.comment,onChange:l=>n(i.id,{comment:l.target.value}),disabled:r})},{title:"",key:"del",width:40,render:(a,i)=>(0,jo.jsx)(Pr,{type:"text",size:"small",danger:!0,icon:(0,jo.jsx)(Qx,{}),disabled:r||e.length<=1,onClick:()=>t(e.filter(l=>l.id!==i.id))})}],dataSource:e,pagination:!1,scroll:{x:920}}),(0,jo.jsx)(Pr,{type:"dashed",size:"small",icon:(0,jo.jsx)(pP,{}),disabled:r,onClick:()=>t([...e,rhe()]),children:"\u6DFB\u52A0\u5B57\u6BB5"})]})}var nhe=["mysql","information_schema","performance_schema","sys"];function qw(e){return nhe.includes(e.toLowerCase())}var _e=$(sr()),ID=/^[a-zA-Z0-9_]+$/,zh=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`,EG=()=>{let{connectionId:e,databaseName:t}=Bs(),r=ri(),[n,o]=(0,Dt.useState)(null),[a,i]=(0,Dt.useState)([]),[l,s]=(0,Dt.useState)(!1),[c,u]=(0,Dt.useState)(!1),[f,d]=(0,Dt.useState)(!1),[m,p]=(0,Dt.useState)(!1),[x,b]=(0,Dt.useState)(""),[g,h]=(0,Dt.useState)(null),[y,v]=(0,Dt.useState)(""),[S,R]=(0,Dt.useState)(null),[C,N]=(0,Dt.useState)(!1),[E,O]=(0,Dt.useState)(!1),[w,A]=(0,Dt.useState)(!1),[T,k]=(0,Dt.useState)(null),[L,H]=(0,Dt.useState)("table"),[_,F]=(0,Dt.useState)(null),[z,M]=(0,Dt.useState)([]),[U,B]=(0,Dt.useState)(!1),[I,j]=(0,Dt.useState)(null),[W,K]=(0,Dt.useState)(!1),[Y,Z]=(0,Dt.useState)(()=>eb()),[ne,te]=(0,Dt.useState)(!1),[de,q]=(0,Dt.useState)("add"),[X,re]=(0,Dt.useState)(null),[V,G]=(0,Dt.useState)(!1),[J,ee]=(0,Dt.useState)("");(0,Dt.useEffect)(()=>{e&&t&&(ae(),ue())},[e,t]);let ae=async()=>{if(e)try{let ie=await cf();if(ie.success&&ie.data){let he=ie.data.find(ze=>ze._id===e);he?o(he):(alert("\u8FDE\u63A5\u4E0D\u5B58\u5728"),r("/"))}}catch{alert("\u52A0\u8F7D\u8FDE\u63A5\u4FE1\u606F\u5931\u8D25"),r("/")}},ue=async()=>{if(!(!e||!t)){s(!0);try{let ie=await Kw(e,decodeURIComponent(t));ie.success&&ie.data?i(ie.data):alert(ie.message||"\u83B7\u53D6\u6570\u636E\u8868\u5217\u8868\u5931\u8D25")}catch{alert("\u83B7\u53D6\u6570\u636E\u8868\u5217\u8868\u5931\u8D25")}finally{s(!1)}}},se=ie=>{e&&t&&r(`/connection/${e}/database/${t}/collection/${encodeURIComponent(ie.name)}`)},Se=async()=>{if(!e||!t||!x.trim()){k("\u8BF7\u8F93\u5165\u8868\u540D");return}let ie=x.trim();if(!ID.test(ie)){k("\u8868\u540D\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF");return}let he=new Set;for(let Be of Y){let tt=Be.name.trim();if(!tt){k("\u6BCF\u4E2A\u5B57\u6BB5\u90FD\u9700\u586B\u5199\u5B57\u6BB5\u540D");return}if(!ID.test(tt)){k(`\u5B57\u6BB5\u540D\u4E0D\u5408\u6CD5: ${tt}`);return}if(he.has(tt)){k(`\u91CD\u590D\u5B57\u6BB5\u540D: ${tt}`);return}if(he.add(tt),Be.autoIncrement&&!Be.primaryKey){k(`\u81EA\u589E\u5217\u5FC5\u987B\u4E3A\u4E3B\u952E: ${tt}`);return}}let ze=0;for(let Be of Y)Be.autoIncrement&&ze++;if(ze>1){k("\u4E00\u5F20\u8868\u6700\u591A\u4E00\u4E2A\u81EA\u589E\u5217");return}let ut=Y.map(Be=>({name:Be.name.trim(),columnType:Be.columnType.trim(),nullable:Be.nullable,defaultValue:Be.defaultValue.trim()||void 0,primaryKey:Be.primaryKey,autoIncrement:Be.autoIncrement,comment:Be.comment.trim()||void 0}));N(!0),k(null);try{let Be=await xG(e,decodeURIComponent(t),ie,ut);Be.success?(u(!1),b(""),Z(eb()),ue()):k(Be.message||"\u521B\u5EFA\u6570\u636E\u8868\u5931\u8D25")}catch(Be){k(Be instanceof Error?Be.message:"\u521B\u5EFA\u6570\u636E\u8868\u5931\u8D25")}finally{N(!1)}},ye=async()=>{if(!e||!t||!g||!y.trim()){k("\u8BF7\u8F93\u5165\u8868\u540D");return}let ie=y.trim();if(!ID.test(ie)){k("\u8868\u540D\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF");return}if(ie===g.name){k("\u65B0\u540D\u79F0\u4E0D\u80FD\u4E0E\u5F53\u524D\u540D\u79F0\u76F8\u540C");return}O(!0),k(null);try{let he=await vG(e,decodeURIComponent(t),g.name,ie);he.success?(d(!1),h(null),v(""),ue()):k(he.message||"\u91CD\u547D\u540D\u6570\u636E\u8868\u5931\u8D25")}catch(he){k(he instanceof Error?he.message:"\u91CD\u547D\u540D\u6570\u636E\u8868\u5931\u8D25")}finally{O(!1)}},Pe=async()=>{if(!(!e||!t||!S)){A(!0),k(null);try{let ie=await bG(e,decodeURIComponent(t),S.name);ie.success?(p(!1),R(null),ue()):k(ie.message||"\u5220\u9664\u6570\u636E\u8868\u5931\u8D25")}catch(ie){k(ie instanceof Error?ie.message:"\u5220\u9664\u6570\u636E\u8868\u5931\u8D25")}finally{A(!1)}}},Ne=ie=>{h(ie),v(ie.name),k(null),d(!0)},oe=ie=>{R(ie),k(null),p(!0)},ce=t?decodeURIComponent(t):"",be=qw(ce),me=(0,Dt.useMemo)(()=>{let ie=J.trim().toLowerCase();return ie?a.filter(he=>he.name.toLowerCase().includes(ie)):a},[a,J]),xe=(0,Dt.useCallback)(async()=>{if(!(!e||!_)){B(!0),j(null);try{let ie=await MD(e,ce,_.name);ie.success&&ie.data?M(ie.data):j(ie.message||"\u52A0\u8F7D\u8868\u7ED3\u6784\u5931\u8D25")}catch{j("\u52A0\u8F7D\u8868\u7ED3\u6784\u5931\u8D25")}finally{B(!1)}}},[e,ce,_]),Ee=(0,Dt.useCallback)(async ie=>{if(e){F(ie),K(!1),M([]),B(!0),j(null);try{let he=await MD(e,ce,ie.name);he.success&&he.data?M(he.data):j(he.message||"\u52A0\u8F7D\u8868\u7ED3\u6784\u5931\u8D25")}catch{j("\u52A0\u8F7D\u8868\u7ED3\u6784\u5931\u8D25")}finally{B(!1)}}},[e,ce]),pe=(0,Dt.useCallback)(()=>{F(null),M([]),j(null),K(!1)},[]),Te=(0,Dt.useCallback)(()=>{q("add"),re(null),te(!0)},[]),Oe=(0,Dt.useCallback)(ie=>{q("edit"),re(ie),te(!0)},[]),ge=(0,Dt.useCallback)(async(ie,he)=>{var ze,ut,Be;if(!(!e||!_)){G(!0);try{if(he==="add"){let tt=(ze=ie.afterColumn)==null?void 0:ze.trim(),et=!tt||tt==="__end__"?null:tt,We=await Jx(e,ce,_.name,{addColumns:[{name:ie.name.trim(),columnType:ie.columnType.trim(),nullable:ie.nullable,defaultValue:ie.defaultValue.trim()||void 0,comment:ie.comment.trim()||void 0,afterColumn:et}]});if(!We.success){alert(We.message||"\u6DFB\u52A0\u5B57\u6BB5\u5931\u8D25");return}}else if(X){let tt=(ut=ie.newName)==null?void 0:ut.trim(),et=tt&&tt.length>0?tt:X.name,We=(Be=ie.afterColumn)==null?void 0:Be.trim(),fe=!1,Re;We&&We!=="__keep__"&&(We==="__first__"?fe=!0:Re=We);let Fe=await Jx(e,ce,_.name,{modifyColumns:[{columnName:X.name,...et!==X.name?{newName:et}:{},columnType:ie.columnType.trim(),nullable:ie.autoIncrement?!1:ie.nullable,defaultValue:ie.defaultValue.trim()||void 0,comment:ie.comment.trim()||void 0,autoIncrement:ie.autoIncrement,...fe?{placeFirst:!0}:Re?{afterColumn:Re}:{}}]});if(!Fe.success){alert(Fe.message||"\u4FEE\u6539\u5B57\u6BB5\u5931\u8D25");return}}te(!1),re(null),await xe()}finally{G(!1)}}},[e,ce,_,X,xe]),ve=(0,Dt.useCallback)(async(ie,he)=>{var We;if(!e||!_||he==="up"&&ie<=0||he==="down"&&ie>=z.length-1)return;let ze=z[ie],ut=he==="up"&&ie===1,Be=he==="up"?ut?void 0:z[ie-2].name:z[ie+1].name,tt=/auto_increment/i.test(ze.extra),et=await Jx(e,ce,_.name,{modifyColumns:[{columnName:ze.name,columnType:ze.columnType,nullable:tt?!1:ze.nullable,defaultValue:(We=ze.defaultValue)!=null?We:void 0,comment:ze.comment||void 0,autoIncrement:tt,...ut?{placeFirst:!0}:{afterColumn:Be}}]});if(!et.success){alert(et.message||"\u8C03\u6574\u5B57\u6BB5\u987A\u5E8F\u5931\u8D25");return}await xe()},[e,ce,_,z,xe]),De=(0,Dt.useCallback)(ie=>{!e||!_||bn.confirm({title:`\u786E\u5B9A\u5220\u9664\u5B57\u6BB5\u300C${ie.name}\u300D\uFF1F`,okType:"danger",okText:"\u5220\u9664",onOk:async()=>{let he=await Jx(e,ce,_.name,{dropColumns:[ie.name]});if(!he.success)throw alert(he.message||"\u5220\u9664\u5B57\u6BB5\u5931\u8D25"),new Error("abort");await xe()}})},[e,ce,_,xe]),$e=n&&ce?[{label:"\u8FDE\u63A5\u5217\u8868",path:"/"},{label:n.name,path:`/connection/${e}`},{label:ce}]:[],at=(0,Dt.useMemo)(()=>{let ie=[{title:"#",key:"ordinal",width:44,dataIndex:"ordinal"},{title:"\u5B57\u6BB5",dataIndex:"name",width:140,render:(he,ze)=>(0,_e.jsx)(mD,{className:`m-0 border-0 text-xs ${pG(mG(ze.dataType))}`,children:he})},{title:"\u7C7B\u578B",dataIndex:"columnType",key:"columnType",ellipsis:!0},{title:"\u53EF\u7A7A",key:"nullable",width:56,render:(he,ze)=>ze.nullable?"\u662F":"\u5426"},{title:"\u952E",dataIndex:"columnKey",key:"columnKey",width:52,render:he=>he||"\u2014"},{title:"\u9ED8\u8BA4",dataIndex:"defaultValue",key:"defaultValue",width:100,ellipsis:!0,render:he=>he!=null?he:"\u2014"},{title:"\u989D\u5916",dataIndex:"extra",key:"extra",width:88,ellipsis:!0,render:he=>he||"\u2014"},{title:"\u6CE8\u91CA",dataIndex:"comment",key:"comment",ellipsis:!0,render:he=>he||"\u2014"}];return W&&!be&&ie.push({title:"\u64CD\u4F5C",key:"ops",width:200,fixed:"right",render:(he,ze,ut)=>(0,_e.jsxs)("div",{className:"flex flex-nowrap items-center gap-0",onClick:Be=>Be.stopPropagation(),children:[(0,_e.jsx)(Pr,{type:"text",size:"small",className:"px-1",icon:(0,_e.jsx)(ED,{}),disabled:ut===0,title:"\u4E0A\u79FB",onClick:()=>void ve(ut,"up")}),(0,_e.jsx)(Pr,{type:"text",size:"small",className:"px-1",icon:(0,_e.jsx)(vD,{}),disabled:ut===z.length-1,title:"\u4E0B\u79FB",onClick:()=>void ve(ut,"down")}),(0,_e.jsx)(Pr,{type:"link",size:"small",className:"px-1",onClick:()=>Oe(ze),children:"\u4FEE\u6539"}),(0,_e.jsx)(Pr,{type:"link",size:"small",danger:!0,className:"px-1",onClick:()=>De(ze),children:"\u5220\u9664"})]})}),ie},[W,be,z.length,Oe,De,ve]),He=(0,Dt.useMemo)(()=>[{title:"\u8868\u540D",dataIndex:"name",key:"name",ellipsis:!0,width:160,render:ie=>(0,_e.jsx)("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:ie})},{title:"\u884C\u6570\uFF08\u7EA6\uFF09",dataIndex:"count",key:"count",width:120,align:"right"},{title:"\u5408\u8BA1",key:"size",width:100,align:"right",render:(ie,he)=>zh(he.size)},{title:"\u6570\u636E",key:"storageSize",width:100,align:"right",render:(ie,he)=>zh(he.storageSize)},{title:"\u7D22\u5F15",key:"totalIndexSize",width:100,align:"right",render:(ie,he)=>zh(he.totalIndexSize)},{title:"\u64CD\u4F5C",key:"actions",width:152,render:(ie,he)=>(0,_e.jsxs)("div",{className:"flex items-center gap-0",onClick:ze=>ze.stopPropagation(),children:[(0,_e.jsx)(Pr,{type:"text",size:"small",icon:(0,_e.jsx)(jw,{}),onClick:()=>void Ee(he),title:"\u8868\u7ED3\u6784"}),(0,_e.jsx)(Pr,{type:"text",size:"small",icon:(0,_e.jsx)(xD,{}),disabled:be,onClick:()=>Ne(he),title:be?"\u7CFB\u7EDF\u5E93\u4E0D\u53EF\u91CD\u547D\u540D":"\u91CD\u547D\u540D"}),(0,_e.jsx)(Pr,{type:"text",size:"small",danger:!0,icon:(0,_e.jsx)(Qx,{}),disabled:be,onClick:()=>oe(he),title:be?"\u7CFB\u7EDF\u5E93\u4E0D\u53EF\u5220\u9664":"\u5220\u9664"})]})}],[be,Ee]);return l&&!n?(0,_e.jsx)(Ci,{breadcrumbs:$e,children:(0,_e.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."})}):(0,_e.jsx)(Ci,{breadcrumbs:$e,children:(0,_e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,_e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,_e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,_e.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"\u6570\u636E\u8868"}),(0,_e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,_e.jsx)(CP,{value:L,onChange:H,options:[{label:"\u8868\u683C",value:"table"},{label:"\u5361\u7247",value:"grid"}]}),(0,_e.jsx)("button",{type:"button",onClick:()=>{u(!0),k(null),b(""),Z(eb())},disabled:be,className:"rounded-md bg-green-600 px-2.5 py-1 text-sm font-medium text-white transition hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-green-700 dark:hover:bg-green-800",title:be?"\u7CFB\u7EDF\u5E93\u4E0D\u5141\u8BB8\u65B0\u5EFA\u8868":"",children:"\u65B0\u5EFA\u8868"}),(0,_e.jsx)("button",{type:"button",onClick:ue,className:"rounded-md border border-gray-300 bg-white px-2.5 py-1 text-sm font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:"\u5237\u65B0"})]})]}),(0,_e.jsx)(on,{allowClear:!0,placeholder:"\u6309\u8868\u540D\u7B5B\u9009",value:J,onChange:ie=>ee(ie.target.value),prefix:(0,_e.jsx)(oc,{className:"text-gray-400"}),className:"max-w-md"})]}),l?(0,_e.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."}):a.length===0?(0,_e.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:"\u6682\u65E0\u6570\u636E\u8868"}):me.length===0?(0,_e.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:"\u65E0\u5339\u914D\u7684\u8868\uFF0C\u8BF7\u8C03\u6574\u7B5B\u9009\u5173\u952E\u8BCD"}):L==="table"?(0,_e.jsx)(of,{rowKey:"name",size:"small",columns:He,dataSource:me,pagination:{pageSize:20,showSizeChanger:!0,pageSizeOptions:[10,20,50,100],showTotal:ie=>`\u5171 ${ie} \u5F20\u8868`},onRow:ie=>({onClick:()=>se(ie),className:"cursor-pointer"})}):(0,_e.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:me.map(ie=>(0,_e.jsxs)("div",{onClick:()=>se(ie),className:"group relative cursor-pointer rounded-md border border-gray-200 bg-gray-50/50 p-4 transition hover:border-gray-300 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800",children:[(0,_e.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,_e.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:ie.name}),(0,_e.jsxs)("span",{className:"rounded-full bg-blue-100 px-2 py-0.5 text-xs text-blue-700 dark:bg-blue-500/20 dark:text-blue-400",children:["\u7EA6 ",ie.count," \u884C"]})]}),(0,_e.jsxs)("div",{className:"space-y-1 text-sm text-gray-600 dark:text-gray-400",children:[(0,_e.jsxs)("div",{children:["\u5408\u8BA1: ",zh(ie.size)]}),(0,_e.jsxs)("div",{children:["\u6570\u636E: ",zh(ie.storageSize)]}),(0,_e.jsxs)("div",{children:["\u7D22\u5F15: ",zh(ie.totalIndexSize)]})]}),(0,_e.jsxs)("div",{className:"absolute right-2 top-2 flex gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,_e.jsx)("button",{type:"button",onClick:he=>{he.stopPropagation(),Ee(ie)},className:"rounded-md bg-white/90 p-1.5 text-gray-700 shadow-md transition hover:bg-white dark:bg-gray-700/90 dark:text-gray-300 dark:hover:bg-gray-700",title:"\u8868\u7ED3\u6784",children:(0,_e.jsx)(jw,{className:"text-base"})}),(0,_e.jsx)("button",{type:"button",onClick:he=>{he.stopPropagation(),Ne(ie)},disabled:be,className:"rounded-md bg-white/90 p-1.5 text-gray-700 shadow-md transition hover:bg-white disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-700/90 dark:text-gray-300 dark:hover:bg-gray-700",title:"\u91CD\u547D\u540D",children:(0,_e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,_e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,_e.jsx)("button",{type:"button",onClick:he=>{he.stopPropagation(),oe(ie)},disabled:be,className:"rounded-md bg-white/90 p-1.5 text-red-600 shadow-md transition hover:bg-white disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-700/90 dark:text-red-400 dark:hover:bg-gray-700",title:"\u5220\u9664",children:(0,_e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,_e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]},ie.name))}),(0,_e.jsxs)(bn,{title:_?`\u8868\u7ED3\u6784 \u2014 ${_.name}`:"\u8868\u7ED3\u6784",open:!!_,onCancel:pe,footer:null,width:960,destroyOnClose:!0,children:[I&&(0,_e.jsx)("div",{className:"mb-3 rounded-md border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",children:I}),_&&!be&&(0,_e.jsx)("div",{className:"mb-3 flex flex-wrap items-center justify-end gap-2",children:(0,_e.jsxs)(fc,{children:[(0,_e.jsx)(Pr,{size:"small",type:W?"primary":"default",onClick:()=>K(ie=>!ie),children:W?"\u5B8C\u6210\u7F16\u8F91":"\u7F16\u8F91\u7ED3\u6784"}),W&&(0,_e.jsx)(Pr,{size:"small",type:"primary",onClick:Te,children:"\u6DFB\u52A0\u5B57\u6BB5"})]})}),(0,_e.jsx)(Dx,{spinning:U,children:(0,_e.jsx)(of,{size:"small",rowKey:ie=>`${ie.ordinal}-${ie.name}`,columns:at,dataSource:z,pagination:!1,scroll:{x:W?1120:900,y:520}})})]}),(0,_e.jsx)(SG,{open:ne,mode:de,existingColumnNames:z.map(ie=>ie.name),editTarget:X,onCancel:()=>{te(!1),re(null)},onSubmit:ge,submitting:V}),(0,_e.jsx)(bn,{title:"\u65B0\u5EFA\u6570\u636E\u8868",open:c,onOk:Se,onCancel:()=>{u(!1),b(""),Z(eb()),k(null)},confirmLoading:C,okText:"\u521B\u5EFA",cancelText:"\u53D6\u6D88",width:960,children:(0,_e.jsxs)("div",{className:"mb-4",children:[(0,_e.jsx)("label",{htmlFor:"collection-name-input",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u8868\u540D"}),(0,_e.jsx)(on,{id:"collection-name-input",value:x,onChange:ie=>{b(ie.target.value),k(null)},onPressEnter:Se,placeholder:"\u4EC5\u542B\u5B57\u6BCD\u6570\u5B57\u4E0B\u5212\u7EBF"}),T&&(0,_e.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:T}),(0,_e.jsxs)("div",{className:"mt-4",children:[(0,_e.jsx)("div",{className:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u5B57\u6BB5\u5B9A\u4E49"}),(0,_e.jsx)(RG,{value:Y,onChange:Z})]}),(0,_e.jsx)("div",{className:"mt-2 text-xs text-gray-500 dark:text-gray-400",children:"\u5F15\u64CE InnoDB\uFF0C\u5B57\u7B26\u96C6 utf8mb4\u3002\u9ED8\u8BA4\u503C\u53EF\u586B\u6570\u5B57\u3001NULL\u3001CURRENT_TIMESTAMP \u7B49\u3002"})]})}),(0,_e.jsx)(bn,{title:"\u91CD\u547D\u540D\u6570\u636E\u8868",open:f&&!!g,onOk:ye,onCancel:()=>{d(!1),h(null),v(""),k(null)},confirmLoading:E,okText:"\u91CD\u547D\u540D",cancelText:"\u53D6\u6D88",children:(0,_e.jsxs)("div",{className:"mb-4",children:[(0,_e.jsx)("label",{htmlFor:"rename-collection-input",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u65B0\u8868\u540D"}),(0,_e.jsx)(on,{id:"rename-collection-input",value:y,onChange:ie=>{v(ie.target.value),k(null)},onPressEnter:ye}),T&&(0,_e.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:T})]})}),(0,_e.jsx)(bn,{title:"\u5220\u9664\u6570\u636E\u8868",open:m&&!!S,onOk:Pe,onCancel:()=>{p(!1),R(null),k(null)},confirmLoading:w,okText:"\u786E\u8BA4\u5220\u9664",cancelText:"\u53D6\u6D88",okType:"danger",children:(0,_e.jsxs)("div",{className:"mb-4",children:[(0,_e.jsxs)("div",{className:"mb-2 text-sm text-gray-700 dark:text-gray-300",children:["\u786E\u5B9A\u5220\u9664\u8868 ",(0,_e.jsx)("span",{className:"font-semibold text-gray-900 dark:text-white",children:S==null?void 0:S.name})," \uFF1F"]}),T&&(0,_e.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:T}),(0,_e.jsxs)("div",{className:"mt-4 rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-500/10 dark:text-red-400",children:[(0,_e.jsx)("strong",{children:"\u8B66\u544A\uFF1A"}),"DROP TABLE \u4E0D\u53EF\u6062\u590D\u3002"]})]})})]})})};var Bh=$(P());var wn=$(P());var ohe="/api";async function wG(e,t,r,n,o="find",a){return(await fetch(`${ohe}/query/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,query:n,operation:o,document:a})})).json()}var Kd=$(P());function NG(){return`${Date.now()}-${Math.random().toString(36).substring(2,11)}`}var Si=$(sr());function ahe(e){let t=[],r=new Set;for(let n of e)for(let o of TG(n))r.has(o)||(r.add(o),t.push(o));return{ordered:t,set:r}}var TG=(e,t="")=>{let r=[];for(let[n,o]of Object.entries(e)){if(n.startsWith("__"))continue;let a=t?`${t}.${n}`:n;o!==null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)?r.push(...TG(o,a)):r.push(a)}return r},ihe=(e,t)=>{let r=t.split("."),n=e;for(let o of r){if(n==null||typeof n!="object")return;n=n[o]}return n},lhe=e=>e==null?"":e instanceof Date?e.toISOString():Array.isArray(e)?`[${e.length} \u9879]`:typeof e=="object"?"[\u5BF9\u8C61]":typeof e=="string"&&e.length>100?`${e.substring(0,100)}...`:String(e),she=e=>e.__pk&&typeof e.__pk=="object"?JSON.stringify(e.__pk):NG(),OG=({documents:e,columnOrder:t,loading:r=!1,onEdit:n,onDelete:o})=>{let a=(0,Kd.useMemo)(()=>{if(e.length===0)return[];let{ordered:u,set:f}=ahe(e);if(!(t!=null&&t.length))return u;let d=new Set,m=[];for(let p of t)f.has(p)&&!d.has(p)&&(d.add(p),m.push(p));for(let p of u)d.has(p)||(d.add(p),m.push(p));return m},[e,t]),[i,l]=(0,Kd.useState)(()=>new Set(a));(0,Kd.useEffect)(()=>{l(u=>{let f=new Set(u),d=!1;for(let m of a)f.has(m)||(f.add(m),d=!0);return d?f:u})},[a]);let s=(0,Kd.useMemo)(()=>{let u=[];for(let f of a)i.has(f)&&u.push({title:f,dataIndex:f,key:f,width:150,ellipsis:!0,render:(d,m)=>{let p=ihe(m,f);return(0,Si.jsx)("span",{className:"font-mono text-sm",children:lhe(p)})}});return(n||o)&&u.push({title:"\u64CD\u4F5C",key:"actions",width:120,fixed:"right",render:(f,d)=>(0,Si.jsxs)("div",{className:"flex gap-2",children:[n&&(0,Si.jsx)(Pr,{type:"link",size:"small",onClick:()=>n(d),children:"\u7F16\u8F91"}),o&&(0,Si.jsx)(Pr,{type:"link",size:"small",danger:!0,onClick:()=>o(d),children:"\u5220\u9664"})]})}),u},[a,i,n,o]),c=a.map(u=>({key:u,label:(0,Si.jsx)(na,{checked:i.has(u),onChange:f=>{let d=new Set(i);f.target.checked?d.add(u):d.delete(u),l(d)},onClick:f=>f.stopPropagation(),children:u})}));return(0,Si.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Si.jsx)("div",{className:"flex items-center justify-between",children:(0,Si.jsx)(dc,{menu:{items:c},trigger:["click"],placement:"bottomLeft",children:(0,Si.jsx)(Pr,{icon:(0,Si.jsx)(OD,{}),size:"small",children:"\u5217\u8BBE\u7F6E"})})}),(0,Si.jsx)(of,{columns:s,rowKey:u=>she(u),dataSource:e,loading:r,pagination:!1,scroll:{x:"max-content"},size:"small"})]})};var Et=$(sr()),$G=({connection:e,databaseName:t,collection:r,readOnly:n=!1})=>{let[o,a]=(0,wn.useState)(!1),[i,l]=(0,wn.useState)(null),[s,c]=(0,wn.useState)(1),[u]=(0,wn.useState)(20),[f,d]=(0,wn.useState)([]),[m,p]=(0,wn.useState)([]),[x,b]=(0,wn.useState)(0),[g,h]=(0,wn.useState)(!0),[y,v]=(0,wn.useState)(!1),[S,R]=(0,wn.useState)(!1),[C,N]=(0,wn.useState)(null),[E,O]=(0,wn.useState)("{}"),[w,A]=(0,wn.useState)(!1),[T,k]=(0,wn.useState)(!1),[L,H]=(0,wn.useState)("{}"),[_,F]=(0,wn.useState)("find"),[z,M]=(0,wn.useState)("{}"),[U,B]=(0,wn.useState)(!1),[I,j]=(0,wn.useState)(null),W=async()=>{if(e._id){a(!0),l(null),j(null);try{let q=await wG(e._id,t,r.name,L,_,_==="insertOne"?z:void 0);if(q.success){let X=q.data;_==="insertOne"?(k(!1),M("{}"),B(!1),Y(1)):typeof X=="number"?(j(`\u5339\u914D\u884C\u6570: ${X}`),d([]),p([]),b(0)):Array.isArray(X)?(d(X),p([]),b(X.length),B(!0),j("\u6CE8\u610F\uFF1A\u81EA\u5B9A\u4E49\u67E5\u8BE2\u7ED3\u679C\u53EF\u80FD\u7F3A\u5C11\u4E3B\u952E\u4FE1\u606F\uFF0C\u7F16\u8F91/\u5220\u9664\u53EF\u80FD\u4E0D\u53EF\u7528")):typeof X=="object"&&X!==null?(d([X]),p([]),b(1),B(!0)):(d([]),p([]),b(0)),_!=="insertOne"&&k(!1)}else l(q.message||"\u67E5\u8BE2\u5931\u8D25")}catch(q){l(q instanceof Error?q.message:"\u67E5\u8BE2\u5931\u8D25")}finally{a(!1)}}},K=()=>{B(!1),j(null),H("{}"),F("find"),M("{}"),Y(1)},Y=async(q=1)=>{var X;if(e._id){v(!0);try{let re=await hG(e._id,t,r.name,q,u);re.success&&re.data&&(d(re.data.documents),p((X=re.data.columnNames)!=null?X:[]),b(re.data.total),c(q),h(re.data.hasPrimaryKey!==!1))}catch(re){console.error("\u52A0\u8F7D\u6570\u636E\u5931\u8D25:",re)}finally{v(!1)}}};(0,wn.useEffect)(()=>{!U&&e._id&&Y(1)},[U,e._id,t,r.name]);let Z=q=>{N(q),O(JSON.stringify(q,null,2)),R(!0)},ne=async()=>{if(!e._id||!(C!=null&&C.__pk)){alert("\u5F53\u524D\u884C\u7F3A\u5C11\u4E3B\u952E\u4FE1\u606F\uFF0C\u65E0\u6CD5\u66F4\u65B0");return}A(!0);try{let q=JSON.parse(E),{__pk:X,...re}=q,V=await gG(e._id,t,r.name,{__pk:C.__pk},re);V.success?(R(!1),N(null),O("{}"),U?W():Y(s)):alert(V.message||"\u66F4\u65B0\u5931\u8D25")}catch(q){alert(q instanceof Error?q.message:"\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5 JSON \u683C\u5F0F")}finally{A(!1)}},te=async q=>{let X=e._id;if(!X||!q.__pk){alert("\u5F53\u524D\u884C\u7F3A\u5C11\u4E3B\u952E\u4FE1\u606F\uFF0C\u65E0\u6CD5\u5220\u9664");return}bn.confirm({title:"\u5220\u9664\u884C",content:"\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u4E00\u884C\u5417\uFF1F",okText:"\u786E\u8BA4\u5220\u9664",cancelText:"\u53D6\u6D88",okType:"danger",onOk:async()=>{A(!0);try{let re=await yG(X,t,r.name,{__pk:q.__pk});re.success?U?W():Y(s):bn.error({title:"\u5220\u9664\u5931\u8D25",content:re.message||"\u5220\u9664\u5931\u8D25"})}catch(re){bn.error({title:"\u5220\u9664\u5931\u8D25",content:re instanceof Error?re.message:"\u5220\u9664\u5931\u8D25"})}finally{A(!1)}}})},de=!n&&g;return(0,Et.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsxs)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:["\u6570\u636E\u6D4F\u89C8 - ",r.name]}),(0,Et.jsxs)("div",{className:"flex gap-2",children:[(0,Et.jsx)(Pr,{type:"primary",onClick:()=>k(!0),children:"\u81EA\u5B9A\u4E49\u67E5\u8BE2"}),U&&(0,Et.jsx)(Pr,{onClick:K,children:"\u6E05\u9664\u67E5\u8BE2"})]})]}),n&&(0,Et.jsxs)("div",{className:"rounded-md border border-amber-500/50 bg-amber-50 p-4 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400",children:[(0,Et.jsx)("strong",{children:"\u53EA\u8BFB\u6A21\u5F0F\uFF1A"}),"\u7CFB\u7EDF\u5E93\u4E0D\u5141\u8BB8\u5199\u5165\u3002"]}),!n&&!g&&(0,Et.jsx)("div",{className:"rounded-md border border-amber-500/50 bg-amber-50 p-4 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400",children:"\u8BE5\u8868\u6CA1\u6709\u4E3B\u952E\uFF0C\u65E0\u6CD5\u4F7F\u7528\u56FE\u5F62\u754C\u9762\u5B89\u5168\u66F4\u65B0\u6216\u5220\u9664\u5355\u884C\u3002"}),i&&(0,Et.jsx)("div",{className:"rounded-md border border-red-500/50 bg-red-50 p-4 text-red-600 dark:bg-red-500/10 dark:text-red-400",children:i}),I&&(0,Et.jsx)("div",{className:"rounded-md border border-blue-500/50 bg-blue-50 p-4 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",children:I}),(0,Et.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsx)("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:U?(0,Et.jsxs)(Et.Fragment,{children:["\u67E5\u8BE2\u7ED3\u679C: ",x," \u884C"]}):(0,Et.jsxs)(Et.Fragment,{children:["\u5171 ",x," \u884C\uFF0C\u7B2C ",s," \u9875\uFF0C\u6BCF\u9875 ",u," \u884C"]})}),!U&&(0,Et.jsxs)("div",{className:"flex gap-2",children:[(0,Et.jsx)(Pr,{onClick:()=>Y(s-1),disabled:s<=1||y,children:"\u4E0A\u4E00\u9875"}),(0,Et.jsx)(Pr,{onClick:()=>Y(s+1),disabled:s*u>=x||y,children:"\u4E0B\u4E00\u9875"})]})]}),y?(0,Et.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."}):f.length===0?(0,Et.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:U?"\u67E5\u8BE2\u7ED3\u679C\u4E3A\u7A7A":"\u6682\u65E0\u6570\u636E"}):(0,Et.jsx)(OG,{documents:f,columnOrder:m.length>0?m:void 0,loading:y,onEdit:de?Z:void 0,onDelete:de?te:void 0})]}),(0,Et.jsxs)(bn,{title:"\u81EA\u5B9A\u4E49\u67E5\u8BE2",open:T,onOk:W,onCancel:()=>{k(!1),l(null)},confirmLoading:o,width:800,okText:_==="insertOne"?"\u63D2\u5165":"\u6267\u884C",cancelText:"\u53D6\u6D88",okButtonProps:{disabled:n&&_==="insertOne"},children:[(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"query-modal-operation",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u64CD\u4F5C\u7C7B\u578B"}),(0,Et.jsx)(Cl,{id:"query-modal-operation",value:_,onChange:q=>{F(q),q==="insertOne"?H("{}"):M("{}")},className:"w-full",disabled:n,options:[{label:"\u67E5\u8BE2\uFF08\u7B49\u503C\u6761\u4EF6 JSON\uFF0C\u6700\u591A 100 \u884C\uFF09",value:"find"},{label:"\u67E5\u8BE2\u4E00\u884C\uFF08\u7B49\u503C\u6761\u4EF6 JSON\uFF09",value:"findOne"},{label:"\u8BA1\u6570\uFF08\u7B49\u503C\u6761\u4EF6 JSON\uFF09",value:"count"},{label:"\u81EA\u5B9A\u4E49 SELECT\uFF08\u5B8C\u6574 SQL\uFF0C\u9700\u4EE5 SELECT \u5F00\u5934\uFF09",value:"aggregate"},{label:"\u63D2\u5165\u4E00\u884C\uFF08\u5217\u540D JSON\uFF09",value:"insertOne",disabled:n}]})]}),_==="insertOne"?(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"query-modal-document-textarea",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u884C\u6570\u636E\uFF08JSON\uFF0C\u952E\u4E3A\u5217\u540D\uFF09"}),(0,Et.jsx)(on.TextArea,{id:"query-modal-document-textarea",value:z,onChange:q=>M(q.target.value),rows:12,className:"font-mono",placeholder:'\u4F8B\u5982: {"name": "test", "age": 20}'})]}):_==="aggregate"?(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"query-modal-sql",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"SELECT \u8BED\u53E5"}),(0,Et.jsx)(on.TextArea,{id:"query-modal-sql",value:L,onChange:q=>H(q.target.value),rows:12,className:"font-mono",placeholder:"\u4F8B\u5982: SELECT * FROM your_table LIMIT 10"})]}):(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"query-modal-textarea",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u7B49\u503C\u6761\u4EF6\uFF08JSON \u5BF9\u8C61\uFF0C\u7A7A\u5BF9\u8C61\u8868\u793A\u65E0\u989D\u5916\u6761\u4EF6\uFF09"}),(0,Et.jsx)(on.TextArea,{id:"query-modal-textarea",value:L,onChange:q=>H(q.target.value),rows:12,className:"font-mono",placeholder:'\u4F8B\u5982: {"id": 1}'})]}),i&&(0,Et.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:i})]}),(0,Et.jsx)(bn,{title:"\u7F16\u8F91\u884C",open:S,onOk:ne,onCancel:()=>{R(!1),N(null),O("{}")},confirmLoading:w,width:800,okText:"\u66F4\u65B0",cancelText:"\u53D6\u6D88",children:(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"edit-doc-textarea",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u884C\u6570\u636E JSON\uFF08\u8BF7\u52FF\u4FEE\u6539\u4E3B\u952E\u5217\uFF1B`__pk` \u4E3A\u5185\u90E8\u5B57\u6BB5\uFF0C\u4FDD\u5B58\u524D\u4F1A\u4ECE\u670D\u52A1\u7AEF\u903B\u8F91\u4E2D\u5265\u79BB\uFF09"}),(0,Et.jsx)(on.TextArea,{id:"edit-doc-textarea",value:E,onChange:q=>O(q.target.value),rows:12,className:"font-mono"})]})})]})};var tb=$(sr()),MG=()=>{let{connectionId:e,databaseName:t,collectionName:r}=Bs(),n=ri(),[o,a]=(0,Bh.useState)(null),[i,l]=(0,Bh.useState)(null),[s,c]=(0,Bh.useState)(!1);(0,Bh.useEffect)(()=>{e&&t&&r&&(u(),f())},[e,t,r]);let u=async()=>{if(e)try{let b=await cf();if(b.success&&b.data){let g=b.data.find(h=>h._id===e);g?a(g):(alert("\u8FDE\u63A5\u4E0D\u5B58\u5728"),n("/"))}}catch{alert("\u52A0\u8F7D\u8FDE\u63A5\u4FE1\u606F\u5931\u8D25"),n("/")}},f=async()=>{if(!(!e||!t||!r)){c(!0);try{let b=decodeURIComponent(t),g=decodeURIComponent(r),h=await Kw(e,b);if(h.success&&h.data){let y=h.data.find(v=>v.name===g);y?l(y):(alert("\u6570\u636E\u8868\u4E0D\u5B58\u5728"),n(`/connection/${e}/database/${t}`))}}catch{alert("\u52A0\u8F7D\u6570\u636E\u8868\u5931\u8D25"),n(`/connection/${e}/database/${t}`)}finally{c(!1)}}},d=t?decodeURIComponent(t):"",m=r?decodeURIComponent(r):"",p=qw(d),x=o&&d&&m?[{label:"\u8FDE\u63A5\u5217\u8868",path:"/"},{label:o.name,path:`/connection/${e}`},{label:d,path:`/connection/${e}/database/${t}`},{label:m}]:[];return s&&(!o||!i)?(0,tb.jsx)(Ci,{breadcrumbs:x,children:(0,tb.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."})}):!o||!i?null:(0,tb.jsx)(Ci,{breadcrumbs:x,children:(0,tb.jsx)($G,{connection:o,databaseName:d,collection:i,readOnly:p})})};function IG(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var che=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uhe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fhe={};function Gw(e,t){return((t||fhe).jsx?uhe:che).test(e)}var dhe=/[ \t\n\f\r]/g;function PD(e){return typeof e=="object"?e.type==="text"?PG(e.value):!1:PG(e)}function PG(e){return e.replace(dhe,"")===""}var Sc=class{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}};Sc.prototype.normal={};Sc.prototype.property={};Sc.prototype.space=void 0;function AD(e,t){let r={},n={};for(let o of e)Object.assign(r,o.property),Object.assign(n,o.normal);return new Sc(r,n,t)}function rb(e){return e.toLowerCase()}var Ro=class{constructor(t,r){this.attribute=r,this.property=t}};Ro.prototype.attribute="";Ro.prototype.booleanish=!1;Ro.prototype.boolean=!1;Ro.prototype.commaOrSpaceSeparated=!1;Ro.prototype.commaSeparated=!1;Ro.prototype.defined=!1;Ro.prototype.mustUseProperty=!1;Ro.prototype.number=!1;Ro.prototype.overloadedBoolean=!1;Ro.prototype.property="";Ro.prototype.spaceSeparated=!1;Ro.prototype.space=void 0;var nb={};Ak(nb,{boolean:()=>$t,booleanish:()=>Nn,commaOrSpaceSeparated:()=>ja,commaSeparated:()=>ff,number:()=>Me,overloadedBoolean:()=>Xw,spaceSeparated:()=>Nr});var mhe=0,$t=qd(),Nn=qd(),Xw=qd(),Me=qd(),Nr=qd(),ff=qd(),ja=qd();function qd(){return 2**++mhe}var DD=Object.keys(nb),Gd=class extends Ro{constructor(t,r,n,o){let a=-1;if(super(t,r),AG(this,"space",o),typeof n=="number")for(;++a<DD.length;){let i=DD[a];AG(this,DD[a],(n&nb[i])===nb[i])}}};Gd.prototype.defined=!0;function AG(e,t,r){r&&(e[t]=r)}function al(e){let t={},r={};for(let[n,o]of Object.entries(e.properties)){let a=new Gd(n,e.transform(e.attributes||{},n),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(a.mustUseProperty=!0),t[n]=a,r[rb(n)]=n,r[rb(a.attribute)]=n}return new Sc(t,r,e.space)}var kD=al({properties:{ariaActiveDescendant:null,ariaAtomic:Nn,ariaAutoComplete:null,ariaBusy:Nn,ariaChecked:Nn,ariaColCount:Me,ariaColIndex:Me,ariaColSpan:Me,ariaControls:Nr,ariaCurrent:null,ariaDescribedBy:Nr,ariaDetails:null,ariaDisabled:Nn,ariaDropEffect:Nr,ariaErrorMessage:null,ariaExpanded:Nn,ariaFlowTo:Nr,ariaGrabbed:Nn,ariaHasPopup:null,ariaHidden:Nn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nr,ariaLevel:Me,ariaLive:null,ariaModal:Nn,ariaMultiLine:Nn,ariaMultiSelectable:Nn,ariaOrientation:null,ariaOwns:Nr,ariaPlaceholder:null,ariaPosInSet:Me,ariaPressed:Nn,ariaReadOnly:Nn,ariaRelevant:null,ariaRequired:Nn,ariaRoleDescription:Nr,ariaRowCount:Me,ariaRowIndex:Me,ariaRowSpan:Me,ariaSelected:Nn,ariaSetSize:Me,ariaSort:null,ariaValueMax:Me,ariaValueMin:Me,ariaValueNow:Me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Yw(e,t){return t in e?e[t]:t}function Qw(e,t){return Yw(e,t.toLowerCase())}var DG=al({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ff,acceptCharset:Nr,accessKey:Nr,action:null,allow:null,allowFullScreen:$t,allowPaymentRequest:$t,allowUserMedia:$t,alt:null,as:null,async:$t,autoCapitalize:null,autoComplete:Nr,autoFocus:$t,autoPlay:$t,blocking:Nr,capture:null,charSet:null,checked:$t,cite:null,className:Nr,cols:Me,colSpan:null,content:null,contentEditable:Nn,controls:$t,controlsList:Nr,coords:Me|ff,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$t,defer:$t,dir:null,dirName:null,disabled:$t,download:Xw,draggable:Nn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$t,formTarget:null,headers:Nr,height:Me,hidden:Xw,high:Me,href:null,hrefLang:null,htmlFor:Nr,httpEquiv:Nr,id:null,imageSizes:null,imageSrcSet:null,inert:$t,inputMode:null,integrity:null,is:null,isMap:$t,itemId:null,itemProp:Nr,itemRef:Nr,itemScope:$t,itemType:Nr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$t,low:Me,manifest:null,max:null,maxLength:Me,media:null,method:null,min:null,minLength:Me,multiple:$t,muted:$t,name:null,nonce:null,noModule:$t,noValidate:$t,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$t,optimum:Me,pattern:null,ping:Nr,placeholder:null,playsInline:$t,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$t,referrerPolicy:null,rel:Nr,required:$t,reversed:$t,rows:Me,rowSpan:Me,sandbox:Nr,scope:null,scoped:$t,seamless:$t,selected:$t,shadowRootClonable:$t,shadowRootDelegatesFocus:$t,shadowRootMode:null,shape:null,size:Me,sizes:null,slot:null,span:Me,spellCheck:Nn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Me,step:null,style:null,tabIndex:Me,target:null,title:null,translate:null,type:null,typeMustMatch:$t,useMap:null,value:Nn,width:Me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nr,axis:null,background:null,bgColor:null,border:Me,borderColor:null,bottomMargin:Me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$t,declare:$t,event:null,face:null,frame:null,frameBorder:null,hSpace:Me,leftMargin:Me,link:null,longDesc:null,lowSrc:null,marginHeight:Me,marginWidth:Me,noResize:$t,noHref:$t,noShade:$t,noWrap:$t,object:null,profile:null,prompt:null,rev:null,rightMargin:Me,rules:null,scheme:null,scrolling:Nn,standby:null,summary:null,text:null,topMargin:Me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$t,disableRemotePlayback:$t,prefix:null,property:null,results:Me,security:null,unselectable:null},space:"html",transform:Qw});var kG=al({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ja,accentHeight:Me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Me,amplitude:Me,arabicForm:null,ascent:Me,attributeName:null,attributeType:null,azimuth:Me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Me,by:null,calcMode:null,capHeight:Me,className:Nr,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Me,diffuseConstant:Me,direction:null,display:null,dur:null,divisor:Me,dominantBaseline:null,download:$t,dx:null,dy:null,edgeMode:null,editable:null,elevation:Me,enableBackground:null,end:null,event:null,exponent:Me,externalResourcesRequired:null,fill:null,fillOpacity:Me,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ff,g2:ff,glyphName:ff,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Me,horizOriginX:Me,horizOriginY:Me,id:null,ideographic:Me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Me,k:Me,k1:Me,k2:Me,k3:Me,k4:Me,kernelMatrix:ja,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Me,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Me,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Me,overlineThickness:Me,paintOrder:null,panose1:null,path:null,pathLength:Me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Me,pointsAtY:Me,pointsAtZ:Me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ja,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ja,rev:ja,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ja,requiredFeatures:ja,requiredFonts:ja,requiredFormats:ja,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Me,specularExponent:Me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Me,strikethroughThickness:Me,string:null,stroke:null,strokeDashArray:ja,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Me,strokeOpacity:Me,strokeWidth:null,style:null,surfaceScale:Me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ja,tabIndex:Me,tableValues:null,target:null,targetX:Me,targetY:Me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ja,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Me,underlineThickness:Me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Me,values:null,vAlphabetic:Me,vMathematical:Me,vectorEffect:null,vHanging:Me,vIdeographic:Me,version:null,vertAdvY:Me,vertOriginX:Me,vertOriginY:Me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Yw});var LD=al({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var _D=al({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qw});var zD=al({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var BD={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var phe=/[A-Z]/g,LG=/-[a-z]/g,hhe=/^data[-\w.:]+$/i;function FD(e,t){let r=rb(t),n=t,o=Ro;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&hhe.test(t)){if(t.charAt(4)==="-"){let a=t.slice(5).replace(LG,yhe);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{let a=t.slice(4);if(!LG.test(a)){let i=a.replace(phe,ghe);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=Gd}return new o(n,t)}function ghe(e){return"-"+e.toLowerCase()}function yhe(e){return e.charAt(1).toUpperCase()}var _G=AD([kD,DG,LD,_D,zD],"html"),Zw=AD([kD,kG,LD,_D,zD],"svg");function zG(e){return e.join(" ").trim()}var JG=$(XG(),1);var e1=YG("end"),Fh=YG("start");function YG(e){return t;function t(r){let n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function jD(e){let t=Fh(e),r=e1(e);if(t&&r)return{start:t,end:r}}function df(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?QG(e.position):"start"in e||"end"in e?QG(e):"line"in e||"column"in e?UD(e):""}function UD(e){return ZG(e&&e.line)+":"+ZG(e&&e.column)}function QG(e){return UD(e&&e.start)+"-"+UD(e&&e.end)}function ZG(e){return e&&typeof e=="number"?e:1}var Ln=class extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let o="",a={},i=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?o=t:!a.cause&&t&&(i=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof n=="string"){let s=n.indexOf(":");s===-1?a.ruleId=n:(a.source=n.slice(0,s),a.ruleId=n.slice(s+1))}if(!a.place&&a.ancestors&&a.ancestors){let s=a.ancestors[a.ancestors.length-1];s&&(a.place=s.position)}let l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=l?l.line:void 0,this.name=df(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Ln.prototype.file="";Ln.prototype.name="";Ln.prototype.reason="";Ln.prototype.message="";Ln.prototype.stack="";Ln.prototype.column=void 0;Ln.prototype.line=void 0;Ln.prototype.ancestors=void 0;Ln.prototype.cause=void 0;Ln.prototype.fatal=void 0;Ln.prototype.place=void 0;Ln.prototype.ruleId=void 0;Ln.prototype.source=void 0;var WD={}.hasOwnProperty,jhe=new Map,Uhe=/[A-Z]/g,Whe=new Set(["table","tbody","thead","tfoot","tr"]),Khe=new Set(["td","th"]),eX="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function KD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let r=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=ege(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Jhe(r,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Zw:_G,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=tX(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function tX(e,t,r){if(t.type==="element")return qhe(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Ghe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Yhe(e,t,r);if(t.type==="mdxjsEsm")return Xhe(e,t);if(t.type==="root")return Qhe(e,t,r);if(t.type==="text")return Zhe(e,t)}function qhe(e,t,r){let n=e.schema,o=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(o=Zw,e.schema=o),e.ancestors.push(t);let a=nX(e,t.tagName,!1),i=tge(e,t),l=GD(e,t);return Whe.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!PD(s):!0})),rX(e,i,a,t),qD(i,l),e.ancestors.pop(),e.schema=n,e.create(t,a,i,r)}function Ghe(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ab(e,t.position)}function Xhe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ab(e,t.position)}function Yhe(e,t,r){let n=e.schema,o=n;t.name==="svg"&&n.space==="html"&&(o=Zw,e.schema=o),e.ancestors.push(t);let a=t.name===null?e.Fragment:nX(e,t.name,!0),i=rge(e,t),l=GD(e,t);return rX(e,i,a,t),qD(i,l),e.ancestors.pop(),e.schema=n,e.create(t,a,i,r)}function Qhe(e,t,r){let n={};return qD(n,GD(e,t)),e.create(t,e.Fragment,n,r)}function Zhe(e,t){return t.value}function rX(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function qD(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function Jhe(e,t,r){return n;function n(o,a,i,l){let c=Array.isArray(i.children)?r:t;return l?c(a,i,l):c(a,i)}}function ege(e,t){return r;function r(n,o,a,i){let l=Array.isArray(a.children),s=Fh(n);return t(o,a,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function tge(e,t){let r={},n,o;for(o in t.properties)if(o!=="children"&&WD.call(t.properties,o)){let a=nge(e,o,t.properties[o]);if(a){let[i,l]=a;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&Khe.has(t.tagName)?n=l:r[i]=l}}if(n){let a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function rge(e,t){let r={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let a=n.data.estree.body[0];a.type;let i=a.expression;i.type;let l=i.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else ab(e,t.position);else{let o=n.name,a;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let l=n.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else ab(e,t.position);else a=n.value===null?!0:n.value;r[o]=a}return r}function GD(e,t){let r=[],n=-1,o=e.passKeys?new Map:jhe;for(;++n<t.children.length;){let a=t.children[n],i;if(e.passKeys){let s=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(s){let c=o.get(s)||0;i=s+"-"+c,o.set(s,c+1)}}let l=tX(e,a,i);l!==void 0&&r.push(l)}return r}function nge(e,t,r){let n=FD(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?IG(r):zG(r)),n.property==="style"){let o=typeof r=="object"?r:oge(e,String(r));return e.stylePropertyNameCase==="css"&&(o=age(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&n.space?BD[n.property]||n.property:n.attribute,r]}}function oge(e,t){try{return(0,JG.default)(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let n=r,o=new Ln("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=eX+"#cannot-parse-style-attribute",o}}function nX(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){let o=t.split("."),a=-1,i;for(;++a<o.length;){let l=Gw(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};i=i?{type:"MemberExpression",object:i,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}n=i}else n=Gw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let o=n.value;return WD.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(n);ab(e)}function ab(e,t){let r=new Ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=eX+"#cannot-handle-mdx-estrees-without-createevaluater",r}function age(e){let t={},r;for(r in e)WD.call(e,r)&&(t[ige(r)]=e[r]);return t}function ige(e){let t=e.replace(Uhe,lge);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lge(e){return"-"+e.toLowerCase()}var ib={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var Kh=$(sr(),1),PY=$(P(),1);var sge={};function XD(e,t){let r=t||sge,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return aX(e,n,o)}function aX(e,t,r){if(cge(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return oX(e.children,t,r)}return Array.isArray(e)?oX(e,t,r):""}function oX(e,t,r){let n=[],o=-1;for(;++o<e.length;)n[o]=aX(e[o],t,r);return n.join("")}function cge(e){return!!(e&&typeof e=="object")}var iX=document.createElement("i");function Hh(e){let t="&"+e+";";iX.innerHTML=t;let r=iX.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Uo(e,t,r,n){let o=e.length,a=0,i;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,n.length<1e4)i=Array.from(n),i.unshift(t,r),e.splice(...i);else for(r&&e.splice(t,r);a<n.length;)i=n.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function ga(e,t){return e.length>0?(Uo(e,e.length,0,t),e):t}var lX={}.hasOwnProperty;function sX(e){let t={},r=-1;for(;++r<e.length;)uge(t,e[r]);return t}function uge(e,t){let r;for(r in t){let o=(lX.call(e,r)?e[r]:void 0)||(e[r]={}),a=t[r],i;if(a)for(i in a){lX.call(o,i)||(o[i]=[]);let l=a[i];fge(o[i],Array.isArray(l)?l:l?[l]:[])}}}function fge(e,t){let r=-1,n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);Uo(e,0,0,n)}function t1(e,t){let r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function Rc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Ri=mf(/[A-Za-z]/),Eo=mf(/[\dA-Za-z]/),cX=mf(/[#-'*+\--9=?A-Z^-~]/);function lb(e){return e!==null&&(e<32||e===127)}var sb=mf(/\d/),uX=mf(/[\dA-Fa-f]/),fX=mf(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function _n(e){return e!==null&&(e<0||e===32)}function Nt(e){return e===-2||e===-1||e===32}var dX=mf(new RegExp("\\p{P}|\\p{S}","u")),mX=mf(/\s/);function mf(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function il(e){let t=[],r=-1,n=0,o=0;for(;++r<e.length;){let a=e.charCodeAt(r),i="";if(a===37&&Eo(e.charCodeAt(r+1))&&Eo(e.charCodeAt(r+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){let l=e.charCodeAt(r+1);a<56320&&l>56319&&l<57344?(i=String.fromCharCode(a,l),o=1):i="\uFFFD"}else i=String.fromCharCode(a);i&&(t.push(e.slice(n,r),encodeURIComponent(i)),n=r+o+1,i=""),o&&(r+=o,o=0)}return t.join("")+e.slice(n)}function Mt(e,t,r,n){let o=n?n-1:Number.POSITIVE_INFINITY,a=0;return i;function i(s){return Nt(s)?(e.enter(r),l(s)):t(s)}function l(s){return Nt(s)&&a++<o?(e.consume(s),l):(e.exit(r),t(s))}}var pX={tokenize:dge};function dge(e){let t=e.attempt(this.parser.constructs.contentInitial,n,o),r;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Mt(e,t,"linePrefix")}function o(l){return e.enter("paragraph"),a(l)}function a(l){let s=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=s),r=s,i(l)}function i(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Je(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),i)}}var gX={tokenize:mge},hX={tokenize:pge};function mge(e){let t=this,r=[],n=0,o,a,i;return l;function l(y){if(n<r.length){let v=r[n];return t.containerState=v[1],e.attempt(v[0].continuation,s,c)(y)}return c(y)}function s(y){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&h();let v=t.events.length,S=v,R;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){R=t.events[S][1].end;break}g(n);let C=v;for(;C<t.events.length;)t.events[C][1].end={...R},C++;return Uo(t.events,S+1,0,t.events.slice(v)),t.events.length=C,c(y)}return l(y)}function c(y){if(n===r.length){if(!o)return d(y);if(o.currentConstruct&&o.currentConstruct.concrete)return p(y);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hX,u,f)(y)}function u(y){return o&&h(),g(n),d(y)}function f(y){return t.parser.lazy[t.now().line]=n!==r.length,i=t.now().offset,p(y)}function d(y){return t.containerState={},e.attempt(hX,m,p)(y)}function m(y){return n++,r.push([t.currentConstruct,t.containerState]),d(y)}function p(y){if(y===null){o&&h(),g(0),e.consume(y);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),x(y)}function x(y){if(y===null){b(e.exit("chunkFlow"),!0),g(0),e.consume(y);return}return Je(y)?(e.consume(y),b(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(y),x)}function b(y,v){let S=t.sliceStream(y);if(v&&S.push(null),y.previous=a,a&&(a.next=y),a=y,o.defineSkip(y.start),o.write(S),t.parser.lazy[y.start.line]){let R=o.events.length;for(;R--;)if(o.events[R][1].start.offset<i&&(!o.events[R][1].end||o.events[R][1].end.offset>i))return;let C=t.events.length,N=C,E,O;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(E){O=t.events[N][1].end;break}E=!0}for(g(n),R=C;R<t.events.length;)t.events[R][1].end={...O},R++;Uo(t.events,N+1,0,t.events.slice(C)),t.events.length=R}}function g(y){let v=r.length;for(;v-- >y;){let S=r[v];t.containerState=S[1],S[0].exit.call(t,e)}r.length=y}function h(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function pge(e,t,r){return Mt(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function YD(e){if(e===null||_n(e)||mX(e))return 1;if(dX(e))return 2}function Vh(e,t,r){let n=[],o=-1;for(;++o<e.length;){let a=e[o].resolveAll;a&&!n.includes(a)&&(t=a(t,r),n.push(a))}return t}var cb={name:"attention",resolveAll:hge,tokenize:gge};function hge(e,t){let r=-1,n,o,a,i,l,s,c,u;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let f={...e[n][1].end},d={...e[r][1].start};yX(f,-s),yX(d,s),i={type:s>1?"strongSequence":"emphasisSequence",start:f,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:d},a={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},o={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[r][1].start={...l.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=ga(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=ga(c,[["enter",o,t],["enter",i,t],["exit",i,t],["enter",a,t]]),c=ga(c,Vh(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=ga(c,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(u=2,c=ga(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):u=0,Uo(e,n-1,r-n+3,c),r=n+c.length-u-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function gge(e,t){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,o=YD(n),a;return i;function i(s){return a=s,e.enter("attentionSequence"),l(s)}function l(s){if(s===a)return e.consume(s),l;let c=e.exit("attentionSequence"),u=YD(s),f=!u||u===2&&o||r.includes(s),d=!o||o===2&&u||r.includes(n);return c._open=!!(a===42?f:f&&(o||!d)),c._close=!!(a===42?d:d&&(u||!f)),t(s)}}function yX(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var QD={name:"autolink",tokenize:yge};function yge(e,t,r){let n=0;return o;function o(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return Ri(m)?(e.consume(m),i):m===64?r(m):c(m)}function i(m){return m===43||m===45||m===46||Eo(m)?(n=1,l(m)):c(m)}function l(m){return m===58?(e.consume(m),n=0,s):(m===43||m===45||m===46||Eo(m))&&n++<32?(e.consume(m),l):(n=0,c(m))}function s(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||lb(m)?r(m):(e.consume(m),s)}function c(m){return m===64?(e.consume(m),u):cX(m)?(e.consume(m),c):r(m)}function u(m){return Eo(m)?f(m):r(m)}function f(m){return m===46?(e.consume(m),n=0,u):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):d(m)}function d(m){if((m===45||Eo(m))&&n++<63){let p=m===45?d:f;return e.consume(m),p}return r(m)}}var pf={partial:!0,tokenize:xge};function xge(e,t,r){return n;function n(a){return Nt(a)?Mt(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Je(a)?t(a):r(a)}}var r1={continuation:{tokenize:vge},exit:Cge,name:"blockQuote",tokenize:bge};function bge(e,t,r){let n=this;return o;function o(i){if(i===62){let l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),a}return r(i)}function a(i){return Nt(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function vge(e,t,r){let n=this;return o;function o(i){return Nt(i)?Mt(e,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):a(i)}function a(i){return e.attempt(r1,t,r)(i)}}function Cge(e){e.exit("blockQuote")}var n1={name:"characterEscape",tokenize:Sge};function Sge(e,t,r){return n;function n(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return fX(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(a)}}var o1={name:"characterReference",tokenize:Rge};function Rge(e,t,r){let n=this,o=0,a,i;return l;function l(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),s}function s(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),a=31,i=Eo,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,i=uX,u):(e.enter("characterReferenceValue"),a=7,i=sb,u(f))}function u(f){if(f===59&&o){let d=e.exit("characterReferenceValue");return i===Eo&&!Hh(n.sliceSerialize(d))?r(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(f)&&o++<a?(e.consume(f),u):r(f)}}var xX={partial:!0,tokenize:wge},a1={concrete:!0,name:"codeFenced",tokenize:Ege};function Ege(e,t,r){let n=this,o={partial:!0,tokenize:S},a=0,i=0,l;return s;function s(R){return c(R)}function c(R){let C=n.events[n.events.length-1];return a=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,l=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(R)}function u(R){return R===l?(i++,e.consume(R),u):i<3?r(R):(e.exit("codeFencedFenceSequence"),Nt(R)?Mt(e,f,"whitespace")(R):f(R))}function f(R){return R===null||Je(R)?(e.exit("codeFencedFence"),n.interrupt?t(R):e.check(xX,x,v)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(R))}function d(R){return R===null||Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(R)):Nt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mt(e,m,"whitespace")(R)):R===96&&R===l?r(R):(e.consume(R),d)}function m(R){return R===null||Je(R)?f(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(R))}function p(R){return R===null||Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(R)):R===96&&R===l?r(R):(e.consume(R),p)}function x(R){return e.attempt(o,v,b)(R)}function b(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),g}function g(R){return a>0&&Nt(R)?Mt(e,h,"linePrefix",a+1)(R):h(R)}function h(R){return R===null||Je(R)?e.check(xX,x,v)(R):(e.enter("codeFlowValue"),y(R))}function y(R){return R===null||Je(R)?(e.exit("codeFlowValue"),h(R)):(e.consume(R),y)}function v(R){return e.exit("codeFenced"),t(R)}function S(R,C,N){let E=0;return O;function O(L){return R.enter("lineEnding"),R.consume(L),R.exit("lineEnding"),w}function w(L){return R.enter("codeFencedFence"),Nt(L)?Mt(R,A,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):A(L)}function A(L){return L===l?(R.enter("codeFencedFenceSequence"),T(L)):N(L)}function T(L){return L===l?(E++,R.consume(L),T):E>=i?(R.exit("codeFencedFenceSequence"),Nt(L)?Mt(R,k,"whitespace")(L):k(L)):N(L)}function k(L){return L===null||Je(L)?(R.exit("codeFencedFence"),C(L)):N(L)}}}function wge(e,t,r){let n=this;return o;function o(i){return i===null?r(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a)}function a(i){return n.parser.lazy[n.now().line]?r(i):t(i)}}var ub={name:"codeIndented",tokenize:Tge},Nge={partial:!0,tokenize:Oge};function Tge(e,t,r){let n=this;return o;function o(c){return e.enter("codeIndented"),Mt(e,a,"linePrefix",5)(c)}function a(c){let u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?i(c):r(c)}function i(c){return c===null?s(c):Je(c)?e.attempt(Nge,i,s)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||Je(c)?(e.exit("codeFlowValue"),i(c)):(e.consume(c),l)}function s(c){return e.exit("codeIndented"),t(c)}}function Oge(e,t,r){let n=this;return o;function o(i){return n.parser.lazy[n.now().line]?r(i):Je(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):Mt(e,a,"linePrefix",5)(i)}function a(i){let l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):Je(i)?o(i):r(i)}}var ZD={name:"codeText",previous:Mge,resolve:$ge,tokenize:Ige};function $ge(e){let t=e.length-4,r=3,n,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)o===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(o=n):(n===t||e[n][1].type==="lineEnding")&&(e[o][1].type="codeTextData",n!==o+2&&(e[o][1].end=e[n-1][1].end,e.splice(o+2,n-o-2),t-=n-o-2,n=o+2),o=void 0);return e}function Mge(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ige(e,t,r){let n=this,o=0,a,i;return l;function l(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),o++,s):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?r(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(i=e.enter("codeTextSequence"),a=0,f(d)):Je(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||Je(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),a++,f):a===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",u(d))}}var i1=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){let n=r==null?Number.POSITIVE_INFINITY:r;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){let o=r||0;this.setCursor(Math.trunc(t));let a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return n&&fb(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fb(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fb(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let r=this.left.splice(t,Number.POSITIVE_INFINITY);fb(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fb(this.left,r.reverse())}}};function fb(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function l1(e){let t={},r=-1,n,o,a,i,l,s,c,u=new i1(e);for(;++r<u.length;){for(;r in t;)r=t[r];if(n=u.get(r),r&&n[1].type==="chunkFlow"&&u.get(r-1)[1].type==="listItemPrefix"&&(s=n[1]._tokenizer.events,a=0,a<s.length&&s[a][1].type==="lineEndingBlank"&&(a+=2),a<s.length&&s[a][1].type==="content"))for(;++a<s.length&&s[a][1].type!=="content";)s[a][1].type==="chunkText"&&(s[a][1]._isInFirstContentOfListItem=!0,a++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,Pge(u,r)),r=t[r],c=!0);else if(n[1]._container){for(a=r,o=void 0;a--;)if(i=u.get(a),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),i[1].type="lineEnding",o=a);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;o&&(n[1].end={...u.get(o)[1].start},l=u.slice(o,r),l.unshift(n),u.splice(o,r-o+1,l))}}return Uo(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Pge(e,t){let r=e.get(t)[1],n=e.get(t)[2],o=t-1,a=[],i=r._tokenizer;i||(i=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let l=i.events,s=[],c={},u,f,d=-1,m=r,p=0,x=0,b=[x];for(;m;){for(;e.get(++o)[1]!==m;);a.push(o),m._tokenizer||(u=n.sliceStream(m),m.next||u.push(null),f&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(u),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),f=m,m=m.next}for(m=r;++d<l.length;)l[d][0]==="exit"&&l[d-1][0]==="enter"&&l[d][1].type===l[d-1][1].type&&l[d][1].start.line!==l[d][1].end.line&&(x=d+1,b.push(x),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),d=b.length;d--;){let g=l.slice(b[d],b[d+1]),h=a.pop();s.push([h,h+g.length-1]),e.splice(h,2,g)}for(s.reverse(),d=-1;++d<s.length;)c[p+s[d][0]]=p+s[d][1],p+=s[d][1]-s[d][0]-1;return c}var JD={resolve:Dge,tokenize:kge},Age={partial:!0,tokenize:Lge};function Dge(e){return l1(e),e}function kge(e,t){let r;return n;function n(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?a(l):Je(l)?e.check(Age,i,a)(l):(e.consume(l),o)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function i(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function Lge(e,t,r){let n=this;return o;function o(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Mt(e,a,"linePrefix")}function a(i){if(i===null||Je(i))return r(i);let l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,r,t)(i)}}function s1(e,t,r,n,o,a,i,l,s){let c=s||Number.POSITIVE_INFINITY,u=0;return f;function f(g){return g===60?(e.enter(n),e.enter(o),e.enter(a),e.consume(g),e.exit(a),d):g===null||g===32||g===41||lb(g)?r(g):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(g))}function d(g){return g===62?(e.enter(a),e.consume(g),e.exit(a),e.exit(o),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===62?(e.exit("chunkString"),e.exit(l),d(g)):g===null||g===60||Je(g)?r(g):(e.consume(g),g===92?p:m)}function p(g){return g===60||g===62||g===92?(e.consume(g),m):m(g)}function x(g){return!u&&(g===null||g===41||_n(g))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(g)):u<c&&g===40?(e.consume(g),u++,x):g===41?(e.consume(g),u--,x):g===null||g===32||g===40||lb(g)?r(g):(e.consume(g),g===92?b:x)}function b(g){return g===40||g===41||g===92?(e.consume(g),x):x(g)}}function c1(e,t,r,n,o,a){let i=this,l=0,s;return c;function c(m){return e.enter(n),e.enter(o),e.consume(m),e.exit(o),e.enter(a),u}function u(m){return l>999||m===null||m===91||m===93&&!s||m===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?r(m):m===93?(e.exit(a),e.enter(o),e.consume(m),e.exit(o),e.exit(n),t):Je(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||Je(m)||l++>999?(e.exit("chunkString"),u(m)):(e.consume(m),s||(s=!Nt(m)),m===92?d:f)}function d(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function u1(e,t,r,n,o,a){let i;return l;function l(d){return d===34||d===39||d===40?(e.enter(n),e.enter(o),e.consume(d),e.exit(o),i=d===40?41:d,s):r(d)}function s(d){return d===i?(e.enter(o),e.consume(d),e.exit(o),e.exit(n),t):(e.enter(a),c(d))}function c(d){return d===i?(e.exit(a),s(i)):d===null?r(d):Je(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Mt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===i||d===null||Je(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?f:u)}function f(d){return d===i||d===92?(e.consume(d),u):u(d)}}function Yd(e,t){let r;return n;function n(o){return Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,n):Nt(o)?Mt(e,n,r?"linePrefix":"lineSuffix")(o):t(o)}}var ek={name:"definition",tokenize:zge},_ge={partial:!0,tokenize:Bge};function zge(e,t,r){let n=this,o;return a;function a(m){return e.enter("definition"),i(m)}function i(m){return c1.call(n,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return o=Rc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s):r(m)}function s(m){return _n(m)?Yd(e,c)(m):c(m)}function c(m){return s1(e,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return e.attempt(_ge,f,f)(m)}function f(m){return Nt(m)?Mt(e,d,"whitespace")(m):d(m)}function d(m){return m===null||Je(m)?(e.exit("definition"),n.parser.defined.push(o),t(m)):r(m)}}function Bge(e,t,r){return n;function n(l){return _n(l)?Yd(e,o)(l):r(l)}function o(l){return u1(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Nt(l)?Mt(e,i,"whitespace")(l):i(l)}function i(l){return l===null||Je(l)?t(l):r(l)}}var tk={name:"hardBreakEscape",tokenize:Fge};function Fge(e,t,r){return n;function n(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Je(a)?(e.exit("hardBreakEscape"),t(a)):r(a)}}var rk={name:"headingAtx",resolve:Hge,tokenize:Vge};function Hge(e,t){let r=e.length-2,n=3,o,a;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(o={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},a={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},Uo(e,n,r-n+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function Vge(e,t,r){let n=0;return o;function o(u){return e.enter("atxHeading"),a(u)}function a(u){return e.enter("atxHeadingSequence"),i(u)}function i(u){return u===35&&n++<6?(e.consume(u),i):u===null||_n(u)?(e.exit("atxHeadingSequence"),l(u)):r(u)}function l(u){return u===35?(e.enter("atxHeadingSequence"),s(u)):u===null||Je(u)?(e.exit("atxHeading"),t(u)):Nt(u)?Mt(e,l,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function s(u){return u===35?(e.consume(u),s):(e.exit("atxHeadingSequence"),l(u))}function c(u){return u===null||u===35||_n(u)?(e.exit("atxHeadingText"),l(u)):(e.consume(u),c)}}var bX=["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"],nk=["pre","script","style","textarea"];var ok={concrete:!0,name:"htmlFlow",resolveTo:Wge,tokenize:Kge},jge={partial:!0,tokenize:Gge},Uge={partial:!0,tokenize:qge};function Wge(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Kge(e,t,r){let n=this,o,a,i,l,s;return c;function c(I){return u(I)}function u(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),d):I===47?(e.consume(I),a=!0,x):I===63?(e.consume(I),o=3,n.interrupt?t:M):Ri(I)?(e.consume(I),i=String.fromCharCode(I),b):r(I)}function d(I){return I===45?(e.consume(I),o=2,m):I===91?(e.consume(I),o=5,l=0,p):Ri(I)?(e.consume(I),o=4,n.interrupt?t:M):r(I)}function m(I){return I===45?(e.consume(I),n.interrupt?t:M):r(I)}function p(I){let j="CDATA[";return I===j.charCodeAt(l++)?(e.consume(I),l===j.length?n.interrupt?t:A:p):r(I)}function x(I){return Ri(I)?(e.consume(I),i=String.fromCharCode(I),b):r(I)}function b(I){if(I===null||I===47||I===62||_n(I)){let j=I===47,W=i.toLowerCase();return!j&&!a&&nk.includes(W)?(o=1,n.interrupt?t(I):A(I)):bX.includes(i.toLowerCase())?(o=6,j?(e.consume(I),g):n.interrupt?t(I):A(I)):(o=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(I):a?h(I):y(I))}return I===45||Eo(I)?(e.consume(I),i+=String.fromCharCode(I),b):r(I)}function g(I){return I===62?(e.consume(I),n.interrupt?t:A):r(I)}function h(I){return Nt(I)?(e.consume(I),h):O(I)}function y(I){return I===47?(e.consume(I),O):I===58||I===95||Ri(I)?(e.consume(I),v):Nt(I)?(e.consume(I),y):O(I)}function v(I){return I===45||I===46||I===58||I===95||Eo(I)?(e.consume(I),v):S(I)}function S(I){return I===61?(e.consume(I),R):Nt(I)?(e.consume(I),S):y(I)}function R(I){return I===null||I===60||I===61||I===62||I===96?r(I):I===34||I===39?(e.consume(I),s=I,C):Nt(I)?(e.consume(I),R):N(I)}function C(I){return I===s?(e.consume(I),s=null,E):I===null||Je(I)?r(I):(e.consume(I),C)}function N(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||_n(I)?S(I):(e.consume(I),N)}function E(I){return I===47||I===62||Nt(I)?y(I):r(I)}function O(I){return I===62?(e.consume(I),w):r(I)}function w(I){return I===null||Je(I)?A(I):Nt(I)?(e.consume(I),w):r(I)}function A(I){return I===45&&o===2?(e.consume(I),H):I===60&&o===1?(e.consume(I),_):I===62&&o===4?(e.consume(I),U):I===63&&o===3?(e.consume(I),M):I===93&&o===5?(e.consume(I),z):Je(I)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(jge,B,T)(I)):I===null||Je(I)?(e.exit("htmlFlowData"),T(I)):(e.consume(I),A)}function T(I){return e.check(Uge,k,B)(I)}function k(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),L}function L(I){return I===null||Je(I)?T(I):(e.enter("htmlFlowData"),A(I))}function H(I){return I===45?(e.consume(I),M):A(I)}function _(I){return I===47?(e.consume(I),i="",F):A(I)}function F(I){if(I===62){let j=i.toLowerCase();return nk.includes(j)?(e.consume(I),U):A(I)}return Ri(I)&&i.length<8?(e.consume(I),i+=String.fromCharCode(I),F):A(I)}function z(I){return I===93?(e.consume(I),M):A(I)}function M(I){return I===62?(e.consume(I),U):I===45&&o===2?(e.consume(I),M):A(I)}function U(I){return I===null||Je(I)?(e.exit("htmlFlowData"),B(I)):(e.consume(I),U)}function B(I){return e.exit("htmlFlow"),t(I)}}function qge(e,t,r){let n=this;return o;function o(i){return Je(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a):r(i)}function a(i){return n.parser.lazy[n.now().line]?r(i):t(i)}}function Gge(e,t,r){return n;function n(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(pf,t,r)}}var ak={name:"htmlText",tokenize:Xge};function Xge(e,t,r){let n=this,o,a,i;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),s}function s(M){return M===33?(e.consume(M),c):M===47?(e.consume(M),S):M===63?(e.consume(M),y):Ri(M)?(e.consume(M),N):r(M)}function c(M){return M===45?(e.consume(M),u):M===91?(e.consume(M),a=0,p):Ri(M)?(e.consume(M),h):r(M)}function u(M){return M===45?(e.consume(M),m):r(M)}function f(M){return M===null?r(M):M===45?(e.consume(M),d):Je(M)?(i=f,_(M)):(e.consume(M),f)}function d(M){return M===45?(e.consume(M),m):f(M)}function m(M){return M===62?H(M):M===45?d(M):f(M)}function p(M){let U="CDATA[";return M===U.charCodeAt(a++)?(e.consume(M),a===U.length?x:p):r(M)}function x(M){return M===null?r(M):M===93?(e.consume(M),b):Je(M)?(i=x,_(M)):(e.consume(M),x)}function b(M){return M===93?(e.consume(M),g):x(M)}function g(M){return M===62?H(M):M===93?(e.consume(M),g):x(M)}function h(M){return M===null||M===62?H(M):Je(M)?(i=h,_(M)):(e.consume(M),h)}function y(M){return M===null?r(M):M===63?(e.consume(M),v):Je(M)?(i=y,_(M)):(e.consume(M),y)}function v(M){return M===62?H(M):y(M)}function S(M){return Ri(M)?(e.consume(M),R):r(M)}function R(M){return M===45||Eo(M)?(e.consume(M),R):C(M)}function C(M){return Je(M)?(i=C,_(M)):Nt(M)?(e.consume(M),C):H(M)}function N(M){return M===45||Eo(M)?(e.consume(M),N):M===47||M===62||_n(M)?E(M):r(M)}function E(M){return M===47?(e.consume(M),H):M===58||M===95||Ri(M)?(e.consume(M),O):Je(M)?(i=E,_(M)):Nt(M)?(e.consume(M),E):H(M)}function O(M){return M===45||M===46||M===58||M===95||Eo(M)?(e.consume(M),O):w(M)}function w(M){return M===61?(e.consume(M),A):Je(M)?(i=w,_(M)):Nt(M)?(e.consume(M),w):E(M)}function A(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(e.consume(M),o=M,T):Je(M)?(i=A,_(M)):Nt(M)?(e.consume(M),A):(e.consume(M),k)}function T(M){return M===o?(e.consume(M),o=void 0,L):M===null?r(M):Je(M)?(i=T,_(M)):(e.consume(M),T)}function k(M){return M===null||M===34||M===39||M===60||M===61||M===96?r(M):M===47||M===62||_n(M)?E(M):(e.consume(M),k)}function L(M){return M===47||M===62||_n(M)?E(M):r(M)}function H(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):r(M)}function _(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),F}function F(M){return Nt(M)?Mt(e,z,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):z(M)}function z(M){return e.enter("htmlTextData"),i(M)}}var Qd={name:"labelEnd",resolveAll:Jge,resolveTo:eye,tokenize:tye},Yge={tokenize:rye},Qge={tokenize:nye},Zge={tokenize:oye};function Jge(e){let t=-1,r=[];for(;++t<e.length;){let n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let o=n.type==="labelImage"?4:2;n.type="data",t+=o}}return e.length!==r.length&&Uo(e,0,e.length,r),e}function eye(e,t){let r=e.length,n=0,o,a,i,l;for(;r--;)if(o=e[r][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(i){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=r,o.type!=="labelLink")){n=2;break}}else o.type==="labelEnd"&&(i=r);let s={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[a][1].start},end:{...e[i][1].end}},u={type:"labelText",start:{...e[a+n+2][1].end},end:{...e[i-2][1].start}};return l=[["enter",s,t],["enter",c,t]],l=ga(l,e.slice(a+1,a+n+3)),l=ga(l,[["enter",u,t]]),l=ga(l,Vh(t.parser.constructs.insideSpan.null,e.slice(a+n+4,i-3),t)),l=ga(l,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),l=ga(l,e.slice(i+1)),l=ga(l,[["exit",s,t]]),Uo(e,a,e.length,l),e}function tye(e,t,r){let n=this,o=n.events.length,a,i;for(;o--;)if((n.events[o][1].type==="labelImage"||n.events[o][1].type==="labelLink")&&!n.events[o][1]._balanced){a=n.events[o][1];break}return l;function l(d){return a?a._inactive?f(d):(i=n.parser.defined.includes(Rc(n.sliceSerialize({start:a.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),s):r(d)}function s(d){return d===40?e.attempt(Yge,u,i?u:f)(d):d===91?e.attempt(Qge,u,i?c:f)(d):i?u(d):f(d)}function c(d){return e.attempt(Zge,u,f)(d)}function u(d){return t(d)}function f(d){return a._balanced=!0,r(d)}}function rye(e,t,r){return n;function n(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return _n(f)?Yd(e,a)(f):a(f)}function a(f){return f===41?u(f):s1(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function i(f){return _n(f)?Yd(e,s)(f):u(f)}function l(f){return r(f)}function s(f){return f===34||f===39||f===40?u1(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return _n(f)?Yd(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):r(f)}}function nye(e,t,r){let n=this;return o;function o(l){return c1.call(n,e,a,i,"reference","referenceMarker","referenceString")(l)}function a(l){return n.parser.defined.includes(Rc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function i(l){return r(l)}}function oye(e,t,r){return n;function n(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):r(a)}}var ik={name:"labelStartImage",resolveAll:Qd.resolveAll,tokenize:aye};function aye(e,t,r){let n=this;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),i):r(l)}function i(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(l):t(l)}}var lk={name:"labelStartLink",resolveAll:Qd.resolveAll,tokenize:iye};function iye(e,t,r){let n=this;return o;function o(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),a}function a(i){return i===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(i):t(i)}}var db={name:"lineEnding",tokenize:lye};function lye(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Mt(e,t,"linePrefix")}}var Zd={name:"thematicBreak",tokenize:sye};function sye(e,t,r){let n=0,o;return a;function a(c){return e.enter("thematicBreak"),i(c)}function i(c){return o=c,l(c)}function l(c){return c===o?(e.enter("thematicBreakSequence"),s(c)):n>=3&&(c===null||Je(c))?(e.exit("thematicBreak"),t(c)):r(c)}function s(c){return c===o?(e.consume(c),n++,s):(e.exit("thematicBreakSequence"),Nt(c)?Mt(e,l,"whitespace")(c):l(c))}}var aa={continuation:{tokenize:dye},exit:pye,name:"list",tokenize:fye},cye={partial:!0,tokenize:hye},uye={partial:!0,tokenize:mye};function fye(e,t,r){let n=this,o=n.events[n.events.length-1],a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,i=0;return l;function l(m){let p=n.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!n.containerState.marker||m===n.containerState.marker:sb(m)){if(n.containerState.type||(n.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Zd,r,c)(m):c(m);if(!n.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(m)}return r(m)}function s(m){return sb(m)&&++i<10?(e.consume(m),s):(!n.interrupt||i<2)&&(n.containerState.marker?m===n.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):r(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||m,e.check(pf,n.interrupt?r:u,e.attempt(cye,d,f))}function u(m){return n.containerState.initialBlankLine=!0,a++,d(m)}function f(m){return Nt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),d):r(m)}function d(m){return n.containerState.size=a+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function dye(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(pf,o,a);function o(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Mt(e,t,"listItemIndent",n.containerState.size+1)(l)}function a(l){return n.containerState.furtherBlankLines||!Nt(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(uye,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,Mt(e,e.attempt(aa,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function mye(e,t,r){let n=this;return Mt(e,o,"listItemIndent",n.containerState.size+1);function o(a){let i=n.events[n.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===n.containerState.size?t(a):r(a)}}function pye(e){e.exit(this.containerState.type)}function hye(e,t,r){let n=this;return Mt(e,o,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){let i=n.events[n.events.length-1];return!Nt(a)&&i&&i[1].type==="listItemPrefixWhitespace"?t(a):r(a)}}var f1={name:"setextUnderline",resolveTo:gye,tokenize:yye};function gye(e,t){let r=e.length,n,o,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!a&&e[r][1].type==="definition"&&(a=r);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",i,t]),e.splice(a+1,0,["exit",e[n][1],t]),e[n][1].end={...e[a][1].end}):e[n][1]=i,e.push(["exit",i,t]),e}function yye(e,t,r){let n=this,o;return a;function a(c){let u=n.events.length,f;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){f=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(e.enter("setextHeadingLine"),o=c,i(c)):r(c)}function i(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===o?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),Nt(c)?Mt(e,s,"lineSuffix")(c):s(c))}function s(c){return c===null||Je(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}var vX={tokenize:xye};function xye(e){let t=this,r=e.attempt(pf,n,e.attempt(this.parser.constructs.flowInitial,o,Mt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(JD,o)),"linePrefix")));return r;function n(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var CX={resolveAll:wX()},SX=EX("string"),RX=EX("text");function EX(e){return{resolveAll:wX(e==="text"?bye:void 0),tokenize:t};function t(r){let n=this,o=this.parser.constructs[e],a=r.attempt(o,i,l);return i;function i(u){return c(u)?a(u):l(u)}function l(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),s}function s(u){return c(u)?(r.exit("data"),a(u)):(r.consume(u),s)}function c(u){if(u===null)return!0;let f=o[u],d=-1;if(f)for(;++d<f.length;){let m=f[d];if(!m.previous||m.previous.call(n,n.previous))return!0}return!1}}}function wX(e){return t;function t(r,n){let o=-1,a;for(;++o<=r.length;)a===void 0?r[o]&&r[o][1].type==="data"&&(a=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==a+2&&(r[a][1].end=r[o-1][1].end,r.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(r,n):r}}function bye(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let n=e[r-1][1],o=t.sliceStream(n),a=o.length,i=-1,l=0,s;for(;a--;){let c=o[a];if(typeof c=="string"){for(i=c.length;c.charCodeAt(i-1)===32;)l++,i--;if(i)break;i=-1}else if(c===-2)s=!0,l++;else if(c!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){let c={type:r===e.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?i:n.start._bufferIndex+i,_index:n.start._index+a,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}var sk={};Ak(sk,{attentionMarkers:()=>Tye,contentInitial:()=>Cye,disable:()=>Oye,document:()=>vye,flow:()=>Rye,flowInitial:()=>Sye,insideSpan:()=>Nye,string:()=>Eye,text:()=>wye});var vye={42:aa,43:aa,45:aa,48:aa,49:aa,50:aa,51:aa,52:aa,53:aa,54:aa,55:aa,56:aa,57:aa,62:r1},Cye={91:ek},Sye={[-2]:ub,[-1]:ub,32:ub},Rye={35:rk,42:Zd,45:[f1,Zd],60:ok,61:f1,95:Zd,96:a1,126:a1},Eye={38:o1,92:n1},wye={[-5]:db,[-4]:db,[-3]:db,33:ik,38:o1,42:cb,60:[QD,ak],91:lk,92:[tk,n1],93:Qd,95:cb,96:ZD},Nye={null:[cb,CX]},Tye={null:[42,95]},Oye={null:[]};function NX(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},o={},a=[],i=[],l=[],s=!0,c={attempt:E(C),check:E(N),consume:v,enter:S,exit:R,interrupt:E(N,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:b,parser:e,previous:null,sliceSerialize:p,sliceStream:x,write:m},f=t.tokenize.call(u,c),d;return t.resolveAll&&a.push(t),u;function m(T){return i=ga(i,T),h(),i[i.length-1]!==null?[]:(O(t,0),u.events=Vh(a,u.events,u),u.events)}function p(T,k){return Mye(x(T),k)}function x(T){return $ye(i,T)}function b(){let{_bufferIndex:T,_index:k,line:L,column:H,offset:_}=n;return{_bufferIndex:T,_index:k,line:L,column:H,offset:_}}function g(T){o[T.line]=T.column,A()}function h(){let T;for(;n._index<i.length;){let k=i[n._index];if(typeof k=="string")for(T=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===T&&n._bufferIndex<k.length;)y(k.charCodeAt(n._bufferIndex));else y(k)}}function y(T){s=void 0,d=T,f=f(T)}function v(T){Je(T)?(n.line++,n.column=1,n.offset+=T===-3?2:1,A()):T!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===i[n._index].length&&(n._bufferIndex=-1,n._index++)),u.previous=T,s=!0}function S(T,k){let L=k||{};return L.type=T,L.start=b(),u.events.push(["enter",L,u]),l.push(L),L}function R(T){let k=l.pop();return k.end=b(),u.events.push(["exit",k,u]),k}function C(T,k){O(T,k.from)}function N(T,k){k.restore()}function E(T,k){return L;function L(H,_,F){let z,M,U,B;return Array.isArray(H)?j(H):"tokenize"in H?j([H]):I(H);function I(Z){return ne;function ne(te){let de=te!==null&&Z[te],q=te!==null&&Z.null,X=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(q)?q:q?[q]:[]];return j(X)(te)}}function j(Z){return z=Z,M=0,Z.length===0?F:W(Z[M])}function W(Z){return ne;function ne(te){return B=w(),U=Z,Z.partial||(u.currentConstruct=Z),Z.name&&u.parser.constructs.disable.null.includes(Z.name)?Y(te):Z.tokenize.call(k?Object.assign(Object.create(u),k):u,c,K,Y)(te)}}function K(Z){return s=!0,T(U,B),_}function Y(Z){return s=!0,B.restore(),++M<z.length?W(z[M]):F}}}function O(T,k){T.resolveAll&&!a.includes(T)&&a.push(T),T.resolve&&Uo(u.events,k,u.events.length-k,T.resolve(u.events.slice(k),u)),T.resolveTo&&(u.events=T.resolveTo(u.events,u))}function w(){let T=b(),k=u.previous,L=u.currentConstruct,H=u.events.length,_=Array.from(l);return{from:H,restore:F};function F(){n=T,u.previous=k,u.currentConstruct=L,u.events.length=H,l=_,A()}}function A(){n.line in o&&n.column<2&&(n.column=o[n.line],n.offset+=o[n.line]-1)}}function $ye(e,t){let r=t.start._index,n=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex,i;if(r===o)i=[e[r].slice(n,a)];else{if(i=e.slice(r,o),n>-1){let l=i[0];typeof l=="string"?i[0]=l.slice(n):i.shift()}a>0&&i.push(e[o].slice(0,a))}return i}function Mye(e,t){let r=-1,n=[],o;for(;++r<e.length;){let a=e[r],i;if(typeof a=="string")i=a;else switch(a){case-5:{i="\r";break}case-4:{i=`
286
+ ${Q(h(o).mul(-1).equal())}`,[`${t}-tbody > tr:last-child > td`]:{borderBottomWidth:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:d,fontWeight:r,textAlign:"start",background:p,borderBottom:y,transition:`background-color ${m} ease`},[`& > ${t}-measure-cell`]:{paddingBlock:"0 !important",borderBlock:"0 !important",[`${t}-measure-cell-content`]:{height:0,overflow:"hidden",pointerEvents:"none"}}}},[`${t}-footer`]:{padding:`${Q(n)} ${Q(o)}`,color:b,background:g}}}},hpe=e=>{let{colorFillAlter:t,colorBgContainer:r,colorTextHeading:n,colorFillSecondary:o,colorFillContent:a,controlItemBgActive:i,controlItemBgActiveHover:l,padding:s,paddingSM:c,paddingXS:u,colorBorderSecondary:f,borderRadiusLG:d,controlHeight:m,colorTextPlaceholder:p,fontSize:x,fontSizeSM:b,lineHeight:g,lineWidth:h,colorIcon:y,colorIconHover:v,opacityLoading:S,controlInteractiveSize:R}=e,C=new yt(o).onBackground(r).toHexString(),N=new yt(a).onBackground(r).toHexString(),E=new yt(t).onBackground(r).toHexString(),O=new yt(y),w=new yt(v),A=R/2-h,T=A*2+h*3;return{headerBg:E,headerColor:n,headerSortActiveBg:C,headerSortHoverBg:N,bodySortBg:E,rowHoverBg:E,rowSelectedBg:i,rowSelectedHoverBg:l,rowExpandedBg:t,cellPaddingBlock:s,cellPaddingInline:s,cellPaddingBlockMD:c,cellPaddingInlineMD:u,cellPaddingBlockSM:u,cellPaddingInlineSM:u,borderColor:f,headerBorderRadius:d,footerBg:E,footerColor:n,cellFontSize:x,cellFontSizeMD:x,cellFontSizeSM:x,headerSplitColor:f,fixedHeaderSortActiveBg:C,headerFilterHoverBg:a,filterDropdownMenuBg:r,filterDropdownBg:r,expandIconBg:r,selectionColumnWidth:m,stickyScrollBarBg:p,stickyScrollBarBorderRadius:100,expandIconMarginTop:(x*g-h*3)/2-Math.ceil((b*1.4-h*3)/2),headerIconColor:O.clone().setA(O.a*S).toRgbString(),headerIconHoverColor:w.clone().setA(w.a*S).toRgbString(),expandIconHalfInner:A,expandIconSize:T,expandIconScale:R/T}},gpe=2,$q=ft("Table",e=>{let{colorTextHeading:t,colorSplit:r,colorBgContainer:n,controlInteractiveSize:o,headerBg:a,headerColor:i,headerSortActiveBg:l,headerSortHoverBg:s,bodySortBg:c,rowHoverBg:u,rowSelectedBg:f,rowSelectedHoverBg:d,rowExpandedBg:m,cellPaddingBlock:p,cellPaddingInline:x,cellPaddingBlockMD:b,cellPaddingInlineMD:g,cellPaddingBlockSM:h,cellPaddingInlineSM:y,borderColor:v,footerBg:S,footerColor:R,headerBorderRadius:C,cellFontSize:N,cellFontSizeMD:E,cellFontSizeSM:O,headerSplitColor:w,fixedHeaderSortActiveBg:A,headerFilterHoverBg:T,filterDropdownBg:k,expandIconBg:L,selectionColumnWidth:H,stickyScrollBarBg:_,calc:F}=e,z=nt(e,{tableFontSize:N,tableBg:n,tableRadius:C,tablePaddingVertical:p,tablePaddingHorizontal:x,tablePaddingVerticalMiddle:b,tablePaddingHorizontalMiddle:g,tablePaddingVerticalSmall:h,tablePaddingHorizontalSmall:y,tableBorderColor:v,tableHeaderTextColor:i,tableHeaderBg:a,tableFooterTextColor:R,tableFooterBg:S,tableHeaderCellSplitColor:w,tableHeaderSortBg:l,tableHeaderSortHoverBg:s,tableBodySortBg:c,tableFixedHeaderSortActiveBg:A,tableHeaderFilterActiveBg:T,tableFilterDropdownBg:k,tableRowHoverBg:u,tableSelectedRowBg:f,tableSelectedRowHoverBg:d,zIndexTableFixed:gpe,tableFontSizeMiddle:E,tableFontSizeSmall:O,tableSelectionColumnWidth:H,tableExpandIconBg:L,tableExpandColumnWidth:F(o).add(F(e.padding).mul(2)).equal(),tableExpandedRowBg:m,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:_,tableScrollThumbBgHover:t,tableScrollBg:r});return[ppe(z),Cq(z),cD(z),Nq(z),bq(z),hq(z),Sq(z),xq(z),cD(z),yq(z),Eq(z),vq(z),Tq(z),gq(z),wq(z),Rq(z),Oq(z)]},hpe,{resetFont:!1,unitless:{expandIconScale:!0}});var Mq=[],ype=(e,t)=>{var Ut,Ar;let{prefixCls:r,className:n,rootClassName:o,style:a,classNames:i,styles:l,size:s,bordered:c,dropdownPrefixCls:u,dataSource:f,pagination:d,rowSelection:m,rowKey:p,rowClassName:x,columns:b,children:g,childrenColumnName:h,onChange:y,getPopupContainer:v,loading:S,expandIcon:R,expandable:C,expandedRowRender:N,expandIconColumnIndex:E,indentSize:O,scroll:w,sortDirections:A,locale:T,showSorterTooltip:k={target:"full-header"},virtual:L}=e,H=wa("Table"),_=xr.useMemo(()=>b||JE(g),[b,g]),F=xr.useMemo(()=>_.some(Xe=>Xe.responsive),[_]),z=rh(F),M=xr.useMemo(()=>{let Xe=new Set(Object.keys(z).filter(dt=>z[dt]));return _.filter(dt=>!dt.responsive||dt.responsive.some(Ft=>Xe.has(Ft)))},[_,z]),U=gt(e,["className","style","columns"]),{locale:B=go,table:I}=xr.useContext(Ie),{getPrefixCls:j,direction:W,renderEmpty:K,getPopupContainer:Y,className:Z,style:ne,classNames:te,styles:de}=pt("table"),q=lr(Xe=>s==="middle"?"medium":s!=null?s:Xe),X={...e,size:q,bordered:c},[re,V]=ht([te,i],[de,l],{props:X},{pagination:{_default:"root"},header:{_default:"wrapper"},body:{_default:"wrapper"}}),G={...B.Table,...T},[J]=In("global",go.global),ee=f||Mq,ae=j("table",r),ue=j("dropdown",u),[,se]=qt(),Se=Xt(ae),[ye,Pe]=$q(ae,Se),Ne={childrenColumnName:h,expandIconColumnIndex:E,...C,expandIcon:(Ar=C==null?void 0:C.expandIcon)!=null?Ar:(Ut=I==null?void 0:I.expandable)==null?void 0:Ut.expandIcon},{childrenColumnName:oe="children"}=Ne,ce=xr.useMemo(()=>ee.some(Xe=>Xe==null?void 0:Xe[oe])?"nest":N||C!=null&&C.expandedRowRender?"row":null,[oe,ee]),be={body:xr.useRef(null)},me=zA(ae),xe=xr.useRef(null),Ee=xr.useRef(null);R6(t,()=>({...Ee.current,nativeElement:xe.current}));let pe=p||(I==null?void 0:I.rowKey)||"key",Te=w!=null?w:I==null?void 0:I.scroll,Oe=xr.useMemo(()=>typeof pe=="function"?pe:Xe=>Xe==null?void 0:Xe[pe],[pe]),[ge]=QK(ee,oe,Oe),ve={},De=(Xe,dt,Ft=!1)=>{var io,Wr,cn,Wo;let rr={...ve,...Xe};Ft&&((io=ve.resetPagination)==null||io.call(ve),(Wr=rr.pagination)!=null&&Wr.current&&(rr.pagination.current=1),d&&((Wo=d.onChange)==null||Wo.call(d,1,(cn=rr.pagination)==null?void 0:cn.pageSize))),w&&w.scrollToFirstRowOnChange!==!1&&be.body.current&&u2(0,{getContainer:()=>be.body.current}),y==null||y(rr.pagination,rr.filters,rr.sorter,{currentDataSource:Rw(Ow(ee,rr.sorterStates,oe),rr.filterStates,oe),action:dt})},$e=(Xe,dt)=>{De({sorter:Xe,sorterStates:dt},"sort",!1)},[at,He,ie,he]=cq({prefixCls:ae,mergedColumns:M,onSorterChange:$e,sortDirections:A||["ascend","descend"],tableLocale:G,showSorterTooltip:k,globalLocale:J}),ze=xr.useMemo(()=>Ow(ee,He,oe),[oe,ee,He]);ve.sorter=he(),ve.sorterStates=He;let ut=(Xe,dt)=>{De({filters:Xe,filterStates:dt},"filter",!0)},[Be,tt,et]=XK({prefixCls:ae,locale:G,dropdownPrefixCls:ue,mergedColumns:M,onFilterChange:ut,getPopupContainer:v||Y,rootClassName:D(o,Se)}),We=Rw(ze,tt,oe);ve.filters=et,ve.filterStates=tt;let fe=xr.useMemo(()=>{let Xe={};return Object.keys(et).forEach(dt=>{et[dt]!==null&&(Xe[dt]=et[dt])}),{...ie,filters:Xe}},[ie,et]),[Re]=dq(fe),Fe=(Xe,dt)=>{De({pagination:{...ve.pagination,current:Xe,pageSize:dt}},"paginate")},[Ce,Ae]=eq(We.length,Fe,d);ve.pagination=d===!1?{}:JK(Ce,d),ve.resetPagination=Ae;let ke=xr.useMemo(()=>{if(d===!1||!Ce.pageSize)return We;let{current:Xe=1,total:dt,pageSize:Ft=nD}=Ce;return We.length<dt?We.length>Ft?We.slice((Xe-1)*Ft,Xe*Ft):We:We.slice((Xe-1)*Ft,Xe*Ft)},[!!d,We,Ce==null?void 0:Ce.current,Ce==null?void 0:Ce.pageSize,Ce==null?void 0:Ce.total]),[Ve,Qe]=JW({prefixCls:ae,data:We,pageData:ke,getRowKey:Oe,getRecordByKey:ge,expandType:ce,childrenColumnName:oe,locale:G,getPopupContainer:v||Y},m),Zt=(Xe,dt,Ft)=>{let rr=typeof x=="function"?x(Xe,dt,Ft):x;return D({[`${ae}-row-selected`]:Qe.has(Oe(Xe,dt))},rr)};Ne.__PARENT_RENDER_ICON__=Ne.expandIcon,Ne.expandIcon=Ne.expandIcon||R||tK(G),ce==="nest"&&Ne.expandIconColumnIndex===void 0?Ne.expandIconColumnIndex=m?1:0:Ne.expandIconColumnIndex>0&&m&&(Ne.expandIconColumnIndex-=1),typeof Ne.indentSize!="number"&&(Ne.indentSize=typeof O=="number"?O:15);let jt=xr.useCallback(Xe=>Re(Ve(Be(at(Xe)))),[at,Be,Ve]),Rt,vr;if(d!==!1&&(Ce!=null&&Ce.total)){let Xe;Ce.size?Xe=Ce.size:Xe=q==="small"||q==="medium"?"small":void 0;let dt=(cn="end")=>xr.createElement(YU,{...Ce,classNames:re.pagination,styles:V.pagination,className:D(`${ae}-pagination ${ae}-pagination-${cn}`,Ce.className),size:Xe}),{placement:Ft,position:rr}=Ce,io=Ft!=null?Ft:rr,Wr=cn=>{let Wo=cn.toLowerCase();return Wo.includes("center")?"center":Wo.includes("left")||Wo.includes("start")?"start":"end"};if(Array.isArray(io)){let[cn,Wo]=["top","bottom"].map(Pl=>io.find(Al=>Al.includes(Pl))),gf=io.every(Pl=>`${Pl}`=="none");!cn&&!Wo&&!gf&&(vr=dt()),cn&&(Rt=dt(Wr(cn))),Wo&&(vr=dt(Wr(Wo)))}else vr=dt()}let gr=xr.useMemo(()=>typeof S=="boolean"?{spinning:S}:typeof S=="object"&&S!==null?{spinning:!0,...S}:void 0,[S]),zt=D(Pe,Se,`${ae}-wrapper`,Z,{[`${ae}-wrapper-rtl`]:W==="rtl"},n,o,re.root,ye),bt={...V.root,...ne,...a},Le=xr.useMemo(()=>gr!=null&&gr.spinning&&ee===Mq?null:typeof(T==null?void 0:T.emptyText)<"u"?T.emptyText:(K==null?void 0:K("Table"))||xr.createElement(fR,{componentName:"Table"}),[gr==null?void 0:gr.spinning,ee,T==null?void 0:T.emptyText,K]),qe=L?pq:mq,it={},wt=xr.useMemo(()=>{let{fontSize:Xe,lineHeight:dt,lineWidth:Ft,padding:rr,paddingXS:io,paddingSM:Wr}=se,cn=Math.floor(Xe*dt);switch(q){case"medium":return Wr*2+cn+Ft;case"small":return io*2+cn+Ft;default:return rr*2+cn+Ft}},[se,q]);return L&&(it.listItemHeight=wt),xr.createElement("div",{ref:xe,className:zt,style:bt},xr.createElement(Dx,{spinning:!1,...gr},Rt,xr.createElement(qe,{...it,...U,scroll:Te,classNames:re,styles:V,ref:Ee,columns:M,direction:W,expandable:Ne,prefixCls:ae,className:D({[`${ae}-medium`]:q==="medium",[`${ae}-small`]:q==="small",[`${ae}-bordered`]:c,[`${ae}-empty`]:ee.length===0},Pe,Se,ye),data:ke,rowKey:Oe,rowClassName:Zt,emptyText:Le,internalHooks:ps,internalRefs:be,transformColumns:jt,getContainerWidth:me,measureRowRender:Xe=>xr.createElement(ih.Provider,{value:!0},xr.createElement(gl,{getPopupContainer:dt=>dt},Xe))}),vr))},Iq=xr.forwardRef(ype);var xpe=(e,t)=>{let r=Dh.useRef(0);return r.current+=1,Dh.createElement(Iq,{...e,ref:t,_renderTimes:r.current})},bc=Dh.forwardRef(xpe);bc.SELECTION_COLUMN=yc;bc.EXPAND_COLUMN=Ji;bc.SELECTION_ALL=iw;bc.SELECTION_INVERT=lw;bc.SELECTION_NONE=sw;bc.Column=WW;bc.ColumnGroup=KW;bc.Summary=Fx;var Pq=bc;var of=Pq;var kn=$(P());var af=$(P());var bpe=e=>{let{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:o,calc:a}=e,i=a(n).sub(r).equal(),l=a(t).sub(r).equal();return{[o]:{...At(e),display:"inline-block",height:"auto",paddingInline:i,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",backgroundColor:e.defaultBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${o}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${o}-close-icon`]:{marginInlineStart:l,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${o}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive},"&-disabled":{cursor:"not-allowed",[`&:not(${o}-checkable-checked)`]:{color:e.colorTextDisabled,"&:hover":{backgroundColor:"transparent"}},[`&${o}-checkable-checked`]:{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled},"&:hover, &:active":{backgroundColor:e.colorBgContainerDisabled,color:e.colorTextDisabled},[`&:not(${o}-checkable-checked):hover`]:{color:e.colorTextDisabled}},"&-group":{display:"flex",flexWrap:"wrap",gap:e.paddingXS}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:i}},[`&${e.componentCls}-solid`]:{borderColor:"transparent",color:e.colorTextLightSolid,backgroundColor:e.colorBgSolid,[`&${o}-default`]:{color:e.solidTextColor}},[`${o}-filled`]:{borderColor:"transparent",backgroundColor:e.tagBorderlessBg},[`&${o}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",backgroundColor:e.colorBgContainerDisabled,a:{cursor:"not-allowed",pointerEvents:"none",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}},"a&":{"&:hover, &:active":{color:e.colorTextDisabled}},[`&${o}-outlined`]:{borderColor:e.colorBorderDisabled},[`&${o}-solid, &${o}-filled`]:{color:e.colorTextDisabled,[`${o}-close-icon`]:{color:e.colorTextDisabled}},[`${o}-close-icon`]:{cursor:"not-allowed",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}}}}},Xx=e=>{let{lineWidth:t,fontSizeIcon:r,calc:n}=e,o=e.fontSizeSM;return nt(e,{tagFontSize:o,tagLineHeight:Q(n(e.lineHeightSM).mul(o).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},Yx=e=>{let t=sS(new yd(e.colorBgSolid),"#fff")?"#000":"#fff";return{defaultBg:new yt(e.colorFillTertiary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText,solidTextColor:t}},kh=ft("Tag",e=>{let t=Xx(e);return bpe(t)},Yx);var vpe=af.forwardRef((e,t)=>{let{prefixCls:r,style:n,className:o,checked:a,children:i,icon:l,onChange:s,onClick:c,disabled:u,...f}=e,{getPrefixCls:d,tag:m}=af.useContext(Ie),p=af.useContext(mn),x=u!=null?u:p,b=S=>{x||(s==null||s(!a),c==null||c(S))},g=d("tag",r),[h,y]=kh(g),v=D(g,`${g}-checkable`,{[`${g}-checkable-checked`]:a,[`${g}-checkable-disabled`]:x},m==null?void 0:m.className,o,h,y);return af.createElement("span",{...f,ref:t,style:{...n,...m==null?void 0:m.style},className:v,onClick:b},l,af.createElement("span",null,i))}),$w=vpe;var vc=$(P());var Cpe=vc.default.forwardRef((e,t)=>{let{id:r,prefixCls:n,rootClassName:o,className:a,style:i,classNames:l,styles:s,disabled:c,options:u,value:f,defaultValue:d,onChange:m,multiple:p,...x}=e,{getPrefixCls:b,direction:g,className:h,style:y,classNames:v,styles:S}=pt("tag"),R=b("tag",n),C=`${R}-checkable-group`,N=Xt(R),[E,O]=kh(R,N),[w,A]=ht([v,l],[S,s],{props:e}),T=(0,vc.useMemo)(()=>Array.isArray(u)?u.map(z=>z&&typeof z=="object"?z:{value:z,label:z}):[],[u]),[k,L]=Lt(d,f),H=(z,M)=>{let U=null;if(p){let B=k||[];U=z?[].concat(Ke(B),[M.value]):B.filter(I=>I!==M.value)}else U=z?M.value:null;L(U),m==null||m(U)},_=vc.default.useRef(null);(0,vc.useImperativeHandle)(t,()=>({nativeElement:_.current}));let F=mr(x,{aria:!0,data:!0});return vc.default.createElement("div",{...F,className:D(C,h,o,{[`${C}-disabled`]:c,[`${C}-rtl`]:g==="rtl"},E,O,a,w.root),style:{...y,...A.root,...i},id:r,ref:_},T.map(z=>vc.default.createElement($w,{key:z.value,className:D(`${C}-item`,w.item),style:A.item,checked:p?(k||[]).includes(z.value):k===z.value,onChange:M=>H(M,z),disabled:c},z.label)))}),Aq=Cpe;var Dq=$(P());function uD(e,t){let{color:r,variant:n,bordered:o}=e;return Dq.useMemo(()=>{let a=r==null?void 0:r.endsWith("-inverse"),i;n?i=n:a?i="solid":o===!1?i="filled":i=t||"filled";let l=a?r==null?void 0:r.replace("-inverse",""):r,s=RR(r),c=w7(r),u={};if(!s&&!c&&l)if(i==="solid")u.backgroundColor=r;else{let f=new yt(l).toHsl();f.l=.95,u.backgroundColor=new yt(f).toHexString(),u.color=r,i==="outlined"&&(u.borderColor=r)}return[i,l,s,c,u]},[r,n,o,t])}var Spe=e=>yp(e,(t,{textColor:r,lightBorderColor:n,lightColor:o,darkColor:a})=>({[`${e.componentCls}${e.componentCls}-${t}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:o,borderColor:n,color:r},[`&${e.componentCls}-solid`]:{backgroundColor:a,borderColor:a,color:e.colorTextLightSolid},[`&${e.componentCls}-filled`]:{backgroundColor:o,color:r}}})),kq=ai(["Tag","preset"],e=>{let t=Xx(e);return Spe(t)},Yx);function fD(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}var Mw=(e,t,r)=>{let n=fD(r);return{[`${e.componentCls}${e.componentCls}-${t}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:e[`color${n}Bg`],borderColor:e[`color${n}Border`],color:e[`color${r}`]},[`&${e.componentCls}-solid`]:{backgroundColor:e[`color${r}`],borderColor:e[`color${r}`]},[`&${e.componentCls}-filled`]:{backgroundColor:e[`color${n}Bg`],color:e[`color${r}`]}}}},Lq=ai(["Tag","status"],e=>{let t=Xx(e);return[Mw(t,"success","Success"),Mw(t,"processing","Info"),Mw(t,"error","Error"),Mw(t,"warning","Warning")]},Yx);var Rpe=kn.forwardRef((e,t)=>{var G;let{prefixCls:r,className:n,rootClassName:o,style:a,children:i,icon:l,color:s,variant:c,onClose:u,bordered:f,disabled:d,href:m,target:p,styles:x,classNames:b,...g}=e,{getPrefixCls:h,direction:y,className:v,variant:S,style:R,classNames:C,styles:N}=pt("tag"),[E,O,w,A,T]=uD(e,S),k=w||A,L=kn.useContext(mn),H=d!=null?d:L,{tag:_}=kn.useContext(Ie),[F,z]=kn.useState(!0),M=gt(g,["closeIcon","closable"]),U={...e,color:O,variant:E,disabled:H},[B,I]=ht([C,b],[N,x],{props:U}),j=kn.useMemo(()=>{let J={...I.root,...R,...a};return H||(J={...T,...J}),J},[I.root,R,a,T,H]),W=h("tag",r),[K,Y]=kh(W),Z=D(W,v,B.root,`${W}-${E}`,{[`${W}-${O}`]:k,[`${W}-hidden`]:!F,[`${W}-rtl`]:y==="rtl",[`${W}-disabled`]:H},n,o,K,Y),ne=J=>{H||(J.stopPropagation(),u==null||u(J),!J.defaultPrevented&&z(!1))},[,te]=NC(Sp(e),Sp(_),{closable:!1,closeIconRender:J=>{let ee=kn.createElement("span",{className:`${W}-close-icon`,onClick:ne},J);return $2(J,ee,ae=>({onClick:ue=>{var se;(se=ae==null?void 0:ae.onClick)==null||se.call(ae,ue),ne(ue)},className:D(ae==null?void 0:ae.className,`${W}-close-icon`)}))}}),de=typeof g.onClick=="function"||i&&i.type==="a",q=Er(l,{className:D(kn.isValidElement(l)?(G=l.props)==null?void 0:G.className:void 0,B.icon),style:I.icon}),X=q?kn.createElement(kn.Fragment,null,q,i&&kn.createElement("span",{className:B.content,style:I.content},i)):i,V=kn.createElement(m?"a":"span",{...M,ref:t,className:Z,style:j,href:H?void 0:m,target:p,onClick:H?void 0:M.onClick,...m&&H?{"aria-disabled":!0}:{}},X,te,w&&kn.createElement(kq,{key:"preset",prefixCls:W}),A&&kn.createElement(Lq,{key:"status",prefixCls:W}));return de?kn.createElement(gu,{component:"Tag"},V):V}),dD=Rpe;dD.CheckableTag=$w;dD.CheckableTagGroup=Aq;var mD=dD;var Epe=e=>{let t=e!=null&&e.algorithm?Kl(e.algorithm):Qf,r={...hl,...e==null?void 0:e.token};return Tv(r,{override:e==null?void 0:e.token},t,my)},_q=Epe;function pD(e){let{sizeUnit:t,sizeStep:r}=e,n=r-2;return{sizeXXL:t*(n+10),sizeXL:t*(n+6),sizeLG:t*(n+2),sizeMD:t*(n+2),sizeMS:t*(n+1),size:t*n,sizeSM:t*n,sizeXS:t*(n-1),sizeXXS:t*(n-1)}}var wpe=(e,t)=>{let r=t!=null?t:Us(e),n=r.fontSizeSM,o=r.controlHeight-4;return{...r,...pD(t!=null?t:e),...Gv(n),controlHeight:o,...qv({...r,controlHeight:o})}},zq=wpe;var vi=(e,t)=>new yt(e).setA(t).toRgbString(),lf=(e,t)=>new yt(e).lighten(t).toHexString();var hD=e=>{let t=Vi(e,{theme:"dark"});return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[6],6:t[5],7:t[4],8:t[6],9:t[5],10:t[4]}},Bq=(e,t)=>{let r=e||"#000",n=t||"#fff";return{colorBgBase:r,colorTextBase:n,colorText:vi(n,.85),colorTextSecondary:vi(n,.65),colorTextTertiary:vi(n,.45),colorTextQuaternary:vi(n,.25),colorFill:vi(n,.18),colorFillSecondary:vi(n,.12),colorFillTertiary:vi(n,.08),colorFillQuaternary:vi(n,.04),colorBgSolid:vi(n,.95),colorBgSolidHover:vi(n,1),colorBgSolidActive:vi(n,.9),colorBgElevated:lf(r,12),colorBgContainer:lf(r,8),colorBgLayout:lf(r,0),colorBgSpotlight:lf(r,26),colorBgBlur:vi(n,.04),colorBorder:lf(r,26),colorBorderDisabled:lf(r,26),colorBorderSecondary:lf(r,19)}};var Npe=(e,t)=>{let r=Object.keys(cy).map(i=>{let l=Vi(e[i],{theme:"dark"});return Array.from({length:10},()=>1).reduce((s,c,u)=>(s[`${i}-${u+1}`]=l[u],s[`${i}${u+1}`]=l[u],s),{})}).reduce((i,l)=>(i={...i,...l},i),{}),n=t!=null?t:Us(e),o=dy(e,{generateColorPalettes:hD,generateNeutralColorPalettes:Bq}),a=Ao.reduce((i,l)=>{let s=e[l];if(s){let c=hD(s);i[`${l}Hover`]=c[7],i[`${l}Active`]=c[5]}return i},{});return{...n,...r,...o,...a,colorPrimaryBg:o.colorPrimaryBorder,colorPrimaryBgHover:o.colorPrimaryBorderHover}},Fq=Npe;function Tpe(){let[e,t,r,n]=qt();return{theme:e,token:t,hashId:r,cssVar:n}}var Iw={defaultSeed:lu.token,useToken:Tpe,defaultAlgorithm:Us,darkAlgorithm:Fq,compactAlgorithm:zq,getDesignToken:_q,defaultConfig:lu,_internalContext:Zf};var Pw=$(P());var Ope={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},Hq=Ope;function gD(){return gD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gD.apply(this,arguments)}var $pe=(e,t)=>Pw.createElement(Ge,gD({},e,{ref:t,icon:Hq})),Mpe=Pw.forwardRef($pe),Qx=Mpe;var Aw=$(P());var Ipe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"},Vq=Ipe;function yD(){return yD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yD.apply(this,arguments)}var Ppe=(e,t)=>Aw.createElement(Ge,yD({},e,{ref:t,icon:Vq})),Ape=Aw.forwardRef(Ppe),xD=Ape;var sf=$(P()),Xq=$(sr()),qq=(0,sf.createContext)(void 0),Kq="mysql-dashboard-theme",Gq=({children:e})=>{let[t,r]=(0,sf.useState)(()=>typeof window<"u"&&localStorage.getItem(Kq)||"dark");(0,sf.useEffect)(()=>{let a=document.documentElement;t==="dark"?a.classList.add("dark"):a.classList.remove("dark"),localStorage.setItem(Kq,t)},[t]);let n=()=>{r(a=>a==="dark"?"light":"dark")},o=a=>{r(a)};return(0,Xq.jsx)(qq.Provider,{value:{theme:t,toggleTheme:n,setTheme:o},children:e})},kw=()=>{let e=(0,sf.useContext)(qq);if(e===void 0)throw new Error("useTheme \u5FC5\u987B\u5728 ThemeProvider \u5185\u4F7F\u7528");return e};var uf=$(P());var Zx="/api";async function cf(){return(await fetch(`${Zx}/connection/list`,{method:"POST",headers:{"Content-Type":"application/json"}})).json()}async function Yq(e){return(await fetch(`${Zx}/connection/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()}async function Qq(e,t){return(await fetch(`${Zx}/connection/update/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json()}async function Zq(e){return(await fetch(`${Zx}/connection/delete/${e}`,{method:"POST",headers:{"Content-Type":"application/json"}})).json()}async function Lw(e){return(await fetch(`${Zx}/connection/test`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json()}var Lh=$(P());var cr=$(sr()),Jq=({connection:e,onSuccess:t,onCancel:r})=>{let[n,o]=(0,Lh.useState)({name:"",host:"localhost",port:3306,username:"",password:"",database:"",connectionString:""}),[a,i]=(0,Lh.useState)(!1),[l,s]=(0,Lh.useState)(!1);(0,Lh.useEffect)(()=>{e&&o({name:e.name,host:e.host,port:e.port||3306,username:e.username||"",password:e.password||"",database:e.database||"",connectionString:e.connectionString||""})},[e]);let c=async f=>{f.preventDefault(),i(!0);try{let d;e!=null&&e._id?d=await Qq(e._id,n):d=await Yq(n),d.success?t():alert(d.message||"\u4FDD\u5B58\u5931\u8D25")}catch{alert("\u4FDD\u5B58\u5931\u8D25")}finally{i(!1)}},u=async()=>{s(!0);try{let f={...n,_id:e==null?void 0:e._id},d=await Lw(f);d.success&&d.data?alert(d.data.message):alert(d.message||"\u6D4B\u8BD5\u5931\u8D25")}catch{alert("\u6D4B\u8BD5\u5931\u8D25")}finally{s(!1)}};return(0,cr.jsxs)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-6 dark:border-gray-700 dark:bg-gray-800/50",children:[(0,cr.jsx)("h3",{className:"mb-4 text-lg font-semibold text-gray-900 dark:text-white",children:e?"\u7F16\u8F91\u8FDE\u63A5":"\u65B0\u5EFA\u8FDE\u63A5"}),(0,cr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-name",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u8FDE\u63A5\u540D\u79F0"}),(0,cr.jsx)("input",{id:"connection-name",type:"text",required:!0,value:n.name,onChange:f=>o({...n,name:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"\u4F8B\u5982: \u672C\u5730 MySQL"})]}),(0,cr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-host",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u4E3B\u673A\u5730\u5740"}),(0,cr.jsx)("input",{id:"connection-host",type:"text",required:!0,value:n.host,onChange:f=>o({...n,host:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"localhost"})]}),(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-port",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u7AEF\u53E3"}),(0,cr.jsx)("input",{id:"connection-port",type:"number",value:n.port,onChange:f=>o({...n,port:parseInt(f.target.value,10)||3306}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"3306"})]})]}),(0,cr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-username",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u7528\u6237\u540D"}),(0,cr.jsx)("input",{id:"connection-username",type:"text",value:n.username,onChange:f=>o({...n,username:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"\u53EF\u9009"})]}),(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-password",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u5BC6\u7801"}),(0,cr.jsx)("input",{id:"connection-password",type:"password",value:n.password,onChange:f=>o({...n,password:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"\u53EF\u9009"})]})]}),(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-database",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u9ED8\u8BA4\u6570\u636E\u5E93"}),(0,cr.jsx)("input",{id:"connection-database",type:"text",value:n.database,onChange:f=>o({...n,database:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"\u53EF\u9009\uFF0C\u8FDE\u63A5\u540E\u53EF\u6D4F\u89C8\u6240\u6709\u5E93"})]}),(0,cr.jsxs)("div",{children:[(0,cr.jsx)("label",{htmlFor:"connection-string",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u8FDE\u63A5 URI\uFF08\u53EF\u9009\uFF0C\u4F18\u5148\u7EA7\u9AD8\u4E8E\u4EE5\u4E0A\u914D\u7F6E\uFF09"}),(0,cr.jsx)("input",{id:"connection-string",type:"text",value:n.connectionString,onChange:f=>o({...n,connectionString:f.target.value}),className:"w-full rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm text-gray-900 placeholder-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",placeholder:"mysql://user:password@localhost:3306/dbname"})]}),(0,cr.jsxs)("div",{className:"flex gap-2",children:[(0,cr.jsx)("button",{type:"submit",disabled:a,className:"flex-1 rounded-md bg-blue-600 px-3 py-1.5 font-medium text-white transition hover:bg-blue-700 disabled:opacity-50",children:a?"\u4FDD\u5B58\u4E2D...":"\u4FDD\u5B58"}),(0,cr.jsx)("button",{type:"button",onClick:u,disabled:l,className:"rounded-md border border-gray-300 bg-white px-3 py-1.5 font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:l?"\u6D4B\u8BD5\u4E2D...":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,cr.jsx)("button",{type:"button",onClick:r,className:"rounded-md border border-gray-300 bg-white px-3 py-1.5 font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:"\u53D6\u6D88"})]})]})]})};var _w=$(P());var Lpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},eG=Lpe;function bD(){return bD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bD.apply(this,arguments)}var _pe=(e,t)=>_w.createElement(Ge,bD({},e,{ref:t,icon:eG})),zpe=_w.forwardRef(_pe),vD=zpe;var zw=$(P());var Bpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"},tG=Bpe;function CD(){return CD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CD.apply(this,arguments)}var Fpe=(e,t)=>zw.createElement(Ge,CD({},e,{ref:t,icon:tG})),Hpe=zw.forwardRef(Fpe),SD=Hpe;var Bw=$(P());var Vpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"},rG=Vpe;function RD(){return RD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RD.apply(this,arguments)}var jpe=(e,t)=>Bw.createElement(Ge,RD({},e,{ref:t,icon:rG})),Upe=Bw.forwardRef(jpe),ED=Upe;var Fw=$(P());var Wpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M511.6 76.3C264.3 76.2 64 276.4 64 523.5 64 718.9 189.3 885 363.8 946c23.5 5.9 19.9-10.8 19.9-22.2v-77.5c-135.7 15.9-141.2-73.9-150.3-88.9C215 726 171.5 718 184.5 703c30.9-15.9 62.4 4 98.9 57.9 26.4 39.1 77.9 32.5 104 26 5.7-23.5 17.9-44.5 34.7-60.8-140.6-25.2-199.2-111-199.2-213 0-49.5 16.3-95 48.3-131.7-20.4-60.5 1.9-112.3 4.9-120 58.1-5.2 118.5 41.6 123.2 45.3 33-8.9 70.7-13.6 112.9-13.6 42.4 0 80.2 4.9 113.5 13.9 11.3-8.6 67.3-48.8 121.3-43.9 2.9 7.7 24.7 58.3 5.5 118 32.4 36.8 48.9 82.7 48.9 132.3 0 102.2-59 188.1-200 212.9a127.5 127.5 0 0138.1 91v112.5c.8 9 0 17.9 15 17.9 177.1-59.7 304.6-227 304.6-424.1 0-247.2-200.4-447.3-447.5-447.3z"}}]},name:"github",theme:"outlined"},nG=Wpe;function wD(){return wD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wD.apply(this,arguments)}var Kpe=(e,t)=>Fw.createElement(Ge,wD({},e,{ref:t,icon:nG})),qpe=Fw.forwardRef(Kpe),ND=qpe;var Hw=$(P());var Gpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},oG=Gpe;function TD(){return TD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TD.apply(this,arguments)}var Xpe=(e,t)=>Hw.createElement(Ge,TD({},e,{ref:t,icon:oG})),Ype=Hw.forwardRef(Xpe),OD=Ype;var Vw=$(P());var Qpe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 208H676V232h212v136zm0 224H676V432h212v160zM412 432h200v160H412V432zm200-64H412V232h200v136zm-476 64h212v160H136V432zm0-200h212v136H136V232zm0 424h212v136H136V656zm276 0h200v136H412V656zm476 136H676V656h212v136z"}}]},name:"table",theme:"outlined"},aG=Qpe;function $D(){return $D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$D.apply(this,arguments)}var Zpe=(e,t)=>Vw.createElement(Ge,$D({},e,{ref:t,icon:aG})),Jpe=Vw.forwardRef(Zpe),jw=Jpe;var _h=$(sr()),iG=()=>{let{theme:e,toggleTheme:t}=kw();return(0,_h.jsx)("button",{type:"button",onClick:t,className:"rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm font-medium text-gray-700 transition hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700","aria-label":e==="dark"?"\u5207\u6362\u5230\u4EAE\u8272\u4E3B\u9898":"\u5207\u6362\u5230\u6697\u8272\u4E3B\u9898",children:e==="dark"?(0,_h.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,_h.jsx)("path",{fillRule:"evenodd",d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z",clipRule:"evenodd"})}):(0,_h.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,_h.jsx)("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"})})})};var gn=$(sr()),Ci=({children:e,breadcrumbs:t})=>(0,gn.jsxs)("div",{className:"min-h-screen bg-white text-gray-900 dark:bg-slate-950 dark:text-slate-100",children:[(0,gn.jsx)("header",{className:"border-b border-gray-200 bg-gray-50/50 dark:border-gray-800 dark:bg-gray-900/50",children:(0,gn.jsxs)("div",{className:"container mx-auto px-6 py-4",children:[(0,gn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,gn.jsx)(eu,{to:"/",className:"text-2xl font-bold text-gray-900 dark:text-white hover:opacity-80",children:"MySQL Dashboard"}),(0,gn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,gn.jsx)(dc,{menu:{items:[{key:"readme",label:(0,gn.jsx)(eu,{to:"/help/readme",children:"\u5E2E\u52A9\u624B\u518C"})},{key:"development",label:(0,gn.jsx)(eu,{to:"/help/development",children:"\u5F00\u53D1\u624B\u518C"})}]},placement:"bottomRight",children:(0,gn.jsxs)("button",{type:"button",className:"flex items-center gap-1.5 rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm font-medium text-gray-700 transition hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700","aria-label":"\u5E2E\u52A9\u624B\u518C",children:[(0,gn.jsx)(Px,{className:"text-base"}),(0,gn.jsx)("span",{className:"hidden sm:inline",children:"\u5E2E\u52A9"})]})}),(0,gn.jsxs)("a",{href:"https://gitee.com/shy9120/mysql-dashboard",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm font-medium text-gray-700 transition hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700","aria-label":"\u67E5\u770B\u9879\u76EE\u6E90\u7801",children:[(0,gn.jsx)(ND,{className:"text-base"}),(0,gn.jsx)("span",{className:"hidden sm:inline",children:"Gitee"})]}),(0,gn.jsx)(iG,{})]})]}),t&&t.length>0&&(0,gn.jsx)("nav",{className:"mt-2 flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:t.map((n,o)=>(0,gn.jsxs)("span",{className:"flex items-center gap-2",children:[o>0&&(0,gn.jsx)("span",{className:"text-gray-400",children:">"}),n.path?(0,gn.jsx)(eu,{to:n.path,className:"hover:text-gray-900 dark:hover:text-white",children:n.label}):(0,gn.jsx)("span",{className:"text-gray-900 dark:text-white",children:n.label})]},o))})]})}),(0,gn.jsx)("main",{className:"container mx-auto px-6 py-8",children:e})]});var Ur=$(sr()),lG=()=>{let e=ri(),[t,r]=(0,uf.useState)([]),[n,o]=(0,uf.useState)(!1),[a,i]=(0,uf.useState)(!1),[l,s]=(0,uf.useState)(null),[c,u]=(0,uf.useState)(null);(0,uf.useEffect)(()=>{f()},[]);let f=async()=>{o(!0);try{let h=await cf();h.success&&h.data&&r(h.data)}catch(h){console.error("\u52A0\u8F7D\u8FDE\u63A5\u5217\u8868\u5931\u8D25:",h)}finally{o(!1)}},d=async h=>{bn.confirm({title:"\u5220\u9664\u8FDE\u63A5",content:"\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u4E2A\u8FDE\u63A5\u5417\uFF1F",okText:"\u786E\u8BA4\u5220\u9664",cancelText:"\u53D6\u6D88",okType:"danger",onOk:async()=>{try{let y=await Zq(h);y.success?await f():bn.error({title:"\u5220\u9664\u5931\u8D25",content:y.message||"\u5220\u9664\u5931\u8D25"})}catch{bn.error({title:"\u5220\u9664\u5931\u8D25",content:"\u5220\u9664\u5931\u8D25"})}}})},m=async h=>{u(h._id||null);try{let y=await Lw(h);y.success&&y.data?alert(y.data.message):alert(y.message||"\u6D4B\u8BD5\u5931\u8D25")}catch{alert("\u6D4B\u8BD5\u5931\u8D25")}finally{u(null)}},p=h=>{s(h),i(!0)},x=()=>{i(!1),s(null),f()},b=()=>{i(!1),s(null)},g=h=>{h._id&&e(`/connection/${h._id}`)};return(0,Ur.jsx)(Ci,{children:(0,Ur.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,Ur.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ur.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"MySQL \u8FDE\u63A5"}),(0,Ur.jsx)("button",{type:"button",onClick:()=>{s(null),i(!0)},className:"rounded-md bg-blue-600 px-3 py-1.5 text-sm font-medium text-white transition hover:bg-blue-700",children:"\u65B0\u5EFA\u8FDE\u63A5"})]}),a&&(0,Ur.jsx)(Jq,{connection:l||void 0,onSuccess:x,onCancel:b}),n?(0,Ur.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."}):t.length===0?(0,Ur.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:"\u6682\u65E0\u8FDE\u63A5\uFF0C\u8BF7\u521B\u5EFA\u65B0\u8FDE\u63A5"}):(0,Ur.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:t.map(h=>(0,Ur.jsxs)("div",{className:"group rounded-md border border-gray-200 bg-gray-50/50 p-4 transition hover:border-gray-300 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800",children:[(0,Ur.jsxs)("div",{className:"mb-3 flex items-start justify-between",children:[(0,Ur.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:h.name}),(0,Ur.jsxs)("div",{className:"flex gap-2 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,Ur.jsx)("button",{type:"button",onClick:()=>p(h),className:"rounded px-1.5 py-0.5 text-xs text-blue-600 transition hover:bg-blue-100 dark:text-blue-400 dark:hover:bg-blue-500/20",children:"\u7F16\u8F91"}),(0,Ur.jsx)("button",{type:"button",onClick:()=>h._id&&d(h._id),className:"rounded px-1.5 py-0.5 text-xs text-red-600 transition hover:bg-red-100 dark:text-red-400 dark:hover:bg-red-500/20",children:"\u5220\u9664"})]})]}),(0,Ur.jsxs)("div",{className:"mb-3 space-y-1 text-sm text-gray-700 dark:text-gray-300",children:[(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("span",{className:"text-gray-500 dark:text-gray-500",children:"\u5730\u5740:"})," ",h.host,":",h.port||3306]}),h.database&&(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("span",{className:"text-gray-500 dark:text-gray-500",children:"\u9ED8\u8BA4\u5E93:"})," ",h.database]}),h.username&&(0,Ur.jsxs)("div",{children:[(0,Ur.jsx)("span",{className:"text-gray-500 dark:text-gray-500",children:"\u7528\u6237:"})," ",h.username]})]}),(0,Ur.jsxs)("div",{className:"flex gap-2",children:[(0,Ur.jsx)("button",{type:"button",onClick:()=>g(h),className:"flex-1 rounded-md bg-green-600 px-2.5 py-1.5 text-sm font-medium text-white transition hover:bg-green-700",children:"\u8FDE\u63A5"}),(0,Ur.jsx)("button",{type:"button",onClick:()=>m(h),disabled:c===h._id,className:"rounded-md border border-gray-300 bg-white px-2.5 py-1.5 text-sm font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:c===h._id?"\u6D4B\u8BD5\u4E2D...":"\u6D4B\u8BD5"})]})]},h._id))})]})})};var Vo=$(P());var Uw="/api";async function sG(e){return(await fetch(`${Uw}/database/list`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e})})).json()}async function cG(e,t){return(await fetch(`${Uw}/database/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t})})).json()}async function uG(e,t){return(await fetch(`${Uw}/database/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t})})).json()}async function fG(e,t,r){return(await fetch(`${Uw}/database/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,oldDatabaseName:t,newDatabaseName:r})})).json()}var St=$(sr()),Ww=["mysql","information_schema","performance_schema","sys"],dG=()=>{let{connectionId:e}=Bs(),t=ri(),[r,n]=(0,Vo.useState)(null),[o,a]=(0,Vo.useState)([]),[i,l]=(0,Vo.useState)(!1),[s,c]=(0,Vo.useState)(!1),[u,f]=(0,Vo.useState)(!1),[d,m]=(0,Vo.useState)(!1),[p,x]=(0,Vo.useState)(""),[b,g]=(0,Vo.useState)(null),[h,y]=(0,Vo.useState)(""),[v,S]=(0,Vo.useState)(null),[R,C]=(0,Vo.useState)(!1),[N,E]=(0,Vo.useState)(!1),[O,w]=(0,Vo.useState)(!1),[A,T]=(0,Vo.useState)(null);(0,Vo.useEffect)(()=>{e&&(k(),L())},[e]);let k=async()=>{if(e)try{let j=await cf();if(j.success&&j.data){let W=j.data.find(K=>K._id===e);W?n(W):(alert("\u8FDE\u63A5\u4E0D\u5B58\u5728"),t("/"))}}catch{alert("\u52A0\u8F7D\u8FDE\u63A5\u4FE1\u606F\u5931\u8D25"),t("/")}},L=async()=>{if(e){l(!0);try{let j=await sG(e);j.success&&j.data?a(j.data):alert(j.message||"\u83B7\u53D6\u6570\u636E\u5E93\u5217\u8868\u5931\u8D25")}catch{alert("\u83B7\u53D6\u6570\u636E\u5E93\u5217\u8868\u5931\u8D25")}finally{l(!1)}}},H=j=>{e&&t(`/connection/${e}/database/${encodeURIComponent(j.name)}`)},_=async()=>{if(!e||!p.trim()){T("\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u540D\u79F0");return}let j=p.trim();if(!/^[a-zA-Z0-9_]+$/.test(j)){T("\u6570\u636E\u5E93\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF");return}if(Ww.includes(j.toLowerCase())){T("\u4E0D\u80FD\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u5E93\u540D");return}C(!0),T(null);try{let K=await cG(e,j);K.success?(c(!1),x(""),L()):T(K.message||"\u521B\u5EFA\u6570\u636E\u5E93\u5931\u8D25")}catch(K){T(K instanceof Error?K.message:"\u521B\u5EFA\u6570\u636E\u5E93\u5931\u8D25")}finally{C(!1)}},F=async()=>{if(!e||!b||!h.trim()){T("\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u540D\u79F0");return}let j=h.trim();if(!/^[a-zA-Z0-9_]+$/.test(j)){T("\u6570\u636E\u5E93\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF");return}if(j===b.name){T("\u65B0\u540D\u79F0\u4E0D\u80FD\u4E0E\u5F53\u524D\u540D\u79F0\u76F8\u540C");return}if(Ww.includes(j.toLowerCase())){T("\u4E0D\u80FD\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u5E93\u540D");return}E(!0),T(null);try{let K=await fG(e,b.name,j);K.success?(f(!1),g(null),y(""),L()):T(K.message||"\u91CD\u547D\u540D\u6570\u636E\u5E93\u5931\u8D25")}catch(K){T(K instanceof Error?K.message:"\u91CD\u547D\u540D\u6570\u636E\u5E93\u5931\u8D25")}finally{E(!1)}},z=async()=>{if(!(!e||!v)){w(!0),T(null);try{let j=await uG(e,v.name);j.success?(m(!1),S(null),L()):T(j.message||"\u5220\u9664\u6570\u636E\u5E93\u5931\u8D25")}catch(j){T(j instanceof Error?j.message:"\u5220\u9664\u6570\u636E\u5E93\u5931\u8D25")}finally{w(!1)}}},M=j=>{g(j),y(j.name),T(null),f(!0)},U=j=>{S(j),T(null),m(!0)},B=j=>j<1024?`${j} B`:j<1024*1024?`${(j/1024).toFixed(2)} KB`:j<1024*1024*1024?`${(j/(1024*1024)).toFixed(2)} MB`:`${(j/(1024*1024*1024)).toFixed(2)} GB`,I=r?[{label:"\u8FDE\u63A5\u5217\u8868",path:"/"},{label:r.name}]:[];return i&&!r?(0,St.jsx)(Ci,{breadcrumbs:I,children:(0,St.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."})}):(0,St.jsx)(Ci,{breadcrumbs:I,children:(0,St.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,St.jsxs)("div",{className:"flex items-center justify-between",children:[(0,St.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"\u6570\u636E\u5E93\u5217\u8868"}),(0,St.jsxs)("div",{className:"flex gap-2",children:[(0,St.jsx)("button",{type:"button",onClick:()=>{c(!0),T(null),x("")},className:"rounded-md bg-green-600 px-2.5 py-1 text-sm font-medium text-white transition hover:bg-green-700 dark:bg-green-700 dark:hover:bg-green-800",children:"\u65B0\u5EFA\u6570\u636E\u5E93"}),(0,St.jsx)("button",{type:"button",onClick:L,className:"rounded-md border border-gray-300 bg-white px-2.5 py-1 text-sm font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:"\u5237\u65B0"})]})]}),i?(0,St.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."}):o.length===0?(0,St.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:"\u6682\u65E0\u6570\u636E\u5E93"}):(0,St.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:o.map(j=>(0,St.jsxs)("div",{onClick:()=>H(j),className:"group relative cursor-pointer rounded-md border border-gray-200 bg-gray-50/50 p-4 transition hover:border-gray-300 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800",children:[(0,St.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,St.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:j.name}),j.empty&&(0,St.jsx)("span",{className:"rounded-full bg-gray-200 px-2 py-0.5 text-xs text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"\u7A7A"})]}),(0,St.jsx)("div",{className:"mb-3 text-sm text-gray-600 dark:text-gray-400",children:(0,St.jsxs)("div",{children:["\u4F30\u7B97\u5927\u5C0F: ",B(j.sizeOnDisk)]})}),(0,St.jsxs)("div",{className:"absolute right-2 top-2 flex gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,St.jsx)("button",{type:"button",onClick:W=>{W.stopPropagation(),M(j)},disabled:Ww.includes(j.name.toLowerCase()),className:"rounded-md bg-white/90 p-1.5 text-gray-700 shadow-md transition hover:bg-white disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-700/90 dark:text-gray-300 dark:hover:bg-gray-700",title:"\u91CD\u547D\u540D",children:(0,St.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,St.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,St.jsx)("button",{type:"button",onClick:W=>{W.stopPropagation(),U(j)},disabled:Ww.includes(j.name.toLowerCase()),className:"rounded-md bg-white/90 p-1.5 text-red-600 shadow-md transition hover:bg-white disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-700/90 dark:text-red-400 dark:hover:bg-gray-700",title:"\u5220\u9664",children:(0,St.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,St.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]},j.name))}),(0,St.jsx)(bn,{title:"\u65B0\u5EFA\u6570\u636E\u5E93",open:s,onOk:_,onCancel:()=>{c(!1),x(""),T(null)},confirmLoading:R,okText:"\u521B\u5EFA",cancelText:"\u53D6\u6D88",children:(0,St.jsxs)("div",{className:"mb-4",children:[(0,St.jsx)("label",{htmlFor:"database-name-input",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u6570\u636E\u5E93\u540D\u79F0"}),(0,St.jsx)(on,{id:"database-name-input",value:p,onChange:j=>{x(j.target.value),T(null)},onPressEnter:_,placeholder:"\u4F8B\u5982 my_app"}),A&&(0,St.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:A}),(0,St.jsx)("div",{className:"mt-2 text-xs text-gray-500 dark:text-gray-400",children:"\u4EC5\u652F\u6301\u5B57\u6BCD\u3001\u6570\u5B57\u4E0E\u4E0B\u5212\u7EBF"})]})}),(0,St.jsx)(bn,{title:"\u91CD\u547D\u540D\u6570\u636E\u5E93",open:u&&!!b,onOk:F,onCancel:()=>{f(!1),g(null),y(""),T(null)},confirmLoading:N,okText:"\u91CD\u547D\u540D",cancelText:"\u53D6\u6D88",children:(0,St.jsxs)("div",{className:"mb-4",children:[(0,St.jsx)("label",{htmlFor:"rename-database-input",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u65B0\u6570\u636E\u5E93\u540D\u79F0"}),(0,St.jsx)(on,{id:"rename-database-input",value:h,onChange:j=>{y(j.target.value),T(null)},onPressEnter:F}),A&&(0,St.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:A}),(0,St.jsx)("div",{className:"mt-1 text-xs text-amber-600 dark:text-amber-400",children:"\u5C06\u901A\u8FC7\u65B0\u5EFA\u5E93\u5E76 RENAME TABLE \u7684\u65B9\u5F0F\u8FC1\u79FB\u5168\u90E8\u8868\uFF0C\u6570\u636E\u91CF\u5927\u65F6\u8BF7\u8C28\u614E\u64CD\u4F5C\u3002"})]})}),(0,St.jsx)(bn,{title:"\u5220\u9664\u6570\u636E\u5E93",open:d&&!!v,onOk:z,onCancel:()=>{m(!1),S(null),T(null)},confirmLoading:O,okText:"\u786E\u8BA4\u5220\u9664",cancelText:"\u53D6\u6D88",okType:"danger",children:(0,St.jsxs)("div",{className:"mb-4",children:[(0,St.jsxs)("div",{className:"mb-2 text-sm text-gray-700 dark:text-gray-300",children:["\u786E\u5B9A\u8981\u5220\u9664\u6570\u636E\u5E93 ",(0,St.jsx)("span",{className:"font-semibold text-gray-900 dark:text-white",children:v==null?void 0:v.name})," \u5417\uFF1F"]}),(0,St.jsxs)("div",{className:"mb-2 text-sm text-gray-600 dark:text-gray-400",children:["\u4F30\u7B97\u5927\u5C0F: ",v?B(v.sizeOnDisk):""]}),A&&(0,St.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:A}),(0,St.jsxs)("div",{className:"mt-4 rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-500/10 dark:text-red-400",children:[(0,St.jsx)("strong",{children:"\u8B66\u544A\uFF1A"}),"\u6B64\u64CD\u4F5C\u5C06\u6C38\u4E45\u5220\u9664\u6570\u636E\u5E93\u53CA\u5176\u6240\u6709\u6570\u636E\uFF0C\u4E14\u65E0\u6CD5\u6062\u590D\u3002"]})]})})]})})};var Dt=$(P());function mG(e){let t=e.toLowerCase();return["tinyint","smallint","mediumint","int","integer","bigint"].includes(t)?"integer":["decimal","numeric","float","double","real"].includes(t)?"decimal":["char","varchar"].includes(t)?"string":["tinytext","text","mediumtext","longtext"].includes(t)?"text":["binary","varbinary","blob","tinyblob","mediumblob","longblob"].includes(t)?"binary":["date","datetime","timestamp","time","year"].includes(t)?"temporal":t==="json"?"json":t==="enum"||t==="set"?"enum":"other"}function pG(e){switch(e){case"integer":return"border-0 bg-blue-100 text-blue-900 dark:bg-blue-500/25 dark:text-blue-200";case"decimal":return"border-0 bg-amber-100 text-amber-950 dark:bg-amber-500/20 dark:text-amber-200";case"string":return"border-0 bg-emerald-100 text-emerald-950 dark:bg-emerald-500/20 dark:text-emerald-200";case"text":return"border-0 bg-teal-100 text-teal-950 dark:bg-teal-500/20 dark:text-teal-200";case"binary":return"border-0 bg-slate-200 text-slate-900 dark:bg-slate-500/30 dark:text-slate-100";case"temporal":return"border-0 bg-violet-100 text-violet-950 dark:bg-violet-500/25 dark:text-violet-200";case"json":return"border-0 bg-cyan-100 text-cyan-950 dark:bg-cyan-500/20 dark:text-cyan-200";case"enum":return"border-0 bg-fuchsia-100 text-fuchsia-950 dark:bg-fuchsia-500/20 dark:text-fuchsia-200";default:return"border-0 bg-gray-100 text-gray-900 dark:bg-gray-600/40 dark:text-gray-100"}}var Cc="/api";async function Kw(e,t){return(await fetch(`${Cc}/collection/list`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t})})).json()}async function MD(e,t,r){return(await fetch(`${Cc}/collection/schema`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r})})).json()}async function hG(e,t,r,n=1,o=20){return(await fetch(`${Cc}/collection/documents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,page:n,pageSize:o})})).json()}async function gG(e,t,r,n,o){return(await fetch(`${Cc}/collection/update`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,filter:n,update:o})})).json()}async function yG(e,t,r,n){return(await fetch(`${Cc}/collection/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,filter:n})})).json()}async function xG(e,t,r,n){return(await fetch(`${Cc}/collection/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,columns:n})})).json()}async function Jx(e,t,r,n){return(await fetch(`${Cc}/collection/alter-schema`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,...n})})).json()}async function bG(e,t,r){return(await fetch(`${Cc}/collection/delete-collection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r})})).json()}async function vG(e,t,r,n){return(await fetch(`${Cc}/collection/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,oldCollectionName:r,newCollectionName:n})})).json()}var CG=$(P());var br=$(sr()),ehe=[{value:"INT",label:"INT"},{value:"BIGINT",label:"BIGINT"},{value:"TINYINT",label:"TINYINT"},{value:"VARCHAR(64)",label:"VARCHAR(64)"},{value:"VARCHAR(255)",label:"VARCHAR(255)"},{value:"TEXT",label:"TEXT"},{value:"DATETIME",label:"DATETIME"},{value:"DATE",label:"DATE"},{value:"TIMESTAMP",label:"TIMESTAMP"},{value:"DECIMAL(10,2)",label:"DECIMAL(10,2)"},{value:"DOUBLE",label:"DOUBLE"},{value:"BOOLEAN",label:"BOOLEAN"}];function SG({open:e,mode:t,existingColumnNames:r,editTarget:n,onCancel:o,onSubmit:a,submitting:i}){var f,d;let[l]=oa.useForm(),s=(f=oa.useWatch("autoIncrement",l))!=null?f:!1;(0,CG.useEffect)(()=>{var m;e&&(t==="add"?l.setFieldsValue({name:"",newName:"",columnType:"VARCHAR(255)",nullable:!0,defaultValue:"",comment:"",autoIncrement:!1,afterColumn:void 0}):n&&l.setFieldsValue({name:n.name,newName:n.name,columnType:n.columnType,nullable:n.nullable,defaultValue:(m=n.defaultValue)!=null?m:"",comment:n.comment||"",autoIncrement:/auto_increment/i.test(n.extra),afterColumn:"__keep__"}))},[e,t,n,l]);let c=[{label:"\u8868\u5C3E\uFF08\u9ED8\u8BA4\uFF09",value:"__end__"},...r.map(m=>({label:`\u5728\u300C${m}\u300D\u4E4B\u540E`,value:m}))],u=n!=null?[{label:"\u4FDD\u6301\u539F\u4F4D\u7F6E",value:"__keep__"},{label:"\u79FB\u5230\u7B2C\u4E00\u5217",value:"__first__"},...r.filter(m=>m!==n.name).map(m=>({label:`\u5728\u300C${m}\u300D\u4E4B\u540E`,value:m}))]:[];return(0,br.jsx)(bn,{title:t==="add"?"\u6DFB\u52A0\u5B57\u6BB5":`\u4FEE\u6539\u5B57\u6BB5 \u2014 ${(d=n==null?void 0:n.name)!=null?d:""}`,open:e,onCancel:o,onOk:()=>l.submit(),confirmLoading:i,okText:"\u4FDD\u5B58",destroyOnClose:!0,width:520,children:(0,br.jsxs)(oa,{form:l,layout:"vertical",onFinish:async m=>{await a(m,t)},children:[t==="add"&&(0,br.jsx)(oa.Item,{name:"name",label:"\u5B57\u6BB5\u540D",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B57\u6BB5\u540D"},{pattern:/^[a-zA-Z0-9_]+$/,message:"\u4EC5\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF"}],children:(0,br.jsx)(on,{placeholder:"\u4EC5\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF"})}),t==="edit"&&(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(oa.Item,{label:"\u5F53\u524D\u5B57\u6BB5\u540D",children:(0,br.jsx)(on,{value:n==null?void 0:n.name,disabled:!0})}),(0,br.jsx)(oa.Item,{name:"newName",label:"\u65B0\u5B57\u6BB5\u540D",tooltip:"\u4E0E\u5F53\u524D\u540D\u79F0\u76F8\u540C\u8868\u793A\u4E0D\u91CD\u547D\u540D",rules:[{pattern:/^[a-zA-Z0-9_]*$/,message:"\u4EC5\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF"}],children:(0,br.jsx)(on,{placeholder:n==null?void 0:n.name})})]}),(0,br.jsx)(oa.Item,{label:"\u7C7B\u578B",children:(0,br.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,br.jsx)(oa.Item,{name:"columnType",noStyle:!0,rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7C7B\u578B"}],children:(0,br.jsx)(on,{className:"min-w-[200px] flex-1",placeholder:"\u5982 VARCHAR(255)"})}),(0,br.jsx)(Cl,{placeholder:"\u5E38\u7528\u7C7B\u578B",className:"min-w-[140px] flex-1",allowClear:!0,options:ehe,onChange:m=>{m&&l.setFieldValue("columnType",m)}})]})}),(0,br.jsx)(oa.Item,{name:"nullable",valuePropName:"checked",label:null,children:(0,br.jsx)(na,{disabled:t==="edit"?s:!1,children:"\u5141\u8BB8 NULL"})}),t==="edit"&&(0,br.jsx)(oa.Item,{name:"autoIncrement",valuePropName:"checked",label:null,children:(0,br.jsx)(na,{onChange:m=>{m.target.checked&&l.setFieldValue("nullable",!1)},children:"AUTO_INCREMENT"})}),(0,br.jsx)(oa.Item,{name:"defaultValue",label:"\u9ED8\u8BA4\u503C",children:(0,br.jsx)(on,{placeholder:"\u7559\u7A7A\u8868\u793A\u4E0D\u8BBE\u7F6E\uFF1BNULL\u3001\u6570\u5B57\u3001CURRENT_TIMESTAMP \u7B49",disabled:t==="edit"&&s})}),(0,br.jsx)(oa.Item,{name:"comment",label:"\u6CE8\u91CA",children:(0,br.jsx)(on,{})}),t==="add"&&(0,br.jsx)(oa.Item,{name:"afterColumn",label:"\u4F4D\u7F6E",children:(0,br.jsx)(Cl,{allowClear:!0,placeholder:"\u9ED8\u8BA4\u6DFB\u52A0\u5230\u8868\u5C3E",options:c})}),t==="edit"&&(0,br.jsx)(oa.Item,{name:"afterColumn",label:"\u4F4D\u7F6E",children:(0,br.jsx)(Cl,{options:u})})]})})}var jo=$(sr()),the=[{value:"INT",label:"INT"},{value:"BIGINT",label:"BIGINT"},{value:"TINYINT",label:"TINYINT"},{value:"VARCHAR(64)",label:"VARCHAR(64)"},{value:"VARCHAR(255)",label:"VARCHAR(255)"},{value:"TEXT",label:"TEXT"},{value:"DATETIME",label:"DATETIME"},{value:"DATE",label:"DATE"},{value:"TIMESTAMP",label:"TIMESTAMP"},{value:"DECIMAL(10,2)",label:"DECIMAL(10,2)"},{value:"DOUBLE",label:"DOUBLE"},{value:"BOOLEAN",label:"BOOLEAN"}];function eb(){return[{id:crypto.randomUUID(),name:"id",columnType:"INT",nullable:!1,defaultValue:"",primaryKey:!0,autoIncrement:!0,comment:""}]}function rhe(){return{id:crypto.randomUUID(),name:"",columnType:"VARCHAR(255)",nullable:!0,defaultValue:"",primaryKey:!1,autoIncrement:!1,comment:""}}function RG({value:e,onChange:t,disabled:r}){let n=(a,i)=>{t(e.map(l=>{if(l.id!==a)return l;let s={...l,...i};return i.primaryKey===!1&&(s.autoIncrement=!1),i.autoIncrement===!0&&(s.primaryKey=!0,s.nullable=!1),s}))};return(0,jo.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,jo.jsx)(of,{size:"small",rowKey:"id",columns:[{title:"\u5B57\u6BB5\u540D",key:"name",width:120,render:(a,i)=>(0,jo.jsx)(on,{size:"small",value:i.name,onChange:l=>n(i.id,{name:l.target.value}),disabled:r,placeholder:"name"})},{title:"\u7C7B\u578B",key:"columnType",width:268,render:(a,i)=>(0,jo.jsxs)(fc,{size:4,wrap:!0,className:"w-full",children:[(0,jo.jsx)(on,{size:"small",value:i.columnType,onChange:l=>n(i.id,{columnType:l.target.value}),disabled:r,className:"min-w-[120px] flex-1"}),(0,jo.jsx)(Cl,{size:"small",disabled:r,placeholder:"\u5E38\u7528",className:"min-w-[116px]",allowClear:!0,options:the,onChange:l=>{l&&n(i.id,{columnType:l})}})]})},{title:"\u53EF\u7A7A",key:"nullable",width:56,render:(a,i)=>(0,jo.jsx)(na,{checked:i.nullable,disabled:r||i.primaryKey||i.autoIncrement,onChange:l=>n(i.id,{nullable:l.target.checked})})},{title:"\u4E3B\u952E",key:"pk",width:52,render:(a,i)=>(0,jo.jsx)(na,{checked:i.primaryKey,disabled:r,onChange:l=>{let s=l.target.checked;n(i.id,{primaryKey:s,autoIncrement:s?i.autoIncrement:!1,nullable:!s})}})},{title:"\u81EA\u589E",key:"ai",width:52,render:(a,i)=>(0,jo.jsx)(na,{checked:i.autoIncrement,disabled:r||!i.primaryKey,onChange:l=>n(i.id,{autoIncrement:l.target.checked,nullable:l.target.checked?!1:i.nullable})})},{title:"\u9ED8\u8BA4",key:"def",width:108,render:(a,i)=>(0,jo.jsx)(on,{size:"small",value:i.defaultValue,onChange:l=>n(i.id,{defaultValue:l.target.value}),disabled:r||i.autoIncrement,placeholder:"\u53EF\u9009"})},{title:"\u6CE8\u91CA",key:"comment",width:100,render:(a,i)=>(0,jo.jsx)(on,{size:"small",value:i.comment,onChange:l=>n(i.id,{comment:l.target.value}),disabled:r})},{title:"",key:"del",width:40,render:(a,i)=>(0,jo.jsx)(Pr,{type:"text",size:"small",danger:!0,icon:(0,jo.jsx)(Qx,{}),disabled:r||e.length<=1,onClick:()=>t(e.filter(l=>l.id!==i.id))})}],dataSource:e,pagination:!1,scroll:{x:920}}),(0,jo.jsx)(Pr,{type:"dashed",size:"small",icon:(0,jo.jsx)(pP,{}),disabled:r,onClick:()=>t([...e,rhe()]),children:"\u6DFB\u52A0\u5B57\u6BB5"})]})}var nhe=["mysql","information_schema","performance_schema","sys"];function qw(e){return nhe.includes(e.toLowerCase())}var _e=$(sr()),ID=/^[a-zA-Z0-9_]+$/,zh=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`,EG=()=>{let{connectionId:e,databaseName:t}=Bs(),r=ri(),[n,o]=(0,Dt.useState)(null),[a,i]=(0,Dt.useState)([]),[l,s]=(0,Dt.useState)(!1),[c,u]=(0,Dt.useState)(!1),[f,d]=(0,Dt.useState)(!1),[m,p]=(0,Dt.useState)(!1),[x,b]=(0,Dt.useState)(""),[g,h]=(0,Dt.useState)(null),[y,v]=(0,Dt.useState)(""),[S,R]=(0,Dt.useState)(null),[C,N]=(0,Dt.useState)(!1),[E,O]=(0,Dt.useState)(!1),[w,A]=(0,Dt.useState)(!1),[T,k]=(0,Dt.useState)(null),[L,H]=(0,Dt.useState)("table"),[_,F]=(0,Dt.useState)(null),[z,M]=(0,Dt.useState)([]),[U,B]=(0,Dt.useState)(!1),[I,j]=(0,Dt.useState)(null),[W,K]=(0,Dt.useState)(!1),[Y,Z]=(0,Dt.useState)(()=>eb()),[ne,te]=(0,Dt.useState)(!1),[de,q]=(0,Dt.useState)("add"),[X,re]=(0,Dt.useState)(null),[V,G]=(0,Dt.useState)(!1),[J,ee]=(0,Dt.useState)("");(0,Dt.useEffect)(()=>{e&&t&&(ae(),ue())},[e,t]);let ae=async()=>{if(e)try{let ie=await cf();if(ie.success&&ie.data){let he=ie.data.find(ze=>ze._id===e);he?o(he):(alert("\u8FDE\u63A5\u4E0D\u5B58\u5728"),r("/"))}}catch{alert("\u52A0\u8F7D\u8FDE\u63A5\u4FE1\u606F\u5931\u8D25"),r("/")}},ue=async()=>{if(!(!e||!t)){s(!0);try{let ie=await Kw(e,decodeURIComponent(t));ie.success&&ie.data?i(ie.data):alert(ie.message||"\u83B7\u53D6\u6570\u636E\u8868\u5217\u8868\u5931\u8D25")}catch{alert("\u83B7\u53D6\u6570\u636E\u8868\u5217\u8868\u5931\u8D25")}finally{s(!1)}}},se=ie=>{e&&t&&r(`/connection/${e}/database/${t}/collection/${encodeURIComponent(ie.name)}`)},Se=async()=>{if(!e||!t||!x.trim()){k("\u8BF7\u8F93\u5165\u8868\u540D");return}let ie=x.trim();if(!ID.test(ie)){k("\u8868\u540D\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF");return}let he=new Set;for(let Be of Y){let tt=Be.name.trim();if(!tt){k("\u6BCF\u4E2A\u5B57\u6BB5\u90FD\u9700\u586B\u5199\u5B57\u6BB5\u540D");return}if(!ID.test(tt)){k(`\u5B57\u6BB5\u540D\u4E0D\u5408\u6CD5: ${tt}`);return}if(he.has(tt)){k(`\u91CD\u590D\u5B57\u6BB5\u540D: ${tt}`);return}if(he.add(tt),Be.autoIncrement&&!Be.primaryKey){k(`\u81EA\u589E\u5217\u5FC5\u987B\u4E3A\u4E3B\u952E: ${tt}`);return}}let ze=0;for(let Be of Y)Be.autoIncrement&&ze++;if(ze>1){k("\u4E00\u5F20\u8868\u6700\u591A\u4E00\u4E2A\u81EA\u589E\u5217");return}let ut=Y.map(Be=>({name:Be.name.trim(),columnType:Be.columnType.trim(),nullable:Be.nullable,defaultValue:Be.defaultValue.trim()||void 0,primaryKey:Be.primaryKey,autoIncrement:Be.autoIncrement,comment:Be.comment.trim()||void 0}));N(!0),k(null);try{let Be=await xG(e,decodeURIComponent(t),ie,ut);Be.success?(u(!1),b(""),Z(eb()),ue()):k(Be.message||"\u521B\u5EFA\u6570\u636E\u8868\u5931\u8D25")}catch(Be){k(Be instanceof Error?Be.message:"\u521B\u5EFA\u6570\u636E\u8868\u5931\u8D25")}finally{N(!1)}},ye=async()=>{if(!e||!t||!g||!y.trim()){k("\u8BF7\u8F93\u5165\u8868\u540D");return}let ie=y.trim();if(!ID.test(ie)){k("\u8868\u540D\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF");return}if(ie===g.name){k("\u65B0\u540D\u79F0\u4E0D\u80FD\u4E0E\u5F53\u524D\u540D\u79F0\u76F8\u540C");return}O(!0),k(null);try{let he=await vG(e,decodeURIComponent(t),g.name,ie);he.success?(d(!1),h(null),v(""),ue()):k(he.message||"\u91CD\u547D\u540D\u6570\u636E\u8868\u5931\u8D25")}catch(he){k(he instanceof Error?he.message:"\u91CD\u547D\u540D\u6570\u636E\u8868\u5931\u8D25")}finally{O(!1)}},Pe=async()=>{if(!(!e||!t||!S)){A(!0),k(null);try{let ie=await bG(e,decodeURIComponent(t),S.name);ie.success?(p(!1),R(null),ue()):k(ie.message||"\u5220\u9664\u6570\u636E\u8868\u5931\u8D25")}catch(ie){k(ie instanceof Error?ie.message:"\u5220\u9664\u6570\u636E\u8868\u5931\u8D25")}finally{A(!1)}}},Ne=ie=>{h(ie),v(ie.name),k(null),d(!0)},oe=ie=>{R(ie),k(null),p(!0)},ce=t?decodeURIComponent(t):"",be=qw(ce),me=(0,Dt.useMemo)(()=>{let ie=J.trim().toLowerCase();return ie?a.filter(he=>he.name.toLowerCase().includes(ie)):a},[a,J]),xe=(0,Dt.useCallback)(async()=>{if(!(!e||!_)){B(!0),j(null);try{let ie=await MD(e,ce,_.name);ie.success&&ie.data?M(ie.data):j(ie.message||"\u52A0\u8F7D\u8868\u7ED3\u6784\u5931\u8D25")}catch{j("\u52A0\u8F7D\u8868\u7ED3\u6784\u5931\u8D25")}finally{B(!1)}}},[e,ce,_]),Ee=(0,Dt.useCallback)(async ie=>{if(e){F(ie),K(!1),M([]),B(!0),j(null);try{let he=await MD(e,ce,ie.name);he.success&&he.data?M(he.data):j(he.message||"\u52A0\u8F7D\u8868\u7ED3\u6784\u5931\u8D25")}catch{j("\u52A0\u8F7D\u8868\u7ED3\u6784\u5931\u8D25")}finally{B(!1)}}},[e,ce]),pe=(0,Dt.useCallback)(()=>{F(null),M([]),j(null),K(!1)},[]),Te=(0,Dt.useCallback)(()=>{q("add"),re(null),te(!0)},[]),Oe=(0,Dt.useCallback)(ie=>{q("edit"),re(ie),te(!0)},[]),ge=(0,Dt.useCallback)(async(ie,he)=>{var ze,ut,Be;if(!(!e||!_)){G(!0);try{if(he==="add"){let tt=(ze=ie.afterColumn)==null?void 0:ze.trim(),et=!tt||tt==="__end__"?null:tt,We=await Jx(e,ce,_.name,{addColumns:[{name:ie.name.trim(),columnType:ie.columnType.trim(),nullable:ie.nullable,defaultValue:ie.defaultValue.trim()||void 0,comment:ie.comment.trim()||void 0,afterColumn:et}]});if(!We.success){alert(We.message||"\u6DFB\u52A0\u5B57\u6BB5\u5931\u8D25");return}}else if(X){let tt=(ut=ie.newName)==null?void 0:ut.trim(),et=tt&&tt.length>0?tt:X.name,We=(Be=ie.afterColumn)==null?void 0:Be.trim(),fe=!1,Re;We&&We!=="__keep__"&&(We==="__first__"?fe=!0:Re=We);let Fe=await Jx(e,ce,_.name,{modifyColumns:[{columnName:X.name,...et!==X.name?{newName:et}:{},columnType:ie.columnType.trim(),nullable:ie.autoIncrement?!1:ie.nullable,defaultValue:ie.defaultValue.trim()||void 0,comment:ie.comment.trim()||void 0,autoIncrement:ie.autoIncrement,...fe?{placeFirst:!0}:Re?{afterColumn:Re}:{}}]});if(!Fe.success){alert(Fe.message||"\u4FEE\u6539\u5B57\u6BB5\u5931\u8D25");return}}te(!1),re(null),await xe()}finally{G(!1)}}},[e,ce,_,X,xe]),ve=(0,Dt.useCallback)(async(ie,he)=>{var We;if(!e||!_||he==="up"&&ie<=0||he==="down"&&ie>=z.length-1)return;let ze=z[ie],ut=he==="up"&&ie===1,Be=he==="up"?ut?void 0:z[ie-2].name:z[ie+1].name,tt=/auto_increment/i.test(ze.extra),et=await Jx(e,ce,_.name,{modifyColumns:[{columnName:ze.name,columnType:ze.columnType,nullable:tt?!1:ze.nullable,defaultValue:(We=ze.defaultValue)!=null?We:void 0,comment:ze.comment||void 0,autoIncrement:tt,...ut?{placeFirst:!0}:{afterColumn:Be}}]});if(!et.success){alert(et.message||"\u8C03\u6574\u5B57\u6BB5\u987A\u5E8F\u5931\u8D25");return}await xe()},[e,ce,_,z,xe]),De=(0,Dt.useCallback)(ie=>{!e||!_||bn.confirm({title:`\u786E\u5B9A\u5220\u9664\u5B57\u6BB5\u300C${ie.name}\u300D\uFF1F`,okType:"danger",okText:"\u5220\u9664",onOk:async()=>{let he=await Jx(e,ce,_.name,{dropColumns:[ie.name]});if(!he.success)throw alert(he.message||"\u5220\u9664\u5B57\u6BB5\u5931\u8D25"),new Error("abort");await xe()}})},[e,ce,_,xe]),$e=n&&ce?[{label:"\u8FDE\u63A5\u5217\u8868",path:"/"},{label:n.name,path:`/connection/${e}`},{label:ce}]:[],at=(0,Dt.useMemo)(()=>{let ie=[{title:"#",key:"ordinal",width:44,dataIndex:"ordinal"},{title:"\u5B57\u6BB5",dataIndex:"name",width:140,render:(he,ze)=>(0,_e.jsx)(mD,{className:`m-0 border-0 text-xs ${pG(mG(ze.dataType))}`,children:he})},{title:"\u7C7B\u578B",dataIndex:"columnType",key:"columnType",ellipsis:!0},{title:"\u53EF\u7A7A",key:"nullable",width:56,render:(he,ze)=>ze.nullable?"\u662F":"\u5426"},{title:"\u952E",dataIndex:"columnKey",key:"columnKey",width:52,render:he=>he||"\u2014"},{title:"\u9ED8\u8BA4",dataIndex:"defaultValue",key:"defaultValue",width:100,ellipsis:!0,render:he=>he!=null?he:"\u2014"},{title:"\u989D\u5916",dataIndex:"extra",key:"extra",width:88,ellipsis:!0,render:he=>he||"\u2014"},{title:"\u6CE8\u91CA",dataIndex:"comment",key:"comment",ellipsis:!0,render:he=>he||"\u2014"}];return W&&!be&&ie.push({title:"\u64CD\u4F5C",key:"ops",width:200,fixed:"right",render:(he,ze,ut)=>(0,_e.jsxs)("div",{className:"flex flex-nowrap items-center gap-0",onClick:Be=>Be.stopPropagation(),children:[(0,_e.jsx)(Pr,{type:"text",size:"small",className:"px-1",icon:(0,_e.jsx)(ED,{}),disabled:ut===0,title:"\u4E0A\u79FB",onClick:()=>void ve(ut,"up")}),(0,_e.jsx)(Pr,{type:"text",size:"small",className:"px-1",icon:(0,_e.jsx)(vD,{}),disabled:ut===z.length-1,title:"\u4E0B\u79FB",onClick:()=>void ve(ut,"down")}),(0,_e.jsx)(Pr,{type:"link",size:"small",className:"px-1",onClick:()=>Oe(ze),children:"\u4FEE\u6539"}),(0,_e.jsx)(Pr,{type:"link",size:"small",danger:!0,className:"px-1",onClick:()=>De(ze),children:"\u5220\u9664"})]})}),ie},[W,be,z.length,Oe,De,ve]),He=(0,Dt.useMemo)(()=>[{title:"\u8868\u540D",dataIndex:"name",key:"name",ellipsis:!0,width:160,render:ie=>(0,_e.jsx)("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:ie})},{title:"\u884C\u6570\uFF08\u7EA6\uFF09",dataIndex:"count",key:"count",width:120,align:"right"},{title:"\u5408\u8BA1",key:"size",width:100,align:"right",render:(ie,he)=>zh(he.size)},{title:"\u6570\u636E",key:"storageSize",width:100,align:"right",render:(ie,he)=>zh(he.storageSize)},{title:"\u7D22\u5F15",key:"totalIndexSize",width:100,align:"right",render:(ie,he)=>zh(he.totalIndexSize)},{title:"\u64CD\u4F5C",key:"actions",width:152,render:(ie,he)=>(0,_e.jsxs)("div",{className:"flex items-center gap-0",onClick:ze=>ze.stopPropagation(),children:[(0,_e.jsx)(Pr,{type:"text",size:"small",icon:(0,_e.jsx)(jw,{}),onClick:()=>void Ee(he),title:"\u8868\u7ED3\u6784"}),(0,_e.jsx)(Pr,{type:"text",size:"small",icon:(0,_e.jsx)(xD,{}),disabled:be,onClick:()=>Ne(he),title:be?"\u7CFB\u7EDF\u5E93\u4E0D\u53EF\u91CD\u547D\u540D":"\u91CD\u547D\u540D"}),(0,_e.jsx)(Pr,{type:"text",size:"small",danger:!0,icon:(0,_e.jsx)(Qx,{}),disabled:be,onClick:()=>oe(he),title:be?"\u7CFB\u7EDF\u5E93\u4E0D\u53EF\u5220\u9664":"\u5220\u9664"})]})}],[be,Ee]);return l&&!n?(0,_e.jsx)(Ci,{breadcrumbs:$e,children:(0,_e.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."})}):(0,_e.jsx)(Ci,{breadcrumbs:$e,children:(0,_e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,_e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,_e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,_e.jsx)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"\u6570\u636E\u8868"}),(0,_e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,_e.jsx)(CP,{value:L,onChange:H,options:[{label:"\u8868\u683C",value:"table"},{label:"\u5361\u7247",value:"grid"}]}),(0,_e.jsx)("button",{type:"button",onClick:()=>{u(!0),k(null),b(""),Z(eb())},disabled:be,className:"rounded-md bg-green-600 px-2.5 py-1 text-sm font-medium text-white transition hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed dark:bg-green-700 dark:hover:bg-green-800",title:be?"\u7CFB\u7EDF\u5E93\u4E0D\u5141\u8BB8\u65B0\u5EFA\u8868":"",children:"\u65B0\u5EFA\u8868"}),(0,_e.jsx)("button",{type:"button",onClick:ue,className:"rounded-md border border-gray-300 bg-white px-2.5 py-1 text-sm font-medium text-gray-700 transition hover:border-gray-400 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:border-gray-500 dark:hover:bg-gray-700",children:"\u5237\u65B0"})]})]}),(0,_e.jsx)(on,{allowClear:!0,placeholder:"\u6309\u8868\u540D\u7B5B\u9009",value:J,onChange:ie=>ee(ie.target.value),prefix:(0,_e.jsx)(oc,{className:"text-gray-400"}),className:"max-w-md"})]}),l?(0,_e.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."}):a.length===0?(0,_e.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:"\u6682\u65E0\u6570\u636E\u8868"}):me.length===0?(0,_e.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:"\u65E0\u5339\u914D\u7684\u8868\uFF0C\u8BF7\u8C03\u6574\u7B5B\u9009\u5173\u952E\u8BCD"}):L==="table"?(0,_e.jsx)(of,{rowKey:"name",size:"small",columns:He,dataSource:me,pagination:{showSizeChanger:!0,pageSizeOptions:[10,20,50,100],showTotal:ie=>`\u5171 ${ie} \u5F20\u8868`},onRow:ie=>({onClick:()=>se(ie),className:"cursor-pointer"})}):(0,_e.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:me.map(ie=>(0,_e.jsxs)("div",{onClick:()=>se(ie),className:"group relative cursor-pointer rounded-md border border-gray-200 bg-gray-50/50 p-4 transition hover:border-gray-300 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800",children:[(0,_e.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,_e.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:ie.name}),(0,_e.jsxs)("span",{className:"rounded-full bg-blue-100 px-2 py-0.5 text-xs text-blue-700 dark:bg-blue-500/20 dark:text-blue-400",children:["\u7EA6 ",ie.count," \u884C"]})]}),(0,_e.jsxs)("div",{className:"space-y-1 text-sm text-gray-600 dark:text-gray-400",children:[(0,_e.jsxs)("div",{children:["\u5408\u8BA1: ",zh(ie.size)]}),(0,_e.jsxs)("div",{children:["\u6570\u636E: ",zh(ie.storageSize)]}),(0,_e.jsxs)("div",{children:["\u7D22\u5F15: ",zh(ie.totalIndexSize)]})]}),(0,_e.jsxs)("div",{className:"absolute right-2 top-2 flex gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,_e.jsx)("button",{type:"button",onClick:he=>{he.stopPropagation(),Ee(ie)},className:"rounded-md bg-white/90 p-1.5 text-gray-700 shadow-md transition hover:bg-white dark:bg-gray-700/90 dark:text-gray-300 dark:hover:bg-gray-700",title:"\u8868\u7ED3\u6784",children:(0,_e.jsx)(jw,{className:"text-base"})}),(0,_e.jsx)("button",{type:"button",onClick:he=>{he.stopPropagation(),Ne(ie)},disabled:be,className:"rounded-md bg-white/90 p-1.5 text-gray-700 shadow-md transition hover:bg-white disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-700/90 dark:text-gray-300 dark:hover:bg-gray-700",title:"\u91CD\u547D\u540D",children:(0,_e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,_e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,_e.jsx)("button",{type:"button",onClick:he=>{he.stopPropagation(),oe(ie)},disabled:be,className:"rounded-md bg-white/90 p-1.5 text-red-600 shadow-md transition hover:bg-white disabled:opacity-50 disabled:cursor-not-allowed dark:bg-gray-700/90 dark:text-red-400 dark:hover:bg-gray-700",title:"\u5220\u9664",children:(0,_e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,_e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]},ie.name))}),(0,_e.jsxs)(bn,{title:_?`\u8868\u7ED3\u6784 \u2014 ${_.name}`:"\u8868\u7ED3\u6784",open:!!_,onCancel:pe,footer:null,width:960,destroyOnClose:!0,children:[I&&(0,_e.jsx)("div",{className:"mb-3 rounded-md border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",children:I}),_&&!be&&(0,_e.jsx)("div",{className:"mb-3 flex flex-wrap items-center justify-end gap-2",children:(0,_e.jsxs)(fc,{children:[(0,_e.jsx)(Pr,{size:"small",type:W?"primary":"default",onClick:()=>K(ie=>!ie),children:W?"\u5B8C\u6210\u7F16\u8F91":"\u7F16\u8F91\u7ED3\u6784"}),W&&(0,_e.jsx)(Pr,{size:"small",type:"primary",onClick:Te,children:"\u6DFB\u52A0\u5B57\u6BB5"})]})}),(0,_e.jsx)(Dx,{spinning:U,children:(0,_e.jsx)(of,{size:"small",rowKey:ie=>`${ie.ordinal}-${ie.name}`,columns:at,dataSource:z,pagination:!1,scroll:{x:W?1120:900,y:520}})})]}),(0,_e.jsx)(SG,{open:ne,mode:de,existingColumnNames:z.map(ie=>ie.name),editTarget:X,onCancel:()=>{te(!1),re(null)},onSubmit:ge,submitting:V}),(0,_e.jsx)(bn,{title:"\u65B0\u5EFA\u6570\u636E\u8868",open:c,onOk:Se,onCancel:()=>{u(!1),b(""),Z(eb()),k(null)},confirmLoading:C,okText:"\u521B\u5EFA",cancelText:"\u53D6\u6D88",width:960,children:(0,_e.jsxs)("div",{className:"mb-4",children:[(0,_e.jsx)("label",{htmlFor:"collection-name-input",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u8868\u540D"}),(0,_e.jsx)(on,{id:"collection-name-input",value:x,onChange:ie=>{b(ie.target.value),k(null)},onPressEnter:Se,placeholder:"\u4EC5\u542B\u5B57\u6BCD\u6570\u5B57\u4E0B\u5212\u7EBF"}),T&&(0,_e.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:T}),(0,_e.jsxs)("div",{className:"mt-4",children:[(0,_e.jsx)("div",{className:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u5B57\u6BB5\u5B9A\u4E49"}),(0,_e.jsx)(RG,{value:Y,onChange:Z})]}),(0,_e.jsx)("div",{className:"mt-2 text-xs text-gray-500 dark:text-gray-400",children:"\u5F15\u64CE InnoDB\uFF0C\u5B57\u7B26\u96C6 utf8mb4\u3002\u9ED8\u8BA4\u503C\u53EF\u586B\u6570\u5B57\u3001NULL\u3001CURRENT_TIMESTAMP \u7B49\u3002"})]})}),(0,_e.jsx)(bn,{title:"\u91CD\u547D\u540D\u6570\u636E\u8868",open:f&&!!g,onOk:ye,onCancel:()=>{d(!1),h(null),v(""),k(null)},confirmLoading:E,okText:"\u91CD\u547D\u540D",cancelText:"\u53D6\u6D88",children:(0,_e.jsxs)("div",{className:"mb-4",children:[(0,_e.jsx)("label",{htmlFor:"rename-collection-input",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u65B0\u8868\u540D"}),(0,_e.jsx)(on,{id:"rename-collection-input",value:y,onChange:ie=>{v(ie.target.value),k(null)},onPressEnter:ye}),T&&(0,_e.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:T})]})}),(0,_e.jsx)(bn,{title:"\u5220\u9664\u6570\u636E\u8868",open:m&&!!S,onOk:Pe,onCancel:()=>{p(!1),R(null),k(null)},confirmLoading:w,okText:"\u786E\u8BA4\u5220\u9664",cancelText:"\u53D6\u6D88",okType:"danger",children:(0,_e.jsxs)("div",{className:"mb-4",children:[(0,_e.jsxs)("div",{className:"mb-2 text-sm text-gray-700 dark:text-gray-300",children:["\u786E\u5B9A\u5220\u9664\u8868 ",(0,_e.jsx)("span",{className:"font-semibold text-gray-900 dark:text-white",children:S==null?void 0:S.name})," \uFF1F"]}),T&&(0,_e.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:T}),(0,_e.jsxs)("div",{className:"mt-4 rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-500/10 dark:text-red-400",children:[(0,_e.jsx)("strong",{children:"\u8B66\u544A\uFF1A"}),"DROP TABLE \u4E0D\u53EF\u6062\u590D\u3002"]})]})})]})})};var Bh=$(P());var wn=$(P());var ohe="/api";async function wG(e,t,r,n,o="find",a){return(await fetch(`${ohe}/query/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionId:e,databaseName:t,collectionName:r,query:n,operation:o,document:a})})).json()}var Kd=$(P());function NG(){return`${Date.now()}-${Math.random().toString(36).substring(2,11)}`}var Si=$(sr());function ahe(e){let t=[],r=new Set;for(let n of e)for(let o of TG(n))r.has(o)||(r.add(o),t.push(o));return{ordered:t,set:r}}var TG=(e,t="")=>{let r=[];for(let[n,o]of Object.entries(e)){if(n.startsWith("__"))continue;let a=t?`${t}.${n}`:n;o!==null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)?r.push(...TG(o,a)):r.push(a)}return r},ihe=(e,t)=>{let r=t.split("."),n=e;for(let o of r){if(n==null||typeof n!="object")return;n=n[o]}return n},lhe=e=>e==null?"":e instanceof Date?e.toISOString():Array.isArray(e)?`[${e.length} \u9879]`:typeof e=="object"?"[\u5BF9\u8C61]":typeof e=="string"&&e.length>100?`${e.substring(0,100)}...`:String(e),she=e=>e.__pk&&typeof e.__pk=="object"?JSON.stringify(e.__pk):NG(),OG=({documents:e,columnOrder:t,loading:r=!1,onEdit:n,onDelete:o})=>{let a=(0,Kd.useMemo)(()=>{if(e.length===0)return[];let{ordered:u,set:f}=ahe(e);if(!(t!=null&&t.length))return u;let d=new Set,m=[];for(let p of t)f.has(p)&&!d.has(p)&&(d.add(p),m.push(p));for(let p of u)d.has(p)||(d.add(p),m.push(p));return m},[e,t]),[i,l]=(0,Kd.useState)(()=>new Set(a));(0,Kd.useEffect)(()=>{l(u=>{let f=new Set(u),d=!1;for(let m of a)f.has(m)||(f.add(m),d=!0);return d?f:u})},[a]);let s=(0,Kd.useMemo)(()=>{let u=[];for(let f of a)i.has(f)&&u.push({title:f,dataIndex:f,key:f,width:150,ellipsis:!0,render:(d,m)=>{let p=ihe(m,f);return(0,Si.jsx)("span",{className:"font-mono text-sm",children:lhe(p)})}});return(n||o)&&u.push({title:"\u64CD\u4F5C",key:"actions",width:120,fixed:"right",render:(f,d)=>(0,Si.jsxs)("div",{className:"flex gap-2",children:[n&&(0,Si.jsx)(Pr,{type:"link",size:"small",onClick:()=>n(d),children:"\u7F16\u8F91"}),o&&(0,Si.jsx)(Pr,{type:"link",size:"small",danger:!0,onClick:()=>o(d),children:"\u5220\u9664"})]})}),u},[a,i,n,o]),c=a.map(u=>({key:u,label:(0,Si.jsx)(na,{checked:i.has(u),onChange:f=>{let d=new Set(i);f.target.checked?d.add(u):d.delete(u),l(d)},onClick:f=>f.stopPropagation(),children:u})}));return(0,Si.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,Si.jsx)("div",{className:"flex items-center justify-between",children:(0,Si.jsx)(dc,{menu:{items:c},trigger:["click"],placement:"bottomLeft",children:(0,Si.jsx)(Pr,{icon:(0,Si.jsx)(OD,{}),size:"small",children:"\u5217\u8BBE\u7F6E"})})}),(0,Si.jsx)(of,{columns:s,rowKey:u=>she(u),dataSource:e,loading:r,pagination:!1,scroll:{x:"max-content"},size:"small"})]})};var Et=$(sr()),$G=({connection:e,databaseName:t,collection:r,readOnly:n=!1})=>{let[o,a]=(0,wn.useState)(!1),[i,l]=(0,wn.useState)(null),[s,c]=(0,wn.useState)(1),[u]=(0,wn.useState)(20),[f,d]=(0,wn.useState)([]),[m,p]=(0,wn.useState)([]),[x,b]=(0,wn.useState)(0),[g,h]=(0,wn.useState)(!0),[y,v]=(0,wn.useState)(!1),[S,R]=(0,wn.useState)(!1),[C,N]=(0,wn.useState)(null),[E,O]=(0,wn.useState)("{}"),[w,A]=(0,wn.useState)(!1),[T,k]=(0,wn.useState)(!1),[L,H]=(0,wn.useState)("{}"),[_,F]=(0,wn.useState)("find"),[z,M]=(0,wn.useState)("{}"),[U,B]=(0,wn.useState)(!1),[I,j]=(0,wn.useState)(null),W=async()=>{if(e._id){a(!0),l(null),j(null);try{let q=await wG(e._id,t,r.name,L,_,_==="insertOne"?z:void 0);if(q.success){let X=q.data;_==="insertOne"?(k(!1),M("{}"),B(!1),Y(1)):typeof X=="number"?(j(`\u5339\u914D\u884C\u6570: ${X}`),d([]),p([]),b(0)):Array.isArray(X)?(d(X),p([]),b(X.length),B(!0),j("\u6CE8\u610F\uFF1A\u81EA\u5B9A\u4E49\u67E5\u8BE2\u7ED3\u679C\u53EF\u80FD\u7F3A\u5C11\u4E3B\u952E\u4FE1\u606F\uFF0C\u7F16\u8F91/\u5220\u9664\u53EF\u80FD\u4E0D\u53EF\u7528")):typeof X=="object"&&X!==null?(d([X]),p([]),b(1),B(!0)):(d([]),p([]),b(0)),_!=="insertOne"&&k(!1)}else l(q.message||"\u67E5\u8BE2\u5931\u8D25")}catch(q){l(q instanceof Error?q.message:"\u67E5\u8BE2\u5931\u8D25")}finally{a(!1)}}},K=()=>{B(!1),j(null),H("{}"),F("find"),M("{}"),Y(1)},Y=async(q=1)=>{var X;if(e._id){v(!0);try{let re=await hG(e._id,t,r.name,q,u);re.success&&re.data&&(d(re.data.documents),p((X=re.data.columnNames)!=null?X:[]),b(re.data.total),c(q),h(re.data.hasPrimaryKey!==!1))}catch(re){console.error("\u52A0\u8F7D\u6570\u636E\u5931\u8D25:",re)}finally{v(!1)}}};(0,wn.useEffect)(()=>{!U&&e._id&&Y(1)},[U,e._id,t,r.name]);let Z=q=>{N(q),O(JSON.stringify(q,null,2)),R(!0)},ne=async()=>{if(!e._id||!(C!=null&&C.__pk)){alert("\u5F53\u524D\u884C\u7F3A\u5C11\u4E3B\u952E\u4FE1\u606F\uFF0C\u65E0\u6CD5\u66F4\u65B0");return}A(!0);try{let q=JSON.parse(E),{__pk:X,...re}=q,V=await gG(e._id,t,r.name,{__pk:C.__pk},re);V.success?(R(!1),N(null),O("{}"),U?W():Y(s)):alert(V.message||"\u66F4\u65B0\u5931\u8D25")}catch(q){alert(q instanceof Error?q.message:"\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5 JSON \u683C\u5F0F")}finally{A(!1)}},te=async q=>{let X=e._id;if(!X||!q.__pk){alert("\u5F53\u524D\u884C\u7F3A\u5C11\u4E3B\u952E\u4FE1\u606F\uFF0C\u65E0\u6CD5\u5220\u9664");return}bn.confirm({title:"\u5220\u9664\u884C",content:"\u786E\u5B9A\u8981\u5220\u9664\u8FD9\u4E00\u884C\u5417\uFF1F",okText:"\u786E\u8BA4\u5220\u9664",cancelText:"\u53D6\u6D88",okType:"danger",onOk:async()=>{A(!0);try{let re=await yG(X,t,r.name,{__pk:q.__pk});re.success?U?W():Y(s):bn.error({title:"\u5220\u9664\u5931\u8D25",content:re.message||"\u5220\u9664\u5931\u8D25"})}catch(re){bn.error({title:"\u5220\u9664\u5931\u8D25",content:re instanceof Error?re.message:"\u5220\u9664\u5931\u8D25"})}finally{A(!1)}}})},de=!n&&g;return(0,Et.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsxs)("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:["\u6570\u636E\u6D4F\u89C8 - ",r.name]}),(0,Et.jsxs)("div",{className:"flex gap-2",children:[(0,Et.jsx)(Pr,{type:"primary",onClick:()=>k(!0),children:"\u81EA\u5B9A\u4E49\u67E5\u8BE2"}),U&&(0,Et.jsx)(Pr,{onClick:K,children:"\u6E05\u9664\u67E5\u8BE2"})]})]}),n&&(0,Et.jsxs)("div",{className:"rounded-md border border-amber-500/50 bg-amber-50 p-4 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400",children:[(0,Et.jsx)("strong",{children:"\u53EA\u8BFB\u6A21\u5F0F\uFF1A"}),"\u7CFB\u7EDF\u5E93\u4E0D\u5141\u8BB8\u5199\u5165\u3002"]}),!n&&!g&&(0,Et.jsx)("div",{className:"rounded-md border border-amber-500/50 bg-amber-50 p-4 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400",children:"\u8BE5\u8868\u6CA1\u6709\u4E3B\u952E\uFF0C\u65E0\u6CD5\u4F7F\u7528\u56FE\u5F62\u754C\u9762\u5B89\u5168\u66F4\u65B0\u6216\u5220\u9664\u5355\u884C\u3002"}),i&&(0,Et.jsx)("div",{className:"rounded-md border border-red-500/50 bg-red-50 p-4 text-red-600 dark:bg-red-500/10 dark:text-red-400",children:i}),I&&(0,Et.jsx)("div",{className:"rounded-md border border-blue-500/50 bg-blue-50 p-4 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",children:I}),(0,Et.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,Et.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Et.jsx)("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:U?(0,Et.jsxs)(Et.Fragment,{children:["\u67E5\u8BE2\u7ED3\u679C: ",x," \u884C"]}):(0,Et.jsxs)(Et.Fragment,{children:["\u5171 ",x," \u884C\uFF0C\u7B2C ",s," \u9875\uFF0C\u6BCF\u9875 ",u," \u884C"]})}),!U&&(0,Et.jsxs)("div",{className:"flex gap-2",children:[(0,Et.jsx)(Pr,{onClick:()=>Y(s-1),disabled:s<=1||y,children:"\u4E0A\u4E00\u9875"}),(0,Et.jsx)(Pr,{onClick:()=>Y(s+1),disabled:s*u>=x||y,children:"\u4E0B\u4E00\u9875"})]})]}),y?(0,Et.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."}):f.length===0?(0,Et.jsx)("div",{className:"rounded-md border border-gray-200 bg-gray-50/50 p-8 text-center text-gray-600 dark:border-gray-700 dark:bg-gray-800/50 dark:text-gray-400",children:U?"\u67E5\u8BE2\u7ED3\u679C\u4E3A\u7A7A":"\u6682\u65E0\u6570\u636E"}):(0,Et.jsx)(OG,{documents:f,columnOrder:m.length>0?m:void 0,loading:y,onEdit:de?Z:void 0,onDelete:de?te:void 0})]}),(0,Et.jsxs)(bn,{title:"\u81EA\u5B9A\u4E49\u67E5\u8BE2",open:T,onOk:W,onCancel:()=>{k(!1),l(null)},confirmLoading:o,width:800,okText:_==="insertOne"?"\u63D2\u5165":"\u6267\u884C",cancelText:"\u53D6\u6D88",okButtonProps:{disabled:n&&_==="insertOne"},children:[(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"query-modal-operation",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u64CD\u4F5C\u7C7B\u578B"}),(0,Et.jsx)(Cl,{id:"query-modal-operation",value:_,onChange:q=>{F(q),q==="insertOne"?H("{}"):M("{}")},className:"w-full",disabled:n,options:[{label:"\u67E5\u8BE2\uFF08\u7B49\u503C\u6761\u4EF6 JSON\uFF0C\u6700\u591A 100 \u884C\uFF09",value:"find"},{label:"\u67E5\u8BE2\u4E00\u884C\uFF08\u7B49\u503C\u6761\u4EF6 JSON\uFF09",value:"findOne"},{label:"\u8BA1\u6570\uFF08\u7B49\u503C\u6761\u4EF6 JSON\uFF09",value:"count"},{label:"\u81EA\u5B9A\u4E49 SELECT\uFF08\u5B8C\u6574 SQL\uFF0C\u9700\u4EE5 SELECT \u5F00\u5934\uFF09",value:"aggregate"},{label:"\u63D2\u5165\u4E00\u884C\uFF08\u5217\u540D JSON\uFF09",value:"insertOne",disabled:n}]})]}),_==="insertOne"?(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"query-modal-document-textarea",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u884C\u6570\u636E\uFF08JSON\uFF0C\u952E\u4E3A\u5217\u540D\uFF09"}),(0,Et.jsx)(on.TextArea,{id:"query-modal-document-textarea",value:z,onChange:q=>M(q.target.value),rows:12,className:"font-mono",placeholder:'\u4F8B\u5982: {"name": "test", "age": 20}'})]}):_==="aggregate"?(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"query-modal-sql",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"SELECT \u8BED\u53E5"}),(0,Et.jsx)(on.TextArea,{id:"query-modal-sql",value:L,onChange:q=>H(q.target.value),rows:12,className:"font-mono",placeholder:"\u4F8B\u5982: SELECT * FROM your_table LIMIT 10"})]}):(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"query-modal-textarea",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u7B49\u503C\u6761\u4EF6\uFF08JSON \u5BF9\u8C61\uFF0C\u7A7A\u5BF9\u8C61\u8868\u793A\u65E0\u989D\u5916\u6761\u4EF6\uFF09"}),(0,Et.jsx)(on.TextArea,{id:"query-modal-textarea",value:L,onChange:q=>H(q.target.value),rows:12,className:"font-mono",placeholder:'\u4F8B\u5982: {"id": 1}'})]}),i&&(0,Et.jsx)("div",{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:i})]}),(0,Et.jsx)(bn,{title:"\u7F16\u8F91\u884C",open:S,onOk:ne,onCancel:()=>{R(!1),N(null),O("{}")},confirmLoading:w,width:800,okText:"\u66F4\u65B0",cancelText:"\u53D6\u6D88",children:(0,Et.jsxs)("div",{className:"mb-4",children:[(0,Et.jsx)("label",{htmlFor:"edit-doc-textarea",className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:"\u884C\u6570\u636E JSON\uFF08\u8BF7\u52FF\u4FEE\u6539\u4E3B\u952E\u5217\uFF1B`__pk` \u4E3A\u5185\u90E8\u5B57\u6BB5\uFF0C\u4FDD\u5B58\u524D\u4F1A\u4ECE\u670D\u52A1\u7AEF\u903B\u8F91\u4E2D\u5265\u79BB\uFF09"}),(0,Et.jsx)(on.TextArea,{id:"edit-doc-textarea",value:E,onChange:q=>O(q.target.value),rows:12,className:"font-mono"})]})})]})};var tb=$(sr()),MG=()=>{let{connectionId:e,databaseName:t,collectionName:r}=Bs(),n=ri(),[o,a]=(0,Bh.useState)(null),[i,l]=(0,Bh.useState)(null),[s,c]=(0,Bh.useState)(!1);(0,Bh.useEffect)(()=>{e&&t&&r&&(u(),f())},[e,t,r]);let u=async()=>{if(e)try{let b=await cf();if(b.success&&b.data){let g=b.data.find(h=>h._id===e);g?a(g):(alert("\u8FDE\u63A5\u4E0D\u5B58\u5728"),n("/"))}}catch{alert("\u52A0\u8F7D\u8FDE\u63A5\u4FE1\u606F\u5931\u8D25"),n("/")}},f=async()=>{if(!(!e||!t||!r)){c(!0);try{let b=decodeURIComponent(t),g=decodeURIComponent(r),h=await Kw(e,b);if(h.success&&h.data){let y=h.data.find(v=>v.name===g);y?l(y):(alert("\u6570\u636E\u8868\u4E0D\u5B58\u5728"),n(`/connection/${e}/database/${t}`))}}catch{alert("\u52A0\u8F7D\u6570\u636E\u8868\u5931\u8D25"),n(`/connection/${e}/database/${t}`)}finally{c(!1)}}},d=t?decodeURIComponent(t):"",m=r?decodeURIComponent(r):"",p=qw(d),x=o&&d&&m?[{label:"\u8FDE\u63A5\u5217\u8868",path:"/"},{label:o.name,path:`/connection/${e}`},{label:d,path:`/connection/${e}/database/${t}`},{label:m}]:[];return s&&(!o||!i)?(0,tb.jsx)(Ci,{breadcrumbs:x,children:(0,tb.jsx)("div",{className:"text-center text-gray-600 dark:text-gray-400",children:"\u52A0\u8F7D\u4E2D..."})}):!o||!i?null:(0,tb.jsx)(Ci,{breadcrumbs:x,children:(0,tb.jsx)($G,{connection:o,databaseName:d,collection:i,readOnly:p})})};function IG(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var che=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uhe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fhe={};function Gw(e,t){return((t||fhe).jsx?uhe:che).test(e)}var dhe=/[ \t\n\f\r]/g;function PD(e){return typeof e=="object"?e.type==="text"?PG(e.value):!1:PG(e)}function PG(e){return e.replace(dhe,"")===""}var Sc=class{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}};Sc.prototype.normal={};Sc.prototype.property={};Sc.prototype.space=void 0;function AD(e,t){let r={},n={};for(let o of e)Object.assign(r,o.property),Object.assign(n,o.normal);return new Sc(r,n,t)}function rb(e){return e.toLowerCase()}var Ro=class{constructor(t,r){this.attribute=r,this.property=t}};Ro.prototype.attribute="";Ro.prototype.booleanish=!1;Ro.prototype.boolean=!1;Ro.prototype.commaOrSpaceSeparated=!1;Ro.prototype.commaSeparated=!1;Ro.prototype.defined=!1;Ro.prototype.mustUseProperty=!1;Ro.prototype.number=!1;Ro.prototype.overloadedBoolean=!1;Ro.prototype.property="";Ro.prototype.spaceSeparated=!1;Ro.prototype.space=void 0;var nb={};Ak(nb,{boolean:()=>$t,booleanish:()=>Nn,commaOrSpaceSeparated:()=>ja,commaSeparated:()=>ff,number:()=>Me,overloadedBoolean:()=>Xw,spaceSeparated:()=>Nr});var mhe=0,$t=qd(),Nn=qd(),Xw=qd(),Me=qd(),Nr=qd(),ff=qd(),ja=qd();function qd(){return 2**++mhe}var DD=Object.keys(nb),Gd=class extends Ro{constructor(t,r,n,o){let a=-1;if(super(t,r),AG(this,"space",o),typeof n=="number")for(;++a<DD.length;){let i=DD[a];AG(this,DD[a],(n&nb[i])===nb[i])}}};Gd.prototype.defined=!0;function AG(e,t,r){r&&(e[t]=r)}function al(e){let t={},r={};for(let[n,o]of Object.entries(e.properties)){let a=new Gd(n,e.transform(e.attributes||{},n),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(a.mustUseProperty=!0),t[n]=a,r[rb(n)]=n,r[rb(a.attribute)]=n}return new Sc(t,r,e.space)}var kD=al({properties:{ariaActiveDescendant:null,ariaAtomic:Nn,ariaAutoComplete:null,ariaBusy:Nn,ariaChecked:Nn,ariaColCount:Me,ariaColIndex:Me,ariaColSpan:Me,ariaControls:Nr,ariaCurrent:null,ariaDescribedBy:Nr,ariaDetails:null,ariaDisabled:Nn,ariaDropEffect:Nr,ariaErrorMessage:null,ariaExpanded:Nn,ariaFlowTo:Nr,ariaGrabbed:Nn,ariaHasPopup:null,ariaHidden:Nn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nr,ariaLevel:Me,ariaLive:null,ariaModal:Nn,ariaMultiLine:Nn,ariaMultiSelectable:Nn,ariaOrientation:null,ariaOwns:Nr,ariaPlaceholder:null,ariaPosInSet:Me,ariaPressed:Nn,ariaReadOnly:Nn,ariaRelevant:null,ariaRequired:Nn,ariaRoleDescription:Nr,ariaRowCount:Me,ariaRowIndex:Me,ariaRowSpan:Me,ariaSelected:Nn,ariaSetSize:Me,ariaSort:null,ariaValueMax:Me,ariaValueMin:Me,ariaValueNow:Me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Yw(e,t){return t in e?e[t]:t}function Qw(e,t){return Yw(e,t.toLowerCase())}var DG=al({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ff,acceptCharset:Nr,accessKey:Nr,action:null,allow:null,allowFullScreen:$t,allowPaymentRequest:$t,allowUserMedia:$t,alt:null,as:null,async:$t,autoCapitalize:null,autoComplete:Nr,autoFocus:$t,autoPlay:$t,blocking:Nr,capture:null,charSet:null,checked:$t,cite:null,className:Nr,cols:Me,colSpan:null,content:null,contentEditable:Nn,controls:$t,controlsList:Nr,coords:Me|ff,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$t,defer:$t,dir:null,dirName:null,disabled:$t,download:Xw,draggable:Nn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$t,formTarget:null,headers:Nr,height:Me,hidden:Xw,high:Me,href:null,hrefLang:null,htmlFor:Nr,httpEquiv:Nr,id:null,imageSizes:null,imageSrcSet:null,inert:$t,inputMode:null,integrity:null,is:null,isMap:$t,itemId:null,itemProp:Nr,itemRef:Nr,itemScope:$t,itemType:Nr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$t,low:Me,manifest:null,max:null,maxLength:Me,media:null,method:null,min:null,minLength:Me,multiple:$t,muted:$t,name:null,nonce:null,noModule:$t,noValidate:$t,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$t,optimum:Me,pattern:null,ping:Nr,placeholder:null,playsInline:$t,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$t,referrerPolicy:null,rel:Nr,required:$t,reversed:$t,rows:Me,rowSpan:Me,sandbox:Nr,scope:null,scoped:$t,seamless:$t,selected:$t,shadowRootClonable:$t,shadowRootDelegatesFocus:$t,shadowRootMode:null,shape:null,size:Me,sizes:null,slot:null,span:Me,spellCheck:Nn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Me,step:null,style:null,tabIndex:Me,target:null,title:null,translate:null,type:null,typeMustMatch:$t,useMap:null,value:Nn,width:Me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nr,axis:null,background:null,bgColor:null,border:Me,borderColor:null,bottomMargin:Me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$t,declare:$t,event:null,face:null,frame:null,frameBorder:null,hSpace:Me,leftMargin:Me,link:null,longDesc:null,lowSrc:null,marginHeight:Me,marginWidth:Me,noResize:$t,noHref:$t,noShade:$t,noWrap:$t,object:null,profile:null,prompt:null,rev:null,rightMargin:Me,rules:null,scheme:null,scrolling:Nn,standby:null,summary:null,text:null,topMargin:Me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$t,disableRemotePlayback:$t,prefix:null,property:null,results:Me,security:null,unselectable:null},space:"html",transform:Qw});var kG=al({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ja,accentHeight:Me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Me,amplitude:Me,arabicForm:null,ascent:Me,attributeName:null,attributeType:null,azimuth:Me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Me,by:null,calcMode:null,capHeight:Me,className:Nr,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Me,diffuseConstant:Me,direction:null,display:null,dur:null,divisor:Me,dominantBaseline:null,download:$t,dx:null,dy:null,edgeMode:null,editable:null,elevation:Me,enableBackground:null,end:null,event:null,exponent:Me,externalResourcesRequired:null,fill:null,fillOpacity:Me,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ff,g2:ff,glyphName:ff,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Me,horizOriginX:Me,horizOriginY:Me,id:null,ideographic:Me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Me,k:Me,k1:Me,k2:Me,k3:Me,k4:Me,kernelMatrix:ja,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Me,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Me,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Me,overlineThickness:Me,paintOrder:null,panose1:null,path:null,pathLength:Me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Me,pointsAtY:Me,pointsAtZ:Me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ja,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ja,rev:ja,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ja,requiredFeatures:ja,requiredFonts:ja,requiredFormats:ja,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Me,specularExponent:Me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Me,strikethroughThickness:Me,string:null,stroke:null,strokeDashArray:ja,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Me,strokeOpacity:Me,strokeWidth:null,style:null,surfaceScale:Me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ja,tabIndex:Me,tableValues:null,target:null,targetX:Me,targetY:Me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ja,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Me,underlineThickness:Me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Me,values:null,vAlphabetic:Me,vMathematical:Me,vectorEffect:null,vHanging:Me,vIdeographic:Me,version:null,vertAdvY:Me,vertOriginX:Me,vertOriginY:Me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Yw});var LD=al({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var _D=al({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Qw});var zD=al({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var BD={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var phe=/[A-Z]/g,LG=/-[a-z]/g,hhe=/^data[-\w.:]+$/i;function FD(e,t){let r=rb(t),n=t,o=Ro;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&hhe.test(t)){if(t.charAt(4)==="-"){let a=t.slice(5).replace(LG,yhe);n="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{let a=t.slice(4);if(!LG.test(a)){let i=a.replace(phe,ghe);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=Gd}return new o(n,t)}function ghe(e){return"-"+e.toLowerCase()}function yhe(e){return e.charAt(1).toUpperCase()}var _G=AD([kD,DG,LD,_D,zD],"html"),Zw=AD([kD,kG,LD,_D,zD],"svg");function zG(e){return e.join(" ").trim()}var JG=$(XG(),1);var e1=YG("end"),Fh=YG("start");function YG(e){return t;function t(r){let n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function jD(e){let t=Fh(e),r=e1(e);if(t&&r)return{start:t,end:r}}function df(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?QG(e.position):"start"in e||"end"in e?QG(e):"line"in e||"column"in e?UD(e):""}function UD(e){return ZG(e&&e.line)+":"+ZG(e&&e.column)}function QG(e){return UD(e&&e.start)+"-"+UD(e&&e.end)}function ZG(e){return e&&typeof e=="number"?e:1}var Ln=class extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let o="",a={},i=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?o=t:!a.cause&&t&&(i=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof n=="string"){let s=n.indexOf(":");s===-1?a.ruleId=n:(a.source=n.slice(0,s),a.ruleId=n.slice(s+1))}if(!a.place&&a.ancestors&&a.ancestors){let s=a.ancestors[a.ancestors.length-1];s&&(a.place=s.position)}let l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=l?l.line:void 0,this.name=df(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Ln.prototype.file="";Ln.prototype.name="";Ln.prototype.reason="";Ln.prototype.message="";Ln.prototype.stack="";Ln.prototype.column=void 0;Ln.prototype.line=void 0;Ln.prototype.ancestors=void 0;Ln.prototype.cause=void 0;Ln.prototype.fatal=void 0;Ln.prototype.place=void 0;Ln.prototype.ruleId=void 0;Ln.prototype.source=void 0;var WD={}.hasOwnProperty,jhe=new Map,Uhe=/[A-Z]/g,Whe=new Set(["table","tbody","thead","tfoot","tr"]),Khe=new Set(["td","th"]),eX="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function KD(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let r=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=ege(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Jhe(r,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Zw:_G,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=tX(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function tX(e,t,r){if(t.type==="element")return qhe(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Ghe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Yhe(e,t,r);if(t.type==="mdxjsEsm")return Xhe(e,t);if(t.type==="root")return Qhe(e,t,r);if(t.type==="text")return Zhe(e,t)}function qhe(e,t,r){let n=e.schema,o=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(o=Zw,e.schema=o),e.ancestors.push(t);let a=nX(e,t.tagName,!1),i=tge(e,t),l=GD(e,t);return Whe.has(t.tagName)&&(l=l.filter(function(s){return typeof s=="string"?!PD(s):!0})),rX(e,i,a,t),qD(i,l),e.ancestors.pop(),e.schema=n,e.create(t,a,i,r)}function Ghe(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ab(e,t.position)}function Xhe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ab(e,t.position)}function Yhe(e,t,r){let n=e.schema,o=n;t.name==="svg"&&n.space==="html"&&(o=Zw,e.schema=o),e.ancestors.push(t);let a=t.name===null?e.Fragment:nX(e,t.name,!0),i=rge(e,t),l=GD(e,t);return rX(e,i,a,t),qD(i,l),e.ancestors.pop(),e.schema=n,e.create(t,a,i,r)}function Qhe(e,t,r){let n={};return qD(n,GD(e,t)),e.create(t,e.Fragment,n,r)}function Zhe(e,t){return t.value}function rX(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function qD(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function Jhe(e,t,r){return n;function n(o,a,i,l){let c=Array.isArray(i.children)?r:t;return l?c(a,i,l):c(a,i)}}function ege(e,t){return r;function r(n,o,a,i){let l=Array.isArray(a.children),s=Fh(n);return t(o,a,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function tge(e,t){let r={},n,o;for(o in t.properties)if(o!=="children"&&WD.call(t.properties,o)){let a=nge(e,o,t.properties[o]);if(a){let[i,l]=a;e.tableCellAlignToStyle&&i==="align"&&typeof l=="string"&&Khe.has(t.tagName)?n=l:r[i]=l}}if(n){let a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function rge(e,t){let r={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let a=n.data.estree.body[0];a.type;let i=a.expression;i.type;let l=i.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else ab(e,t.position);else{let o=n.name,a;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let l=n.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else ab(e,t.position);else a=n.value===null?!0:n.value;r[o]=a}return r}function GD(e,t){let r=[],n=-1,o=e.passKeys?new Map:jhe;for(;++n<t.children.length;){let a=t.children[n],i;if(e.passKeys){let s=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(s){let c=o.get(s)||0;i=s+"-"+c,o.set(s,c+1)}}let l=tX(e,a,i);l!==void 0&&r.push(l)}return r}function nge(e,t,r){let n=FD(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?IG(r):zG(r)),n.property==="style"){let o=typeof r=="object"?r:oge(e,String(r));return e.stylePropertyNameCase==="css"&&(o=age(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&n.space?BD[n.property]||n.property:n.attribute,r]}}function oge(e,t){try{return(0,JG.default)(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let n=r,o=new Ln("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=eX+"#cannot-parse-style-attribute",o}}function nX(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){let o=t.split("."),a=-1,i;for(;++a<o.length;){let l=Gw(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};i=i?{type:"MemberExpression",object:i,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}n=i}else n=Gw(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let o=n.value;return WD.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(n);ab(e)}function ab(e,t){let r=new Ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=eX+"#cannot-handle-mdx-estrees-without-createevaluater",r}function age(e){let t={},r;for(r in e)WD.call(e,r)&&(t[ige(r)]=e[r]);return t}function ige(e){let t=e.replace(Uhe,lge);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lge(e){return"-"+e.toLowerCase()}var ib={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var Kh=$(sr(),1),PY=$(P(),1);var sge={};function XD(e,t){let r=t||sge,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return aX(e,n,o)}function aX(e,t,r){if(cge(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return oX(e.children,t,r)}return Array.isArray(e)?oX(e,t,r):""}function oX(e,t,r){let n=[],o=-1;for(;++o<e.length;)n[o]=aX(e[o],t,r);return n.join("")}function cge(e){return!!(e&&typeof e=="object")}var iX=document.createElement("i");function Hh(e){let t="&"+e+";";iX.innerHTML=t;let r=iX.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Uo(e,t,r,n){let o=e.length,a=0,i;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,n.length<1e4)i=Array.from(n),i.unshift(t,r),e.splice(...i);else for(r&&e.splice(t,r);a<n.length;)i=n.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function ga(e,t){return e.length>0?(Uo(e,e.length,0,t),e):t}var lX={}.hasOwnProperty;function sX(e){let t={},r=-1;for(;++r<e.length;)uge(t,e[r]);return t}function uge(e,t){let r;for(r in t){let o=(lX.call(e,r)?e[r]:void 0)||(e[r]={}),a=t[r],i;if(a)for(i in a){lX.call(o,i)||(o[i]=[]);let l=a[i];fge(o[i],Array.isArray(l)?l:l?[l]:[])}}}function fge(e,t){let r=-1,n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);Uo(e,0,0,n)}function t1(e,t){let r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function Rc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var Ri=mf(/[A-Za-z]/),Eo=mf(/[\dA-Za-z]/),cX=mf(/[#-'*+\--9=?A-Z^-~]/);function lb(e){return e!==null&&(e<32||e===127)}var sb=mf(/\d/),uX=mf(/[\dA-Fa-f]/),fX=mf(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function _n(e){return e!==null&&(e<0||e===32)}function Nt(e){return e===-2||e===-1||e===32}var dX=mf(new RegExp("\\p{P}|\\p{S}","u")),mX=mf(/\s/);function mf(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function il(e){let t=[],r=-1,n=0,o=0;for(;++r<e.length;){let a=e.charCodeAt(r),i="";if(a===37&&Eo(e.charCodeAt(r+1))&&Eo(e.charCodeAt(r+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){let l=e.charCodeAt(r+1);a<56320&&l>56319&&l<57344?(i=String.fromCharCode(a,l),o=1):i="\uFFFD"}else i=String.fromCharCode(a);i&&(t.push(e.slice(n,r),encodeURIComponent(i)),n=r+o+1,i=""),o&&(r+=o,o=0)}return t.join("")+e.slice(n)}function Mt(e,t,r,n){let o=n?n-1:Number.POSITIVE_INFINITY,a=0;return i;function i(s){return Nt(s)?(e.enter(r),l(s)):t(s)}function l(s){return Nt(s)&&a++<o?(e.consume(s),l):(e.exit(r),t(s))}}var pX={tokenize:dge};function dge(e){let t=e.attempt(this.parser.constructs.contentInitial,n,o),r;return t;function n(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Mt(e,t,"linePrefix")}function o(l){return e.enter("paragraph"),a(l)}function a(l){let s=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=s),r=s,i(l)}function i(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Je(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),i)}}var gX={tokenize:mge},hX={tokenize:pge};function mge(e){let t=this,r=[],n=0,o,a,i;return l;function l(y){if(n<r.length){let v=r[n];return t.containerState=v[1],e.attempt(v[0].continuation,s,c)(y)}return c(y)}function s(y){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&h();let v=t.events.length,S=v,R;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){R=t.events[S][1].end;break}g(n);let C=v;for(;C<t.events.length;)t.events[C][1].end={...R},C++;return Uo(t.events,S+1,0,t.events.slice(v)),t.events.length=C,c(y)}return l(y)}function c(y){if(n===r.length){if(!o)return d(y);if(o.currentConstruct&&o.currentConstruct.concrete)return p(y);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hX,u,f)(y)}function u(y){return o&&h(),g(n),d(y)}function f(y){return t.parser.lazy[t.now().line]=n!==r.length,i=t.now().offset,p(y)}function d(y){return t.containerState={},e.attempt(hX,m,p)(y)}function m(y){return n++,r.push([t.currentConstruct,t.containerState]),d(y)}function p(y){if(y===null){o&&h(),g(0),e.consume(y);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),x(y)}function x(y){if(y===null){b(e.exit("chunkFlow"),!0),g(0),e.consume(y);return}return Je(y)?(e.consume(y),b(e.exit("chunkFlow")),n=0,t.interrupt=void 0,l):(e.consume(y),x)}function b(y,v){let S=t.sliceStream(y);if(v&&S.push(null),y.previous=a,a&&(a.next=y),a=y,o.defineSkip(y.start),o.write(S),t.parser.lazy[y.start.line]){let R=o.events.length;for(;R--;)if(o.events[R][1].start.offset<i&&(!o.events[R][1].end||o.events[R][1].end.offset>i))return;let C=t.events.length,N=C,E,O;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(E){O=t.events[N][1].end;break}E=!0}for(g(n),R=C;R<t.events.length;)t.events[R][1].end={...O},R++;Uo(t.events,N+1,0,t.events.slice(C)),t.events.length=R}}function g(y){let v=r.length;for(;v-- >y;){let S=r[v];t.containerState=S[1],S[0].exit.call(t,e)}r.length=y}function h(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function pge(e,t,r){return Mt(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function YD(e){if(e===null||_n(e)||mX(e))return 1;if(dX(e))return 2}function Vh(e,t,r){let n=[],o=-1;for(;++o<e.length;){let a=e[o].resolveAll;a&&!n.includes(a)&&(t=a(t,r),n.push(a))}return t}var cb={name:"attention",resolveAll:hge,tokenize:gge};function hge(e,t){let r=-1,n,o,a,i,l,s,c,u;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let f={...e[n][1].end},d={...e[r][1].start};yX(f,-s),yX(d,s),i={type:s>1?"strongSequence":"emphasisSequence",start:f,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:d},a={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},o={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[r][1].start={...l.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=ga(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=ga(c,[["enter",o,t],["enter",i,t],["exit",i,t],["enter",a,t]]),c=ga(c,Vh(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=ga(c,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(u=2,c=ga(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):u=0,Uo(e,n-1,r-n+3,c),r=n+c.length-u-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function gge(e,t){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,o=YD(n),a;return i;function i(s){return a=s,e.enter("attentionSequence"),l(s)}function l(s){if(s===a)return e.consume(s),l;let c=e.exit("attentionSequence"),u=YD(s),f=!u||u===2&&o||r.includes(s),d=!o||o===2&&u||r.includes(n);return c._open=!!(a===42?f:f&&(o||!d)),c._close=!!(a===42?d:d&&(u||!f)),t(s)}}function yX(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var QD={name:"autolink",tokenize:yge};function yge(e,t,r){let n=0;return o;function o(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return Ri(m)?(e.consume(m),i):m===64?r(m):c(m)}function i(m){return m===43||m===45||m===46||Eo(m)?(n=1,l(m)):c(m)}function l(m){return m===58?(e.consume(m),n=0,s):(m===43||m===45||m===46||Eo(m))&&n++<32?(e.consume(m),l):(n=0,c(m))}function s(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||lb(m)?r(m):(e.consume(m),s)}function c(m){return m===64?(e.consume(m),u):cX(m)?(e.consume(m),c):r(m)}function u(m){return Eo(m)?f(m):r(m)}function f(m){return m===46?(e.consume(m),n=0,u):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):d(m)}function d(m){if((m===45||Eo(m))&&n++<63){let p=m===45?d:f;return e.consume(m),p}return r(m)}}var pf={partial:!0,tokenize:xge};function xge(e,t,r){return n;function n(a){return Nt(a)?Mt(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Je(a)?t(a):r(a)}}var r1={continuation:{tokenize:vge},exit:Cge,name:"blockQuote",tokenize:bge};function bge(e,t,r){let n=this;return o;function o(i){if(i===62){let l=n.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),a}return r(i)}function a(i){return Nt(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function vge(e,t,r){let n=this;return o;function o(i){return Nt(i)?Mt(e,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):a(i)}function a(i){return e.attempt(r1,t,r)(i)}}function Cge(e){e.exit("blockQuote")}var n1={name:"characterEscape",tokenize:Sge};function Sge(e,t,r){return n;function n(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return fX(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(a)}}var o1={name:"characterReference",tokenize:Rge};function Rge(e,t,r){let n=this,o=0,a,i;return l;function l(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),s}function s(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),a=31,i=Eo,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,i=uX,u):(e.enter("characterReferenceValue"),a=7,i=sb,u(f))}function u(f){if(f===59&&o){let d=e.exit("characterReferenceValue");return i===Eo&&!Hh(n.sliceSerialize(d))?r(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(f)&&o++<a?(e.consume(f),u):r(f)}}var xX={partial:!0,tokenize:wge},a1={concrete:!0,name:"codeFenced",tokenize:Ege};function Ege(e,t,r){let n=this,o={partial:!0,tokenize:S},a=0,i=0,l;return s;function s(R){return c(R)}function c(R){let C=n.events[n.events.length-1];return a=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,l=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(R)}function u(R){return R===l?(i++,e.consume(R),u):i<3?r(R):(e.exit("codeFencedFenceSequence"),Nt(R)?Mt(e,f,"whitespace")(R):f(R))}function f(R){return R===null||Je(R)?(e.exit("codeFencedFence"),n.interrupt?t(R):e.check(xX,x,v)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(R))}function d(R){return R===null||Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(R)):Nt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mt(e,m,"whitespace")(R)):R===96&&R===l?r(R):(e.consume(R),d)}function m(R){return R===null||Je(R)?f(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(R))}function p(R){return R===null||Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(R)):R===96&&R===l?r(R):(e.consume(R),p)}function x(R){return e.attempt(o,v,b)(R)}function b(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),g}function g(R){return a>0&&Nt(R)?Mt(e,h,"linePrefix",a+1)(R):h(R)}function h(R){return R===null||Je(R)?e.check(xX,x,v)(R):(e.enter("codeFlowValue"),y(R))}function y(R){return R===null||Je(R)?(e.exit("codeFlowValue"),h(R)):(e.consume(R),y)}function v(R){return e.exit("codeFenced"),t(R)}function S(R,C,N){let E=0;return O;function O(L){return R.enter("lineEnding"),R.consume(L),R.exit("lineEnding"),w}function w(L){return R.enter("codeFencedFence"),Nt(L)?Mt(R,A,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):A(L)}function A(L){return L===l?(R.enter("codeFencedFenceSequence"),T(L)):N(L)}function T(L){return L===l?(E++,R.consume(L),T):E>=i?(R.exit("codeFencedFenceSequence"),Nt(L)?Mt(R,k,"whitespace")(L):k(L)):N(L)}function k(L){return L===null||Je(L)?(R.exit("codeFencedFence"),C(L)):N(L)}}}function wge(e,t,r){let n=this;return o;function o(i){return i===null?r(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a)}function a(i){return n.parser.lazy[n.now().line]?r(i):t(i)}}var ub={name:"codeIndented",tokenize:Tge},Nge={partial:!0,tokenize:Oge};function Tge(e,t,r){let n=this;return o;function o(c){return e.enter("codeIndented"),Mt(e,a,"linePrefix",5)(c)}function a(c){let u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?i(c):r(c)}function i(c){return c===null?s(c):Je(c)?e.attempt(Nge,i,s)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||Je(c)?(e.exit("codeFlowValue"),i(c)):(e.consume(c),l)}function s(c){return e.exit("codeIndented"),t(c)}}function Oge(e,t,r){let n=this;return o;function o(i){return n.parser.lazy[n.now().line]?r(i):Je(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):Mt(e,a,"linePrefix",5)(i)}function a(i){let l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):Je(i)?o(i):r(i)}}var ZD={name:"codeText",previous:Mge,resolve:$ge,tokenize:Ige};function $ge(e){let t=e.length-4,r=3,n,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)o===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(o=n):(n===t||e[n][1].type==="lineEnding")&&(e[o][1].type="codeTextData",n!==o+2&&(e[o][1].end=e[n-1][1].end,e.splice(o+2,n-o-2),t-=n-o-2,n=o+2),o=void 0);return e}function Mge(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ige(e,t,r){let n=this,o=0,a,i;return l;function l(d){return e.enter("codeText"),e.enter("codeTextSequence"),s(d)}function s(d){return d===96?(e.consume(d),o++,s):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?r(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(i=e.enter("codeTextSequence"),a=0,f(d)):Je(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||Je(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),a++,f):a===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",u(d))}}var i1=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){let n=r==null?Number.POSITIVE_INFINITY:r;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){let o=r||0;this.setCursor(Math.trunc(t));let a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return n&&fb(this.left,n),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fb(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fb(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let r=this.left.splice(t,Number.POSITIVE_INFINITY);fb(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fb(this.left,r.reverse())}}};function fb(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function l1(e){let t={},r=-1,n,o,a,i,l,s,c,u=new i1(e);for(;++r<u.length;){for(;r in t;)r=t[r];if(n=u.get(r),r&&n[1].type==="chunkFlow"&&u.get(r-1)[1].type==="listItemPrefix"&&(s=n[1]._tokenizer.events,a=0,a<s.length&&s[a][1].type==="lineEndingBlank"&&(a+=2),a<s.length&&s[a][1].type==="content"))for(;++a<s.length&&s[a][1].type!=="content";)s[a][1].type==="chunkText"&&(s[a][1]._isInFirstContentOfListItem=!0,a++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,Pge(u,r)),r=t[r],c=!0);else if(n[1]._container){for(a=r,o=void 0;a--;)if(i=u.get(a),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),i[1].type="lineEnding",o=a);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;o&&(n[1].end={...u.get(o)[1].start},l=u.slice(o,r),l.unshift(n),u.splice(o,r-o+1,l))}}return Uo(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function Pge(e,t){let r=e.get(t)[1],n=e.get(t)[2],o=t-1,a=[],i=r._tokenizer;i||(i=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let l=i.events,s=[],c={},u,f,d=-1,m=r,p=0,x=0,b=[x];for(;m;){for(;e.get(++o)[1]!==m;);a.push(o),m._tokenizer||(u=n.sliceStream(m),m.next||u.push(null),f&&i.defineSkip(m.start),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(u),m._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),f=m,m=m.next}for(m=r;++d<l.length;)l[d][0]==="exit"&&l[d-1][0]==="enter"&&l[d][1].type===l[d-1][1].type&&l[d][1].start.line!==l[d][1].end.line&&(x=d+1,b.push(x),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(i.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),d=b.length;d--;){let g=l.slice(b[d],b[d+1]),h=a.pop();s.push([h,h+g.length-1]),e.splice(h,2,g)}for(s.reverse(),d=-1;++d<s.length;)c[p+s[d][0]]=p+s[d][1],p+=s[d][1]-s[d][0]-1;return c}var JD={resolve:Dge,tokenize:kge},Age={partial:!0,tokenize:Lge};function Dge(e){return l1(e),e}function kge(e,t){let r;return n;function n(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?a(l):Je(l)?e.check(Age,i,a)(l):(e.consume(l),o)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function i(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function Lge(e,t,r){let n=this;return o;function o(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Mt(e,a,"linePrefix")}function a(i){if(i===null||Je(i))return r(i);let l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(n.parser.constructs.flow,r,t)(i)}}function s1(e,t,r,n,o,a,i,l,s){let c=s||Number.POSITIVE_INFINITY,u=0;return f;function f(g){return g===60?(e.enter(n),e.enter(o),e.enter(a),e.consume(g),e.exit(a),d):g===null||g===32||g===41||lb(g)?r(g):(e.enter(n),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(g))}function d(g){return g===62?(e.enter(a),e.consume(g),e.exit(a),e.exit(o),e.exit(n),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===62?(e.exit("chunkString"),e.exit(l),d(g)):g===null||g===60||Je(g)?r(g):(e.consume(g),g===92?p:m)}function p(g){return g===60||g===62||g===92?(e.consume(g),m):m(g)}function x(g){return!u&&(g===null||g===41||_n(g))?(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(n),t(g)):u<c&&g===40?(e.consume(g),u++,x):g===41?(e.consume(g),u--,x):g===null||g===32||g===40||lb(g)?r(g):(e.consume(g),g===92?b:x)}function b(g){return g===40||g===41||g===92?(e.consume(g),x):x(g)}}function c1(e,t,r,n,o,a){let i=this,l=0,s;return c;function c(m){return e.enter(n),e.enter(o),e.consume(m),e.exit(o),e.enter(a),u}function u(m){return l>999||m===null||m===91||m===93&&!s||m===94&&!l&&"_hiddenFootnoteSupport"in i.parser.constructs?r(m):m===93?(e.exit(a),e.enter(o),e.consume(m),e.exit(o),e.exit(n),t):Je(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||Je(m)||l++>999?(e.exit("chunkString"),u(m)):(e.consume(m),s||(s=!Nt(m)),m===92?d:f)}function d(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function u1(e,t,r,n,o,a){let i;return l;function l(d){return d===34||d===39||d===40?(e.enter(n),e.enter(o),e.consume(d),e.exit(o),i=d===40?41:d,s):r(d)}function s(d){return d===i?(e.enter(o),e.consume(d),e.exit(o),e.exit(n),t):(e.enter(a),c(d))}function c(d){return d===i?(e.exit(a),s(i)):d===null?r(d):Je(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Mt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(d){return d===i||d===null||Je(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?f:u)}function f(d){return d===i||d===92?(e.consume(d),u):u(d)}}function Yd(e,t){let r;return n;function n(o){return Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,n):Nt(o)?Mt(e,n,r?"linePrefix":"lineSuffix")(o):t(o)}}var ek={name:"definition",tokenize:zge},_ge={partial:!0,tokenize:Bge};function zge(e,t,r){let n=this,o;return a;function a(m){return e.enter("definition"),i(m)}function i(m){return c1.call(n,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return o=Rc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),s):r(m)}function s(m){return _n(m)?Yd(e,c)(m):c(m)}function c(m){return s1(e,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return e.attempt(_ge,f,f)(m)}function f(m){return Nt(m)?Mt(e,d,"whitespace")(m):d(m)}function d(m){return m===null||Je(m)?(e.exit("definition"),n.parser.defined.push(o),t(m)):r(m)}}function Bge(e,t,r){return n;function n(l){return _n(l)?Yd(e,o)(l):r(l)}function o(l){return u1(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return Nt(l)?Mt(e,i,"whitespace")(l):i(l)}function i(l){return l===null||Je(l)?t(l):r(l)}}var tk={name:"hardBreakEscape",tokenize:Fge};function Fge(e,t,r){return n;function n(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Je(a)?(e.exit("hardBreakEscape"),t(a)):r(a)}}var rk={name:"headingAtx",resolve:Hge,tokenize:Vge};function Hge(e,t){let r=e.length-2,n=3,o,a;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(o={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},a={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},Uo(e,n,r-n+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function Vge(e,t,r){let n=0;return o;function o(u){return e.enter("atxHeading"),a(u)}function a(u){return e.enter("atxHeadingSequence"),i(u)}function i(u){return u===35&&n++<6?(e.consume(u),i):u===null||_n(u)?(e.exit("atxHeadingSequence"),l(u)):r(u)}function l(u){return u===35?(e.enter("atxHeadingSequence"),s(u)):u===null||Je(u)?(e.exit("atxHeading"),t(u)):Nt(u)?Mt(e,l,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function s(u){return u===35?(e.consume(u),s):(e.exit("atxHeadingSequence"),l(u))}function c(u){return u===null||u===35||_n(u)?(e.exit("atxHeadingText"),l(u)):(e.consume(u),c)}}var bX=["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"],nk=["pre","script","style","textarea"];var ok={concrete:!0,name:"htmlFlow",resolveTo:Wge,tokenize:Kge},jge={partial:!0,tokenize:Gge},Uge={partial:!0,tokenize:qge};function Wge(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Kge(e,t,r){let n=this,o,a,i,l,s;return c;function c(I){return u(I)}function u(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),d):I===47?(e.consume(I),a=!0,x):I===63?(e.consume(I),o=3,n.interrupt?t:M):Ri(I)?(e.consume(I),i=String.fromCharCode(I),b):r(I)}function d(I){return I===45?(e.consume(I),o=2,m):I===91?(e.consume(I),o=5,l=0,p):Ri(I)?(e.consume(I),o=4,n.interrupt?t:M):r(I)}function m(I){return I===45?(e.consume(I),n.interrupt?t:M):r(I)}function p(I){let j="CDATA[";return I===j.charCodeAt(l++)?(e.consume(I),l===j.length?n.interrupt?t:A:p):r(I)}function x(I){return Ri(I)?(e.consume(I),i=String.fromCharCode(I),b):r(I)}function b(I){if(I===null||I===47||I===62||_n(I)){let j=I===47,W=i.toLowerCase();return!j&&!a&&nk.includes(W)?(o=1,n.interrupt?t(I):A(I)):bX.includes(i.toLowerCase())?(o=6,j?(e.consume(I),g):n.interrupt?t(I):A(I)):(o=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(I):a?h(I):y(I))}return I===45||Eo(I)?(e.consume(I),i+=String.fromCharCode(I),b):r(I)}function g(I){return I===62?(e.consume(I),n.interrupt?t:A):r(I)}function h(I){return Nt(I)?(e.consume(I),h):O(I)}function y(I){return I===47?(e.consume(I),O):I===58||I===95||Ri(I)?(e.consume(I),v):Nt(I)?(e.consume(I),y):O(I)}function v(I){return I===45||I===46||I===58||I===95||Eo(I)?(e.consume(I),v):S(I)}function S(I){return I===61?(e.consume(I),R):Nt(I)?(e.consume(I),S):y(I)}function R(I){return I===null||I===60||I===61||I===62||I===96?r(I):I===34||I===39?(e.consume(I),s=I,C):Nt(I)?(e.consume(I),R):N(I)}function C(I){return I===s?(e.consume(I),s=null,E):I===null||Je(I)?r(I):(e.consume(I),C)}function N(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||_n(I)?S(I):(e.consume(I),N)}function E(I){return I===47||I===62||Nt(I)?y(I):r(I)}function O(I){return I===62?(e.consume(I),w):r(I)}function w(I){return I===null||Je(I)?A(I):Nt(I)?(e.consume(I),w):r(I)}function A(I){return I===45&&o===2?(e.consume(I),H):I===60&&o===1?(e.consume(I),_):I===62&&o===4?(e.consume(I),U):I===63&&o===3?(e.consume(I),M):I===93&&o===5?(e.consume(I),z):Je(I)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(jge,B,T)(I)):I===null||Je(I)?(e.exit("htmlFlowData"),T(I)):(e.consume(I),A)}function T(I){return e.check(Uge,k,B)(I)}function k(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),L}function L(I){return I===null||Je(I)?T(I):(e.enter("htmlFlowData"),A(I))}function H(I){return I===45?(e.consume(I),M):A(I)}function _(I){return I===47?(e.consume(I),i="",F):A(I)}function F(I){if(I===62){let j=i.toLowerCase();return nk.includes(j)?(e.consume(I),U):A(I)}return Ri(I)&&i.length<8?(e.consume(I),i+=String.fromCharCode(I),F):A(I)}function z(I){return I===93?(e.consume(I),M):A(I)}function M(I){return I===62?(e.consume(I),U):I===45&&o===2?(e.consume(I),M):A(I)}function U(I){return I===null||Je(I)?(e.exit("htmlFlowData"),B(I)):(e.consume(I),U)}function B(I){return e.exit("htmlFlow"),t(I)}}function qge(e,t,r){let n=this;return o;function o(i){return Je(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),a):r(i)}function a(i){return n.parser.lazy[n.now().line]?r(i):t(i)}}function Gge(e,t,r){return n;function n(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(pf,t,r)}}var ak={name:"htmlText",tokenize:Xge};function Xge(e,t,r){let n=this,o,a,i;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),s}function s(M){return M===33?(e.consume(M),c):M===47?(e.consume(M),S):M===63?(e.consume(M),y):Ri(M)?(e.consume(M),N):r(M)}function c(M){return M===45?(e.consume(M),u):M===91?(e.consume(M),a=0,p):Ri(M)?(e.consume(M),h):r(M)}function u(M){return M===45?(e.consume(M),m):r(M)}function f(M){return M===null?r(M):M===45?(e.consume(M),d):Je(M)?(i=f,_(M)):(e.consume(M),f)}function d(M){return M===45?(e.consume(M),m):f(M)}function m(M){return M===62?H(M):M===45?d(M):f(M)}function p(M){let U="CDATA[";return M===U.charCodeAt(a++)?(e.consume(M),a===U.length?x:p):r(M)}function x(M){return M===null?r(M):M===93?(e.consume(M),b):Je(M)?(i=x,_(M)):(e.consume(M),x)}function b(M){return M===93?(e.consume(M),g):x(M)}function g(M){return M===62?H(M):M===93?(e.consume(M),g):x(M)}function h(M){return M===null||M===62?H(M):Je(M)?(i=h,_(M)):(e.consume(M),h)}function y(M){return M===null?r(M):M===63?(e.consume(M),v):Je(M)?(i=y,_(M)):(e.consume(M),y)}function v(M){return M===62?H(M):y(M)}function S(M){return Ri(M)?(e.consume(M),R):r(M)}function R(M){return M===45||Eo(M)?(e.consume(M),R):C(M)}function C(M){return Je(M)?(i=C,_(M)):Nt(M)?(e.consume(M),C):H(M)}function N(M){return M===45||Eo(M)?(e.consume(M),N):M===47||M===62||_n(M)?E(M):r(M)}function E(M){return M===47?(e.consume(M),H):M===58||M===95||Ri(M)?(e.consume(M),O):Je(M)?(i=E,_(M)):Nt(M)?(e.consume(M),E):H(M)}function O(M){return M===45||M===46||M===58||M===95||Eo(M)?(e.consume(M),O):w(M)}function w(M){return M===61?(e.consume(M),A):Je(M)?(i=w,_(M)):Nt(M)?(e.consume(M),w):E(M)}function A(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(e.consume(M),o=M,T):Je(M)?(i=A,_(M)):Nt(M)?(e.consume(M),A):(e.consume(M),k)}function T(M){return M===o?(e.consume(M),o=void 0,L):M===null?r(M):Je(M)?(i=T,_(M)):(e.consume(M),T)}function k(M){return M===null||M===34||M===39||M===60||M===61||M===96?r(M):M===47||M===62||_n(M)?E(M):(e.consume(M),k)}function L(M){return M===47||M===62||_n(M)?E(M):r(M)}function H(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):r(M)}function _(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),F}function F(M){return Nt(M)?Mt(e,z,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):z(M)}function z(M){return e.enter("htmlTextData"),i(M)}}var Qd={name:"labelEnd",resolveAll:Jge,resolveTo:eye,tokenize:tye},Yge={tokenize:rye},Qge={tokenize:nye},Zge={tokenize:oye};function Jge(e){let t=-1,r=[];for(;++t<e.length;){let n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let o=n.type==="labelImage"?4:2;n.type="data",t+=o}}return e.length!==r.length&&Uo(e,0,e.length,r),e}function eye(e,t){let r=e.length,n=0,o,a,i,l;for(;r--;)if(o=e[r][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(i){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=r,o.type!=="labelLink")){n=2;break}}else o.type==="labelEnd"&&(i=r);let s={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[a][1].start},end:{...e[i][1].end}},u={type:"labelText",start:{...e[a+n+2][1].end},end:{...e[i-2][1].start}};return l=[["enter",s,t],["enter",c,t]],l=ga(l,e.slice(a+1,a+n+3)),l=ga(l,[["enter",u,t]]),l=ga(l,Vh(t.parser.constructs.insideSpan.null,e.slice(a+n+4,i-3),t)),l=ga(l,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),l=ga(l,e.slice(i+1)),l=ga(l,[["exit",s,t]]),Uo(e,a,e.length,l),e}function tye(e,t,r){let n=this,o=n.events.length,a,i;for(;o--;)if((n.events[o][1].type==="labelImage"||n.events[o][1].type==="labelLink")&&!n.events[o][1]._balanced){a=n.events[o][1];break}return l;function l(d){return a?a._inactive?f(d):(i=n.parser.defined.includes(Rc(n.sliceSerialize({start:a.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),s):r(d)}function s(d){return d===40?e.attempt(Yge,u,i?u:f)(d):d===91?e.attempt(Qge,u,i?c:f)(d):i?u(d):f(d)}function c(d){return e.attempt(Zge,u,f)(d)}function u(d){return t(d)}function f(d){return a._balanced=!0,r(d)}}function rye(e,t,r){return n;function n(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return _n(f)?Yd(e,a)(f):a(f)}function a(f){return f===41?u(f):s1(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function i(f){return _n(f)?Yd(e,s)(f):u(f)}function l(f){return r(f)}function s(f){return f===34||f===39||f===40?u1(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return _n(f)?Yd(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):r(f)}}function nye(e,t,r){let n=this;return o;function o(l){return c1.call(n,e,a,i,"reference","referenceMarker","referenceString")(l)}function a(l){return n.parser.defined.includes(Rc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function i(l){return r(l)}}function oye(e,t,r){return n;function n(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):r(a)}}var ik={name:"labelStartImage",resolveAll:Qd.resolveAll,tokenize:aye};function aye(e,t,r){let n=this;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),i):r(l)}function i(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(l):t(l)}}var lk={name:"labelStartLink",resolveAll:Qd.resolveAll,tokenize:iye};function iye(e,t,r){let n=this;return o;function o(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),a}function a(i){return i===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(i):t(i)}}var db={name:"lineEnding",tokenize:lye};function lye(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Mt(e,t,"linePrefix")}}var Zd={name:"thematicBreak",tokenize:sye};function sye(e,t,r){let n=0,o;return a;function a(c){return e.enter("thematicBreak"),i(c)}function i(c){return o=c,l(c)}function l(c){return c===o?(e.enter("thematicBreakSequence"),s(c)):n>=3&&(c===null||Je(c))?(e.exit("thematicBreak"),t(c)):r(c)}function s(c){return c===o?(e.consume(c),n++,s):(e.exit("thematicBreakSequence"),Nt(c)?Mt(e,l,"whitespace")(c):l(c))}}var aa={continuation:{tokenize:dye},exit:pye,name:"list",tokenize:fye},cye={partial:!0,tokenize:hye},uye={partial:!0,tokenize:mye};function fye(e,t,r){let n=this,o=n.events[n.events.length-1],a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,i=0;return l;function l(m){let p=n.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!n.containerState.marker||m===n.containerState.marker:sb(m)){if(n.containerState.type||(n.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Zd,r,c)(m):c(m);if(!n.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(m)}return r(m)}function s(m){return sb(m)&&++i<10?(e.consume(m),s):(!n.interrupt||i<2)&&(n.containerState.marker?m===n.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):r(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||m,e.check(pf,n.interrupt?r:u,e.attempt(cye,d,f))}function u(m){return n.containerState.initialBlankLine=!0,a++,d(m)}function f(m){return Nt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),d):r(m)}function d(m){return n.containerState.size=a+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function dye(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(pf,o,a);function o(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Mt(e,t,"listItemIndent",n.containerState.size+1)(l)}function a(l){return n.containerState.furtherBlankLines||!Nt(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,i(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(uye,t,i)(l))}function i(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,Mt(e,e.attempt(aa,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function mye(e,t,r){let n=this;return Mt(e,o,"listItemIndent",n.containerState.size+1);function o(a){let i=n.events[n.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===n.containerState.size?t(a):r(a)}}function pye(e){e.exit(this.containerState.type)}function hye(e,t,r){let n=this;return Mt(e,o,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){let i=n.events[n.events.length-1];return!Nt(a)&&i&&i[1].type==="listItemPrefixWhitespace"?t(a):r(a)}}var f1={name:"setextUnderline",resolveTo:gye,tokenize:yye};function gye(e,t){let r=e.length,n,o,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!a&&e[r][1].type==="definition"&&(a=r);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",i,t]),e.splice(a+1,0,["exit",e[n][1],t]),e[n][1].end={...e[a][1].end}):e[n][1]=i,e.push(["exit",i,t]),e}function yye(e,t,r){let n=this,o;return a;function a(c){let u=n.events.length,f;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){f=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(e.enter("setextHeadingLine"),o=c,i(c)):r(c)}function i(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===o?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),Nt(c)?Mt(e,s,"lineSuffix")(c):s(c))}function s(c){return c===null||Je(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}var vX={tokenize:xye};function xye(e){let t=this,r=e.attempt(pf,n,e.attempt(this.parser.constructs.flowInitial,o,Mt(e,e.attempt(this.parser.constructs.flow,o,e.attempt(JD,o)),"linePrefix")));return r;function n(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var CX={resolveAll:wX()},SX=EX("string"),RX=EX("text");function EX(e){return{resolveAll:wX(e==="text"?bye:void 0),tokenize:t};function t(r){let n=this,o=this.parser.constructs[e],a=r.attempt(o,i,l);return i;function i(u){return c(u)?a(u):l(u)}function l(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),s}function s(u){return c(u)?(r.exit("data"),a(u)):(r.consume(u),s)}function c(u){if(u===null)return!0;let f=o[u],d=-1;if(f)for(;++d<f.length;){let m=f[d];if(!m.previous||m.previous.call(n,n.previous))return!0}return!1}}}function wX(e){return t;function t(r,n){let o=-1,a;for(;++o<=r.length;)a===void 0?r[o]&&r[o][1].type==="data"&&(a=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==a+2&&(r[a][1].end=r[o-1][1].end,r.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(r,n):r}}function bye(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let n=e[r-1][1],o=t.sliceStream(n),a=o.length,i=-1,l=0,s;for(;a--;){let c=o[a];if(typeof c=="string"){for(i=c.length;c.charCodeAt(i-1)===32;)l++,i--;if(i)break;i=-1}else if(c===-2)s=!0,l++;else if(c!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){let c={type:r===e.length||s||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?i:n.start._bufferIndex+i,_index:n.start._index+a,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}var sk={};Ak(sk,{attentionMarkers:()=>Tye,contentInitial:()=>Cye,disable:()=>Oye,document:()=>vye,flow:()=>Rye,flowInitial:()=>Sye,insideSpan:()=>Nye,string:()=>Eye,text:()=>wye});var vye={42:aa,43:aa,45:aa,48:aa,49:aa,50:aa,51:aa,52:aa,53:aa,54:aa,55:aa,56:aa,57:aa,62:r1},Cye={91:ek},Sye={[-2]:ub,[-1]:ub,32:ub},Rye={35:rk,42:Zd,45:[f1,Zd],60:ok,61:f1,95:Zd,96:a1,126:a1},Eye={38:o1,92:n1},wye={[-5]:db,[-4]:db,[-3]:db,33:ik,38:o1,42:cb,60:[QD,ak],91:lk,92:[tk,n1],93:Qd,95:cb,96:ZD},Nye={null:[cb,CX]},Tye={null:[42,95]},Oye={null:[]};function NX(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},o={},a=[],i=[],l=[],s=!0,c={attempt:E(C),check:E(N),consume:v,enter:S,exit:R,interrupt:E(N,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:b,parser:e,previous:null,sliceSerialize:p,sliceStream:x,write:m},f=t.tokenize.call(u,c),d;return t.resolveAll&&a.push(t),u;function m(T){return i=ga(i,T),h(),i[i.length-1]!==null?[]:(O(t,0),u.events=Vh(a,u.events,u),u.events)}function p(T,k){return Mye(x(T),k)}function x(T){return $ye(i,T)}function b(){let{_bufferIndex:T,_index:k,line:L,column:H,offset:_}=n;return{_bufferIndex:T,_index:k,line:L,column:H,offset:_}}function g(T){o[T.line]=T.column,A()}function h(){let T;for(;n._index<i.length;){let k=i[n._index];if(typeof k=="string")for(T=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===T&&n._bufferIndex<k.length;)y(k.charCodeAt(n._bufferIndex));else y(k)}}function y(T){s=void 0,d=T,f=f(T)}function v(T){Je(T)?(n.line++,n.column=1,n.offset+=T===-3?2:1,A()):T!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===i[n._index].length&&(n._bufferIndex=-1,n._index++)),u.previous=T,s=!0}function S(T,k){let L=k||{};return L.type=T,L.start=b(),u.events.push(["enter",L,u]),l.push(L),L}function R(T){let k=l.pop();return k.end=b(),u.events.push(["exit",k,u]),k}function C(T,k){O(T,k.from)}function N(T,k){k.restore()}function E(T,k){return L;function L(H,_,F){let z,M,U,B;return Array.isArray(H)?j(H):"tokenize"in H?j([H]):I(H);function I(Z){return ne;function ne(te){let de=te!==null&&Z[te],q=te!==null&&Z.null,X=[...Array.isArray(de)?de:de?[de]:[],...Array.isArray(q)?q:q?[q]:[]];return j(X)(te)}}function j(Z){return z=Z,M=0,Z.length===0?F:W(Z[M])}function W(Z){return ne;function ne(te){return B=w(),U=Z,Z.partial||(u.currentConstruct=Z),Z.name&&u.parser.constructs.disable.null.includes(Z.name)?Y(te):Z.tokenize.call(k?Object.assign(Object.create(u),k):u,c,K,Y)(te)}}function K(Z){return s=!0,T(U,B),_}function Y(Z){return s=!0,B.restore(),++M<z.length?W(z[M]):F}}}function O(T,k){T.resolveAll&&!a.includes(T)&&a.push(T),T.resolve&&Uo(u.events,k,u.events.length-k,T.resolve(u.events.slice(k),u)),T.resolveTo&&(u.events=T.resolveTo(u.events,u))}function w(){let T=b(),k=u.previous,L=u.currentConstruct,H=u.events.length,_=Array.from(l);return{from:H,restore:F};function F(){n=T,u.previous=k,u.currentConstruct=L,u.events.length=H,l=_,A()}}function A(){n.line in o&&n.column<2&&(n.column=o[n.line],n.offset+=o[n.line]-1)}}function $ye(e,t){let r=t.start._index,n=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex,i;if(r===o)i=[e[r].slice(n,a)];else{if(i=e.slice(r,o),n>-1){let l=i[0];typeof l=="string"?i[0]=l.slice(n):i.shift()}a>0&&i.push(e[o].slice(0,a))}return i}function Mye(e,t){let r=-1,n=[],o;for(;++r<e.length;){let a=e[r],i;if(typeof a=="string")i=a;else switch(a){case-5:{i="\r";break}case-4:{i=`
287
287
  `;break}case-3:{i=`\r
288
288
  `;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&o)continue;i=" ";break}default:i=String.fromCharCode(a)}o=a===-2,n.push(i)}return n.join("")}function ck(e){let n={constructs:sX([sk,...(e||{}).extensions||[]]),content:o(pX),defined:[],document:o(gX),flow:o(vX),lazy:{},string:o(SX),text:o(RX)};return n;function o(a){return i;function i(l){return NX(n,a,l)}}}function uk(e){for(;!l1(e););return e}var TX=/[\0\t\n\r]/g;function fk(){let e=1,t="",r=!0,n;return o;function o(a,i,l){let s=[],c,u,f,d,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(i||void 0).decode(a)),f=0,t="",r&&(a.charCodeAt(0)===65279&&f++,r=void 0);f<a.length;){if(TX.lastIndex=f,c=TX.exec(a),d=c&&c.index!==void 0?c.index:a.length,m=a.charCodeAt(d),!c){t=a.slice(f);break}if(m===10&&f===d&&n)s.push(-3),n=void 0;else switch(n&&(s.push(-5),n=void 0),f<d&&(s.push(a.slice(f,d)),e+=d-f),m){case 0:{s.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,s.push(-2);e++<u;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:n=!0,e=1}f=d+1}return l&&(n&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Iye=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function OX(e){return e.replace(Iye,Pye)}function Pye(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){let o=r.charCodeAt(1),a=o===120||o===88;return t1(r.slice(a?2:1),a?16:10)}return Hh(r)||e}var MX={}.hasOwnProperty;function dk(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),Aye(r)(uk(ck(r).document().write(fk()(e,t,!0))))}function Aye(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ae),autolinkProtocol:E,autolinkEmail:E,atxHeading:a(V),blockQuote:a(te),characterEscape:E,characterReference:E,codeFenced:a(de),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(de,i),codeText:a(q,i),codeTextData:E,data:E,codeFlowValue:E,definition:a(X),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(re),hardBreakEscape:a(G),hardBreakTrailing:a(G),htmlFlow:a(J,i),htmlFlowData:E,htmlText:a(J,i),htmlTextData:E,image:a(ee),label:i,link:a(ae),listItem:a(se),listItemValue:d,listOrdered:a(ue,f),listUnordered:a(ue),paragraph:a(Se),reference:I,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(V),strong:a(ye),thematicBreak:a(Ne)},exit:{atxHeading:s(),atxHeadingSequence:S,autolink:s(),autolinkEmail:ne,autolinkProtocol:Z,blockQuote:s(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:K,characterReference:Y,codeFenced:s(b),codeFencedFence:x,codeFencedFenceInfo:m,codeFencedFenceMeta:p,codeFlowValue:O,codeIndented:s(g),codeText:s(L),codeTextData:O,data:O,definition:s(),definitionDestinationString:v,definitionLabelString:h,definitionTitleString:y,emphasis:s(),hardBreakEscape:s(A),hardBreakTrailing:s(A),htmlFlow:s(T),htmlFlowData:O,htmlText:s(k),htmlTextData:O,image:s(_),label:z,labelText:F,lineEnding:w,link:s(H),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:j,resourceDestinationString:M,resourceTitleString:U,resource:B,setextHeading:s(N),setextHeadingLineSequence:C,setextHeadingText:R,strong:s(),thematicBreak:s()}};IX(t,(e||{}).mdastExtensions||[]);let r={};return n;function n(oe){let ce={type:"root",children:[]},be={stack:[ce],tokenStack:[],config:t,enter:l,exit:c,buffer:i,resume:u,data:r},me=[],xe=-1;for(;++xe<oe.length;)if(oe[xe][1].type==="listOrdered"||oe[xe][1].type==="listUnordered")if(oe[xe][0]==="enter")me.push(xe);else{let Ee=me.pop();xe=o(oe,Ee,xe)}for(xe=-1;++xe<oe.length;){let Ee=t[oe[xe][0]];MX.call(Ee,oe[xe][1].type)&&Ee[oe[xe][1].type].call(Object.assign({sliceSerialize:oe[xe][2].sliceSerialize},be),oe[xe][1])}if(be.tokenStack.length>0){let Ee=be.tokenStack[be.tokenStack.length-1];(Ee[1]||$X).call(be,void 0,Ee[0])}for(ce.position={start:hf(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:hf(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe<t.transforms.length;)ce=t.transforms[xe](ce)||ce;return ce}function o(oe,ce,be){let me=ce-1,xe=-1,Ee=!1,pe,Te,Oe,ge;for(;++me<=be;){let ve=oe[me];switch(ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ve[0]==="enter"?xe++:xe--,ge=void 0;break}case"lineEndingBlank":{ve[0]==="enter"&&(pe&&!ge&&!xe&&!Oe&&(Oe=me),ge=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ge=void 0}if(!xe&&ve[0]==="enter"&&ve[1].type==="listItemPrefix"||xe===-1&&ve[0]==="exit"&&(ve[1].type==="listUnordered"||ve[1].type==="listOrdered")){if(pe){let De=me;for(Te=void 0;De--;){let $e=oe[De];if($e[1].type==="lineEnding"||$e[1].type==="lineEndingBlank"){if($e[0]==="exit")continue;Te&&(oe[Te][1].type="lineEndingBlank",Ee=!0),$e[1].type="lineEnding",Te=De}else if(!($e[1].type==="linePrefix"||$e[1].type==="blockQuotePrefix"||$e[1].type==="blockQuotePrefixWhitespace"||$e[1].type==="blockQuoteMarker"||$e[1].type==="listItemIndent"))break}Oe&&(!Te||Oe<Te)&&(pe._spread=!0),pe.end=Object.assign({},Te?oe[Te][1].start:ve[1].end),oe.splice(Te||me,0,["exit",pe,ve[2]]),me++,be++}if(ve[1].type==="listItemPrefix"){let De={type:"listItem",_spread:!1,start:Object.assign({},ve[1].start),end:void 0};pe=De,oe.splice(me,0,["enter",De,ve[2]]),me++,be++,Oe=void 0,ge=!0}}}return oe[ce][1]._spread=Ee,be}function a(oe,ce){return be;function be(me){l.call(this,oe(me),me),ce&&ce.call(this,me)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(oe,ce,be){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ce,be||void 0]),oe.position={start:hf(ce.start),end:void 0}}function s(oe){return ce;function ce(be){oe&&oe.call(this,be),c.call(this,be)}}function c(oe,ce){let be=this.stack.pop(),me=this.tokenStack.pop();if(me)me[0].type!==oe.type&&(ce?ce.call(this,oe,me[0]):(me[1]||$X).call(this,oe,me[0]));else throw new Error("Cannot close `"+oe.type+"` ("+df({start:oe.start,end:oe.end})+"): it\u2019s not open");be.position.end=hf(oe.end)}function u(){return XD(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function d(oe){if(this.data.expectingFirstListItemValue){let ce=this.stack[this.stack.length-2];ce.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function m(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.lang=oe}function p(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.meta=oe}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=oe.replace(/(\r?\n|\r)$/g,"")}function h(oe){let ce=this.resume(),be=this.stack[this.stack.length-1];be.label=ce,be.identifier=Rc(this.sliceSerialize(oe)).toLowerCase()}function y(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.title=oe}function v(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.url=oe}function S(oe){let ce=this.stack[this.stack.length-1];if(!ce.depth){let be=this.sliceSerialize(oe).length;ce.depth=be}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function C(oe){let ce=this.stack[this.stack.length-1];ce.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function E(oe){let be=this.stack[this.stack.length-1].children,me=be[be.length-1];(!me||me.type!=="text")&&(me=Pe(),me.position={start:hf(oe.start),end:void 0},be.push(me)),this.stack.push(me)}function O(oe){let ce=this.stack.pop();ce.value+=this.sliceSerialize(oe),ce.position.end=hf(oe.end)}function w(oe){let ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){let be=ce.children[ce.children.length-1];be.position.end=hf(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ce.type)&&(E.call(this,oe),O.call(this,oe))}function A(){this.data.atHardBreak=!0}function T(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=oe}function k(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=oe}function L(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.value=oe}function H(){let oe=this.stack[this.stack.length-1];if(this.data.inReference){let ce=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ce,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function _(){let oe=this.stack[this.stack.length-1];if(this.data.inReference){let ce=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ce,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function F(oe){let ce=this.sliceSerialize(oe),be=this.stack[this.stack.length-2];be.label=OX(ce),be.identifier=Rc(ce).toLowerCase()}function z(){let oe=this.stack[this.stack.length-1],ce=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){let me=oe.children;be.children=me}else be.alt=ce}function M(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.url=oe}function U(){let oe=this.resume(),ce=this.stack[this.stack.length-1];ce.title=oe}function B(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function j(oe){let ce=this.resume(),be=this.stack[this.stack.length-1];be.label=ce,be.identifier=Rc(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function W(oe){this.data.characterReferenceType=oe.type}function K(oe){let ce=this.sliceSerialize(oe),be=this.data.characterReferenceType,me;be?(me=t1(ce,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):me=Hh(ce);let xe=this.stack[this.stack.length-1];xe.value+=me}function Y(oe){let ce=this.stack.pop();ce.position.end=hf(oe.end)}function Z(oe){O.call(this,oe);let ce=this.stack[this.stack.length-1];ce.url=this.sliceSerialize(oe)}function ne(oe){O.call(this,oe);let ce=this.stack[this.stack.length-1];ce.url="mailto:"+this.sliceSerialize(oe)}function te(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function q(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function re(){return{type:"emphasis",children:[]}}function V(){return{type:"heading",depth:0,children:[]}}function G(){return{type:"break"}}function J(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function ae(){return{type:"link",title:null,url:"",children:[]}}function ue(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function se(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function Se(){return{type:"paragraph",children:[]}}function ye(){return{type:"strong",children:[]}}function Pe(){return{type:"text",value:""}}function Ne(){return{type:"thematicBreak"}}}function hf(e){return{line:e.line,column:e.column,offset:e.offset}}function IX(e,t){let r=-1;for(;++r<t.length;){let n=t[r];Array.isArray(n)?IX(e,n):Dye(e,n)}}function Dye(e,t){let r;for(r in t)if(MX.call(t,r))switch(r){case"canContainEols":{let n=t[r];n&&e[r].push(...n);break}case"transforms":{let n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{let n=t[r];n&&Object.assign(e[r],n);break}}}function $X(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+df({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+df({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+df({start:t.start,end:t.end})+") is still open")}function d1(e){let t=this;t.parser=r;function r(n){return dk(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function PX(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function AX(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
289
289
  `}]}function DX(e,t){let r=t.value?t.value+`