You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Shixuns__Detail__Reposit...

38 lines
297 KiB

(self.webpackChunk=self.webpackChunk||[]).push([[7046],{65030:function(bn,ft,b){"use strict";b.d(ft,{Z:function(){return N}});var B=b(27247),q=b(11913),U=b(43079),ye=b(43403),P=b(92310),te=b.n(P),ae=b(29301),Qe=b(76846),ee=b(96452),h=b(6089),He=b(80402),E=b(34280),De=b(49658),T=b(59301),mt=b(32855),Et=b(77900),ct=b(8654);function Mt(g){var C=g.prefixCls,p=g.align,w=g.arrow,I=g.arrowPos,A=w||{},z=A.className,oe=A.content,$=I.x,de=$===void 0?0:$,ie=I.y,ne=ie===void 0?0:ie,pe=T.useRef();if(!p||!p.points)return null;var k={position:"absolute"};if(p.autoArrow!==!1){var ve=p.points[0],K=p.points[1],Ge=ve[0],ge=ve[1],Re=K[0],Le=K[1];Ge===Re||!["t","b"].includes(Ge)?k.top=ne:Ge==="t"?k.top=0:k.bottom=0,ge===Le||!["l","r"].includes(ge)?k.left=de:ge==="l"?k.left=0:k.right=0}return T.createElement("div",{ref:pe,className:te()("".concat(C,"-arrow"),z),style:k},oe)}function dt(g){var C=g.prefixCls,p=g.open,w=g.zIndex,I=g.mask,A=g.motion;return I?T.createElement(Et.default,(0,mt.Z)({},A,{motionAppear:!0,visible:p,removeOnLeave:!0}),function(z){var oe=z.className;return T.createElement("div",{style:{zIndex:w},className:te()("".concat(C,"-mask"),oe)})}):null}var he=T.memo(function(g){var C=g.children;return C},function(g,C){return C.cache}),F=he,yt=T.forwardRef(function(g,C){var p=g.popup,w=g.className,I=g.prefixCls,A=g.style,z=g.target,oe=g.onVisibleChanged,$=g.open,de=g.keepDom,ie=g.fresh,ne=g.onClick,pe=g.mask,k=g.arrow,ve=g.arrowPos,K=g.align,Ge=g.motion,ge=g.maskMotion,Re=g.forceRender,Le=g.getPopupContainer,gt=g.autoDestroy,Xe=g.portal,be=g.zIndex,qe=g.onMouseEnter,Qt=g.onMouseLeave,Er=g.onPointerEnter,$t=g.onPointerDownCapture,Mr=g.ready,et=g.offsetX,it=g.offsetY,kt=g.offsetR,Vt=g.offsetB,Dt=g.onAlign,Pt=g.onPrepare,$e=g.stretch,or=g.targetWidth,nr=g.targetHeight,pr=typeof p=="function"?p():p,tt=$||de,Ir=(Le==null?void 0:Le.length)>0,Br=T.useState(!Le||!Ir),Qr=(0,q.Z)(Br,2),Ur=Qr[0],Fr=Qr[1];if((0,E.Z)(function(){!Ur&&Ir&&z&&Fr(!0)},[Ur,Ir,z]),!Ur)return null;var sr="auto",mr={left:"-1000vw",top:"-1000vh",right:sr,bottom:sr};if(Mr||!$){var lr,_t=K.points,Xt=K.dynamicInset||((lr=K._experimental)===null||lr===void 0?void 0:lr.dynamicInset),yr=Xt&&_t[0][1]==="r",Rt=Xt&&_t[0][0]==="b";yr?(mr.right=kt,mr.left=sr):(mr.left=et,mr.right=sr),Rt?(mr.bottom=Vt,mr.top=sr):(mr.top=it,mr.bottom=sr)}var Y={};return $e&&($e.includes("height")&&nr?Y.height=nr:$e.includes("minHeight")&&nr&&(Y.minHeight=nr),$e.includes("width")&&or?Y.width=or:$e.includes("minWidth")&&or&&(Y.minWidth=or)),$||(Y.pointerEvents="none"),T.createElement(Xe,{open:Re||tt,getContainer:Le&&function(){return Le(z)},autoDestroy:gt},T.createElement(dt,{prefixCls:I,open:$,zIndex:be,mask:pe,motion:ge}),T.createElement(ae.Z,{onResize:Dt,disabled:!$},function(st){return T.createElement(Et.default,(0,mt.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Re,leavedClassName:"".concat(I,"-hidden")},Ge,{onAppearPrepare:Pt,onEnterPrepare:Pt,visible:$,onVisibleChanged:function(Sr){var d;Ge==null||(d=Ge.onVisibleChanged)===null||d===void 0||d.call(Ge,Sr),oe(Sr)}}),function(br,Sr){var d=br.className,v=br.style,H=te()(I,d,w);return T.createElement("div",{ref:(0,ct.sQ)(st,C,Sr),className:H,style:(0,B.Z)((0,B.Z)((0,B.Z)((0,B.Z)({"--arrow-x":"".concat(ve.x||0,"px"),"--arrow-y":"".concat(ve.y||0,"px")},mr),Y),v),{},{boxSizing:"border-box",zIndex:be},A),onMouseEnter:qe,onMouseLeave:Qt,onPointerEnter:Er,onClick:ne,onPointerDownCapture:$t},k&&T.createElement(Mt,{prefixCls:I,arrow:k,arrowPos:ve,align:K}),T.createElement(F,{cache:!$&&!ie},pr))})}))}),Be=yt,re=T.forwardRef(function(g,C){var p=g.children,w=g.getTriggerDOMNode,I=(0,ct.Yr)(p),A=T.useCallback(function(oe){(0,ct.mH)(C,w?w(oe):oe)},[w]),z=(0,ct.x1)(A,(0,ct.C4)(p));return I?T.cloneElement(p,{ref:z}):p}),bt=re,Ve=T.createContext(null),Q=Ve;function lt(g){return g?Array.isArray(g)?g:[g]:[]}function Lt(g,C,p,w){return T.useMemo(function(){var I=lt(p!=null?p:C),A=lt(w!=null?w:C),z=new Set(I),oe=new Set(A);return g&&(z.has("hover")&&(z.delete("hover"),z.add("click")),oe.has("hover")&&(oe.delete("hover"),oe.add("click"))),[z,oe]},[g,C,p,w])}var O=b(29194);function M(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],p=arguments.length>2?arguments[2]:void 0;return p?g[0]===C[0]:g[0]===C[0]&&g[1]===C[1]}function Z(g,C,p,w){for(var I=p.points,A=Object.keys(g),z=0;z<A.length;z+=1){var oe,$=A[z];if(M((oe=g[$])===null||oe===void 0?void 0:oe.points,I,w))return"".concat(C,"-placement-").concat($)}return""}function X(g,C,p,w){return C||(p?{motionName:"".concat(g,"-").concat(p)}:w?{motionName:w}:null)}function W(g){return g.ownerDocument.defaultView}function Ae(g){for(var C=[],p=g==null?void 0:g.parentElement,w=["hidden","scroll","clip","auto"];p;){var I=W(p).getComputedStyle(p),A=I.overflowX,z=I.overflowY,oe=I.overflow;[A,z,oe].some(function($){return w.includes($)})&&C.push(p),p=p.parentElement}return C}function L(g){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(g)?C:g}function se(g){return L(parseFloat(g),0)}function Ne(g,C){var p=(0,B.Z)({},g);return(C||[]).forEach(function(w){if(!(w instanceof HTMLBodyElement||w instanceof HTMLHtmlElement)){var I=W(w).getComputedStyle(w),A=I.overflow,z=I.overflowClipMargin,oe=I.borderTopWidth,$=I.borderBottomWidth,de=I.borderLeftWidth,ie=I.borderRightWidth,ne=w.getBoundingClientRect(),pe=w.offsetHeight,k=w.clientHeight,ve=w.offsetWidth,K=w.clientWidth,Ge=se(oe),ge=se($),Re=se(de),Le=se(ie),gt=L(Math.round(ne.width/ve*1e3)/1e3),Xe=L(Math.round(ne.height/pe*1e3)/1e3),be=(ve-K-Re-Le)*gt,qe=(pe-k-Ge-ge)*Xe,Qt=Ge*Xe,Er=ge*Xe,$t=Re*gt,Mr=Le*gt,et=0,it=0;if(A==="clip"){var kt=se(z);et=kt*gt,it=kt*Xe}var Vt=ne.x+$t-et,Dt=ne.y+Qt-it,Pt=Vt+ne.width+2*et-$t-Mr-be,$e=Dt+ne.height+2*it-Qt-Er-qe;p.left=Math.max(p.left,Vt),p.top=Math.max(p.top,Dt),p.right=Math.min(p.right,Pt),p.bottom=Math.min(p.bottom,$e)}}),p}function ue(g){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p="".concat(C),w=p.match(/^(.*)\%$/);return w?g*(parseFloat(w[1])/100):parseFloat(p)}function je(g,C){var p=C||[],w=(0,q.Z)(p,2),I=w[0],A=w[1];return[ue(g.width,I),ue(g.height,A)]}function _e(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[g[0],g[1]]}function Ee(g,C){var p=C[0],w=C[1],I,A;return p==="t"?A=g.y:p==="b"?A=g.y+g.height:A=g.y+g.height/2,w==="l"?I=g.x:w==="r"?I=g.x+g.width:I=g.x+g.width/2,{x:I,y:A}}function Ue(g,C){var p={t:"b",b:"t",l:"r",r:"l"};return g.map(function(w,I){return I===C?p[w]||"c":w}).join("")}function We(g,C,p,w,I,A,z){var oe=T.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:I[w]||{}}),$=(0,q.Z)(oe,2),de=$[0],ie=$[1],ne=T.useRef(0),pe=T.useMemo(function(){return C?Ae(C):[]},[C]),k=T.useRef({}),ve=function(){k.current={}};g||ve();var K=(0,h.Z)(function(){if(C&&p&&g){let gr=function(Vn,Ye){var ut=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fe,at=tt.x+Vn,vt=tt.y+Ye,rr=at+Rt,Dr=vt+yr,In=Math.max(at,ut.left),Te=Math.max(vt,ut.top),Je=Math.min(rr,ut.right),It=Math.min(Dr,ut.bottom);return Math.max(0,(Je-In)*(It-Te))},Gn=function(){Gr=tt.y+pt,Kr=Gr+yr,wr=tt.x+wt,ot=wr+Rt};var Re,Le,gt,Xe,be=C,qe=be.ownerDocument,Qt=W(be),Er=Qt.getComputedStyle(be),$t=Er.position,Mr=be.style.left,et=be.style.top,it=be.style.right,kt=be.style.bottom,Vt=be.style.overflow,Dt=(0,B.Z)((0,B.Z)({},I[w]),A),Pt=qe.createElement("div");(Re=be.parentElement)===null||Re===void 0||Re.appendChild(Pt),Pt.style.left="".concat(be.offsetLeft,"px"),Pt.style.top="".concat(be.offsetTop,"px"),Pt.style.position=$t,Pt.style.height="".concat(be.offsetHeight,"px"),Pt.style.width="".concat(be.offsetWidth,"px"),be.style.left="0",be.style.top="0",be.style.right="auto",be.style.bottom="auto",be.style.overflow="hidden";var $e;if(Array.isArray(p))$e={x:p[0],y:p[1],width:0,height:0};else{var or,nr,pr=p.getBoundingClientRect();pr.x=(or=pr.x)!==null&&or!==void 0?or:pr.left,pr.y=(nr=pr.y)!==null&&nr!==void 0?nr:pr.top,$e={x:pr.x,y:pr.y,width:pr.width,height:pr.height}}var tt=be.getBoundingClientRect(),Ir=Qt.getComputedStyle(be),Br=Ir.height,Qr=Ir.width;tt.x=(Le=tt.x)!==null&&Le!==void 0?Le:tt.left,tt.y=(gt=tt.y)!==null&&gt!==void 0?gt:tt.top;var Ur=qe.documentElement,Fr=Ur.clientWidth,sr=Ur.clientHeight,mr=Ur.scrollWidth,lr=Ur.scrollHeight,_t=Ur.scrollTop,Xt=Ur.scrollLeft,yr=tt.height,Rt=tt.width,Y=$e.height,st=$e.width,br={left:0,top:0,right:Fr,bottom:sr},Sr={left:-Xt,top:-_t,right:mr-Xt,bottom:lr-_t},d=Dt.htmlRegion,v="visible",H="visibleFirst";d!=="scroll"&&d!==H&&(d=v);var D=d===H,m=Ne(Sr,pe),x=Ne(br,pe),fe=d===v?x:m,ce=D?x:fe;be.style.left="auto",be.style.top="auto",be.style.right="0",be.style.bottom="0";var Pe=be.getBoundingClientRect();be.style.left=Mr,be.style.top=et,be.style.right=it,be.style.bottom=kt,be.style.overflow=Vt,(Xe=be.parentElement)===null||Xe===void 0||Xe.removeChild(Pt);var Ce=L(Math.round(Rt/parseFloat(Qr)*1e3)/1e3),ke=L(Math.round(yr/parseFloat(Br)*1e3)/1e3);if(Ce===0||ke===0||(0,Qe.Sh)(p)&&!(0,O.Z)(p))return;var J=Dt.offset,Me=Dt.targetOffset,_=je(tt,J),Ze=(0,q.Z)(_,2),Se=Ze[0],ze=Ze[1],Tt=je($e,Me),Ft=(0,q.Z)(Tt,2),Yt=Ft[0],zt=Ft[1];$e.x-=Yt,$e.y-=zt;var cr=Dt.points||[],Ct=(0,q.Z)(cr,2),dr=Ct[0],Wr=Ct[1],Ht=_e(Wr),Wt=_e(dr),Bt=Ee($e,Ht),vr=Ee(tt,Wt),Nt=(0,B.Z)({},Dt),wt=Bt.x-vr.x+Se,pt=Bt.y-vr.y+ze,Ut=gr(wt,pt),ur=gr(wt,pt,x),tr=Ee($e,["t","l"]),hr=Ee(tt,["t","l"]),jt=Ee($e,["b","r"]),Ot=Ee(tt,["b","r"]),Cr=Dt.overflow||{},_r=Cr.adjustX,jr=Cr.adjustY,fr=Cr.shiftX,en=Cr.shiftY,Lr=function(Ye){return typeof Ye=="boolean"?Ye:Ye>=0},Gr,Kr,wr,ot;Gn();var G=Lr(jr),j=Wt[0]===Ht[0];if(G&&Wt[0]==="t"&&(Kr>ce.bottom||k.current.bt)){var Oe=pt;j?Oe-=yr-Y:Oe=tr.y-Ot.y-ze;var me=gr(wt,Oe),nt=gr(wt,Oe,x);me>Ut||me===Ut&&(!D||nt>=ur)?(k.current.bt=!0,pt=Oe,ze=-ze,Nt.points=[Ue(Wt,0),Ue(Ht,0)]):k.current.bt=!1}if(G&&Wt[0]==="b"&&(Gr<ce.top||k.current.tb)){var Kt=pt;j?Kt+=yr-Y:Kt=jt.y-hr.y-ze;var Jt=gr(wt,Kt),qt=gr(wt,Kt,x);Jt>Ut||Jt===Ut&&(!D||qt>=ur)?(k.current.tb=!0,pt=Kt,ze=-ze,Nt.points=[Ue(Wt,0),Ue(Ht,0)]):k.current.tb=!1}var Rr=Lr(_r),Xr=Wt[1]===Ht[1];if(Rr&&Wt[1]==="l"&&(ot>ce.right||k.current.rl)){var Tr=wt;Xr?Tr-=Rt-st:Tr=tr.x-Ot.x-Se;var tn=gr(Tr,pt),Or=gr(Tr,pt,x);tn>Ut||tn===Ut&&(!D||Or>=ur)?(k.current.rl=!0,wt=Tr,Se=-Se,Nt.points=[Ue(Wt,1),Ue(Ht,1)]):k.current.rl=!1}if(Rr&&Wt[1]==="r"&&(wr<ce.left||k.current.lr)){var an=wt;Xr?an+=Rt-st:an=jt.x-hr.x-Se;var Pn=gr(an,pt),un=gr(an,pt,x);Pn>Ut||Pn===Ut&&(!D||un>=ur)?(k.current.lr=!0,wt=an,Se=-Se,Nt.points=[Ue(Wt,1),Ue(Ht,1)]):k.current.lr=!1}Gn();var Zr=fr===!0?0:fr;typeof Zr=="number"&&(wr<x.left&&(wt-=wr-x.left-Se,$e.x+st<x.left+Zr&&(wt+=$e.x-x.left+st-Zr)),ot>x.right&&(wt-=ot-x.right-Se,$e.x>x.right-Zr&&(wt+=$e.x-x.right+Zr)));var Yr=en===!0?0:en;typeof Yr=="number"&&(Gr<x.top&&(pt-=Gr-x.top-ze,$e.y+Y<x.top+Yr&&(pt+=$e.y-x.top+Y-Yr)),Kr>x.bottom&&(pt-=Kr-x.bottom-ze,$e.y>x.bottom-Yr&&(pt+=$e.y-x.bottom+Yr)));var Ar=tt.x+wt,on=Ar+Rt,Nn=tt.y+pt,Hn=Nn+yr,Sn=$e.x,vn=Sn+st,Qn=$e.y,xn=Qn+Y,ni=Math.max(Ar,Sn),$r=Math.min(on,vn),Bn=(ni+$r)/2,ui=Bn-Ar,ii=Math.max(Nn,Qn),di=Math.min(Hn,xn),Kn=(ii+di)/2,Hr=Kn-Nn;z==null||z(C,Nt);var fn=Pe.right-tt.x-(wt+tt.width),Un=Pe.bottom-tt.y-(pt+tt.height);Ce===1&&(wt=Math.round(wt),fn=Math.round(fn)),ke===1&&(pt=Math.round(pt),Un=Math.round(Un));var On={ready:!0,offsetX:wt/Ce,offsetY:pt/ke,offsetR:fn/Ce,offsetB:Un/ke,arrowX:ui/Ce,arrowY:Hr/ke,scaleX:Ce,scaleY:ke,align:Nt};ie(On)}}),Ge=function(){ne.current+=1;var Le=ne.current;Promise.resolve().then(function(){ne.current===Le&&K()})},ge=function(){ie(function(Le){return(0,B.Z)((0,B.Z)({},Le),{},{ready:!1})})};return(0,E.Z)(ge,[w]),(0,E.Z)(function(){g||ge()},[g]),[de.ready,de.offsetX,de.offsetY,de.offsetR,de.offsetB,de.arrowX,de.arrowY,de.scaleX,de.scaleY,de.align,Ge]}var At=b(3300);function xt(g,C,p,w,I){(0,E.Z)(function(){if(g&&C&&p){let ne=function(){w(),I()};var A=C,z=p,oe=Ae(A),$=Ae(z),de=W(z),ie=new Set([de].concat((0,At.Z)(oe),(0,At.Z)($)));return ie.forEach(function(pe){pe.addEventListener("scroll",ne,{passive:!0})}),de.addEventListener("resize",ne,{passive:!0}),w(),function(){ie.forEach(function(pe){pe.removeEventListener("scroll",ne),de.removeEventListener("resize",ne)})}}},[g,C,p])}var St=b(48736);function Ie(g,C,p,w,I,A,z,oe){var $=T.useRef(g);$.current=g;var de=T.useRef(!1);T.useEffect(function(){if(C&&w&&(!I||A)){var ne=function(){de.current=!1},pe=function(gt){var Xe;$.current&&!z(((Xe=gt.composedPath)===null||Xe===void 0||(Xe=Xe.call(gt))===null||Xe===void 0?void 0:Xe[0])||gt.target)&&!de.current&&oe(!1)},k=W(w);k.addEventListener("pointerdown",ne,!0),k.addEventListener("mousedown",pe,!0),k.addEventListener("contextmenu",pe,!0);var ve=(0,ee.A)(p);if(ve&&(ve.addEventListener("mousedown",pe,!0),ve.addEventListener("contextmenu",pe,!0)),0)var K,Ge,ge,Re;return function(){k.removeEventListener("pointerdown",ne,!0),k.removeEventListener("mousedown",pe,!0),k.removeEventListener("contextmenu",pe,!0),ve&&(ve.removeEventListener("mousedown",pe,!0),ve.removeEventListener("contextmenu",pe,!0))}}},[C,p,w,I,A]);function ie(){de.current=!0}return ie}var ar=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function er(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ye.Z,C=T.forwardRef(function(p,w){var I=p.prefixCls,A=I===void 0?"rc-trigger-popup":I,z=p.children,oe=p.action,$=oe===void 0?"hover":oe,de=p.showAction,ie=p.hideAction,ne=p.popupVisible,pe=p.defaultPopupVisible,k=p.onPopupVisibleChange,ve=p.afterPopupVisibleChange,K=p.mouseEnterDelay,Ge=p.mouseLeaveDelay,ge=Ge===void 0?.1:Ge,Re=p.focusDelay,Le=p.blurDelay,gt=p.mask,Xe=p.maskClosable,be=Xe===void 0?!0:Xe,qe=p.getPopupContainer,Qt=p.forceRender,Er=p.autoDestroy,$t=p.destroyPopupOnHide,Mr=p.popup,et=p.popupClassName,it=p.popupStyle,kt=p.popupPlacement,Vt=p.builtinPlacements,Dt=Vt===void 0?{}:Vt,Pt=p.popupAlign,$e=p.zIndex,or=p.stretch,nr=p.getPopupClassNameFromAlign,pr=p.fresh,tt=p.alignPoint,Ir=p.onPopupClick,Br=p.onPopupAlign,Qr=p.arrow,Ur=p.popupMotion,Fr=p.maskMotion,sr=p.popupTransitionName,mr=p.popupAnimation,lr=p.maskTransitionName,_t=p.maskAnimation,Xt=p.className,yr=p.getTriggerDOMNode,Rt=(0,U.Z)(p,ar),Y=Er||$t||!1,st=T.useState(!1),br=(0,q.Z)(st,2),Sr=br[0],d=br[1];(0,E.Z)(function(){d((0,De.Z)())},[]);var v=T.useRef({}),H=T.useContext(Q),D=T.useMemo(function(){return{registerSubPopup:function(Je,It){v.current[Je]=It,H==null||H.registerSubPopup(Je,It)}}},[H]),m=(0,He.Z)(),x=T.useState(null),fe=(0,q.Z)(x,2),ce=fe[0],Pe=fe[1],Ce=T.useRef(null),ke=(0,h.Z)(function(Te){Ce.current=Te,(0,Qe.Sh)(Te)&&ce!==Te&&Pe(Te),H==null||H.registerSubPopup(m,Te)}),J=T.useState(null),Me=(0,q.Z)(J,2),_=Me[0],Ze=Me[1],Se=T.useRef(null),ze=(0,h.Z)(function(Te){(0,Qe.Sh)(Te)&&_!==Te&&(Ze(Te),Se.current=Te)}),Tt=T.Children.only(z),Ft=(Tt==null?void 0:Tt.props)||{},Yt={},zt=(0,h.Z)(function(Te){var Je,It,Pr=_;return(Pr==null?void 0:Pr.contains(Te))||((Je=(0,ee.A)(Pr))===null||Je===void 0?void 0:Je.host)===Te||Te===Pr||(ce==null?void 0:ce.contains(Te))||((It=(0,ee.A)(ce))===null||It===void 0?void 0:It.host)===Te||Te===ce||Object.values(v.current).some(function(xr){return(xr==null?void 0:xr.contains(Te))||Te===xr})}),cr=X(A,Ur,mr,sr),Ct=X(A,Fr,_t,lr),dr=T.useState(pe||!1),Wr=(0,q.Z)(dr,2),Ht=Wr[0],Wt=Wr[1],Bt=ne!=null?ne:Ht,vr=(0,h.Z)(function(Te){ne===void 0&&Wt(Te)});(0,E.Z)(function(){Wt(ne||!1)},[ne]);var Nt=T.useRef(Bt);Nt.current=Bt;var wt=T.useRef([]);wt.current=[];var pt=(0,h.Z)(function(Te){var Je;vr(Te),((Je=wt.current[wt.current.length-1])!==null&&Je!==void 0?Je:Bt)!==Te&&(wt.current.push(Te),k==null||k(Te))}),Ut=T.useRef(),ur=function(){clearTimeout(Ut.current)},tr=function(Je){var It=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ur(),It===0?pt(Je):Ut.current=setTimeout(function(){pt(Je)},It*1e3)};T.useEffect(function(){return ur},[]);var hr=T.useState(!1),jt=(0,q.Z)(hr,2),Ot=jt[0],Cr=jt[1];(0,E.Z)(function(Te){(!Te||Bt)&&Cr(!0)},[Bt]);var _r=T.useState(null),jr=(0,q.Z)(_r,2),fr=jr[0],en=jr[1],Lr=T.useState(null),Gr=(0,q.Z)(Lr,2),Kr=Gr[0],wr=Gr[1],ot=function(Je){wr([Je.clientX,Je.clientY])},G=We(Bt,ce,tt&&Kr!==null?Kr:_,kt,Dt,Pt,Br),j=(0,q.Z)(G,11),Oe=j[0],me=j[1],nt=j[2],Kt=j[3],Jt=j[4],qt=j[5],Rr=j[6],Xr=j[7],Tr=j[8],tn=j[9],Or=j[10],an=Lt(Sr,$,de,ie),Pn=(0,q.Z)(an,2),un=Pn[0],Zr=Pn[1],Yr=un.has("click"),Ar=Zr.has("click")||Zr.has("contextMenu"),on=(0,h.Z)(function(){Ot||Or()}),Nn=function(){Nt.current&&tt&&Ar&&tr(!1)};xt(Bt,_,ce,on,Nn),(0,E.Z)(function(){on()},[Kr,kt]),(0,E.Z)(function(){Bt&&!(Dt!=null&&Dt[kt])&&on()},[JSON.stringify(Pt)]);var Hn=T.useMemo(function(){var Te=Z(Dt,A,tn,tt);return te()(Te,nr==null?void 0:nr(tn))},[tn,nr,Dt,A,tt]);T.useImperativeHandle(w,function(){return{nativeElement:Se.current,popupElement:Ce.current,forceAlign:on}});var Sn=T.useState(0),vn=(0,q.Z)(Sn,2),Qn=vn[0],xn=vn[1],ni=T.useState(0),$r=(0,q.Z)(ni,2),Bn=$r[0],ui=$r[1],ii=function(){if(or&&_){var Je=_.getBoundingClientRect();xn(Je.width),ui(Je.height)}},di=function(){ii(),on()},Kn=function(Je){Cr(!1),Or(),ve==null||ve(Je)},Hr=function(){return new Promise(function(Je){ii(),en(function(){return Je})})};(0,E.Z)(function(){fr&&(Or(),fr(),en(null))},[fr]);function fn(Te,Je,It,Pr){Yt[Te]=function(xr){var hn;Pr==null||Pr(xr),tr(Je,It);for(var _n=arguments.length,ei=new Array(_n>1?_n-1:0),Rn=1;Rn<_n;Rn++)ei[Rn-1]=arguments[Rn];(hn=Ft[Te])===null||hn===void 0||hn.call.apply(hn,[Ft,xr].concat(ei))}}(Yr||Ar)&&(Yt.onClick=function(Te){var Je;Nt.current&&Ar?tr(!1):!Nt.current&&Yr&&(ot(Te),tr(!0));for(var It=arguments.length,Pr=new Array(It>1?It-1:0),xr=1;xr<It;xr++)Pr[xr-1]=arguments[xr];(Je=Ft.onClick)===null||Je===void 0||Je.call.apply(Je,[Ft,Te].concat(Pr))});var Un=Ie(Bt,Ar,_,ce,gt,be,zt,tr),On=un.has("hover"),gr=Zr.has("hover"),Gn,Vn;On&&(fn("onMouseEnter",!0,K,function(Te){ot(Te)}),fn("onPointerEnter",!0,K,function(Te){ot(Te)}),Gn=function(Je){(Bt||Ot)&&ce!==null&&ce!==void 0&&ce.contains(Je.target)&&tr(!0,K)},tt&&(Yt.onMouseMove=function(Te){var Je;(Je=Ft.onMouseMove)===null||Je===void 0||Je.call(Ft,Te)})),gr&&(fn("onMouseLeave",!1,ge),fn("onPointerLeave",!1,ge),Vn=function(){tr(!1,ge)}),un.has("focus")&&fn("onFocus",!0,Re),Zr.has("focus")&&fn("onBlur",!1,Le),un.has("contextMenu")&&(Yt.onContextMenu=function(Te){var Je;Nt.current&&Zr.has("contextMenu")?tr(!1):(ot(Te),tr(!0)),Te.preventDefault();for(var It=arguments.length,Pr=new Array(It>1?It-1:0),xr=1;xr<It;xr++)Pr[xr-1]=arguments[xr];(Je=Ft.onContextMenu)===null||Je===void 0||Je.call.apply(Je,[Ft,Te].concat(Pr))}),Xt&&(Yt.className=te()(Ft.className,Xt));var Ye=T.useRef(!1);Ye.current||(Ye.current=Qt||Bt||Ot);var ut=(0,B.Z)((0,B.Z)({},Ft),Yt),at={},vt=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];vt.forEach(function(Te){Rt[Te]&&(at[Te]=function(){for(var Je,It=arguments.length,Pr=new Array(It),xr=0;xr<It;xr++)Pr[xr]=arguments[xr];(Je=ut[Te])===null||Je===void 0||Je.call.apply(Je,[ut].concat(Pr)),Rt[Te].apply(Rt,Pr)})});var rr=T.cloneElement(Tt,(0,B.Z)((0,B.Z)({},ut),at)),Dr={x:qt,y:Rr},In=Qr?(0,B.Z)({},Qr!==!0?Qr:{}):null;return T.createElement(T.Fragment,null,T.createElement(ae.Z,{disabled:!Bt,ref:ze,onResize:di},T.createElement(bt,{getTriggerDOMNode:yr},rr)),Ye.current&&T.createElement(Q.Provider,{value:D},T.createElement(Be,{portal:g,ref:ke,prefixCls:A,popup:Mr,className:te()(et,Hn),style:it,target:_,onMouseEnter:Gn,onMouseLeave:Vn,onPointerEnter:Gn,zIndex:$e,open:Bt,keepDom:Ot,fresh:pr,onClick:Ir,onPointerDownCapture:Un,mask:gt,motion:cr,maskMotion:Ct,onVisibleChanged:Kn,onPrepare:Hr,forceRender:Qt,autoDestroy:Y,getPopupContainer:qe,align:tn,arrow:In,arrowPos:Dr,ready:Oe,offsetX:me,offsetY:nt,offsetR:Kt,offsetB:Jt,onAlign:on,stretch:or,targetWidth:Qn/Xr,targetHeight:Bn/Tr})))});return C}var N=er(ye.Z)},66543:function(){"use strict"},59598:function(){"use strict"},84236:function(bn,ft,b){"use strict";b.d(ft,{t:function(){return E}});var B=b(59301),q=b(99571),U={buttonFixed:"buttonFixed___vyq30",button:"button___hxmYv",buttonWrap:"buttonWrap___uK8dl"},ye=b(92310),P=b.n(ye),te=Object.defineProperty,ae=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,h=(De,T,mt)=>T in De?te(De,T,{enumerable:!0,configurable:!0,writable:!0,value:mt}):De[T]=mt,He=(De,T)=>{for(var mt in T||(T={}))Qe.call(T,mt)&&h(De,mt,T[mt]);if(ae)for(var mt of ae(T))ee.call(T,mt)&&h(De,mt,T[mt]);return De};const E=({cancelText:De="\u53D6\u6D88",okText:T="\u786E\u5B9A",loading:mt=!1,hasOkBtn:Et=!0,hasCancelBtn:ct=!0,okButtonProps:Mt={},onCancel:dt=()=>{},onOk:he=()=>{},className:F=""})=>B.createElement("div",{className:P()(U.buttonFixed,F)},B.createElement("div",{className:U.buttonWrap},ct&&B.createElement(q.ZP,{size:"middle",className:`${U.button} mr20`,onClick:dt},De),Et&&B.createElement(q.ZP,He({size:"middle",type:"primary",className:`${U.button} mr20`,loading:mt,onClick:he},Mt),T)))},44905:function(bn,ft,b){"use strict";b.d(ft,{h:function(){return F}});var B=b(59301),q=b(82326),U=b(28284),ye=b(99571),P=b(89780),te=b.n(P),ae=b(66543),Qe=b(59598),ee=Object.defineProperty,h=Object.defineProperties,He=Object.getOwnPropertyDescriptors,E=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,mt=(yt,Be,re)=>Be in yt?ee(yt,Be,{enumerable:!0,configurable:!0,writable:!0,value:re}):yt[Be]=re,Et=(yt,Be)=>{for(var re in Be||(Be={}))De.call(Be,re)&&mt(yt,re,Be[re]);if(E)for(var re of E(Be))T.call(Be,re)&&mt(yt,re,Be[re]);return yt},ct=(yt,Be)=>h(yt,He(Be));const Mt=q.default.Option,dt={labelCol:{span:4},wrapperCol:{span:20}},he={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};ft.Z=({callback:yt,onCancel:Be})=>{const[re,bt]=(0,B.useState)("python");function Ve(lt){bt(he[lt][1])}function Q(lt){yt(lt)}return B.createElement(U.default,ct(Et({},dt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Q,style:{width:500}}),B.createElement(U.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},B.createElement(q.default,{getPopupContainer:lt=>lt.parentNode,onChange:Ve},Object.keys(he).map(lt=>B.createElement(Mt,{key:lt,value:lt},he[lt][0])))),B.createElement(U.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},B.createElement(F,{mode:re})),B.createElement("div",{className:"flex-container flex-end"},B.createElement(ye.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),B.createElement(ye.ZP,{type:"ghost",onClick:Be},"\u53D6\u6D88")))};function F({value:yt,onChange:Be,mode:re,options:bt={}}){const Ve=(0,B.useRef)(),[Q,lt]=(0,B.useState)();return(0,B.useEffect)(()=>{if(Q){let Lt=function(O){const M=O.getValue();Be&&Be(M)};return Q.on("change",Lt),()=>{Q.off("change",Lt)}}},[Q,Be]),(0,B.useEffect)(()=>{Q&&Q.setOption("mode",re)},[Q,re]),(0,B.useEffect)(()=>{Q&&(yt!==Q.getValue()||yt==="")&&setTimeout(()=>{Q.setValue(yt||"")},300)},[Q,yt]),(0,B.useEffect)(()=>{if(Ve.current&&!Q){const Lt=te().fromTextArea(Ve.current,Et({mode:re,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},bt));lt(Lt)}},[Ve.current,Q]),B.createElement("div",{className:"my-codemirror-container"},B.createElement("textarea",{ref:Ve}))}},61026:function(bn,ft,b){"use strict";b.r(ft),b.d(ft,{default:function(){return ct}});var B=b(59301),q=b(76560),U=b(28284),ye=b(37568),P=b(44905),te=b(84236),ae={bg:"bg___YV4bB",wrap:"wrap___kzW1f",title:"title___qum64",path:"path___G15kO",colorBlue:"colorBlue___LDjoN",width240:"width240___QOLSj"},Qe=Object.defineProperty,ee=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,E=(Mt,dt,he)=>dt in Mt?Qe(Mt,dt,{enumerable:!0,configurable:!0,writable:!0,value:he}):Mt[dt]=he,De=(Mt,dt)=>{for(var he in dt||(dt={}))h.call(dt,he)&&E(Mt,he,dt[he]);if(ee)for(var he of ee(dt))He.call(dt,he)&&E(Mt,he,dt[he]);return Mt},T=(Mt,dt)=>{var he={};for(var F in Mt)h.call(Mt,F)&&dt.indexOf(F)<0&&(he[F]=Mt[F]);if(Mt!=null&&ee)for(var F of ee(Mt))dt.indexOf(F)<0&&He.call(Mt,F)&&(he[F]=Mt[F]);return he},mt=(Mt,dt,he)=>new Promise((F,yt)=>{var Be=Ve=>{try{bt(he.next(Ve))}catch(Q){yt(Q)}},re=Ve=>{try{bt(he.throw(Ve))}catch(Q){yt(Q)}},bt=Ve=>Ve.done?F(Ve.value):Promise.resolve(Ve.value).then(Be,re);bt((he=he.apply(Mt,dt)).next())});const Et=Mt=>{var dt=Mt,{shixunsDetail:he,globalSetting:F,loading:yt,user:Be,dispatch:re}=dt,bt=T(dt,["shixunsDetail","globalSetting","loading","user","dispatch"]);const Ve=(0,q.useLocation)(),[Q,lt]=(0,B.useState)({}),Lt=(0,B.useRef)(),O=(0,B.useRef)(),[M]=U.default.useForm(),[Z,X]=(0,B.useState)("");(0,B.useEffect)(()=>(re({type:"globalSetting/footerToggle",payload:!1}),()=>{re({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,B.useEffect)(()=>{const L=sessionStorage.getItem("pathArray");if(L){const se=L.split(",").join("/"),Ne=se.indexOf("/")===0?se.substr(1):se;X(Ne)}},[]),(0,B.useEffect)(()=>{var L,se,Ne,ue;O.current=(se=(L=Ve.pathname)==null?void 0:L.split("/"))==null?void 0:se[2],Lt.current=((ue=(Ne=Ve.pathname)==null?void 0:Ne.split("/"))==null?void 0:ue[3])==="repository"},[]);const W=(...L)=>mt(void 0,[...L],function*(se={}){if(yield re({type:"shixunsDetail/addRepositoryFile",payload:{id:O.current,message:se.commitMessage,content:se.codeMirror,path:`${Z?`${Z}/`:""}${se.path||""}`,secret_repository:Lt.current?void 0:!0}})){const ue=Lt.current?`/shixuns/${O.current}/repository${Z?`/master/shixun_show/${Z}`:""}`:`/shixuns/${O.current}/secret_repository`;q.history.replace(ue)}}),Ae=()=>{var L,se;q.history.push(`/shixuns/${O.current}/${(se=(L=Ve.pathname)==null?void 0:L.split("/"))==null?void 0:se[3]}${Z?`/master/shixun_show/${Z}`:""}`)};return B.createElement("section",{className:ae.bg},B.createElement("div",{className:ae.wrap},B.createElement("div",{className:ae.title},"\u65B0\u5EFA\u6587\u4EF6"),B.createElement(U.default,{className:"mt10",form:M,scrollToFirstError:!0,layout:"vertical",onFinish:W,onValuesChange:()=>lt(De({},M.getFieldsValue()))},B.createElement(U.default.Item,{label:"\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84\uFF1A"},B.createElement(U.default.Item,{name:"path",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}],noStyle:!0},B.createElement("span",null,B.createElement("span",{className:"mr5"},Z?`${Z}/`:""),B.createElement(ye.default,{className:ae.width240,placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"}))),B.createElement("span",{className:"ml5"},"\u63D0\u793A\uFF1A1.\u8F93\u5165\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u4E00\u4E2A\u65B0\u6587\u4EF6\uFF1B2.\u8F93\u5165\u65B0\u6587\u4EF6\u5939\u540D/\u65B0\u6587\u4EF6\u540D\u53EF\u4EE5\u521B\u5EFA\u65B0\u6587\u4EF6\u5939\u548C\u65B0\u6587\u4EF6\u3002\uFF08\u5982\uFF1Astep1/HelloWorld.java\uFF09")),B.createElement(U.default.Item,{label:"\u63D0\u4EA4\u4FE1\u606F\uFF1A",name:"commitMessage",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63D0\u4EA4\u4FE1\u606F"},{whitespace:!0,message:"\u8BF7\u52FF\u8F93\u5165\u7A7A\u683C"}]},B.createElement(ye.default,{placeholder:"\u8BF7\u8F93\u5165\u672C\u6B21\u63D0\u4EA4\u7684\u4E3B\u8981\u4FE1\u606F\uFF0C\u5408\u7406\u7684\u63CF\u8FF0\u4FE1\u606F\u6709\u5229\u4E8E\u4EE3\u7801\u5386\u53F2\u8BB0\u5F55\u7684\u7BA1\u7406"})),B.createElement("div",{className:"mt10 mb20"},B.createElement(U.default.Item,{name:"codeMirror",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5185\u5BB9"}]},B.createElement(P.h,{options:{modal:"javascript",lineNumbers:!0,theme:"railscasts",indentUnit:4,matchBrackets:!0,autoRefresh:!0,smartIndent:!0,extraKeys:{"Alt-/":"autocomplete"},autofocus:!0,styleActiveLine:!0,lint:!0,linkurl:"",gutters:["CodeMirror-linenumbers","breakpoints","CodeMirror-lint-markers"]}}))),B.createElement(U.default.Item,{noStyle:!0},B.createElement(te.t,{okButtonProps:{htmlType:"submit"},onCancel:Ae})))))};var ct=(0,q.connect)(({shixunsDetail:Mt,loading:dt,globalSetting:he,user:F})=>({shixunsDetail:Mt,globalSetting:he,user:F,loading:dt.models.index}))(Et)},89780:function(bn){(function(ft,b){bn.exports=b()})(this,function(){"use strict";var ft=navigator.userAgent,b=navigator.platform,B=/gecko\/\d/i.test(ft),q=/MSIE \d/.test(ft),U=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ft),ye=/Edge\/(\d+)/.exec(ft),P=q||U||ye,te=P&&(q?document.documentMode||6:+(ye||U)[1]),ae=!ye&&/WebKit\//.test(ft),Qe=ae&&/Qt\/\d+\.\d+/.test(ft),ee=!ye&&/Chrome\//.test(ft),h=/Opera\//.test(ft),He=/Apple Computer/.test(navigator.vendor),E=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ft),De=/PhantomJS/.test(ft),T=!ye&&/AppleWebKit/.test(ft)&&/Mobile\/\w+/.test(ft),mt=/Android/.test(ft),Et=T||mt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ft),ct=T||/Mac/.test(b),Mt=/\bCrOS\b/.test(ft),dt=/win/i.test(b),he=h&&ft.match(/Version\/(\d*\.\d*)/);he&&(he=Number(he[1])),he&&he>=15&&(h=!1,ae=!0);var F=ct&&(Qe||h&&(he==null||he<12.11)),yt=B||P&&te>=9;function Be(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var re=function(e,t){var n=e.className,r=Be(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function bt(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Ve(e,t){return bt(e).appendChild(t)}function Q(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function lt(e,t,n,r){var i=Q(e,t,n,r);return i.setAttribute("role","presentation"),i}var Lt;document.createRange?Lt=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:Lt=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function O(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function M(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function Z(e,t){var n=e.className;Be(t).test(n)||(e.className+=(n?" ":"")+t)}function X(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Be(n[r]).test(t)&&(t+=" "+n[r]);return t}var W=function(e){e.select()};T?W=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:P&&(W=function(e){try{e.select()}catch(t){}});function Ae(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function L(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function se(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=i||0;;){var l=e.indexOf(" ",a);if(l<0||l>=t)return o+(t-a);o+=l-a,o+=n-o%n,a=l+1}}var Ne=function(){this.id=null,this.f=null,this.time=0,this.handler=Ae(this.onTimeout,this)};Ne.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ne.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function ue(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var je=50,_e={toString:function(){return"CodeMirror.Pass"}},Ee={scroll:!1},Ue={origin:"*mouse"},We={origin:"+move"};function At(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(" ",r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var xt=[""];function St(e){for(;xt.length<=e;)xt.push(Ie(xt)+" ");return xt[e]}function Ie(e){return e[e.length-1]}function ar(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function er(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function N(){}function g(e,t){var n;return Object.create?n=Object.create(e):(N.prototype=e,n=new N),t&&L(t,n),n}var C=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function p(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||C.test(e))}function w(e,t){return t?t.source.indexOf("\\w")>-1&&p(e)?!0:t.test(e):p(e)}function I(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var A=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function z(e){return e.charCodeAt(0)>=768&&A.test(e)}function oe(e,t,n){for(;(n<0?t>0:t<e.length)&&z(e.charAt(t));)t+=n;return t}function $(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function de(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?"rtl":"ltr",a),i=!0)}i||r(t,n,"ltr")}var ie=null;function ne(e,t,n){var r;ie=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n=="before"?r=i:ie=i),a.from==t&&(a.from!=a.to&&n!="before"?r=i:ie=i)}return r!=null?r:ie}var pe=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,o=/[Lb1n]/,l=/[1n]/;function s(u,f,c){this.level=u,this.from=f,this.to=c}return function(u,f){var c=f=="ltr"?"L":"R";if(u.length==0||f=="ltr"&&!r.test(u))return!1;for(var S=u.length,y=[],R=0;R<S;++R)y.push(n(u.charCodeAt(R)));for(var V=0,le=c;V<S;++V){var we=y[V];we=="m"?y[V]=le:le=we}for(var Fe=0,xe=c;Fe<S;++Fe){var Ke=y[Fe];Ke=="1"&&xe=="r"?y[Fe]="n":a.test(Ke)&&(xe=Ke,Ke=="r"&&(y[Fe]="R"))}for(var ht=1,rt=y[0];ht<S-1;++ht){var Gt=y[ht];Gt=="+"&&rt=="1"&&y[ht+1]=="1"?y[ht]="1":Gt==","&&rt==y[ht+1]&&(rt=="1"||rt=="n")&&(y[ht]=rt),rt=Gt}for(var zr=0;zr<S;++zr){var mn=y[zr];if(mn==",")y[zr]="N";else if(mn=="%"){var Jr=void 0;for(Jr=zr+1;Jr<S&&y[Jr]=="%";++Jr);for(var Jn=zr&&y[zr-1]=="!"||Jr<S&&y[Jr]=="1"?"1":"N",Fn=zr;Fn<Jr;++Fn)y[Fn]=Jn;zr=Jr-1}}for(var ln=0,Wn=c;ln<S;++ln){var wn=y[ln];Wn=="L"&&wn=="1"?y[ln]="L":a.test(wn)&&(Wn=wn)}for(var dn=0;dn<S;++dn)if(i.test(y[dn])){var sn=void 0;for(sn=dn+1;sn<S&&i.test(y[sn]);++sn);for(var qr=(dn?y[dn-1]:c)=="L",zn=(sn<S?y[sn]:c)=="L",Ji=qr==zn?qr?"L":"R":c,Mi=dn;Mi<sn;++Mi)y[Mi]=Ji;dn=sn-1}for(var Ln=[],ci,yn=0;yn<S;)if(o.test(y[yn])){var Mo=yn;for(++yn;yn<S&&o.test(y[yn]);++yn);Ln.push(new s(0,Mo,yn))}else{var gi=yn,Ii=Ln.length,Ai=f=="rtl"?1:0;for(++yn;yn<S&&y[yn]!="L";++yn);for(var Dn=gi;Dn<yn;)if(l.test(y[Dn])){gi<Dn&&(Ln.splice(Ii,0,new s(1,gi,Dn)),Ii+=Ai);var Qi=Dn;for(++Dn;Dn<yn&&l.test(y[Dn]);++Dn);Ln.splice(Ii,0,new s(2,Qi,Dn)),Ii+=Ai,gi=Dn}else++Dn;gi<yn&&Ln.splice(Ii,0,new s(1,gi,yn))}return f=="ltr"&&(Ln[0].level==1&&(ci=u.match(/^\s+/))&&(Ln[0].from=ci[0].length,Ln.unshift(new s(0,0,ci[0].length))),Ie(Ln).level==1&&(ci=u.match(/\s+$/))&&(Ie(Ln).to-=ci[0].length,Ln.push(new s(0,S-ci[0].length,S)))),f=="rtl"?Ln.reverse():Ln}}();function k(e,t){var n=e.order;return n==null&&(n=e.order=pe(e.text,t)),n}var ve=[],K=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ve).concat(n)}};function Ge(e,t){return e._handlers&&e._handlers[t]||ve}function ge(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=ue(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Re(e,t){var n=Ge(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Le(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Re(e,n||t.type,e,t),Er(t)||t.codemirrorIgnore}function gt(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ue(n,t[r])==-1&&n.push(t[r])}function Xe(e,t){return Ge(e,t).length>0}function be(e){e.prototype.on=function(t,n){K(this,t,n)},e.prototype.off=function(t,n){ge(this,t,n)}}function qe(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Qt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Er(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function $t(e){qe(e),Qt(e)}function Mr(e){return e.target||e.srcElement}function et(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ct&&e.ctrlKey&&t==1&&(t=3),t}var it=function(){if(P&&te<9)return!1;var e=Q("div");return"draggable"in e||"dragDrop"in e}(),kt;function Vt(e){if(kt==null){var t=Q("span","\u200B");Ve(e,Q("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(kt=t.offsetWidth<=1&&t.offsetHeight>2&&!(P&&te<8))}var n=kt?Q("span","\u200B"):Q("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Dt;function Pt(e){if(Dt!=null)return Dt;var t=Ve(e,document.createTextNode("A\u062EA")),n=Lt(t,0,1).getBoundingClientRect(),r=Lt(t,1,2).getBoundingClientRect();return bt(e),!n||n.left==n.right?!1:Dt=r.right-n.right<3}var $e=`
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=a.indexOf("\r");o!=-1?(n.push(a.slice(0,o)),t+=o+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},or=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},nr=function(){var e=Q("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),pr=null;function tt(e){if(pr!=null)return pr;var t=Ve(e,Q("span","x")),n=t.getBoundingClientRect(),r=Lt(t,0,1).getBoundingClientRect();return pr=Math.abs(n.left-r.left)>1}var Ir={},Br={};function Qr(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ir[e]=t}function Ur(e,t){Br[e]=t}function Fr(e){if(typeof e=="string"&&Br.hasOwnProperty(e))e=Br[e];else if(e&&typeof e.name=="string"&&Br.hasOwnProperty(e.name)){var t=Br[e.name];typeof t=="string"&&(t={name:t}),e=g(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Fr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Fr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function sr(e,t){t=Fr(t);var n=Ir[t.name];if(!n)return sr(e,"text/plain");var r=n(e,t);if(mr.hasOwnProperty(t.name)){var i=mr[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var mr={};function lr(e,t){var n=mr.hasOwnProperty(e)?mr[e]:mr[e]={};L(t,n)}function _t(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Xt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function yr(e,t,n){return e.startState?e.startState(t,n):!0}var Rt=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Rt.prototype.eol=function(){return this.pos>=this.string.length},Rt.prototype.sol=function(){return this.pos==this.lineStart},Rt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Rt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Rt.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Rt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Rt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Rt.prototype.skipToEnd=function(){this.pos=this.string.length},Rt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Rt.prototype.backUp=function(e){this.pos-=e},Rt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=se(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?se(this.string,this.lineStart,this.tabSize):0)},Rt.prototype.indentation=function(){return se(this.string,null,this.tabSize)-(this.lineStart?se(this.string,this.lineStart,this.tabSize):0)},Rt.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(o){return n?o.toLowerCase():o},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},Rt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Rt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Rt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Rt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Y(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function st(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(a){var o=a.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function br(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Sr(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function d(e){if(e.parent==null)return null;for(var t=e.parent,n=ue(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function v(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue e}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var l=e.lines[o],s=l.height;if(t<s)break;t-=s}return n+o}function H(e,t){return t>=e.first&&t<e.first+e.size}function D(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function m(e,t,n){if(n===void 0&&(n=null),!(this instanceof m))return new m(e,t,n);this.line=e,this.ch=t,this.sticky=n}function x(e,t){return e.line-t.line||e.ch-t.ch}function fe(e,t){return e.sticky==t.sticky&&x(e,t)==0}function ce(e){return m(e.line,e.ch)}function Pe(e,t){return x(e,t)<0?t:e}function Ce(e,t){return x(e,t)<0?e:t}function ke(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function J(e,t){if(t.line<e.first)return m(e.first,0);var n=e.first+e.size-1;return t.line>n?m(n,Y(e,n).text.length):Me(t,Y(e,t.line).text.length)}function Me(e,t){var n=e.ch;return n==null||n>t?m(e.line,t):n<0?m(e.line,0):e}function _(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=J(e,t[r]);return n}var Ze=function(e,t){this.state=e,this.lookAhead=t},Se=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Se.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Se.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Se.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Se.fromSaved=function(e,t,n){return t instanceof Ze?new Se(e,_t(e.mode,t.state),n,t.lookAhead):new Se(e,_t(e.mode,t),n)},Se.prototype.save=function(e){var t=e!==!1?_t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ze(t,this.maxLookAhead):t};function ze(e,t,n,r){var i=[e.state.modeGen],a={};Ht(e,t.text,e.doc.mode,n,function(u,f){return i.push(u,f)},a,r);for(var o=n.state,l=function(u){n.baseTokens=i;var f=e.state.overlays[u],c=1,S=0;n.state=!0,Ht(e,t.text,f.mode,n,function(y,R){for(var V=c;S<y;){var le=i[c];le>y&&i.splice(c,1,y,i[c+1],le),c+=2,S=Math.min(y,le)}if(R)if(f.opaque)i.splice(V,c-V,y,"overlay "+R),c=V+2;else for(;V<c;V+=2){var we=i[V+1];i[V+1]=(we?we+" ":"")+"overlay "+R}},a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Tt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ft(e,d(t)),i=t.text.length>e.options.maxHighlightLength&&_t(e.doc.mode,r.state),a=ze(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ft(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Se(r,!0,t);var a=Wt(e,t,n),o=a>r.first&&Y(r,a-1).stateAfter,l=o?Se.fromSaved(r,o,a):new Se(r,yr(r.mode),a);return r.iter(a,t,function(s){Yt(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function Yt(e,t,n,r){var i=e.doc.mode,a=new Rt(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==""&&zt(i,n.state);!a.eol();)cr(i,a,n.state),a.start=a.pos}function zt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Xt(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function cr(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Xt(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ct=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function dr(e,t,n,r){var i=e.doc,a=i.mode,o;t=J(i,t);var l=Y(i,t.line),s=Ft(e,t.line,n),u=new Rt(l.text,e.options.tabSize,s),f;for(r&&(f=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=cr(a,u,s.state),r&&f.push(new Ct(u,o,_t(i.mode,s.state)));return r?f:new Ct(u,o,s.state)}function Wr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Ht(e,t,n,r,i,a,o){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,f=new Rt(t,e.options.tabSize,r),c,S=e.options.addModeClass&&[null];for(t==""&&Wr(zt(n,r.state),a);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,o&&Yt(e,t,r,f.pos),f.pos=t.length,c=null):c=Wr(cr(n,f,r.state,S),a),S){var y=S[0].name;y&&(c="m-"+(c?y+" "+c:y))}if(!l||u!=c){for(;s<f.start;)s=Math.min(f.start,s+5e3),i(s,u);u=c}f.start=f.pos}for(;s<f.pos;){var R=Math.min(f.pos,s+5e3);i(R,u),s=R}}function Wt(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>o;--l){if(l<=a.first)return a.first;var s=Y(a,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof Ze?u.lookAhead:0)<=a.modeFrontier))return l;var f=se(s.text,null,e.options.tabSize);(i==null||r>f)&&(i=l-1,r=f)}return i}function Bt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Y(e,r).stateAfter;if(i&&(!(i instanceof Ze)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var vr=!1,Nt=!1;function wt(){vr=!0}function pt(){Nt=!0}function Ut(e,t,n){this.marker=e,this.from=t,this.to=n}function ur(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function tr(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function hr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function jt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,l=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);if(l||a.from==t&&o.type=="bookmark"&&(!n||!a.marker.insertLeft)){var s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(r||(r=[])).push(new Ut(o,a.from,s?null:a.to))}}return r}function Ot(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,l=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);if(l||a.from==t&&o.type=="bookmark"&&(!n||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(r||(r=[])).push(new Ut(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function Cr(e,t){if(t.full)return null;var n=H(e,t.from.line)&&Y(e,t.from.line).markedSpans,r=H(e,t.to.line)&&Y(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=x(t.from,t.to)==0,l=jt(n,i,o),s=Ot(r,a,o),u=t.text.length==1,f=Ie(t.text).length+(u?i:0);if(l)for(var c=0;c<l.length;++c){var S=l[c];if(S.to==null){var y=ur(s,S.marker);y?u&&(S.to=y.to==null?null:y.to+f):S.to=i}}if(s)for(var R=0;R<s.length;++R){var V=s[R];if(V.to!=null&&(V.to+=f),V.from==null){var le=ur(l,V.marker);le||(V.from=f,u&&(l||(l=[])).push(V))}else V.from+=f,u&&(l||(l=[])).push(V)}l&&(l=_r(l)),s&&s!=l&&(s=_r(s));var we=[l];if(!u){var Fe=t.text.length-2,xe;if(Fe>0&&l)for(var Ke=0;Ke<l.length;++Ke)l[Ke].to==null&&(xe||(xe=[])).push(new Ut(l[Ke].marker,null,null));for(var ht=0;ht<Fe;++ht)we.push(xe);we.push(s)}return we}function _r(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function jr(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(y){if(y.markedSpans)for(var R=0;R<y.markedSpans.length;++R){var V=y.markedSpans[R].marker;V.readOnly&&(!r||ue(r,V)==-1)&&(r||(r=[])).push(V)}}),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],l=o.find(0),s=0;s<i.length;++s){var u=i[s];if(!(x(u.to,l.from)<0||x(u.from,l.to)>0)){var f=[s,1],c=x(u.from,l.from),S=x(u.to,l.to);(c<0||!o.inclusiveLeft&&!c)&&f.push({from:u.from,to:l.from}),(S>0||!o.inclusiveRight&&!S)&&f.push({from:l.to,to:u.to}),i.splice.apply(i,f),s+=f.length-3}}return i}function fr(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function en(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Lr(e){return e.inclusiveLeft?-1:0}function Gr(e){return e.inclusiveRight?1:0}function Kr(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=x(r.from,i.from)||Lr(e)-Lr(t);if(a)return-a;var o=x(r.to,i.to)||Gr(e)-Gr(t);return o||t.id-e.id}function wr(e,t){var n=Nt&&e.markedSpans,r;if(n)for(var i=void 0,a=0;a<n.length;++a)i=n[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Kr(r,i.marker)<0)&&(r=i.marker);return r}function ot(e){return wr(e,!0)}function G(e){return wr(e,!1)}function j(e,t){var n=Nt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var a=n[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||Kr(r,a.marker)<0)&&(r=a.marker)}return r}function Oe(e,t,n,r,i){var a=Y(e,t),o=Nt&&a.markedSpans;if(o)for(var l=0;l<o.length;++l){var s=o[l];if(s.marker.collapsed){var u=s.marker.find(0),f=x(u.from,n)||Lr(s.marker)-Lr(i),c=x(u.to,r)||Gr(s.marker)-Gr(i);if(!(f>=0&&c<=0||f<=0&&c>=0)&&(f<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(u.to,n)>=0:x(u.to,n)>0)||f>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?x(u.from,r)<=0:x(u.from,r)<0)))return!0}}}function me(e){for(var t;t=ot(e);)e=t.find(-1,!0).line;return e}function nt(e){for(var t;t=G(e);)e=t.find(1,!0).line;return e}function Kt(e){for(var t,n;t=G(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Jt(e,t){var n=Y(e,t),r=me(n);return n==r?t:d(r)}function qt(e,t){if(t>e.lastLine())return t;var n=Y(e,t),r;if(!Rr(e,n))return t;for(;r=G(n);)n=r.find(1,!0).line;return d(n)+1}function Rr(e,t){var n=Nt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Xr(e,t,r))return!0}}}function Xr(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Xr(e,r.line,ur(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Xr(e,t,i))return!0}function Tr(e){e=me(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;n=a,a=n.parent)for(var o=0;o<a.children.length;++o){var l=a.children[o];if(l==n)break;t+=l.height}return t}function tn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=ot(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=G(r);){var a=n.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function Or(e){var t=e.display,n=e.doc;t.maxLine=Y(n,n.first),t.maxLineLength=tn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=tn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var an=function(e,t,n){this.text=e,en(this,t),this.height=n?n(this):1};an.prototype.lineNo=function(){return d(this)},be(an);function Pn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),fr(e),en(e,n);var i=r?r(e):1;i!=e.height&&Sr(e,i)}function un(e){e.parent=null,fr(e)}var Zr={},Yr={};function Ar(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yr:Zr;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function on(e,t){var n=lt("span",null,null,ae?"padding-right: .1px":null),r={pre:lt("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;r.pos=0,r.addToken=Hn,Pt(e.display.measure)&&(o=k(a,e.doc.direction))&&(r.addToken=vn(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&d(a);xn(a,r,Tt(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=X(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=X(a.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Vt(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(ae){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Re(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=X(r.pre.className,r.textClass||"")),r}function Nn(e){var t=Q("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Hn(e,t,n,r,i,a,o){if(t){var l=e.splitSpaces?Sn(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,f;if(!s.test(t))e.col+=t.length,f=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,f),P&&te<9&&(u=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var c=0;;){s.lastIndex=c;var S=s.exec(t),y=S?S.index-c:t.length-c;if(y){var R=document.createTextNode(l.slice(c,c+y));P&&te<9?f.appendChild(Q("span",[R])):f.appendChild(R),e.map.push(e.pos,e.pos+y,R),e.col+=y,e.pos+=y}if(!S)break;c+=y+1;var V=void 0;if(S[0]==" "){var le=e.cm.options.tabSize,we=le-e.col%le;V=f.appendChild(Q("span",St(we),"cm-tab")),V.setAttribute("role","presentation"),V.setAttribute("cm-text"," "),e.col+=we}else S[0]=="\r"||S[0]==`
`?(V=f.appendChild(Q("span",S[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),V.setAttribute("cm-text",S[0]),e.col+=1):(V=e.cm.options.specialCharPlaceholder(S[0]),V.setAttribute("cm-text",S[0]),P&&te<9?f.appendChild(Q("span",[V])):f.appendChild(V),e.col+=1);e.map.push(e.pos,e.pos+1,V),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||a||o){var Fe=n||"";r&&(Fe+=r),i&&(Fe+=i);var xe=Q("span",[f],Fe,a);if(o)for(var Ke in o)o.hasOwnProperty(Ke)&&Ke!="style"&&Ke!="class"&&xe.setAttribute(Ke,o[Ke]);return e.content.appendChild(xe)}e.content.appendChild(f)}}function Sn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a="\xA0"),r+=a,n=a==" "}return r}function vn(e,t){return function(n,r,i,a,o,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,f=u+r.length;;){for(var c=void 0,S=0;S<t.length&&(c=t[S],!(c.to>u&&c.from<=u));S++);if(c.to>=f)return e(n,r,i,a,o,l,s);e(n,r.slice(0,c.to-u),i,a,null,l,s),a=null,r=r.slice(c.to-u),u=c.to}}}function Qn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function xn(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(a,a=n[o]),Ar(n[o+1],t.cm.options));return}for(var l=i.length,s=0,u=1,f="",c,S,y=0,R,V,le,we,Fe;;){if(y==s){R=V=le=S="",Fe=null,we=null,y=1/0;for(var xe=[],Ke=void 0,ht=0;ht<r.length;++ht){var rt=r[ht],Gt=rt.marker;if(Gt.type=="bookmark"&&rt.from==s&&Gt.widgetNode)xe.push(Gt);else if(rt.from<=s&&(rt.to==null||rt.to>s||Gt.collapsed&&rt.to==s&&rt.from==s)){if(rt.to!=null&&rt.to!=s&&y>rt.to&&(y=rt.to,V=""),Gt.className&&(R+=" "+Gt.className),Gt.css&&(S=(S?S+";":"")+Gt.css),Gt.startStyle&&rt.from==s&&(le+=" "+Gt.startStyle),Gt.endStyle&&rt.to==y&&(Ke||(Ke=[])).push(Gt.endStyle,rt.to),Gt.title&&((Fe||(Fe={})).title=Gt.title),Gt.attributes)for(var zr in Gt.attributes)(Fe||(Fe={}))[zr]=Gt.attributes[zr];Gt.collapsed&&(!we||Kr(we.marker,Gt)<0)&&(we=rt)}else rt.from>s&&y>rt.from&&(y=rt.from)}if(Ke)for(var mn=0;mn<Ke.length;mn+=2)Ke[mn+1]==y&&(V+=" "+Ke[mn]);if(!we||we.from==s)for(var Jr=0;Jr<xe.length;++Jr)Qn(t,0,xe[Jr]);if(we&&(we.from||0)==s){if(Qn(t,(we.to==null?l+1:we.to)-s,we.marker,we.from==null),we.to==null)return;we.to==s&&(we=!1)}}if(s>=l)break;for(var Jn=Math.min(l,y);;){if(f){var Fn=s+f.length;if(!we){var ln=Fn>Jn?f.slice(0,Jn-s):f;t.addToken(t,ln,c?c+R:R,le,s+ln.length==y?V:"",S,Fe)}if(Fn>=Jn){f=f.slice(Jn-s),s=Jn;break}s=Fn,le=""}f=i.slice(a,a=n[u++]),c=Ar(n[u++],t.cm.options)}}}function ni(e,t,n){this.line=t,this.rest=Kt(t),this.size=this.rest?d(Ie(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Rr(e,t)}function $r(e,t,n){for(var r=[],i,a=t;a<n;a=i){var o=new ni(e.doc,Y(e.doc,a),a);i=a+o.size,r.push(o)}return r}var Bn=null;function ui(e){Bn?Bn.ops.push(e):e.ownsGroup=Bn={ops:[e],delayedCallbacks:[]}}function ii(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function di(e,t){var n=e.ownsGroup;if(n)try{ii(n)}finally{Bn=null,t(n)}}var Kn=null;function Hr(e,t){var n=Ge(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Bn?i=Bn.delayedCallbacks:Kn?i=Kn:(i=Kn=[],setTimeout(fn,0));for(var a=function(l){i.push(function(){return n[l].apply(null,r)})},o=0;o<n.length;++o)a(o)}}function fn(){var e=Kn;Kn=null;for(var t=0;t<e.length;++t)e[t]()}function Un(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Vn(e,t):a=="gutter"?ut(e,t,n,r):a=="class"?Ye(e,t):a=="widget"&&at(e,t,r)}t.changes=null}function On(e){return e.node==e.text&&(e.node=Q("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),P&&te<8&&(e.node.style.zIndex=2)),e.node}function gr(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=On(t);t.background=r.insertBefore(Q("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Gn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):on(e,t)}function Vn(e,t){var n=t.text.className,r=Gn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Ye(e,t)):n&&(t.text.className=n)}function Ye(e,t){gr(e,t),t.line.wrapClass?On(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function ut(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=On(t);t.gutterBackground=Q("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=On(t),l=t.gutter=Q("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),o.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(Q("div",D(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,f=a.hasOwnProperty(u)&&a[u];f&&l.appendChild(Q("div",[f],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function at(e,t,n){t.alignable&&(t.alignable=null);for(var r=Be("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);rr(e,t,n)}function vt(e,t,n,r){var i=Gn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Ye(e,t),ut(e,t,n,r),rr(e,t,r),t.node}function rr(e,t,n){if(Dr(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Dr(e,t.rest[r],t,n,!1)}function Dr(e,t,n,r,i){if(t.widgets)for(var a=On(n),o=0,l=t.widgets;o<l.length;++o){var s=l[o],u=Q("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),In(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?a.insertBefore(u,n.gutter||n.text):a.appendChild(u),Hr(s,"redraw")}}function In(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Te(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!O(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),Ve(t.display.measure,Q("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Je(e,t){for(var n=Mr(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function It(e){return e.lineSpace.offsetTop}function Pr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function xr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Ve(e.measure,Q("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function hn(e){return je-e.display.nativeBarWidth}function _n(e){return e.display.scroller.clientWidth-hn(e)-e.display.barWidth}function ei(e){return e.display.scroller.clientHeight-hn(e)-e.display.barHeight}function Rn(e,t,n){var r=e.options.lineWrapping,i=r&&_n(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),l=0;l<o.length-1;l++){var s=o[l],u=o[l+1];Math.abs(s.bottom-u.bottom)>2&&a.push((s.bottom+u.top)/2-n.top)}}a.push(n.bottom-n.top)}}function ki(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(d(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ya(e,t){t=me(t);var n=d(t),r=e.display.externalMeasured=new ni(e.doc,t,n);r.lineN=n;var i=r.built=on(e,r);return r.text=i.pre,Ve(e.display.lineMeasure,i.pre),r}function xa(e,t,n,r){return ti(e,pi(e,t),n,r)}function fi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ti(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function pi(e,t){var n=d(t),r=fi(e,n);r&&!r.text?r=null:r&&r.changes&&(Un(e,r,n,mi(e)),e.curOp.forceUpdate=!0),r||(r=Ya(e,t));var i=ki(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function ti(e,t,n,r,i){t.before&&(n=-1);var a=n+(r||""),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Rn(e,t.view,t.rect),t.hasHeights=!0),o=La(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Ea={left:0,right:0,top:0,bottom:0};function Ma(e,t,n){for(var r,i,a,o,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,a=1,o="left"):t<s?(i=t-l,a=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(a=s-l,i=a-1,t>=s&&(o="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(o=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],o="left";if(n=="right"&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],o="right";break}return{node:r,start:i,end:a,collapse:o,coverStart:l,coverEnd:s}}function Ja(e,t){var n=Ea;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function La(e,t,n,r){var i=Ma(t.map,n,r),a=i.node,o=i.start,l=i.end,s=i.collapse,u;if(a.nodeType==3){for(var f=0;f<4;f++){for(;o&&z(t.line.text.charAt(i.coverStart+o));)--o;for(;i.coverStart+l<i.coverEnd&&z(t.line.text.charAt(i.coverStart+l));)++l;if(P&&te<9&&o==0&&l==i.coverEnd-i.coverStart?u=a.parentNode.getBoundingClientRect():u=Ja(Lt(a,o,l).getClientRects(),r),u.left||u.right||o==0)break;l=o,o=o-1,s="right"}P&&te<11&&(u=Qa(e.display.measure,u))}else{o>0&&(s=r="right");var c;e.options.lineWrapping&&(c=a.getClientRects()).length>1?u=c[r=="right"?c.length-1:0]:u=a.getBoundingClientRect()}if(P&&te<9&&!o&&(!u||!u.left&&!u.right)){var S=a.parentNode.getClientRects()[0];S?u={left:S.left,right:S.left+oi(e.display),top:S.top,bottom:S.bottom}:u=Ea}for(var y=u.top-t.rect.top,R=u.bottom-t.rect.top,V=(y+R)/2,le=t.view.measure.heights,we=0;we<le.length-1&&!(V<le[we]);we++);var Fe=we?le[we-1]:0,xe=le[we],Ke={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:Fe,bottom:xe};return!u.left&&!u.right&&(Ke.bogus=!0),e.options.singleCursorHeightPerLine||(Ke.rtop=y,Ke.rbottom=R),Ke}function Qa(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!tt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function $i(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function qi(e){e.display.externalMeasure=null,bt(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)$i(e.display.view[t])}function Li(e){qi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ea(){return ee&&mt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ra(){return ee&&mt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ta(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Te(e.widgets[n]));return t}function Zi(e,t,n,r,i){if(!i){var a=ta(t);n.top+=a,n.bottom+=a}if(r=="line")return n;r||(r="local");var o=Tr(t);if(r=="local"?o+=It(e.display):o-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();o+=l.top+(r=="window"?0:Ra());var s=l.left+(r=="window"?0:ea());n.left+=s,n.right+=s}return n.top+=o,n.bottom+=o,n}function Ta(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=ea(),i-=Ra();else if(n=="local"||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Fi(e,t,n,r,i){return r||(r=Y(e.doc,t.line)),Zi(e,r,xa(e,r,t.ch,i),n)}function An(e,t,n,r,i,a){r=r||Y(e.doc,t.line),i||(i=pi(e,r));function o(R,V){var le=ti(e,i,R,V?"right":"left",a);return V?le.left=le.right:le.right=le.left,Zi(e,r,le,n)}var l=k(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return o(u=="before"?s-1:s,u=="before");function f(R,V,le){var we=l[V],Fe=we.level==1;return o(le?R-1:R,Fe!=le)}var c=ne(l,s,u),S=ie,y=f(s,c,u=="before");return S!=null&&(y.other=f(s,S,u!="before")),y}function ir(e,t){var n=0;t=J(e.doc,t),e.options.lineWrapping||(n=oi(e.display)*t.ch);var r=Y(e.doc,t.line),i=Tr(r)+It(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Zt(e,t,n,r,i){var a=m(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function Cn(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Zt(r.first,0,null,-1,-1);var i=v(r,n),a=r.first+r.size-1;if(i>a)return Zt(r.first+r.size-1,Y(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=Y(r,i);;){var l=ai(e,o,i,t,n),s=j(o,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var u=s.find(1);if(u.line==i)return u;o=Y(r,i=u.line)}}function En(e,t,n,r){r-=ta(t);var i=t.text.length,a=$(function(o){return ti(e,n,o-1).bottom<=r},i,0);return i=$(function(o){return ti(e,n,o).top>r},a,i),{begin:a,end:i}}function rn(e,t,n,r){n||(n=pi(e,t));var i=Zi(e,t,ti(e,n,r),"line").top;return En(e,t,n,i)}function cn(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function ai(e,t,n,r,i){i-=Tr(t);var a=pi(e,t),o=ta(t),l=0,s=t.text.length,u=!0,f=k(t,e.doc.direction);if(f){var c=(e.options.lineWrapping?vi:ri)(e,t,n,a,f,r,i);u=c.level!=1,l=u?c.from:c.to-1,s=u?c.to:c.from-1}var S=null,y=null,R=$(function(ht){var rt=ti(e,a,ht);return rt.top+=o,rt.bottom+=o,cn(rt,r,i,!1)?(rt.top<=i&&rt.left<=r&&(S=ht,y=rt),!0):!1},l,s),V,le,we=!1;if(y){var Fe=r-y.left<y.right-r,xe=Fe==u;R=S+(xe?0:1),le=xe?"after":"before",V=Fe?y.left:y.right}else{!u&&(R==s||R==l)&&R++,le=R==0?"after":R==t.text.length?"before":ti(e,a,R-(u?1:0)).bottom+o<=i==u?"after":"before";var Ke=An(e,m(n,R,le),"line",t,a);V=Ke.left,we=i<Ke.top?-1:i>=Ke.bottom?1:0}return R=oe(t.text,R,1),Zt(n,R,le,we,r-V)}function ri(e,t,n,r,i,a,o){var l=$(function(c){var S=i[c],y=S.level!=1;return cn(An(e,m(n,y?S.to:S.from,y?"before":"after"),"line",t,r),a,o,!0)},0,i.length-1),s=i[l];if(l>0){var u=s.level!=1,f=An(e,m(n,u?s.from:s.to,u?"after":"before"),"line",t,r);cn(f,a,o,!0)&&f.top>o&&(s=i[l-1])}return s}function vi(e,t,n,r,i,a,o){var l=En(e,t,r,o),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var f=null,c=null,S=0;S<i.length;S++){var y=i[S];if(!(y.from>=u||y.to<=s)){var R=y.level!=1,V=ti(e,r,R?Math.min(u,y.to)-1:Math.max(s,y.from)).right,le=V<a?a-V+1e9:V-a;(!f||c>le)&&(f=y,c=le)}}return f||(f=i[i.length-1]),f.from<s&&(f={from:s,to:f.to,level:f.level}),f.to>u&&(f={from:f.from,to:u,level:f.level}),f}var jn;function Xn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(jn==null){jn=Q("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)jn.appendChild(document.createTextNode("x")),jn.appendChild(Q("br"));jn.appendChild(document.createTextNode("x"))}Ve(e.measure,jn);var n=jn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),bt(e.measure),n||1}function oi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=Q("span","xxxxxxxxxx"),n=Q("pre",[t],"CodeMirror-line-like");Ve(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function mi(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var l=e.display.gutterSpecs[o].className;n[l]=a.offsetLeft+a.clientLeft+i,r[l]=a.clientWidth}return{fixedPos:$a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function $a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ro(e){var t=Xn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/oi(e.display)-3);return function(i){if(Rr(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function qa(e){var t=e.doc,n=Ro(e);t.iter(function(r){var i=n(r);i!=r.height&&Sr(r,i)})}function Ri(e,t,n,r){var i=e.display;if(!n&&Mr(t).getAttribute("cm-not-content")=="true")return null;var a,o,l=i.lineSpace.getBoundingClientRect();try{a=t.clientX-l.left,o=t.clientY-l.top}catch(c){return null}var s=Cn(e,a,o),u;if(r&&s.xRel>0&&(u=Y(e.doc,s.line).text).length==s.ch){var f=se(u,u.length,e.options.tabSize)-u.length;s=m(s.line,Math.max(0,Math.round((a-xr(e.display).left)/oi(e.display))-f))}return s}function Ti(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function kn(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&Jt(e.doc,t)<i.viewTo&&bi(e);else if(n<=i.viewFrom)Nt&&qt(e.doc,n+r)>i.viewFrom?bi(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)bi(e);else if(t<=i.viewFrom){var a=Da(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):bi(e)}else if(n>=i.viewTo){var o=Da(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):bi(e)}else{var l=Da(e,t,t,-1),s=Da(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat($r(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):bi(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function yi(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[Ti(e,t)];if(a.node!=null){var o=a.changes||(a.changes=[]);ue(o,n)==-1&&o.push(n)}}}function bi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Da(e,t,n,r){var i=Ti(e,t),a,o=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s<i;s++)l+=o[s].size;if(l!=t){if(r>0){if(i==o.length-1)return null;a=l+o[i].size-t,i++}else a=l-t;t+=a,n+=a}for(;Jt(e.doc,n)!=n;){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Gl(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=$r(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=$r(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Ti(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat($r(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Ti(e,n)))),r.viewTo=n}function To(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function ra(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Do(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=0;o<n.sel.ranges.length;o++)if(!(!t&&o==n.sel.primIndex)){var l=n.sel.ranges[o];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Po(e,l.head,i),s||Vl(e,l,a)}}return r}function Po(e,t,n){var r=An(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(Q("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var a=n.appendChild(Q("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Pa(e,t){return e.top-t.top||e.left-t.left}function Vl(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=xr(e.display),l=o.left,s=Math.max(r.sizerWidth,_n(e)-r.sizer.offsetLeft)-o.right,u=i.direction=="ltr";function f(xe,Ke,ht,rt){Ke<0&&(Ke=0),Ke=Math.round(Ke),rt=Math.round(rt),a.appendChild(Q("div",null,"CodeMirror-selected","position: absolute; left: "+xe+`px;
top: `+Ke+"px; width: "+(ht==null?s-xe:ht)+`px;
height: `+(rt-Ke)+"px"))}function c(xe,Ke,ht){var rt=Y(i,xe),Gt=rt.text.length,zr,mn;function Jr(ln,Wn){return Fi(e,m(xe,ln),"div",rt,Wn)}function Jn(ln,Wn,wn){var dn=rn(e,rt,null,ln),sn=Wn=="ltr"==(wn=="after")?"left":"right",qr=wn=="after"?dn.begin:dn.end-(/\s/.test(rt.text.charAt(dn.end-1))?2:1);return Jr(qr,sn)[sn]}var Fn=k(rt,i.direction);return de(Fn,Ke||0,ht==null?Gt:ht,function(ln,Wn,wn,dn){var sn=wn=="ltr",qr=Jr(ln,sn?"left":"right"),zn=Jr(Wn-1,sn?"right":"left"),Ji=Ke==null&&ln==0,Mi=ht==null&&Wn==Gt,Ln=dn==0,ci=!Fn||dn==Fn.length-1;if(zn.top-qr.top<=3){var yn=(u?Ji:Mi)&&Ln,Mo=(u?Mi:Ji)&&ci,gi=yn?l:(sn?qr:zn).left,Ii=Mo?s:(sn?zn:qr).right;f(gi,qr.top,Ii-gi,qr.bottom)}else{var Ai,Dn,Qi,Lo;sn?(Ai=u&&Ji&&Ln?l:qr.left,Dn=u?s:Jn(ln,wn,"before"),Qi=u?l:Jn(Wn,wn,"after"),Lo=u&&Mi&&ci?s:zn.right):(Ai=u?Jn(ln,wn,"before"):l,Dn=!u&&Ji&&Ln?s:qr.right,Qi=!u&&Mi&&ci?l:zn.left,Lo=u?Jn(Wn,wn,"after"):s),f(Ai,qr.top,Dn-Ai,qr.bottom),qr.bottom<zn.top&&f(l,qr.bottom,null,zn.top),f(Qi,zn.top,Lo-Qi,zn.bottom)}(!zr||Pa(qr,zr)<0)&&(zr=qr),Pa(zn,zr)<0&&(zr=zn),(!mn||Pa(qr,mn)<0)&&(mn=qr),Pa(zn,mn)<0&&(mn=zn)}),{start:zr,end:mn}}var S=t.from(),y=t.to();if(S.line==y.line)c(S.line,S.ch,y.ch);else{var R=Y(i,S.line),V=Y(i,y.line),le=me(R)==me(V),we=c(S.line,S.ch,le?R.text.length+1:null).end,Fe=c(y.line,le?0:null,y.ch).start;le&&(we.top<Fe.top-2?(f(we.right,we.top,null,we.bottom),f(l,Fe.top,Fe.left,Fe.bottom)):f(we.right,we.top,Fe.left-we.right,we.bottom)),we.bottom<Fe.top&&f(l,we.bottom,null,Fe.top)}n.appendChild(a)}function eo(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Wi(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function No(e){e.state.focused||(e.display.input.focus(),to(e))}function Oo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Wi(e))},100)}function to(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Re(e,"focus",e,t),e.state.focused=!0,Z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),ae&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),eo(e))}function Wi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Re(e,"blur",e,t),e.state.focused=!1,re(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Na(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],a=e.options.lineWrapping,o=void 0,l=0;if(!i.hidden){if(P&&te<8){var s=i.node.offsetTop+i.node.offsetHeight;o=s-n,n=s}else{var u=i.node.getBoundingClientRect();o=u.bottom-u.top,!a&&i.text.firstChild&&(l=i.text.firstChild.getBoundingClientRect().right-u.left-1)}var f=i.line.height-o;if((f>.005||f<-.005)&&(Sr(i.line,o),Io(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Io(i.rest[c]);if(l>e.display.sizerWidth){var S=Math.ceil(l/oi(e.display));S>e.display.maxLineLength&&(e.display.maxLineLength=S,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Io(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Oa(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-It(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=v(t,r),o=v(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<a?(a=l,o=v(t,Tr(Y(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=o&&(a=v(t,Tr(Y(t,s))-e.wrapper.clientHeight),o=s)}return{from:a,to:Math.max(o,a+1)}}function _l(e,t){if(!Le(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!De){var a=Q("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-It(e.display))+`px;
height: `+(t.bottom-t.top+hn(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function jl(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(t=t.ch?m(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,n=t.sticky=="before"?m(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var o=!1,l=An(e,t),s=!n||n==t?l:An(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var u=ro(e,i),f=e.doc.scrollTop,c=e.doc.scrollLeft;if(u.scrollTop!=null&&(ia(e,u.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(o=!0)),u.scrollLeft!=null&&(Di(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return i}function Xl(e,t){var n=ro(e,t);n.scrollTop!=null&&ia(e,n.scrollTop),n.scrollLeft!=null&&Di(e,n.scrollLeft)}function ro(e,t){var n=e.display,r=Xn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=ei(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var l=e.doc.height+Pr(n),s=t.top<r,u=t.bottom>l-r;if(t.top<i)o.scrollTop=s?0:t.top;else if(t.bottom>i+a){var f=Math.min(t.top,(u?l:t.bottom)-a);f!=i&&(o.scrollTop=f)}var c=e.options.fixedGutter?0:n.gutters.offsetWidth,S=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-c,y=_n(e)-n.gutters.offsetWidth,R=t.right-t.left>y;return R&&(t.right=t.left+y),t.left<10?o.scrollLeft=0:t.left<S?o.scrollLeft=Math.max(0,t.left+c-(R?0:10)):t.right>y+S-3&&(o.scrollLeft=t.right+(R?0:10)-y),o}function no(e,t){t!=null&&(Ia(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function zi(e){Ia(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function na(e,t,n){(t!=null||n!=null)&&Ia(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Yl(e,t){Ia(e),e.curOp.scrollToPos=t}function Ia(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=ir(e,t.from),r=ir(e,t.to);Ao(e,n,r,t.margin)}}function Ao(e,t,n,r){var i=ro(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});na(e,i.scrollLeft,i.scrollTop)}function ia(e,t){Math.abs(e.doc.scrollTop-t)<2||(B||ao(e,{top:t}),ko(e,t,!0),B&&ao(e),la(e,100))}function ko(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Di(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Ho(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function aa(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Pr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+hn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Pi=function(e,t,n){this.cm=n;var r=this.vert=Q("div",[Q("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Q("div",[Q("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),K(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),K(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,P&&te<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Pi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Pi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Pi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Pi.prototype.zeroWidthHack=function(){var e=ct&&!E?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ne,this.disableVert=new Ne},Pi.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto";function r(){var i=e.getBoundingClientRect(),a=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);a!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},Pi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var oa=function(){};oa.prototype.update=function(){return{bottom:0,right:0}},oa.prototype.setScrollLeft=function(){},oa.prototype.setScrollTop=function(){},oa.prototype.clear=function(){};function Hi(e,t){t||(t=aa(e));var n=e.display.barWidth,r=e.display.barHeight;Zo(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Na(e),Zo(e,aa(e)),n=e.display.barWidth,r=e.display.barHeight}function Zo(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var Fo={native:Pi,null:oa};function Wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&re(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Fo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),K(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Di(e,t):ia(e,t)},e),e.display.scrollbars.addClass&&Z(e.display.wrapper,e.display.scrollbars.addClass)}var Jl=0;function Ni(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Jl},ui(e.curOp)}function Oi(e){var t=e.curOp;t&&di(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;Ql(n)})}function Ql(e){for(var t=e.ops,n=0;n<t.length;n++)$l(t[n]);for(var r=0;r<t.length;r++)ql(t[r]);for(var i=0;i<t.length;i++)es(t[i]);for(var a=0;a<t.length;a++)ts(t[a]);for(var o=0;o<t.length;o++)rs(t[o])}function $l(e){var t=e.cm,n=t.display;is(t),e.updateMaxLine&&Or(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Aa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ql(e){e.updatedDisplay=e.mustUpdate&&io(e.cm,e.update)}function es(e){var t=e.cm,n=t.display;e.updatedDisplay&&Na(t),e.barMeasure=aa(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=xa(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+hn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-_n(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ts(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Di(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==M();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Hi(t,e.barMeasure),e.updatedDisplay&&lo(t,e.barMeasure),e.selectionChanged&&eo(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&No(e.cm)}function rs(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&zo(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&ko(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Di(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=jl(t,J(r,e.scrollToPos.from),J(r,e.scrollToPos.to),e.scrollToPos.margin);_l(t,i)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var l=0;l<a.length;++l)a[l].lines.length||Re(a[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&Re(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Re(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Yn(e,t){if(e.curOp)return t();Ni(e);try{return t()}finally{Oi(e)}}function gn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ni(e);try{return t.apply(e,arguments)}finally{Oi(e)}}}function Tn(e){return function(){if(this.curOp)return e.apply(this,arguments);Ni(this);try{return e.apply(this,arguments)}finally{Oi(this)}}}function pn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ni(t);try{return e.apply(this,arguments)}finally{Oi(t)}}}function la(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,Ae(ns,e))}function ns(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Ft(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var o=a.styles,l=a.text.length>e.options.maxHighlightLength?_t(t.mode,r.state):null,s=ze(e,a,r,!0);l&&(r.state=l),a.styles=s.styles;var u=a.styleClasses,f=s.classes;f?a.styleClasses=f:u&&(a.styleClasses=null);for(var c=!o||o.length!=a.styles.length||u!=f&&(!u||!f||u.bgClass!=f.bgClass||u.textClass!=f.textClass),S=0;!c&&S<o.length;++S)c=o[S]!=a.styles[S];c&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Yt(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return la(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Yn(e,function(){for(var a=0;a<i.length;a++)yi(e,i[a],"text")})}}var Aa=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Oa(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=_n(e),this.force=n,this.dims=mi(e),this.events=[]};Aa.prototype.signal=function(e,t){Xe(e,t)&&this.events.push(arguments)},Aa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Re.apply(null,this.events[e])};function is(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=hn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=hn(e)+"px",t.scrollbarsClipped=!0)}function as(e){if(e.hasFocus())return null;var t=M();if(!t||!O(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&O(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function os(e){if(!(!e||!e.activeElt||e.activeElt==M())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function io(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return bi(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&To(e)==0)return!1;Bo(e)&&(bi(e),t.dims=mi(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),Nt&&(a=Jt(e.doc,a),o=qt(e.doc,o));var l=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Gl(e,a,o),n.viewOffset=Tr(Y(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=To(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var u=as(e);return s>4&&(n.lineDiv.style.display="none"),ls(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,os(u),bt(n.cursorDiv),bt(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,la(e,400)),n.updateLineNumbers=null,!0}function zo(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==_n(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Pr(e.display)-ei(e),n.top)}),t.visible=Oa(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Oa(e.display,e.doc,n));if(!io(e,t))break;Na(e);var i=aa(e);ra(e),Hi(e,i),lo(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ao(e,t){var n=new Aa(e,t);if(io(e,n)){Na(e),zo(e,n);var r=aa(e);ra(e),Hi(e,r),lo(e,r),n.finish()}}function ls(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function l(R){var V=R.nextSibling;return ae&&ct&&e.display.currentWheelTarget==R?R.style.display="none":R.parentNode.removeChild(R),V}for(var s=r.view,u=r.viewFrom,f=0;f<s.length;f++){var c=s[f];if(!c.hidden)if(!c.node||c.node.parentNode!=a){var S=vt(e,c,u,n);a.insertBefore(S,o)}else{for(;o!=c.node;)o=l(o);var y=i&&t!=null&&t<=u&&c.lineNumber;c.changes&&(ue(c.changes,"gutter")>-1&&(y=!1),Un(e,c,u,n)),y&&(bt(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(D(e.options,u)))),o=c.node.nextSibling}u+=c.size}for(;o;)o=l(o)}function oo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function lo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+hn(e)+"px"}function Ho(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=$a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+"px",o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var l=n[o].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Bo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=D(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Q("div",[Q("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",oo(e.display),!0}return!1}function so(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!="string"&&(o=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:a,style:o})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Ko(e){var t=e.gutters,n=e.gutterSpecs;bt(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,l=t.appendChild(Q("div",null,"CodeMirror-gutter "+a));o&&(l.style.cssText=o),a=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",oo(e)}function sa(e){Ko(e.display),kn(e),Ho(e)}function ss(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=Q("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=Q("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=lt("div",null,"CodeMirror-code"),i.selectionDiv=Q("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=Q("div",null,"CodeMirror-cursors"),i.measure=Q("div",null,"CodeMirror-measure"),i.lineMeasure=Q("div",null,"CodeMirror-measure"),i.lineSpace=lt("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=lt("div",[i.lineSpace],"CodeMirror-lines");i.mover=Q("div",[a],null,"position: relative"),i.sizer=Q("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=Q("div",null,null,"position: absolute; height: "+je+"px; width: 1px;"),i.gutters=Q("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=Q("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=Q("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),P&&te<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!ae&&!(B&&Et)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=so(r.gutters,r.lineNumbers),Ko(i),n.init(i)}var ka=0,$n=null;P?$n=-.53:B?$n=15:ee?$n=-.7:He&&($n=-1/3);function Uo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function us(e){var t=Uo(e);return t.x*=$n,t.y*=$n,t}function Go(e,t){var n=Uo(t),r=n.x,i=n.y,a=e.display,o=a.scroller,l=o.scrollWidth>o.clientWidth,s=o.scrollHeight>o.clientHeight;if(r&&l||i&&s){if(i&&ct&&ae){e:for(var u=t.target,f=a.view;u!=o;u=u.parentNode)for(var c=0;c<f.length;c++)if(f[c].node==u){e.display.currentWheelTarget=u;break e}}if(r&&!B&&!h&&$n!=null){i&&s&&ia(e,Math.max(0,o.scrollTop+i*$n)),Di(e,Math.max(0,o.scrollLeft+r*$n)),(!i||i&&s)&&qe(t),a.wheelStartX=null;return}if(i&&$n!=null){var S=i*$n,y=e.doc.scrollTop,R=y+a.wrapper.clientHeight;S<0?y=Math.max(0,y+S-50):R=Math.min(e.doc.height,R+S+50),ao(e,{top:y,bottom:R})}ka<20&&(a.wheelStartX==null?(a.wheelStartX=o.scrollLeft,a.wheelStartY=o.scrollTop,a.wheelDX=r,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX!=null){var V=o.scrollLeft-a.wheelStartX,le=o.scrollTop-a.wheelStartY,we=le&&a.wheelDY&&le/a.wheelDY||V&&a.wheelDX&&V/a.wheelDX;a.wheelStartX=a.wheelStartY=null,we&&($n=($n*ka+we)/(ka+1),++ka)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var qn=function(e,t){this.ranges=e,this.primIndex=t};qn.prototype.primary=function(){return this.ranges[this.primIndex]},qn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!fe(n.anchor,r.anchor)||!fe(n.head,r.head))return!1}return!0},qn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Nr(ce(this.ranges[t].anchor),ce(this.ranges[t].head));return new qn(e,this.primIndex)},qn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},qn.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(x(t,r.from())>=0&&x(e,r.to())<=0)return n}return-1};var Nr=function(e,t){this.anchor=e,this.head=t};Nr.prototype.from=function(){return Ce(this.anchor,this.head)},Nr.prototype.to=function(){return Pe(this.anchor,this.head)},Nr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function li(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(S,y){return x(S.from(),y.from())}),n=ue(t,i);for(var a=1;a<t.length;a++){var o=t[a],l=t[a-1],s=x(l.to(),o.from());if(r&&!o.empty()?s>0:s>=0){var u=Ce(l.from(),o.from()),f=Pe(l.to(),o.to()),c=l.empty()?o.from()==o.head:l.from()==l.head;a<=n&&--n,t.splice(--a,2,new Nr(c?f:u,c?u:f))}}return new qn(t,n)}function Si(e,t){return new qn([new Nr(e,t||e)],0)}function Ci(e){return e.text?m(e.from.line+e.text.length-1,Ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Vo(e,t){if(x(e,t.from)<0)return e;if(x(e,t.to)<=0)return Ci(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ci(t).ch-t.to.ch),m(n,r)}function uo(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Nr(Vo(i.anchor,t),Vo(i.head,t)))}return li(e.cm,n,e.sel.primIndex)}function _o(e,t,n){return e.line==t.line?m(n.line,e.ch-t.ch+n.ch):m(n.line+(e.line-t.line),e.ch)}function fs(e,t,n){for(var r=[],i=m(e.first,0),a=i,o=0;o<t.length;o++){var l=t[o],s=_o(l.from,i,a),u=_o(Ci(l),i,a);if(i=l.to,a=u,n=="around"){var f=e.sel.ranges[o],c=x(f.head,f.anchor)<0;r[o]=new Nr(c?u:s,c?s:u)}else r[o]=new Nr(s,s)}return new qn(r,e.sel.primIndex)}function fo(e){e.doc.mode=sr(e.options,e.doc.modeOption),ua(e)}function ua(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,la(e,100),e.state.modeGen++,e.curOp&&kn(e)}function jo(e,t){return t.from.ch==0&&t.to.ch==0&&Ie(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function co(e,t,n,r){function i(Fe){return n?n[Fe]:null}function a(Fe,xe,Ke){Pn(Fe,xe,Ke,r),Hr(Fe,"change",Fe,t)}function o(Fe,xe){for(var Ke=[],ht=Fe;ht<xe;++ht)Ke.push(new an(u[ht],i(ht),r));return Ke}var l=t.from,s=t.to,u=t.text,f=Y(e,l.line),c=Y(e,s.line),S=Ie(u),y=i(u.length-1),R=s.line-l.line;if(t.full)e.insert(0,o(0,u.length)),e.remove(u.length,e.size-u.length);else if(jo(e,t)){var V=o(0,u.length-1);a(c,c.text,y),R&&e.remove(l.line,R),V.length&&e.insert(l.line,V)}else if(f==c)if(u.length==1)a(f,f.text.slice(0,l.ch)+S+f.text.slice(s.ch),y);else{var le=o(1,u.length-1);le.push(new an(S+f.text.slice(s.ch),y,r)),a(f,f.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,le)}else if(u.length==1)a(f,f.text.slice(0,l.ch)+u[0]+c.text.slice(s.ch),i(0)),e.remove(l.line+1,R);else{a(f,f.text.slice(0,l.ch)+u[0],i(0)),a(c,S+c.text.slice(s.ch),y);var we=o(1,u.length-1);R>1&&e.remove(l.line+1,R-1),e.insert(l.line+1,we)}Hr(e,"change",e,t)}function wi(e,t,n){function r(i,a,o){if(i.linked)for(var l=0;l<i.linked.length;++l){var s=i.linked[l];if(s.doc!=a){var u=o&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function Xo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,qa(e),fo(e),Yo(e),e.options.lineWrapping||Or(e),e.options.mode=t.modeOption,kn(e)}function Yo(e){(e.doc.direction=="rtl"?Z:re)(e.display.lineDiv,"CodeMirror-rtl")}function cs(e){Yn(e,function(){Yo(e),kn(e)})}function Za(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function vo(e,t){var n={from:ce(t.from),to:Ci(t),text:st(e,t.from,t.to)};return $o(e,n,t.from.line,t.to.line+1),wi(e,function(r){return $o(r,n,t.from.line,t.to.line+1)},!0),n}function Jo(e){for(;e.length;){var t=Ie(e);if(t.ranges)e.pop();else break}}function ds(e,t){if(t)return Jo(e.done),Ie(e.done);if(e.done.length&&!Ie(e.done).ranges)return Ie(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ie(e.done)}function Qo(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,o,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=ds(i,i.lastOp==r)))l=Ie(o.changes),x(t.from,t.to)==0&&x(t.from,l.to)==0?l.to=Ci(t):o.changes.push(vo(e,t));else{var s=Ie(i.done);for((!s||!s.ranges)&&Fa(e.sel,i.done),o={changes:[vo(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Re(e,"historyAdded")}function vs(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function hs(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||vs(e,a,Ie(i.done),t))?i.done[i.done.length-1]=t:Fa(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Jo(i.undone)}function Fa(e,t){var n=Ie(t);n&&n.ranges&&n.equals(e)||t.push(e)}function $o(e,t,n,r){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(o){o.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=o.markedSpans),++a})}function gs(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function ps(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(gs(n[i]));return r}function qo(e,t){var n=ps(e,t),r=Cr(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)e:for(var l=0;l<o.length;++l){for(var s=o[l],u=0;u<a.length;++u)if(a[u].marker==s.marker)continue e;a.push(s)}else o&&(n[i]=o)}return n}function Bi(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?qn.prototype.deepCopy.call(a):a);continue}var o=a.changes,l=[];r.push({changes:l});for(var s=0;s<o.length;++s){var u=o[s],f=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var c in u)(f=c.match(/^spans_(\d+)$/))&&ue(t,Number(f[1]))>-1&&(Ie(l)[c]=u[c],delete u[c])}}return r}function ho(e,t,n,r){if(r){var i=e.anchor;if(n){var a=x(t,i)<0;a!=x(n,i)<0?(i=t,t=n):a!=x(t,n)<0&&(t=n)}return new Nr(i,t)}else return new Nr(n||t,t)}function Wa(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Mn(e,new qn([ho(e.sel.primary(),t,n,i)],0),r)}function el(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=ho(e.sel.ranges[a],t[a],null,i);var o=li(e.cm,r,e.sel.primIndex);Mn(e,o,n)}function go(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Mn(e,li(e.cm,i,e.sel.primIndex),r)}function tl(e,t,n,r){Mn(e,Si(t,n),r)}function ms(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var a=0;a<i.length;a++)this.ranges[a]=new Nr(J(e,i[a].anchor),J(e,i[a].head))},origin:n&&n.origin};return Re(e,"beforeSelectionChange",e,r),e.cm&&Re(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?li(e.cm,r.ranges,r.ranges.length-1):t}function rl(e,t,n){var r=e.history.done,i=Ie(r);i&&i.ranges?(r[r.length-1]=t,za(e,t,n)):Mn(e,t,n)}function Mn(e,t,n){za(e,t,n),hs(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function za(e,t,n){(Xe(e,"beforeSelectionChange")||e.cm&&Xe(e.cm,"beforeSelectionChange"))&&(t=ms(e,t,n));var r=n&&n.bias||(x(t.primary().head,e.sel.primary().head)<0?-1:1);nl(e,al(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&zi(e.cm)}function nl(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,gt(e.cm)),Hr(e,"cursorActivity",e))}function il(e){nl(e,al(e,e.sel,null,!1))}function al(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],s=Ha(e,o.anchor,l&&l.anchor,n,r),u=Ha(e,o.head,l&&l.head,n,r);(i||s!=o.anchor||u!=o.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new Nr(s,u))}return i?li(e.cm,i,t.primIndex):t}function Ki(e,t,n,r,i){var a=Y(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var l=a.markedSpans[o],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,f="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(f?l.to>=t.ch:l.to>t.ch))){if(i&&(Re(s,"beforeCursorEnter"),s.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!s.atomic)continue;if(n){var c=s.find(r<0?1:-1),S=void 0;if((r<0?f:u)&&(c=ol(e,c,-r,c&&c.line==t.line?a:null)),c&&c.line==t.line&&(S=x(c,n))&&(r<0?S<0:S>0))return Ki(e,c,t,r,i)}var y=s.find(r<0?-1:1);return(r<0?u:f)&&(y=ol(e,y,r,y.line==t.line?a:null)),y?Ki(e,y,t,r,i):null}}return t}function Ha(e,t,n,r,i){var a=r||1,o=Ki(e,t,n,a,i)||!i&&Ki(e,t,n,a,!0)||Ki(e,t,n,-a,i)||!i&&Ki(e,t,n,-a,!0);return o||(e.cantEdit=!0,m(e.first,0))}function ol(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?J(e,m(t.line-1)):null:n>0&&t.ch==(r||Y(e,t.line)).text.length?t.line<e.first+e.size-1?m(t.line+1,0):null:new m(t.line,t.ch+n)}function ll(e){e.setSelection(m(e.firstLine(),0),m(e.lastLine()),Ee)}function sl(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,a,o,l){i&&(r.from=J(e,i)),a&&(r.to=J(e,a)),o&&(r.text=o),l!==void 0&&(r.origin=l)}),Re(e,"beforeChange",e,r),e.cm&&Re(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ui(e,t,n){if(e.cm){if(!e.cm.curOp)return gn(e.cm,Ui)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Xe(e,"beforeChange")||e.cm&&Xe(e.cm,"beforeChange"))&&(t=sl(e,t,!0),!t))){var r=vr&&!n&&jr(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)ul(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ul(e,t)}}function ul(e,t){if(!(t.text.length==1&&t.text[0]==""&&x(t.from,t.to)==0)){var n=uo(e,t);Qo(e,t,n,e.cm?e.cm.curOp.id:NaN),fa(e,t,n,Cr(e,t));var r=[];wi(e,function(i,a){!a&&ue(r,i.history)==-1&&(vl(i.history,t),r.push(i.history)),fa(i,t,null,Cr(i,t))})}}function Ba(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,o=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<l.length&&(a=l[u],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));u++);if(u!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=l.pop(),a.ranges){if(Fa(a,s),n&&!a.equals(e.sel)){Mn(e,a,{clearRedo:!1});return}o=a}else if(r){l.push(a);return}else break;var f=[];Fa(o,s),s.push({changes:f,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var c=Xe(e,"beforeChange")||e.cm&&Xe(e.cm,"beforeChange"),S=function(V){var le=a.changes[V];if(le.origin=t,c&&!sl(e,le,!1))return l.length=0,{};f.push(vo(e,le));var we=V?uo(e,le):Ie(l);fa(e,le,we,qo(e,le)),!V&&e.cm&&e.cm.scrollIntoView({from:le.from,to:Ci(le)});var Fe=[];wi(e,function(xe,Ke){!Ke&&ue(Fe,xe.history)==-1&&(vl(xe.history,le),Fe.push(xe.history)),fa(xe,le,null,qo(xe,le))})},y=a.changes.length-1;y>=0;--y){var R=S(y);if(R)return R.v}}}}function fl(e,t){if(t!=0&&(e.first+=t,e.sel=new qn(ar(e.sel.ranges,function(i){return new Nr(m(i.anchor.line+t,i.anchor.ch),m(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){kn(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)yi(e.cm,r,"gutter")}}function fa(e,t,n,r){if(e.cm&&!e.cm.curOp)return gn(e.cm,fa)(e,t,n,r);if(t.to.line<e.first){fl(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);fl(e,i),t={from:m(e.first,0),to:m(t.to.line+i,t.to.ch),text:[Ie(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:m(a,Y(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=st(e,t.from,t.to),n||(n=uo(e,t)),e.cm?ys(e.cm,t,r):co(e,t,r),za(e,n,Ee),e.cantEdit&&Ha(e,m(e.firstLine(),0))&&(e.cantEdit=!1)}}function ys(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,l=!1,s=a.line;e.options.lineWrapping||(s=d(me(Y(r,a.line))),r.iter(s,o.line+1,function(y){if(y==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&gt(e),co(r,t,n,Ro(e)),e.options.lineWrapping||(r.iter(s,a.line+t.text.length,function(y){var R=tn(y);R>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=R,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Bt(r,a.line),la(e,400);var u=t.text.length-(o.line-a.line)-1;t.full?kn(e):a.line==o.line&&t.text.length==1&&!jo(e.doc,t)?yi(e,a.line,"text"):kn(e,a.line,o.line+1,u);var f=Xe(e,"changes"),c=Xe(e,"change");if(c||f){var S={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};c&&Hr(e,"change",e,S),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(S)}e.display.selForContextMenu=null}function Gi(e,t,n,r,i){var a;r||(r=n),x(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Ui(e,{from:n,to:r,text:t,origin:i})}function cl(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function dl(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var l=0;l<a.ranges.length;l++)cl(a.ranges[l].anchor,t,n,r),cl(a.ranges[l].head,t,n,r);continue}for(var s=0;s<a.changes.length;++s){var u=a.changes[s];if(n<u.from.line)u.from=m(u.from.line+r,u.from.ch),u.to=m(u.to.line+r,u.to.ch);else if(t<=u.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function vl(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;dl(e.done,n,r,i),dl(e.undone,n,r,i)}function ca(e,t,n,r){var i=t,a=t;return typeof t=="number"?a=Y(e,ke(e,t)):i=d(t),i==null?null:(r(a,i)&&e.cm&&yi(e.cm,i,n),a)}function da(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}da.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,un(i),Hr(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function va(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}va.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof da))){var l=[];this.collapse(l),this.children=[new da(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,l=o;l<i.lines.length;){var s=new da(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new va(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=ue(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new va(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var ha=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};ha.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=d(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=Te(this);Sr(n,Math.max(0,n.height-a)),e&&(Yn(e,function(){hl(e,n,-a),yi(e,r,"widget")}),Hr(e,"lineWidgetCleared",e,this,r))}},ha.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Te(this)-t;i&&(Rr(this.doc,r)||Sr(r,r.height+i),n&&Yn(n,function(){n.curOp.forceUpdate=!0,hl(n,r,i),Hr(n,"lineWidgetChanged",n,e,d(r))}))},be(ha);function hl(e,t,n){Tr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&no(e,n)}function bs(e,t,n,r){var i=new ha(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),ca(e,t,"widget",function(o){var l=o.widgets||(o.widgets=[]);if(i.insertAt==null?l.push(i):l.splice(Math.min(l.length-1,Math.max(0,i.insertAt)),0,i),i.line=o,a&&!Rr(e,o)){var s=Tr(o)<e.scrollTop;Sr(o,o.height+Te(i)),s&&no(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Hr(a,"lineWidgetAdded",a,i,typeof t=="number"?t:d(t)),i}var gl=0,xi=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++gl};xi.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ni(e),Xe(this,"clear")){var n=this.find();n&&Hr(this,"clear",n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],l=ur(o.markedSpans,this);e&&!this.collapsed?yi(e,d(o),"text"):e&&(l.to!=null&&(i=d(o)),l.from!=null&&(r=d(o))),o.markedSpans=tr(o.markedSpans,l),l.from==null&&this.collapsed&&!Rr(this.doc,o)&&e&&Sr(o,Xn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=me(this.lines[s]),f=tn(u);f>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&kn(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&il(e.doc)),e&&Hr(e,"markerCleared",e,this,r,i),t&&Oi(e),this.parent&&this.parent.clear()}},xi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],o=ur(a.markedSpans,this);if(o.from!=null&&(n=m(t?a:d(a),o.from),e==-1))return n;if(o.to!=null&&(r=m(t?a:d(a),o.to),e==1))return r}return n&&{from:n,to:r}},xi.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Yn(r,function(){var i=t.line,a=d(t.line),o=fi(r,a);if(o&&($i(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Rr(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=Te(n)-l;s&&Sr(i,i.height+s)}Hr(r,"markerChanged",r,e)})},xi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ue(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},xi.prototype.detachLine=function(e){if(this.lines.splice(ue(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},be(xi);function Vi(e,t,n,r,i){if(r&&r.shared)return Ss(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return gn(e.cm,Vi)(e,t,n,r,i);var a=new xi(e,i),o=x(t,n);if(r&&L(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=lt("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Oe(e,t.line,t,n,a)||t.line!=n.line&&Oe(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");pt()}a.addToHistory&&Qo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,u;if(e.iter(l,n.line+1,function(c){s&&a.collapsed&&!s.options.lineWrapping&&me(c)==s.display.maxLine&&(u=!0),a.collapsed&&l!=t.line&&Sr(c,0),hr(c,new Ut(a,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),a.collapsed&&e.iter(t.line,n.line+1,function(c){Rr(e,c)&&Sr(c,0)}),a.clearOnEnter&&K(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(wt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++gl,a.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),a.collapsed)kn(s,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var f=t.line;f<=n.line;f++)yi(s,f,"text");a.atomic&&il(s.doc),Hr(s,"markerAdded",s,a)}return a}var ga=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};ga.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Hr(this,"clear")}},ga.prototype.find=function(e,t){return this.primary.find(e,t)},be(ga);function Ss(e,t,n,r,i){r=L(r),r.shared=!1;var a=[Vi(e,t,n,r,i)],o=a[0],l=r.widgetNode;return wi(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),a.push(Vi(s,J(s,t),J(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;o=Ie(a)}),new ga(a,o)}function pl(e){return e.findMarks(m(e.first,0),e.clipPos(m(e.lastLine())),function(t){return t.parent})}function Cs(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(x(a,o)){var l=Vi(e,a,o,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function ws(e){for(var t=function(r){var i=e[r],a=[i.primary.doc];wi(i.primary.doc,function(s){return a.push(s)});for(var o=0;o<i.markers.length;o++){var l=i.markers[o];ue(a,l.doc)==-1&&(l.parent=null,i.markers.splice(o--,1))}},n=0;n<e.length;n++)t(n)}var xs=0,Zn=function(e,t,n,r,i){if(!(this instanceof Zn))return new Zn(e,t,n,r,i);n==null&&(n=0),va.call(this,[new da([new an("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=m(n,0);this.sel=Si(a),this.history=new Za(null),this.id=++xs,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),co(this,{from:a,to:a,text:e}),Mn(this,Si(a),Ee)};Zn.prototype=g(va.prototype,{constructor:Zn,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=br(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:pn(function(e){var t=m(this.first,0),n=this.first+this.size-1;Ui(this,{from:t,to:m(n,Y(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&na(this.cm,0,0),Mn(this,Si(t),Ee)}),replaceRange:function(e,t,n,r){t=J(this,t),n=n?J(this,n):t,Gi(this,e,t,n,r)},getRange:function(e,t,n){var r=st(this,J(this,e),J(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(H(this,e))return Y(this,e)},getLineNumber:function(e){return d(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Y(this,e)),me(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return J(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:pn(function(e,t,n){tl(this,J(this,typeof e=="number"?m(e,t||0):e),null,n)}),setSelection:pn(function(e,t,n){tl(this,J(this,e),J(this,t||e),n)}),extendSelection:pn(function(e,t,n){Wa(this,J(this,e),t&&J(this,t),n)}),extendSelections:pn(function(e,t){el(this,_(this,e),t)}),extendSelectionsBy:pn(function(e,t){var n=ar(this.sel.ranges,e);el(this,_(this,n),t)}),setSelections:pn(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Nr(J(this,e[i].anchor),J(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Mn(this,li(this.cm,r,t),n)}}),addSelection:pn(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Nr(J(this,e),J(this,t||e))),Mn(this,li(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=st(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=st(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:pn(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var l=t&&t!="end"&&fs(this,r,t),s=r.length-1;s>=0;s--)Ui(this,r[s]);l?rl(this,l):this.cm&&zi(this.cm)}),undo:pn(function(){Ba(this,"undo")}),redo:pn(function(){Ba(this,"redo")}),undoSelection:pn(function(){Ba(this,"undo",!0)}),redoSelection:pn(function(){Ba(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Za(this.history.maxGeneration),wi(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Bi(this.history.done),undone:Bi(this.history.undone)}},setHistory:function(e){var t=this.history=new Za(this.history.maxGeneration);t.done=Bi(e.done.slice(0),null,!0),t.undone=Bi(e.undone.slice(0),null,!0)},setGutterMarker:pn(function(e,t,n){return ca(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&I(i)&&(r.gutterMarkers=null),!0})}),clearGutter:pn(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&ca(t,n,"gutter",function(){return n.gutterMarkers[e]=null,I(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!H(this,e)||(t=e,e=Y(this,e),!e))return null}else if(t=d(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:pn(function(e,t,n){return ca(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(Be(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:pn(function(e,t,n){return ca(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=r[i];if(a)if(n==null)r[i]=null;else{var o=a.match(Be(n));if(!o)return!1;var l=o.index+o[0].length;r[i]=a.slice(0,o.index)+(!o.index||l==a.length?"":" ")+a.slice(l)||null}else return!1;return!0})}),addLineWidget:pn(function(e,t,n){return bs(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Vi(this,J(this,e),J(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=J(this,e),Vi(this,e,e,n,"bookmark")},findMarksAt:function(e){e=J(this,e);var t=[],n=Y(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=J(this,e),t=J(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var l=0;l<o.length;l++){var s=o[l];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),J(this,m(n,t))},indexFromPos:function(e){e=J(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new Zn(br(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Zn(br(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cs(r,pl(this)),r},unlinkDoc:function(e){if(e instanceof Vr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),ws(pl(this));break}}if(e.history==this.history){var r=[e.id];wi(e,function(i){return r.push(i.id)},!0),e.history=new Za(null),e.history.done=Bi(this.history.done,r),e.history.undone=Bi(this.history.undone,r)}},iterLinkedDocs:function(e){wi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):$e(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:pn(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&cs(this.cm))})}),Zn.prototype.eachLine=Zn.prototype.iter;var ml=0;function Es(e){var t=this;if(yl(t),!(Le(t,e)||Je(t.display,e))){qe(e),P&&(ml=+new Date);var n=Ri(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),o=0,l=function(){++o==i&&gn(t,function(){n=J(t.doc,n);var y={from:n,to:n,text:t.doc.splitLines(a.filter(function(R){return R!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ui(t.doc,y),rl(t.doc,Si(J(t.doc,n),J(t.doc,Ci(y))))})()},s=function(y,R){if(t.options.allowDropFileTypes&&ue(t.options.allowDropFileTypes,y.type)==-1){l();return}var V=new FileReader;V.onerror=function(){return l()},V.onload=function(){var le=V.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(le)){l();return}a[R]=le,l()},V.readAsText(y)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var f=e.dataTransfer.getData("Text");if(f){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),za(t.doc,Si(n,n)),c)for(var S=0;S<c.length;++S)Gi(t.doc,"",c[S].anchor,c[S].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(y){}}}}function Ms(e,t){if(P&&(!e.state.draggingText||+new Date-ml<100)){$t(t);return}if(!(Le(e,t)||Je(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!He)){var n=Q("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}function Ls(e,t){var n=Ri(e,t);if(n){var r=document.createDocumentFragment();Po(e,n,r),e.display.dragCursor||(e.display.dragCursor=Q("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Ve(e.display.dragCursor,r)}}function yl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function bl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var a=0;a<n.length;a++)e(n[a])})}}var Sl=!1;function Rs(){Sl||(Ts(),Sl=!0)}function Ts(){var e;K(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,bl(Ds)},100))}),K(window,"blur",function(){return bl(Wi)})}function Ds(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ei={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},pa=0;pa<10;pa++)Ei[pa+48]=Ei[pa+96]=String(pa);for(var Ka=65;Ka<=90;Ka++)Ei[Ka]=String.fromCharCode(Ka);for(var ma=1;ma<=12;ma++)Ei[ma+111]=Ei[ma+63235]="F"+ma;var hi={};hi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},hi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},hi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},hi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},hi.default=ct?hi.macDefault:hi.pcDefault;function Ps(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,a,o=0;o<t.length-1;o++){var l=t[o];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ns(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=ar(n.split(" "),Ps),a=0;a<i.length;a++){var o=void 0,l=void 0;a==i.length-1?(l=i.join(" "),o=r):(l=i.slice(0,a+1).join(" "),o="...");var s=t[l];if(!s)t[l]=o;else if(s!=o)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var u in t)e[u]=t[u];return e}function _i(e,t,n,r){t=Ua(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return _i(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=_i(e,t.fallthrough[a],n,r);if(o)return o}}}function Cl(e){var t=typeof e=="string"?e:Ei[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function wl(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(F?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(F?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function xl(e,t){if(h&&e.keyCode==34&&e.char)return!1;var n=Ei[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),wl(n,e,t))}function Ua(e){return typeof e=="string"?hi[e]:e}function ji(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&x(a.from,Ie(r).to)<=0;){var o=r.pop();if(x(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}Yn(e,function(){for(var l=r.length-1;l>=0;l--)Gi(e.doc,"",r[l].from,r[l].to,"+delete");zi(e)})}function po(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function mo(e,t,n){var r=po(e,t.ch,n);return r==null?null:new m(t.line,r,n<0?"after":"before")}function yo(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=k(n,t.doc.direction);if(a){var o=i<0?Ie(a):a[0],l=i<0==(o.level==1),s=l?"after":"before",u;if(o.level>0||t.doc.direction=="rtl"){var f=pi(t,n);u=i<0?n.text.length-1:0;var c=ti(t,f,u).top;u=$(function(S){return ti(t,f,S).top==c},i<0==(o.level==1)?o.from:o.to-1,u),s=="before"&&(u=po(n,u,1))}else u=i<0?o.to:o.from;return new m(r,u,s)}}return new m(r,i<0?n.text.length:0,i<0?"before":"after")}function Os(e,t,n,r){var i=k(t,e.doc.direction);if(!i)return mo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=ne(i,n.ch,n.sticky),o=i[a];if(e.doc.direction=="ltr"&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return mo(t,n,r);var l=function(we,Fe){return po(t,we instanceof m?we.ch:we,Fe)},s,u=function(we){return e.options.lineWrapping?(s=s||pi(e,t),rn(e,t,s,we)):{begin:0,end:t.text.length}},f=u(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||o.level==1){var c=o.level==1==r<0,S=l(n,c?1:-1);if(S!=null&&(c?S<=o.to&&S<=f.end:S>=o.from&&S>=f.begin)){var y=c?"before":"after";return new m(n.line,S,y)}}var R=function(we,Fe,xe){for(var Ke=function(zr,mn){return mn?new m(n.line,l(zr,1),"before"):new m(n.line,zr,"after")};we>=0&&we<i.length;we+=Fe){var ht=i[we],rt=Fe>0==(ht.level!=1),Gt=rt?xe.begin:l(xe.end,-1);if(ht.from<=Gt&&Gt<ht.to||(Gt=rt?ht.from:l(ht.to,-1),xe.begin<=Gt&&Gt<xe.end))return Ke(Gt,rt)}},V=R(a+r,r,f);if(V)return V;var le=r>0?f.end:l(f.begin,-1);return le!=null&&!(r>0&&le==t.text.length)&&(V=R(r>0?0:i.length-1,r,u(le)),V)?V:null}var ya={selectAll:ll,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return ji(e,function(t){if(t.empty()){var n=Y(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:m(t.head.line+1,0)}:{from:t.head,to:m(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ji(e,function(t){return{from:m(t.from().line,0),to:J(e.doc,m(t.to().line+1,0))}})},delLineLeft:function(e){return ji(e,function(t){return{from:m(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ji(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return ji(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(m(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(m(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return El(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Is(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},We)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},We)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Ml(e,t.head):r},We)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=se(e.getLine(a.line),a.ch,r);t.push(St(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Yn(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=Y(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new m(i.line,i.ch-1)),i.ch>0)i=new m(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),m(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=Y(e.doc,i.line-1).text;o&&(i=new m(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),m(i.line-1,o.length-1),i,"+transpose"))}}n.push(new Nr(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Yn(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);zi(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function El(e,t){var n=Y(e.doc,t),r=me(n);return r!=n&&(t=d(r)),yo(!0,e,r,t,1)}function Is(e,t){var n=Y(e.doc,t),r=nt(n);return r!=n&&(t=d(r)),yo(!0,e,n,t,-1)}function Ml(e,t){var n=El(e,t.line),r=Y(e.doc,n.line),i=k(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return m(n.line,o?0:a,n.sticky)}return n}function Ga(e,t,n){if(typeof t=="string"&&(t=ya[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=_e}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function As(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=_i(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&_i(t,e.options.extraKeys,n,e)||_i(t,e.options.keyMap,n,e)}var ks=new Ne;function ba(e,t,n,r){var i=e.state.keySeq;if(i){if(Cl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ks.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Ll(e,i+" "+t,n,r))return!0}return Ll(e,t,n,r)}function Ll(e,t,n,r){var i=As(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Hr(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(qe(n),eo(e)),!!i}function Rl(e,t){var n=xl(t,!0);return n?t.shiftKey&&!e.state.keySeq?ba(e,"Shift-"+n,t,function(r){return Ga(e,r,!0)})||ba(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Ga(e,r)}):ba(e,n,t,function(r){return Ga(e,r)}):!1}function Zs(e,t,n){return ba(e,"'"+n+"'",t,function(r){return Ga(e,r,!0)})}var bo=null;function Tl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=M(),!Le(t,e))){P&&te<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Rl(t,e);h&&(bo=r?n:null,!r&&n==88&&!nr&&(ct?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),B&&!ct&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fs(t)}}function Fs(e){var t=e.display.lineDiv;Z(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(re(t,"CodeMirror-crosshair"),ge(document,"keyup",n),ge(document,"mouseover",n))}K(document,"keyup",n),K(document,"mouseover",n)}function Dl(e){e.keyCode==16&&(this.doc.sel.shift=!1),Le(this,e)}function Pl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Je(t.display,e)||Le(t,e)||e.ctrlKey&&!e.altKey||ct&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(h&&n==bo){bo=null,qe(e);return}if(!(h&&(!e.which||e.which<10)&&Rl(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(Zs(t,e,i)||t.display.input.onKeyPress(e))}}}var Ws=400,So=function(e,t,n){this.time=e,this.pos=t,this.button=n};So.prototype.compare=function(e,t,n){return this.time+Ws>e&&x(t,this.pos)==0&&n==this.button};var Sa,Ca;function zs(e,t){var n=+new Date;return Ca&&Ca.compare(n,e,t)?(Sa=Ca=null,"triple"):Sa&&Sa.compare(n,e,t)?(Ca=new So(n,e,t),Sa=null,"double"):(Sa=new So(n,e,t),Ca=null,"single")}function Nl(e){var t=this,n=t.display;if(!(Le(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Je(n,e)){ae||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Co(t,e)){var r=Ri(t,e),i=et(e),a=r?zs(r,i):"single";window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Hs(t,i,r,a,e))&&(i==1?r?Ks(t,r,a,e):Mr(e)==n.scroller&&qe(e):i==2?(r&&Wa(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(yt?t.display.input.onContextMenu(e):Oo(t)))}}}function Hs(e,t,n,r,i){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,ba(e,wl(a,i),i,function(o){if(typeof o=="string"&&(o=ya[o]),!o)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=o(e,n)!=_e}finally{e.state.suppressEdits=!1}return l})}function Bs(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var a=Mt?n.shiftKey&&n.metaKey:n.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=ct?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(ct?n.altKey:n.ctrlKey)),i}function Ks(e,t,n,r){P?setTimeout(Ae(No,e),0):e.curOp.focus=M();var i=Bs(e,n,r),a=e.doc.sel,o;e.options.dragDrop&&it&&!e.isReadOnly()&&n=="single"&&(o=a.contains(t))>-1&&(x((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(x(o.to(),t)>0||t.xRel<0)?Us(e,r,t,i):Gs(e,r,t,i)}function Us(e,t,n,r){var i=e.display,a=!1,o=gn(e,function(u){ae&&(i.scroller.draggable=!1),e.state.draggingText=!1,ge(i.wrapper.ownerDocument,"mouseup",o),ge(i.wrapper.ownerDocument,"mousemove",l),ge(i.scroller,"dragstart",s),ge(i.scroller,"drop",o),a||(qe(u),r.addNew||Wa(e.doc,n,null,null,r.extend),ae&&!He||P&&te==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(u){a=a||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return a=!0};ae&&(i.scroller.draggable=!0),e.state.draggingText=o,o.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),K(i.wrapper.ownerDocument,"mouseup",o),K(i.wrapper.ownerDocument,"mousemove",l),K(i.scroller,"dragstart",s),K(i.scroller,"drop",o),Oo(e),setTimeout(function(){return i.input.focus()},20)}function Ol(e,t,n){if(n=="char")return new Nr(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Nr(m(t.line,0),J(e.doc,m(t.line+1,0)));var r=n(e,t);return new Nr(r.from,r.to)}function Gs(e,t,n,r){var i=e.display,a=e.doc;qe(t);var o,l,s=a.sel,u=s.ranges;if(r.addNew&&!r.extend?(l=a.sel.contains(n),l>-1?o=u[l]:o=new Nr(n,n)):(o=a.sel.primary(),l=a.sel.primIndex),r.unit=="rectangle")r.addNew||(o=new Nr(n,n)),n=Ri(e,t,!0,!0),l=-1;else{var f=Ol(e,n,r.unit);r.extend?o=ho(o,f.anchor,f.head,r.extend):o=f}r.addNew?l==-1?(l=u.length,Mn(a,li(e,u.concat([o]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(Mn(a,li(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=a.sel):go(a,l,o,Ue):(l=0,Mn(a,new qn([o],0),Ue),s=a.sel);var c=n;function S(xe){if(x(c,xe)!=0)if(c=xe,r.unit=="rectangle"){for(var Ke=[],ht=e.options.tabSize,rt=se(Y(a,n.line).text,n.ch,ht),Gt=se(Y(a,xe.line).text,xe.ch,ht),zr=Math.min(rt,Gt),mn=Math.max(rt,Gt),Jr=Math.min(n.line,xe.line),Jn=Math.min(e.lastLine(),Math.max(n.line,xe.line));Jr<=Jn;Jr++){var Fn=Y(a,Jr).text,ln=At(Fn,zr,ht);zr==mn?Ke.push(new Nr(m(Jr,ln),m(Jr,ln))):Fn.length>ln&&Ke.push(new Nr(m(Jr,ln),m(Jr,At(Fn,mn,ht))))}Ke.length||Ke.push(new Nr(n,n)),Mn(a,li(e,s.ranges.slice(0,l).concat(Ke),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(xe)}else{var Wn=o,wn=Ol(e,xe,r.unit),dn=Wn.anchor,sn;x(wn.anchor,dn)>0?(sn=wn.head,dn=Ce(Wn.from(),wn.anchor)):(sn=wn.anchor,dn=Pe(Wn.to(),wn.head));var qr=s.ranges.slice(0);qr[l]=Vs(e,new Nr(J(a,dn),sn)),Mn(a,li(e,qr,l),Ue)}}var y=i.wrapper.getBoundingClientRect(),R=0;function V(xe){var Ke=++R,ht=Ri(e,xe,!0,r.unit=="rectangle");if(ht)if(x(ht,c)!=0){e.curOp.focus=M(),S(ht);var rt=Oa(i,a);(ht.line>=rt.to||ht.line<rt.from)&&setTimeout(gn(e,function(){R==Ke&&V(xe)}),150)}else{var Gt=xe.clientY<y.top?-20:xe.clientY>y.bottom?20:0;Gt&&setTimeout(gn(e,function(){R==Ke&&(i.scroller.scrollTop+=Gt,V(xe))}),50)}}function le(xe){e.state.selectingText=!1,R=1/0,xe&&(qe(xe),i.input.focus()),ge(i.wrapper.ownerDocument,"mousemove",we),ge(i.wrapper.ownerDocument,"mouseup",Fe),a.history.lastSelOrigin=null}var we=gn(e,function(xe){xe.buttons===0||!et(xe)?le(xe):V(xe)}),Fe=gn(e,le);e.state.selectingText=Fe,K(i.wrapper.ownerDocument,"mousemove",we),K(i.wrapper.ownerDocument,"mouseup",Fe)}function Vs(e,t){var n=t.anchor,r=t.head,i=Y(e.doc,n.line);if(x(n,r)==0&&n.sticky==r.sticky)return t;var a=k(i);if(!a)return t;var o=ne(a,n.ch,n.sticky),l=a[o];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=o+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==a.length)return t;var u;if(r.line!=n.line)u=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var f=ne(a,r.ch,r.sticky),c=f-o||(r.ch-n.ch)*(l.level==1?-1:1);f==s-1||f==s?u=c<0:u=c>0}var S=a[s+(u?-1:0)],y=u==(S.level==1),R=y?S.from:S.to,V=y?"after":"before";return n.ch==R&&n.sticky==V?t:new Nr(new m(n.line,R,V),r)}function Il(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch(S){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&qe(t);var o=e.display,l=o.lineDiv.getBoundingClientRect();if(a>l.bottom||!Xe(e,n))return Er(t);a-=l.top-o.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=o.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var f=v(e.doc,a),c=e.display.gutterSpecs[s];return Re(e,n,e,f,c.className,t),Er(t)}}}function Co(e,t){return Il(e,t,"gutterClick",!0)}function Al(e,t){Je(e.display,t)||_s(e,t)||Le(e,t,"contextmenu")||yt||e.display.input.onContextMenu(t)}function _s(e,t){return Xe(e,"gutterContextMenu")?Il(e,t,"gutterContextMenu",!1):!1}function kl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Li(e)}var Xi={toString:function(){return"CodeMirror.Init"}},Zl={},Va={};function js(e){var t=e.optionHandlers;function n(r,i,a,o){e.defaults[r]=i,a&&(t[r]=o?function(l,s,u){u!=Xi&&a(l,s,u)}:a)}e.defineOption=n,e.Init=Xi,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,fo(r)},!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){ua(r),Li(r),kn(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var a=[],o=r.doc.first;r.doc.iter(function(s){for(var u=0;;){var f=s.text.indexOf(i,u);if(f==-1)break;u=f+i.length,a.push(m(o,f))}o++});for(var l=a.length-1;l>=0;l--)Gi(r.doc,i,a[l],m(a[l].line,a[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,i,a){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),a!=Xi&&r.refresh()}),n("specialCharPlaceholder",Nn,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",Et?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!dt),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){kl(r),sa(r)},!0),n("keyMap","default",function(r,i,a){var o=Ua(i),l=a!=Xi&&Ua(a);l&&l.detach&&l.detach(r,o),o.attach&&o.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ys,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=so(i,r.options.lineNumbers),sa(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?$a(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Hi(r)},!0),n("scrollbarStyle","native",function(r){Wo(r),Hi(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=so(r.options.gutters,i),sa(r)},!0),n("firstLineNumber",1,sa,!0),n("lineNumberFormatter",function(r){return r},sa,!0),n("showCursorWhenSelecting",!1,ra,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Wi(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Xs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ra,!0),n("singleCursorHeightPerLine",!0,ra,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,ua,!0),n("addModeClass",!1,ua,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,ua,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Xs(e,t,n){var r=n&&n!=Xi;if(!t!=!r){var i=e.display.dragFunctions,a=t?K:ge;a(e.display.scroller,"dragstart",i.start),a(e.display.scroller,"dragenter",i.enter),a(e.display.scroller,"dragover",i.over),a(e.display.scroller,"dragleave",i.leave),a(e.display.scroller,"drop",i.drop)}}function Ys(e){e.options.lineWrapping?(Z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(re(e.display.wrapper,"CodeMirror-wrap"),Or(e)),qa(e),kn(e),Li(e),setTimeout(function(){return Hi(e)},100)}function Vr(e,t){var n=this;if(!(this instanceof Vr))return new Vr(e,t);this.options=t=t?L(t):{},L(Zl,t,!1);var r=t.value;typeof r=="string"?r=new Zn(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Vr.inputStyles[t.inputStyle](this),a=this.display=new ss(e,r,i,t);a.wrapper.CodeMirror=this,kl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Wo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ne,keySeq:null,specialChars:null},t.autofocus&&!Et&&a.input.focus(),P&&te<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Js(this),Rs(),Ni(this),this.curOp.forceUpdate=!0,Xo(this,r),t.autofocus&&!Et||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&to(n)},20):Wi(this);for(var o in Va)Va.hasOwnProperty(o)&&Va[o](this,t[o],Xi);Bo(this),t.finishInit&&t.finishInit(this);for(var l=0;l<wo.length;++l)wo[l](this);Oi(this),ae&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}Vr.defaults=Zl,Vr.optionHandlers=Va;function Js(e){var t=e.display;K(t.scroller,"mousedown",gn(e,Nl)),P&&te<11?K(t.scroller,"dblclick",gn(e,function(s){if(!Le(e,s)){var u=Ri(e,s);if(!(!u||Co(e,s)||Je(e.display,s))){qe(s);var f=e.findWordAt(u);Wa(e.doc,f.anchor,f.head)}}})):K(t.scroller,"dblclick",function(s){return Le(e,s)||qe(s)}),K(t.scroller,"contextmenu",function(s){return Al(e,s)}),K(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||Al(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function o(s,u){if(u.left==null)return!0;var f=u.left-s.left,c=u.top-s.top;return f*f+c*c>20*20}K(t.scroller,"touchstart",function(s){if(!Le(e,s)&&!a(s)&&!Co(e,s)){t.input.ensurePolled(),clearTimeout(n);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),K(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),K(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Je(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var f=e.coordsChar(t.activeTouch,"page"),c;!u.prev||o(u,u.prev)?c=new Nr(f,f):!u.prev.prev||o(u,u.prev.prev)?c=e.findWordAt(f):c=new Nr(m(f.line,0),J(e.doc,m(f.line+1,0))),e.setSelection(c.anchor,c.head),e.focus(),qe(s)}i()}),K(t.scroller,"touchcancel",i),K(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ia(e,t.scroller.scrollTop),Di(e,t.scroller.scrollLeft,!0),Re(e,"scroll",e))}),K(t.scroller,"mousewheel",function(s){return Go(e,s)}),K(t.scroller,"DOMMouseScroll",function(s){return Go(e,s)}),K(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Le(e,s)||$t(s)},over:function(s){Le(e,s)||(Ls(e,s),$t(s))},start:function(s){return Ms(e,s)},drop:gn(e,Es),leave:function(s){Le(e,s)||yl(e)}};var l=t.input.getField();K(l,"keyup",function(s){return Dl.call(e,s)}),K(l,"keydown",gn(e,Tl)),K(l,"keypress",gn(e,Pl)),K(l,"focus",function(s){return to(e,s)}),K(l,"blur",function(s){return Wi(e,s)})}var wo=[];Vr.defineInitHook=function(e){return wo.push(e)};function wa(e,t,n,r){var i=e.doc,a;n==null&&(n="add"),n=="smart"&&(i.mode.indent?a=Ft(e,t).state:n="prev");var o=e.options.tabSize,l=Y(i,t),s=se(l.text,null,o);l.stateAfter&&(l.stateAfter=null);var u=l.text.match(/^\s*/)[0],f;if(!r&&!/\S/.test(l.text))f=0,n="not";else if(n=="smart"&&(f=i.mode.indent(a,l.text.slice(u.length),l.text),f==_e||f>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?f=se(Y(i,t-1).text,null,o):f=0:n=="add"?f=s+e.options.indentUnit:n=="subtract"?f=s-e.options.indentUnit:typeof n=="number"&&(f=s+n),f=Math.max(0,f);var c="",S=0;if(e.options.indentWithTabs)for(var y=Math.floor(f/o);y;--y)S+=o,c+=" ";if(S<f&&(c+=St(f-S)),c!=u)return Gi(i,c,m(t,0),m(t,u.length),"+input"),l.stateAfter=null,!0;for(var R=0;R<i.sel.ranges.length;R++){var V=i.sel.ranges[R];if(V.head.line==t&&V.head.ch<u.length){var le=m(t,u.length);go(i,R,new Nr(le,le));break}}}var si=null;function _a(e){si=e}function xo(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||(r=a.sel);var o=+new Date-200,l=i=="paste"||e.state.pasteIncoming>o,s=$e(t),u=null;if(l&&r.ranges.length>1)if(si&&si.text.join(`
`)==t){if(r.ranges.length%si.text.length==0){u=[];for(var f=0;f<si.text.length;f++)u.push(a.splitLines(si.text[f]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=ar(s,function(we){return[we]}));for(var c=e.curOp.updateInput,S=r.ranges.length-1;S>=0;S--){var y=r.ranges[S],R=y.from(),V=y.to();y.empty()&&(n&&n>0?R=m(R.line,R.ch-n):e.state.overwrite&&!l?V=m(V.line,Math.min(Y(a,V.line).text.length,V.ch+Ie(s).length)):l&&si&&si.lineWise&&si.text.join(`
`)==s.join(`
`)&&(R=V=m(R.line,0)));var le={from:R,to:V,text:u?u[S%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>o?"cut":"+input")};Ui(e.doc,le),Hr(e,"inputRead",e,le)}t&&!l&&Wl(e,t),zi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=c),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Fl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Yn(t,function(){return xo(t,n,0,null,"paste")}),!0}function Wl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var l=0;l<a.electricChars.length;l++)if(t.indexOf(a.electricChars.charAt(l))>-1){o=wa(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Y(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=wa(e,i.head.line,"smart"));o&&Hr(e,"electricInput",e,i.head.line)}}}function zl(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:m(i,0),head:m(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function Hl(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Bl(){var e=Q("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=Q("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ae?e.style.width="1000px":e.setAttribute("wrap","off"),T&&(e.style.border="1px solid black"),Hl(e),t}function Qs(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var a=this.options,o=a[r];a[r]==i&&r!="mode"||(a[r]=i,t.hasOwnProperty(r)&&gn(this,t[r])(this,i,o),Re(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Ua(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==r||i[a].name==r)return i.splice(a,1),!0},addOverlay:Tn(function(r,i){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");er(this.state.overlays,{mode:a,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(o){return o.priority}),this.state.modeGen++,kn(this)}),removeOverlay:Tn(function(r){for(var i=this.state.overlays,a=0;a<i.length;++a){var o=i[a].modeSpec;if(o==r||typeof r=="string"&&o.name==r){i.splice(a,1),this.state.modeGen++,kn(this);return}}}),indentLine:Tn(function(r,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),H(this.doc,r)&&wa(this,r,i,a)}),indentSelection:Tn(function(r){for(var i=this.doc.sel.ranges,a=-1,o=0;o<i.length;o++){var l=i[o];if(l.empty())l.head.line>a&&(wa(this,l.head.line,r,!0),a=l.head.line,o==this.doc.sel.primIndex&&zi(this));else{var s=l.from(),u=l.to(),f=Math.max(a,s.line);a=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var c=f;c<a;++c)wa(this,c,r);var S=this.doc.sel.ranges;s.ch==0&&i.length==S.length&&S[o].from().ch>0&&go(this.doc,o,new Nr(s,S[o].to()),Ee)}}}),getTokenAt:function(r,i){return dr(this,r,i)},getLineTokens:function(r,i){return dr(this,m(r),i,!0)},getTokenTypeAt:function(r){r=J(this.doc,r);var i=Tt(this,Y(this.doc,r.line)),a=0,o=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=a+o>>1;if((u?i[u*2-1]:0)>=l)o=u;else if(i[u*2+1]<l)a=u+1;else{s=i[u*2+2];break}}var f=s?s.indexOf("overlay "):-1;return f<0?s:f==0?null:s.slice(0,f-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var a=[];if(!n.hasOwnProperty(i))return a;var o=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")o[l[i]]&&a.push(o[l[i]]);else if(l[i])for(var s=0;s<l[i].length;s++){var u=o[l[i][s]];u&&a.push(u)}else l.helperType&&o[l.helperType]?a.push(o[l.helperType]):o[l.name]&&a.push(o[l.name]);for(var f=0;f<o._global.length;f++){var c=o._global[f];c.pred(l,this)&&ue(a,c.val)==-1&&a.push(c.val)}return a},getStateAfter:function(r,i){var a=this.doc;return r=ke(a,r==null?a.first+a.size-1:r),Ft(this,r+1,i).state},cursorCoords:function(r,i){var a,o=this.doc.sel.primary();return r==null?a=o.head:typeof r=="object"?a=J(this.doc,r):a=r?o.from():o.to(),An(this,a,i||"page")},charCoords:function(r,i){return Fi(this,J(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Ta(this,r,i||"page"),Cn(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Ta(this,{top:r,left:0},i||"page").top,v(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,a){var o=!1,l;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,o=!0),l=Y(this.doc,r)}else l=r;return Zi(this,l,{top:0,left:0},i||"page",a||o).top+(o?this.doc.height-Tr(l):0)},defaultTextHeight:function(){return Xn(this.display)},defaultCharWidth:function(){return oi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,a,o,l){var s=this.display;r=An(this,J(this.doc,r));var u=r.bottom,f=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),o=="over")u=r.top;else if(o=="above"||o=="near"){var c=Math.max(s.wrapper.clientHeight,this.doc.height),S=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(o=="above"||r.bottom+i.offsetHeight>c)&&r.top>i.offsetHeight?u=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=c&&(u=r.bottom),f+i.offsetWidth>S&&(f=S-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",l=="right"?(f=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?f=0:l=="middle"&&(f=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=f+"px"),a&&Xl(this,{left:f,top:u,right:f+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:Tn(Tl),triggerOnKeyPress:Tn(Pl),triggerOnKeyUp:Dl,triggerOnMouseDown:Tn(Nl),execCommand:function(r){if(ya.hasOwnProperty(r))return ya[r].call(null,this)},triggerElectric:Tn(function(r){Wl(this,r)}),findPosH:function(r,i,a,o){var l=1;i<0&&(l=-1,i=-i);for(var s=J(this.doc,r),u=0;u<i&&(s=Eo(this.doc,s,l,a,o),!s.hitSide);++u);return s},moveH:Tn(function(r,i){var a=this;this.extendSelectionsBy(function(o){return a.display.shift||a.doc.extend||o.empty()?Eo(a.doc,o.head,r,i,a.options.rtlMoveVisually):r<0?o.from():o.to()},We)}),deleteH:Tn(function(r,i){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):ji(this,function(l){var s=Eo(o,l.head,r,i,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,i,a,o){var l=1,s=o;i<0&&(l=-1,i=-i);for(var u=J(this.doc,r),f=0;f<i;++f){var c=An(this,u,"div");if(s==null?s=c.left:c.left=s,u=Kl(this,c,l,a),u.hitSide)break}return u},moveV:Tn(function(r,i){var a=this,o=this.doc,l=[],s=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(f){if(s)return r<0?f.from():f.to();var c=An(a,f.head,"div");f.goalColumn!=null&&(c.left=f.goalColumn),l.push(c.left);var S=Kl(a,c,r,i);return i=="page"&&f==o.sel.primary()&&no(a,Fi(a,S,"div").top-c.top),S},We),l.length)for(var u=0;u<o.sel.ranges.length;u++)o.sel.ranges[u].goalColumn=l[u]}),findWordAt:function(r){var i=this.doc,a=Y(i,r.line).text,o=r.ch,l=r.ch;if(a){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==a.length)&&o?--o:++l;for(var u=a.charAt(o),f=w(u,s)?function(c){return w(c,s)}:/\s/.test(u)?function(c){return/\s/.test(c)}:function(c){return!/\s/.test(c)&&!w(c)};o>0&&f(a.charAt(o-1));)--o;for(;l<a.length&&f(a.charAt(l));)++l}return new Nr(m(r.line,o),m(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Z(this.display.cursorDiv,"CodeMirror-overwrite"):re(this.display.cursorDiv,"CodeMirror-overwrite"),Re(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Tn(function(r,i){na(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-hn(this)-this.display.barHeight,width:r.scrollWidth-hn(this)-this.display.barWidth,clientHeight:ei(this),clientWidth:_n(this)}},scrollIntoView:Tn(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:m(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Yl(this,r):Ao(this,r.from,r.to,r.margin)}),setSize:Tn(function(r,i){var a=this,o=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=o(r)),i!=null&&(this.display.wrapper.style.height=o(i)),this.options.lineWrapping&&qi(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){yi(a,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,Re(this,"refresh",this)}),operation:function(r){return Yn(this,r)},startOperation:function(){return Ni(this)},endOperation:function(){return Oi(this)},refresh:Tn(function(){var r=this.display.cachedTextHeight;kn(this),this.curOp.forceUpdate=!0,Li(this),na(this,this.doc.scrollLeft,this.doc.scrollTop),oo(this.display),(r==null||Math.abs(r-Xn(this.display))>.5||this.options.lineWrapping)&&qa(this),Re(this,"refresh",this)}),swapDoc:Tn(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Xo(this,r),Li(this),this.display.input.reset(),na(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Hr(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(r,i,a){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=a},e.registerGlobalHelper=function(r,i,a,o){e.registerHelper(r,i,o),n[r]._global.push({pred:a,val:o})}}function Eo(e,t,n,r,i){var a=t,o=n,l=Y(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var Fe=t.line+s;return Fe<e.first||Fe>=e.first+e.size?!1:(t=new m(Fe,t.ch,t.sticky),l=Y(e,Fe))}function f(Fe){var xe;if(r=="codepoint"){var Ke=l.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Ke)?xe=null:xe=new m(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(Ke>=55296&&Ke<56320?2:1))),-n)}else i?xe=Os(e.cm,l,t,n):xe=mo(l,t,n);if(xe==null)if(!Fe&&u())t=yo(i,e.cm,l,t.line,s);else return!1;else t=xe;return!0}if(r=="char"||r=="codepoint")f();else if(r=="column")f(!0);else if(r=="word"||r=="group")for(var c=null,S=r=="group",y=e.cm&&e.cm.getHelper(t,"wordChars"),R=!0;!(n<0&&!f(!R));R=!1){var V=l.text.charAt(t.ch)||`
`,le=w(V,y)?"w":S&&V==`
`?"n":!S||/\s/.test(V)?null:"p";if(S&&!R&&!le&&(le="s"),c&&c!=le){n<0&&(n=1,f(),t.sticky="after");break}if(le&&(c=le),n>0&&!f(!R))break}var we=Ha(e,t,a,o,!0);return fe(a,we)&&(we.hitSide=!0),we}function Kl(e,t,n,r){var i=e.doc,a=t.left,o;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(l-.5*Xn(e.display),3);o=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(o=n>0?t.bottom+3:t.top-3);for(var u;u=Cn(e,a,o),!!u.outside;){if(n<0?o<=0:o>=i.height){u.hitSide=!0;break}o+=n*5}return u}var kr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ne,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};kr.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;Hl(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}K(i,"paste",function(l){!a(l)||Le(r,l)||Fl(l,r)||te<=11&&setTimeout(gn(r,function(){return t.updateFromDOM()}),20)}),K(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),K(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),K(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),K(i,"touchstart",function(){return n.forceCompositionEnd()}),K(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(l){if(!(!a(l)||Le(r,l))){if(r.somethingSelected())_a({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=zl(r);_a({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,Ee),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=si.text.join(`
`);if(l.clipboardData.setData("Text",u),l.clipboardData.getData("Text")==u){l.preventDefault();return}}var f=Bl(),c=f.firstChild;r.display.lineSpace.insertBefore(f,r.display.lineSpace.firstChild),c.value=si.text.join(`
`);var S=document.activeElement;W(c),setTimeout(function(){r.display.lineSpace.removeChild(f),S.focus(),S==i&&n.showPrimarySelection()},50)}}K(i,"copy",o),K(i,"cut",o)},kr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},kr.prototype.prepareSelection=function(){var e=Do(this.cm,!1);return e.focus=document.activeElement==this.div,e},kr.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},kr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},kr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=ja(t,e.anchorNode,e.anchorOffset),o=ja(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&o&&!o.bad&&x(Ce(a,o),r)==0&&x(Pe(a,o),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&Ul(t,r)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Ul(t,i);if(!u){var f=l[l.length-1].measure,c=f.maps?f.maps[f.maps.length-1]:f.map;u={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}if(!s||!u){e.removeAllRanges();return}var S=e.rangeCount&&e.getRangeAt(0),y;try{y=Lt(s.node,s.offset,u.offset,u.node)}catch(R){}y&&(!B&&t.state.focused?(e.collapse(s.node,s.offset),y.collapsed||(e.removeAllRanges(),e.addRange(y))):(e.removeAllRanges(),e.addRange(y)),S&&e.anchorNode==null?e.addRange(S):B&&this.startGracePeriod()),this.rememberSelection()}},kr.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},kr.prototype.showMultipleSelections=function(e){Ve(this.cm.display.cursorDiv,e.cursors),Ve(this.cm.display.selectionDiv,e.selection)},kr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},kr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return O(this.div,t)},kr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},kr.prototype.blur=function(){this.div.blur()},kr.prototype.getField=function(){return this.div},kr.prototype.supportsTouch=function(){return!0},kr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Yn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},kr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},kr.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(mt&&ee&&this.cm.display.gutterSpecs.length&&$s(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=ja(t,e.anchorNode,e.anchorOffset),r=ja(t,e.focusNode,e.focusOffset);n&&r&&Yn(t,function(){Mn(t.doc,Si(n,r),Ee),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},kr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=m(r.line-1,Y(e.doc,r.line-1).length)),i.ch==Y(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=m(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,l;r.line==t.viewFrom||(a=Ti(e,r.line))==0?(o=d(t.view[0].line),l=t.view[0].node):(o=d(t.view[a].line),l=t.view[a-1].node.nextSibling);var s=Ti(e,i.line),u,f;if(s==t.view.length-1?(u=t.viewTo-1,f=t.lineDiv.lastChild):(u=d(t.view[s+1].line)-1,f=t.view[s+1].node.previousSibling),!l)return!1;for(var c=e.doc.splitLines(qs(e,l,f,o,u)),S=st(e.doc,m(o,0),m(u,Y(e.doc,u).text.length));c.length>1&&S.length>1;)if(Ie(c)==Ie(S))c.pop(),S.pop(),u--;else if(c[0]==S[0])c.shift(),S.shift(),o++;else break;for(var y=0,R=0,V=c[0],le=S[0],we=Math.min(V.length,le.length);y<we&&V.charCodeAt(y)==le.charCodeAt(y);)++y;for(var Fe=Ie(c),xe=Ie(S),Ke=Math.min(Fe.length-(c.length==1?y:0),xe.length-(S.length==1?y:0));R<Ke&&Fe.charCodeAt(Fe.length-R-1)==xe.charCodeAt(xe.length-R-1);)++R;if(c.length==1&&S.length==1&&o==r.line)for(;y&&y>r.ch&&Fe.charCodeAt(Fe.length-R-1)==xe.charCodeAt(xe.length-R-1);)y--,R++;c[c.length-1]=Fe.slice(0,Fe.length-R).replace(/^\u200b+/,""),c[0]=c[0].slice(y).replace(/\u200b+$/,"");var ht=m(o,y),rt=m(u,S.length?Ie(S).length-R:0);if(c.length>1||c[0]||x(ht,rt))return Gi(e.doc,c,ht,rt,"+input"),!0},kr.prototype.ensurePolled=function(){this.forceCompositionEnd()},kr.prototype.reset=function(){this.forceCompositionEnd()},kr.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},kr.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},kr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Yn(this.cm,function(){return kn(e.cm)})},kr.prototype.setUneditable=function(e){e.contentEditable="false"},kr.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||gn(this.cm,xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},kr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},kr.prototype.onContextMenu=function(){},kr.prototype.resetPosition=function(){},kr.prototype.needsContentAttribute=!0;function Ul(e,t){var n=fi(e,t.line);if(!n||n.hidden)return null;var r=Y(e.doc,t.line),i=ki(n,r,t.line),a=k(r,e.doc.direction),o="left";if(a){var l=ne(a,t.ch);o=l%2?"right":"left"}var s=Ma(i.map,t.ch,o);return s.offset=s.collapse=="right"?s.end:s.start,s}function $s(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Yi(e,t){return t&&(e.bad=!0),e}function qs(e,t,n,r,i){var a="",o=!1,l=e.doc.lineSeparator(),s=!1;function u(y){return function(R){return R.id==y}}function f(){o&&(a+=l,s&&(a+=l),o=s=!1)}function c(y){y&&(f(),a+=y)}function S(y){if(y.nodeType==1){var R=y.getAttribute("cm-text");if(R){c(R);return}var V=y.getAttribute("cm-marker"),le;if(V){var we=e.findMarks(m(r,0),m(i+1,0),u(+V));we.length&&(le=we[0].find(0))&&c(st(e.doc,le.from,le.to).join(l));return}if(y.getAttribute("contenteditable")=="false")return;var Fe=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;Fe&&f();for(var xe=0;xe<y.childNodes.length;xe++)S(y.childNodes[xe]);/^(pre|p)$/i.test(y.nodeName)&&(s=!0),Fe&&(o=!0)}else y.nodeType==3&&c(y.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;S(t),t!=n;)t=t.nextSibling,s=!1;return a}function ja(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Yi(e.clipPos(m(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return eu(a,t,n)}}function eu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!O(r,t))return Yi(m(d(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?Ie(e.rest):e.line;return Yi(m(d(a),a.text.length),i)}var o=t.nodeType==3?t:null,l=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&(n=o.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function f(le,we,Fe){for(var xe=-1;xe<(u?u.length:0);xe++)for(var Ke=xe<0?s.map:u[xe],ht=0;ht<Ke.length;ht+=3){var rt=Ke[ht+2];if(rt==le||rt==we){var Gt=d(xe<0?e.line:e.rest[xe]),zr=Ke[ht]+Fe;return(Fe<0||rt!=le)&&(zr=Ke[ht+(Fe?1:0)]),m(Gt,zr)}}}var c=f(o,l,n);if(c)return Yi(c,i);for(var S=l.nextSibling,y=o?o.nodeValue.length-n:0;S;S=S.nextSibling){if(c=f(S,S.firstChild,0),c)return Yi(m(c.line,c.ch-y),i);y+=S.textContent.length}for(var R=l.previousSibling,V=n;R;R=R.previousSibling){if(c=f(R,R.firstChild,-1),c)return Yi(m(c.line,c.ch+V),i);V+=R.textContent.length}}var nn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ne,this.hasSelection=!1,this.composing=null};nn.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),T&&(i.style.width="0px"),K(i,"input",function(){P&&te>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),K(i,"paste",function(o){Le(r,o)||Fl(o,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(o){if(!Le(r,o)){if(r.somethingSelected())_a({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=zl(r);_a({lineWise:!0,text:l.text}),o.type=="cut"?r.setSelections(l.ranges,null,Ee):(n.prevInput="",i.value=l.text.join(`
`),W(i))}else return;o.type=="cut"&&(r.state.cutIncoming=+new Date)}}K(i,"cut",a),K(i,"copy",a),K(e.scroller,"paste",function(o){if(!(Je(e,o)||Le(r,o))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=o.clipboardData,i.dispatchEvent(l)}}),K(e.lineSpace,"selectstart",function(o){Je(e,o)||qe(o)}),K(i,"compositionstart",function(){var o=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:o,range:r.markText(o,r.getCursor("to"),{className:"CodeMirror-composing"})}}),K(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},nn.prototype.createField=function(e){this.wrapper=Bl(),this.textarea=this.wrapper.firstChild},nn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},nn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Do(e);if(e.options.moveInputWithCursor){var i=An(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},nn.prototype.showSelection=function(e){var t=this.cm,n=t.display;Ve(n.cursorDiv,e.cursors),Ve(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},nn.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&W(this.textarea),P&&te>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",P&&te>=9&&(this.hasSelection=null))}},nn.prototype.getField=function(){return this.textarea},nn.prototype.supportsTouch=function(){return!1},nn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Et||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},nn.prototype.blur=function(){this.textarea.blur()},nn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},nn.prototype.receivedFocus=function(){this.slowPoll()},nn.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},nn.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},nn.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||or(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(P&&te>=9&&this.hasSelection===i||ct&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(r.length,i.length);o<l&&r.charCodeAt(o)==i.charCodeAt(o);)++o;return Yn(t,function(){xo(t,i.slice(o),r.length-o,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},nn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},nn.prototype.onKeyPress=function(){P&&te>=9&&(this.hasSelection=null),this.fastPoll()},nn.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Ri(n,e),o=r.scroller.scrollTop;if(!a||h)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(a)==-1&&gn(n,Mn)(n.doc,Si(a),Ee);var s=i.style.cssText,u=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+`px;
z-index: 1000; background: `+(P?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var c;ae&&(c=window.scrollY),r.input.focus(),ae&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function S(){if(i.selectionStart!=null){var V=n.somethingSelected(),le="\u200B"+(V?i.value:"");i.value="\u21DA",i.value=le,t.prevInput=V?"":"\u200B",i.selectionStart=1,i.selectionEnd=le.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,P&&te<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=o),i.selectionStart!=null)){(!P||P&&te<9)&&S();var V=0,le=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?gn(n,ll)(n):V++<10?r.detectingSelectAll=setTimeout(le,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(le,200)}}if(P&&te>=9&&S(),yt){$t(e);var R=function(){ge(window,"mouseup",R),setTimeout(y,20)};K(window,"mouseup",R)}else setTimeout(y,50)},nn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},nn.prototype.setUneditable=function(){},nn.prototype.needsContentAttribute=!1;function tu(e,t){if(t=t?L(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=M();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(K(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch(s){}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(ge(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=Vr(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function ru(e){e.off=ge,e.on=K,e.wheelEventPixels=us,e.Doc=Zn,e.splitLines=$e,e.countColumn=se,e.findColumn=At,e.isWordChar=p,e.Pass=_e,e.signal=Re,e.Line=an,e.changeEnd=Ci,e.scrollbarModel=Fo,e.Pos=m,e.cmpPos=x,e.modes=Ir,e.mimeModes=Br,e.resolveMode=Fr,e.getMode=sr,e.modeExtensions=mr,e.extendMode=lr,e.copyState=_t,e.startState=yr,e.innerMode=Xt,e.commands=ya,e.keyMap=hi,e.keyName=xl,e.isModifierKey=Cl,e.lookupKey=_i,e.normalizeKeyMap=Ns,e.StringStream=Rt,e.SharedTextMarker=ga,e.TextMarker=xi,e.LineWidget=ha,e.e_preventDefault=qe,e.e_stopPropagation=Qt,e.e_stop=$t,e.addClass=Z,e.contains=O,e.rmClass=re,e.keyNames=Ei}js(Vr),Qs(Vr);var nu="iter insert remove copy getEditor constructor".split(" ");for(var Xa in Zn.prototype)Zn.prototype.hasOwnProperty(Xa)&&ue(nu,Xa)<0&&(Vr.prototype[Xa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Zn.prototype[Xa]));return be(Zn),Vr.inputStyles={textarea:nn,contenteditable:kr},Vr.defineMode=function(e){!Vr.defaults.mode&&e!="null"&&(Vr.defaults.mode=e),Qr.apply(this,arguments)},Vr.defineMIME=Ur,Vr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Vr.defineMIME("text/plain","null"),Vr.defineExtension=function(e,t){Vr.prototype[e]=t},Vr.defineDocExtension=function(e,t){Zn.prototype[e]=t},Vr.fromTextArea=tu,ru(Vr),Vr.version="5.58.2",Vr})},66003:function(bn,ft,b){"use strict";b.d(ft,{Z:function(){return ae}});var B=b(43079),q=b(27247),U=b(34666),ye=b(59301),P=["show"];function te(Qe,ee){if(!ee.max)return!0;var h=ee.strategy(Qe);return h<=ee.max}function ae(Qe,ee){return ye.useMemo(function(){var h={};ee&&(h.show=(0,U.Z)(ee)==="object"&&ee.formatter?ee.formatter:!!ee),h=(0,q.Z)((0,q.Z)({},h),Qe);var He=h,E=He.show,De=(0,B.Z)(He,P);return(0,q.Z)((0,q.Z)({},De),{},{show:!!E,showFormatter:typeof E=="function"?E:void 0,strategy:De.strategy||function(T){return T.length}})},[Qe,ee])}},36901:function(bn,ft,b){"use strict";b.r(ft),b.d(ft,{BaseInput:function(){return h},default:function(){return he}});var B=b(27247),q=b(32855),U=b(74430),ye=b(34666),P=b(92310),te=b.n(P),ae=b(59301),Qe=b(30292),ee=ae.forwardRef(function(F,yt){var Be,re,bt,Ve=F.inputElement,Q=F.children,lt=F.prefixCls,Lt=F.prefix,O=F.suffix,M=F.addonBefore,Z=F.addonAfter,X=F.className,W=F.style,Ae=F.disabled,L=F.readOnly,se=F.focused,Ne=F.triggerFocus,ue=F.allowClear,je=F.value,_e=F.handleReset,Ee=F.hidden,Ue=F.classes,We=F.classNames,At=F.dataAttrs,xt=F.styles,St=F.components,Ie=F.onClear,ar=Q!=null?Q:Ve,er=(St==null?void 0:St.affixWrapper)||"span",N=(St==null?void 0:St.groupWrapper)||"span",g=(St==null?void 0:St.wrapper)||"span",C=(St==null?void 0:St.groupAddon)||"span",p=(0,ae.useRef)(null),w=function(gt){var Xe;(Xe=p.current)!==null&&Xe!==void 0&&Xe.contains(gt.target)&&(Ne==null||Ne())},I=(0,Qe.X3)(F),A=(0,ae.cloneElement)(ar,{value:je,className:te()((Be=ar.props)===null||Be===void 0?void 0:Be.className,!I&&(We==null?void 0:We.variant))||null}),z=(0,ae.useRef)(null);if(ae.useImperativeHandle(yt,function(){return{nativeElement:z.current||p.current}}),I){var oe=null;if(ue){var $=!Ae&&!L&&je,de="".concat(lt,"-clear-icon"),ie=(0,ye.Z)(ue)==="object"&&ue!==null&&ue!==void 0&&ue.clearIcon?ue.clearIcon:"\u2716";oe=ae.createElement("button",{type:"button",tabIndex:-1,onClick:function(gt){_e==null||_e(gt),Ie==null||Ie()},onMouseDown:function(gt){return gt.preventDefault()},className:te()(de,(0,U.Z)((0,U.Z)({},"".concat(de,"-hidden"),!$),"".concat(de,"-has-suffix"),!!O))},ie)}var ne="".concat(lt,"-affix-wrapper"),pe=te()(ne,(0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)({},"".concat(lt,"-disabled"),Ae),"".concat(ne,"-disabled"),Ae),"".concat(ne,"-focused"),se),"".concat(ne,"-readonly"),L),"".concat(ne,"-input-with-clear-btn"),O&&ue&&je),Ue==null?void 0:Ue.affixWrapper,We==null?void 0:We.affixWrapper,We==null?void 0:We.variant),k=(O||ue)&&ae.createElement("span",{className:te()("".concat(lt,"-suffix"),We==null?void 0:We.suffix),style:xt==null?void 0:xt.suffix},oe,O);A=ae.createElement(er,(0,q.Z)({className:pe,style:xt==null?void 0:xt.affixWrapper,onClick:w},At==null?void 0:At.affixWrapper,{ref:p}),Lt&&ae.createElement("span",{className:te()("".concat(lt,"-prefix"),We==null?void 0:We.prefix),style:xt==null?void 0:xt.prefix},Lt),A,k)}if((0,Qe.He)(F)){var ve="".concat(lt,"-group"),K="".concat(ve,"-addon"),Ge="".concat(ve,"-wrapper"),ge=te()("".concat(lt,"-wrapper"),ve,Ue==null?void 0:Ue.wrapper,We==null?void 0:We.wrapper),Re=te()(Ge,(0,U.Z)({},"".concat(Ge,"-disabled"),Ae),Ue==null?void 0:Ue.group,We==null?void 0:We.groupWrapper);A=ae.createElement(N,{className:Re,ref:z},ae.createElement(g,{className:ge},M&&ae.createElement(C,{className:K},M),A,Z&&ae.createElement(C,{className:K},Z)))}return ae.cloneElement(A,{className:te()((re=A.props)===null||re===void 0?void 0:re.className,X)||null,style:(0,B.Z)((0,B.Z)({},(bt=A.props)===null||bt===void 0?void 0:bt.style),W),hidden:Ee})}),h=ee,He=b(3300),E=b(11913),De=b(43079),T=b(18929),mt=b(2738),Et=b(66003),ct=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Mt=(0,ae.forwardRef)(function(F,yt){var Be=F.autoComplete,re=F.onChange,bt=F.onFocus,Ve=F.onBlur,Q=F.onPressEnter,lt=F.onKeyDown,Lt=F.onKeyUp,O=F.prefixCls,M=O===void 0?"rc-input":O,Z=F.disabled,X=F.htmlSize,W=F.className,Ae=F.maxLength,L=F.suffix,se=F.showCount,Ne=F.count,ue=F.type,je=ue===void 0?"text":ue,_e=F.classes,Ee=F.classNames,Ue=F.styles,We=F.onCompositionStart,At=F.onCompositionEnd,xt=(0,De.Z)(F,ct),St=(0,ae.useState)(!1),Ie=(0,E.Z)(St,2),ar=Ie[0],er=Ie[1],N=(0,ae.useRef)(!1),g=(0,ae.useRef)(!1),C=(0,ae.useRef)(null),p=(0,ae.useRef)(null),w=function(it){C.current&&(0,Qe.nH)(C.current,it)},I=(0,T.Z)(F.defaultValue,{value:F.value}),A=(0,E.Z)(I,2),z=A[0],oe=A[1],$=z==null?"":String(z),de=(0,ae.useState)(null),ie=(0,E.Z)(de,2),ne=ie[0],pe=ie[1],k=(0,Et.Z)(Ne,se),ve=k.max||Ae,K=k.strategy($),Ge=!!ve&&K>ve;(0,ae.useImperativeHandle)(yt,function(){var et;return{focus:w,blur:function(){var kt;(kt=C.current)===null||kt===void 0||kt.blur()},setSelectionRange:function(kt,Vt,Dt){var Pt;(Pt=C.current)===null||Pt===void 0||Pt.setSelectionRange(kt,Vt,Dt)},select:function(){var kt;(kt=C.current)===null||kt===void 0||kt.select()},input:C.current,nativeElement:((et=p.current)===null||et===void 0?void 0:et.nativeElement)||C.current}}),(0,ae.useEffect)(function(){g.current&&(g.current=!1),er(function(et){return et&&Z?!1:et})},[Z]);var ge=function(it,kt,Vt){var Dt=kt;if(!N.current&&k.exceedFormatter&&k.max&&k.strategy(kt)>k.max){if(Dt=k.exceedFormatter(kt,{max:k.max}),kt!==Dt){var Pt,$e;pe([((Pt=C.current)===null||Pt===void 0?void 0:Pt.selectionStart)||0,(($e=C.current)===null||$e===void 0?void 0:$e.selectionEnd)||0])}}else if(Vt.source==="compositionEnd")return;oe(Dt),C.current&&(0,Qe.rJ)(C.current,it,re,Dt)};(0,ae.useEffect)(function(){if(ne){var et;(et=C.current)===null||et===void 0||et.setSelectionRange.apply(et,(0,He.Z)(ne))}},[ne]);var Re=function(it){ge(it,it.target.value,{source:"change"})},Le=function(it){N.current=!1,ge(it,it.currentTarget.value,{source:"compositionEnd"}),At==null||At(it)},gt=function(it){Q&&it.key==="Enter"&&!g.current&&(g.current=!0,Q(it)),lt==null||lt(it)},Xe=function(it){it.key==="Enter"&&(g.current=!1),Lt==null||Lt(it)},be=function(it){er(!0),bt==null||bt(it)},qe=function(it){g.current&&(g.current=!1),er(!1),Ve==null||Ve(it)},Qt=function(it){oe(""),w(),C.current&&(0,Qe.rJ)(C.current,it,re)},Er=Ge&&"".concat(M,"-out-of-range"),$t=function(){var it=(0,mt.Z)(F,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return ae.createElement("input",(0,q.Z)({autoComplete:Be},it,{onChange:Re,onFocus:be,onBlur:qe,onKeyDown:gt,onKeyUp:Xe,className:te()(M,(0,U.Z)({},"".concat(M,"-disabled"),Z),Ee==null?void 0:Ee.input),style:Ue==null?void 0:Ue.input,ref:C,size:X,type:je,onCompositionStart:function(Vt){N.current=!0,We==null||We(Vt)},onCompositionEnd:Le}))},Mr=function(){var it=Number(ve)>0;if(L||k.show){var kt=k.showFormatter?k.showFormatter({value:$,count:K,maxLength:ve}):"".concat(K).concat(it?" / ".concat(ve):"");return ae.createElement(ae.Fragment,null,k.show&&ae.createElement("span",{className:te()("".concat(M,"-show-count-suffix"),(0,U.Z)({},"".concat(M,"-show-count-has-suffix"),!!L),Ee==null?void 0:Ee.count),style:(0,B.Z)({},Ue==null?void 0:Ue.count)},kt),L)}return null};return ae.createElement(h,(0,q.Z)({},xt,{prefixCls:M,className:te()(W,Er),handleReset:Qt,value:$,focused:ar,triggerFocus:w,suffix:Mr(),disabled:Z,classes:_e,classNames:Ee,styles:Ue}),$t())}),dt=Mt,he=dt},30292:function(bn,ft,b){"use strict";b.d(ft,{He:function(){return B},X3:function(){return q},nH:function(){return P},rJ:function(){return ye}});function B(te){return!!(te.addonBefore||te.addonAfter)}function q(te){return!!(te.prefix||te.suffix||te.allowClear)}function U(te,ae,Qe){var ee=ae.cloneNode(!0),h=Object.create(te,{target:{value:ee},currentTarget:{value:ee}});return ee.value=Qe,typeof ae.selectionStart=="number"&&typeof ae.selectionEnd=="number"&&(ee.selectionStart=ae.selectionStart,ee.selectionEnd=ae.selectionEnd),ee.setSelectionRange=function(){ae.setSelectionRange.apply(ae,arguments)},h}function ye(te,ae,Qe,ee){if(Qe){var h=ae;if(ae.type==="click"){h=U(ae,te,""),Qe(h);return}if(te.type!=="file"&&ee!==void 0){h=U(ae,te,ee),Qe(h);return}Qe(h)}}function P(te,ae){if(te){te.focus(ae);var Qe=ae||{},ee=Qe.cursor;if(ee){var h=te.value.length;switch(ee){case"start":te.setSelectionRange(0,0);break;case"end":te.setSelectionRange(h,h);break;default:te.setSelectionRange(0,h)}}}}},11780:function(bn,ft,b){"use strict";b.d(ft,{Z:function(){return Ae}});var B=b(32855),q=b(27247),U=b(11913),ye=b(43079),P=b(59301),te=b(92310),ae=b.n(te),Qe=b(29301),ee=b(34280),h=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],He=void 0;function E(L,se){var Ne=L.prefixCls,ue=L.invalidate,je=L.item,_e=L.renderItem,Ee=L.responsive,Ue=L.responsiveDisabled,We=L.registerSize,At=L.itemKey,xt=L.className,St=L.style,Ie=L.children,ar=L.display,er=L.order,N=L.component,g=N===void 0?"div":N,C=(0,ye.Z)(L,h),p=Ee&&!ar;function w($){We(At,$)}P.useEffect(function(){return function(){w(null)}},[]);var I=_e&&je!==He?_e(je,{index:er}):Ie,A;ue||(A={opacity:p?0:1,height:p?0:He,overflowY:p?"hidden":He,order:Ee?er:He,pointerEvents:p?"none":He,position:p?"absolute":He});var z={};p&&(z["aria-hidden"]=!0);var oe=P.createElement(g,(0,B.Z)({className:ae()(!ue&&Ne,xt),style:(0,q.Z)((0,q.Z)({},A),St)},z,C,{ref:se}),I);return Ee&&(oe=P.createElement(Qe.Z,{onResize:function(de){var ie=de.offsetWidth;w(ie)},disabled:Ue},oe)),oe}var De=P.forwardRef(E);De.displayName="Item";var T=De,mt=b(6089),Et=b(4676),ct=b(16089);function Mt(L){if(typeof MessageChannel=="undefined")(0,ct.Z)(L);else{var se=new MessageChannel;se.port1.onmessage=function(){return L()},se.port2.postMessage(void 0)}}function dt(){var L=P.useRef(null),se=function(ue){L.current||(L.current=[],Mt(function(){(0,Et.unstable_batchedUpdates)(function(){L.current.forEach(function(je){je()}),L.current=null})})),L.current.push(ue)};return se}function he(L,se){var Ne=P.useState(se),ue=(0,U.Z)(Ne,2),je=ue[0],_e=ue[1],Ee=(0,mt.Z)(function(Ue){L(function(){_e(Ue)})});return[je,Ee]}var F=P.createContext(null),yt=["component"],Be=["className"],re=["className"],bt=function(se,Ne){var ue=P.useContext(F);if(!ue){var je=se.component,_e=je===void 0?"div":je,Ee=(0,ye.Z)(se,yt);return P.createElement(_e,(0,B.Z)({},Ee,{ref:Ne}))}var Ue=ue.className,We=(0,ye.Z)(ue,Be),At=se.className,xt=(0,ye.Z)(se,re);return P.createElement(F.Provider,{value:null},P.createElement(T,(0,B.Z)({ref:Ne,className:ae()(Ue,At)},We,xt)))},Ve=P.forwardRef(bt);Ve.displayName="RawItem";var Q=Ve,lt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Lt="responsive",O="invalidate";function M(L){return"+ ".concat(L.length," ...")}function Z(L,se){var Ne=L.prefixCls,ue=Ne===void 0?"rc-overflow":Ne,je=L.data,_e=je===void 0?[]:je,Ee=L.renderItem,Ue=L.renderRawItem,We=L.itemKey,At=L.itemWidth,xt=At===void 0?10:At,St=L.ssr,Ie=L.style,ar=L.className,er=L.maxCount,N=L.renderRest,g=L.renderRawRest,C=L.suffix,p=L.component,w=p===void 0?"div":p,I=L.itemComponent,A=L.onVisibleChange,z=(0,ye.Z)(L,lt),oe=St==="full",$=dt(),de=he($,null),ie=(0,U.Z)(de,2),ne=ie[0],pe=ie[1],k=ne||0,ve=he($,new Map),K=(0,U.Z)(ve,2),Ge=K[0],ge=K[1],Re=he($,0),Le=(0,U.Z)(Re,2),gt=Le[0],Xe=Le[1],be=he($,0),qe=(0,U.Z)(be,2),Qt=qe[0],Er=qe[1],$t=he($,0),Mr=(0,U.Z)($t,2),et=Mr[0],it=Mr[1],kt=(0,P.useState)(null),Vt=(0,U.Z)(kt,2),Dt=Vt[0],Pt=Vt[1],$e=(0,P.useState)(null),or=(0,U.Z)($e,2),nr=or[0],pr=or[1],tt=P.useMemo(function(){return nr===null&&oe?Number.MAX_SAFE_INTEGER:nr||0},[nr,ne]),Ir=(0,P.useState)(!1),Br=(0,U.Z)(Ir,2),Qr=Br[0],Ur=Br[1],Fr="".concat(ue,"-item"),sr=Math.max(gt,Qt),mr=er===Lt,lr=_e.length&&mr,_t=er===O,Xt=lr||typeof er=="number"&&_e.length>er,yr=(0,P.useMemo)(function(){var Me=_e;return lr?ne===null&&oe?Me=_e:Me=_e.slice(0,Math.min(_e.length,k/xt)):typeof er=="number"&&(Me=_e.slice(0,er)),Me},[_e,xt,ne,er,lr]),Rt=(0,P.useMemo)(function(){return lr?_e.slice(tt+1):_e.slice(yr.length)},[_e,yr,lr,tt]),Y=(0,P.useCallback)(function(Me,_){var Ze;return typeof We=="function"?We(Me):(Ze=We&&(Me==null?void 0:Me[We]))!==null&&Ze!==void 0?Ze:_},[We]),st=(0,P.useCallback)(Ee||function(Me){return Me},[Ee]);function br(Me,_,Ze){nr===Me&&(_===void 0||_===Dt)||(pr(Me),Ze||(Ur(Me<_e.length-1),A==null||A(Me)),_!==void 0&&Pt(_))}function Sr(Me,_){pe(_.clientWidth)}function d(Me,_){ge(function(Ze){var Se=new Map(Ze);return _===null?Se.delete(Me):Se.set(Me,_),Se})}function v(Me,_){Er(_),Xe(Qt)}function H(Me,_){it(_)}function D(Me){return Ge.get(Y(yr[Me],Me))}(0,ee.Z)(function(){if(k&&typeof sr=="number"&&yr){var Me=et,_=yr.length,Ze=_-1;if(!_){br(0,null);return}for(var Se=0;Se<_;Se+=1){var ze=D(Se);if(oe&&(ze=ze||0),ze===void 0){br(Se-1,void 0,!0);break}if(Me+=ze,Ze===0&&Me<=k||Se===Ze-1&&Me+D(Ze)<=k){br(Ze,null);break}else if(Me+sr>k){br(Se-1,Me-ze-et+Qt);break}}C&&D(0)+et>k&&Pt(null)}},[k,Ge,Qt,et,Y,yr]);var m=Qr&&!!Rt.length,x={};Dt!==null&&lr&&(x={position:"absolute",left:Dt,top:0});var fe={prefixCls:Fr,responsive:lr,component:I,invalidate:_t},ce=Ue?function(Me,_){var Ze=Y(Me,_);return P.createElement(F.Provider,{key:Ze,value:(0,q.Z)((0,q.Z)({},fe),{},{order:_,item:Me,itemKey:Ze,registerSize:d,display:_<=tt})},Ue(Me,_))}:function(Me,_){var Ze=Y(Me,_);return P.createElement(T,(0,B.Z)({},fe,{order:_,key:Ze,item:Me,renderItem:st,itemKey:Ze,registerSize:d,display:_<=tt}))},Pe={order:m?tt:Number.MAX_SAFE_INTEGER,className:"".concat(Fr,"-rest"),registerSize:v,display:m},Ce=N||M,ke=g?P.createElement(F.Provider,{value:(0,q.Z)((0,q.Z)({},fe),Pe)},g(Rt)):P.createElement(T,(0,B.Z)({},fe,Pe),typeof Ce=="function"?Ce(Rt):Ce),J=P.createElement(w,(0,B.Z)({className:ae()(!_t&&ue,ar),style:Ie,ref:se},z),yr.map(ce),Xt?ke:null,C&&P.createElement(T,(0,B.Z)({},fe,{responsive:mr,responsiveDisabled:!lr,order:tt,className:"".concat(Fr,"-suffix"),registerSize:H,display:!0,style:x}),C));return mr?P.createElement(Qe.Z,{onResize:Sr,disabled:!lr},J):J}var X=P.forwardRef(Z);X.displayName="Overflow",X.Item=Q,X.RESPONSIVE=Lt,X.INVALIDATE=O;var W=X,Ae=W},29301:function(bn,ft,b){"use strict";b.d(ft,{Z:function(){return O}});var B=b(32855),q=b(59301),U=b(11592),ye=b(48736),P=b(27247),te=b(34666),ae=b(76846),Qe=b(8654),ee=q.createContext(null);function h(M){var Z=M.children,X=M.onBatchResize,W=q.useRef(0),Ae=q.useRef([]),L=q.useContext(ee),se=q.useCallback(function(Ne,ue,je){W.current+=1;var _e=W.current;Ae.current.push({size:Ne,element:ue,data:je}),Promise.resolve().then(function(){_e===W.current&&(X==null||X(Ae.current),Ae.current=[])}),L==null||L(Ne,ue,je)},[X,L]);return q.createElement(ee.Provider,{value:se},Z)}var He=b(76374),E=new Map;function De(M){M.forEach(function(Z){var X,W=Z.target;(X=E.get(W))===null||X===void 0||X.forEach(function(Ae){return Ae(W)})})}var T=new He.Z(De),mt=null,Et=null;function ct(M,Z){E.has(M)||(E.set(M,new Set),T.observe(M)),E.get(M).add(Z)}function Mt(M,Z){E.has(M)&&(E.get(M).delete(Z),E.get(M).size||(T.unobserve(M),E.delete(M)))}var dt=b(33377),he=b(93912),F=b(18881),yt=b(85461),Be=function(M){(0,F.Z)(X,M);var Z=(0,yt.Z)(X);function X(){return(0,dt.Z)(this,X),Z.apply(this,arguments)}return(0,he.Z)(X,[{key:"render",value:function(){return this.props.children}}]),X}(q.Component);function re(M,Z){var X=M.children,W=M.disabled,Ae=q.useRef(null),L=q.useRef(null),se=q.useContext(ee),Ne=typeof X=="function",ue=Ne?X(Ae):X,je=q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),_e=!Ne&&q.isValidElement(ue)&&(0,Qe.Yr)(ue),Ee=_e?(0,Qe.C4)(ue):null,Ue=(0,Qe.x1)(Ee,Ae),We=function(){var Ie;return(0,ae.ZP)(Ae.current)||(Ae.current&&(0,te.Z)(Ae.current)==="object"?(0,ae.ZP)((Ie=Ae.current)===null||Ie===void 0?void 0:Ie.nativeElement):null)||(0,ae.ZP)(L.current)};q.useImperativeHandle(Z,function(){return We()});var At=q.useRef(M);At.current=M;var xt=q.useCallback(function(St){var Ie=At.current,ar=Ie.onResize,er=Ie.data,N=St.getBoundingClientRect(),g=N.width,C=N.height,p=St.offsetWidth,w=St.offsetHeight,I=Math.floor(g),A=Math.floor(C);if(je.current.width!==I||je.current.height!==A||je.current.offsetWidth!==p||je.current.offsetHeight!==w){var z={width:I,height:A,offsetWidth:p,offsetHeight:w};je.current=z;var oe=p===Math.round(g)?g:p,$=w===Math.round(C)?C:w,de=(0,P.Z)((0,P.Z)({},z),{},{offsetWidth:oe,offsetHeight:$});se==null||se(de,St,er),ar&&Promise.resolve().then(function(){ar(de,St)})}},[]);return q.useEffect(function(){var St=We();return St&&!W&&ct(St,xt),function(){return Mt(St,xt)}},[Ae.current,W]),q.createElement(Be,{ref:L},_e?q.cloneElement(ue,{ref:Ue}):ue)}var bt=q.forwardRef(re),Ve=bt,Q="rc-observer-key";function lt(M,Z){var X=M.children,W=typeof X=="function"?[X]:(0,U.Z)(X);return W.map(function(Ae,L){var se=(Ae==null?void 0:Ae.key)||"".concat(Q,"-").concat(L);return q.createElement(Ve,(0,B.Z)({},M,{key:se,ref:L===0?Z:void 0}),Ae)})}var Lt=q.forwardRef(lt);Lt.Collection=h;var O=Lt},6551:function(bn,ft,b){"use strict";b.d(ft,{ZP:function(){return ae}});var B=b(11913),q=b(59301),U=b(47273),ye=0,P=(0,U.Z)();function te(){var Qe;return P?(Qe=ye,ye+=1):Qe="TEST_OR_SSR",Qe}function ae(Qe){var ee=q.useState(),h=(0,B.Z)(ee,2),He=h[0],E=h[1];return q.useEffect(function(){E("rc_select_".concat(te()))},[]),Qe||He}},37463:function(bn,ft,b){"use strict";b.d(ft,{Ac:function(){return Le},Xo:function(){return Xe},Wx:function(){return qe},ZP:function(){return Sr},lk:function(){return he}});var B=b(32855),q=b(3300),U=b(74430),ye=b(27247),P=b(11913),te=b(43079),ae=b(34666),Qe=b(18929),ee=b(48736),h=b(59301),He=b(92310),E=b.n(He),De=b(34280),T=b(49658),mt=b(8654),Et=function(v){var H=v.className,D=v.customizeIcon,m=v.customizeIconProps,x=v.children,fe=v.onMouseDown,ce=v.onClick,Pe=typeof D=="function"?D(m):D;return h.createElement("span",{className:H,onMouseDown:function(ke){ke.preventDefault(),fe==null||fe(ke)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:ce,"aria-hidden":!0},Pe!==void 0?Pe:h.createElement("span",{className:E()(H.split(/\s+/).map(function(Ce){return"".concat(Ce,"-icon")}))},x))},ct=Et,Mt=function(v,H,D,m,x){var fe=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,ce=arguments.length>6?arguments[6]:void 0,Pe=arguments.length>7?arguments[7]:void 0,Ce=h.useMemo(function(){if((0,ae.Z)(m)==="object")return m.clearIcon;if(x)return x},[m,x]),ke=h.useMemo(function(){return!!(!fe&&m&&(D.length||ce)&&!(Pe==="combobox"&&ce===""))},[m,fe,D.length,ce,Pe]);return{allowClear:ke,clearIcon:h.createElement(ct,{className:"".concat(v,"-clear"),onMouseDown:H,customizeIcon:Ce},"\xD7")}},dt=h.createContext(null);function he(){return h.useContext(dt)}function F(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,v=h.useState(!1),H=(0,P.Z)(v,2),D=H[0],m=H[1],x=h.useRef(null),fe=function(){window.clearTimeout(x.current)};h.useEffect(function(){return fe},[]);var ce=function(Ce,ke){fe(),x.current=window.setTimeout(function(){m(Ce),ke&&ke()},d)};return[D,ce,fe]}function yt(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,v=h.useRef(null),H=h.useRef(null);h.useEffect(function(){return function(){window.clearTimeout(H.current)}},[]);function D(m){(m||v.current===null)&&(v.current=m),window.clearTimeout(H.current),H.current=window.setTimeout(function(){v.current=null},d)}return[function(){return v.current},D]}function Be(d,v,H,D){var m=h.useRef(null);m.current={open:v,triggerOpen:H,customizedTrigger:D},h.useEffect(function(){function x(fe){var ce;if(!((ce=m.current)!==null&&ce!==void 0&&ce.customizedTrigger)){var Pe=fe.target;Pe.shadowRoot&&fe.composed&&(Pe=fe.composedPath()[0]||Pe),m.current.open&&d().filter(function(Ce){return Ce}).every(function(Ce){return!Ce.contains(Pe)&&Ce!==Pe})&&m.current.triggerOpen(!1)}}return window.addEventListener("mousedown",x),function(){return window.removeEventListener("mousedown",x)}},[])}var re=b(10228);function bt(d){return d&&![re.Z.ESC,re.Z.SHIFT,re.Z.BACKSPACE,re.Z.TAB,re.Z.WIN_KEY,re.Z.ALT,re.Z.META,re.Z.WIN_KEY_RIGHT,re.Z.CTRL,re.Z.SEMICOLON,re.Z.EQUALS,re.Z.CAPS_LOCK,re.Z.CONTEXT_MENU,re.Z.F1,re.Z.F2,re.Z.F3,re.Z.F4,re.Z.F5,re.Z.F6,re.Z.F7,re.Z.F8,re.Z.F9,re.Z.F10,re.Z.F11,re.Z.F12].includes(d)}var Ve=b(26112),Q=b(11780);function lt(d,v,H){var D=(0,ye.Z)((0,ye.Z)({},d),H?v:{});return Object.keys(v).forEach(function(m){var x=v[m];typeof x=="function"&&(D[m]=function(){for(var fe,ce=arguments.length,Pe=new Array(ce),Ce=0;Ce<ce;Ce++)Pe[Ce]=arguments[Ce];return x.apply(void 0,Pe),(fe=d[m])===null||fe===void 0?void 0:fe.call.apply(fe,[d].concat(Pe))})}),D}var Lt=lt,O=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],M=function(v,H){var D=v.prefixCls,m=v.id,x=v.inputElement,fe=v.autoFocus,ce=v.autoComplete,Pe=v.editable,Ce=v.activeDescendantId,ke=v.value,J=v.open,Me=v.attrs,_=(0,te.Z)(v,O),Ze=x||h.createElement("input",null),Se=Ze,ze=Se.ref,Tt=Se.props;return(0,ee.Kp)(!("maxLength"in Ze.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Ze=h.cloneElement(Ze,(0,ye.Z)((0,ye.Z)((0,ye.Z)({type:"search"},Lt(_,Tt,!0)),{},{id:m,ref:(0,mt.sQ)(H,ze),autoComplete:ce||"off",autoFocus:fe,className:E()("".concat(D,"-selection-search-input"),Tt==null?void 0:Tt.className),role:"combobox","aria-expanded":J||!1,"aria-haspopup":"listbox","aria-owns":"".concat(m,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(m,"_list"),"aria-activedescendant":J?Ce:void 0},Me),{},{value:Pe?ke:"",readOnly:!Pe,unselectable:Pe?null:"on",style:(0,ye.Z)((0,ye.Z)({},Tt.style),{},{opacity:Pe?null:0})})),Ze},Z=h.forwardRef(M),X=Z;function W(d){return Array.isArray(d)?d:d!==void 0?[d]:[]}var Ae=typeof window!="undefined"&&window.document&&window.document.documentElement,L=Ae;function se(d){return d!=null}function Ne(d){return!d&&d!==0}function ue(d){return["string","number"].includes((0,ae.Z)(d))}function je(d){var v=void 0;return d&&(ue(d.title)?v=d.title.toString():ue(d.label)&&(v=d.label.toString())),v}function _e(d,v){L?h.useLayoutEffect(d,v):h.useEffect(d,v)}function Ee(d){var v;return(v=d.key)!==null&&v!==void 0?v:d.value}var Ue=function(v){v.preventDefault(),v.stopPropagation()},We=function(v){var H=v.id,D=v.prefixCls,m=v.values,x=v.open,fe=v.searchValue,ce=v.autoClearSearchValue,Pe=v.inputRef,Ce=v.placeholder,ke=v.disabled,J=v.mode,Me=v.showSearch,_=v.autoFocus,Ze=v.autoComplete,Se=v.activeDescendantId,ze=v.tabIndex,Tt=v.removeIcon,Ft=v.maxTagCount,Yt=v.maxTagTextLength,zt=v.maxTagPlaceholder,cr=zt===void 0?function(Oe){return"+ ".concat(Oe.length," ...")}:zt,Ct=v.tagRender,dr=v.onToggleOpen,Wr=v.onRemove,Ht=v.onInputChange,Wt=v.onInputPaste,Bt=v.onInputKeyDown,vr=v.onInputMouseDown,Nt=v.onInputCompositionStart,wt=v.onInputCompositionEnd,pt=v.onInputBlur,Ut=h.useRef(null),ur=(0,h.useState)(0),tr=(0,P.Z)(ur,2),hr=tr[0],jt=tr[1],Ot=(0,h.useState)(!1),Cr=(0,P.Z)(Ot,2),_r=Cr[0],jr=Cr[1],fr="".concat(D,"-selection"),en=x||J==="multiple"&&ce===!1||J==="tags"?fe:"",Lr=J==="tags"||J==="multiple"&&ce===!1||Me&&(x||_r);_e(function(){jt(Ut.current.scrollWidth)},[en]);var Gr=function(me,nt,Kt,Jt,qt){return h.createElement("span",{title:je(me),className:E()("".concat(fr,"-item"),(0,U.Z)({},"".concat(fr,"-item-disabled"),Kt))},h.createElement("span",{className:"".concat(fr,"-item-content")},nt),Jt&&h.createElement(ct,{className:"".concat(fr,"-item-remove"),onMouseDown:Ue,onClick:qt,customizeIcon:Tt},"\xD7"))},Kr=function(me,nt,Kt,Jt,qt,Rr){var Xr=function(tn){Ue(tn),dr(!x)};return h.createElement("span",{onMouseDown:Xr},Ct({label:nt,value:me,disabled:Kt,closable:Jt,onClose:qt,isMaxTag:!!Rr}))},wr=function(me){var nt=me.disabled,Kt=me.label,Jt=me.value,qt=!ke&&!nt,Rr=Kt;if(typeof Yt=="number"&&(typeof Kt=="string"||typeof Kt=="number")){var Xr=String(Rr);Xr.length>Yt&&(Rr="".concat(Xr.slice(0,Yt),"..."))}var Tr=function(Or){Or&&Or.stopPropagation(),Wr(me)};return typeof Ct=="function"?Kr(Jt,Rr,nt,qt,Tr):Gr(me,Rr,nt,qt,Tr)},ot=function(me){if(!m.length)return null;var nt=typeof cr=="function"?cr(me):cr;return typeof Ct=="function"?Kr(void 0,nt,!1,!1,void 0,!0):Gr({title:nt},nt,!1)},G=h.createElement("div",{className:"".concat(fr,"-search"),style:{width:hr},onFocus:function(){jr(!0)},onBlur:function(){jr(!1)}},h.createElement(X,{ref:Pe,open:x,prefixCls:D,id:H,inputElement:null,disabled:ke,autoFocus:_,autoComplete:Ze,editable:Lr,activeDescendantId:Se,value:en,onKeyDown:Bt,onMouseDown:vr,onChange:Ht,onPaste:Wt,onCompositionStart:Nt,onCompositionEnd:wt,onBlur:pt,tabIndex:ze,attrs:(0,Ve.Z)(v,!0)}),h.createElement("span",{ref:Ut,className:"".concat(fr,"-search-mirror"),"aria-hidden":!0},en,"\xA0")),j=h.createElement(Q.Z,{prefixCls:"".concat(fr,"-overflow"),data:m,renderItem:wr,renderRest:ot,suffix:G,itemKey:Ee,maxCount:Ft});return h.createElement("span",{className:"".concat(fr,"-wrap")},j,!m.length&&!en&&h.createElement("span",{className:"".concat(fr,"-placeholder")},Ce))},At=We,xt=function(v){var H=v.inputElement,D=v.prefixCls,m=v.id,x=v.inputRef,fe=v.disabled,ce=v.autoFocus,Pe=v.autoComplete,Ce=v.activeDescendantId,ke=v.mode,J=v.open,Me=v.values,_=v.placeholder,Ze=v.tabIndex,Se=v.showSearch,ze=v.searchValue,Tt=v.activeValue,Ft=v.maxLength,Yt=v.onInputKeyDown,zt=v.onInputMouseDown,cr=v.onInputChange,Ct=v.onInputPaste,dr=v.onInputCompositionStart,Wr=v.onInputCompositionEnd,Ht=v.onInputBlur,Wt=v.title,Bt=h.useState(!1),vr=(0,P.Z)(Bt,2),Nt=vr[0],wt=vr[1],pt=ke==="combobox",Ut=pt||Se,ur=Me[0],tr=ze||"";pt&&Tt&&!Nt&&(tr=Tt),h.useEffect(function(){pt&&wt(!1)},[pt,Tt]);var hr=ke!=="combobox"&&!J&&!Se?!1:!!tr,jt=Wt===void 0?je(ur):Wt,Ot=h.useMemo(function(){return ur?null:h.createElement("span",{className:"".concat(D,"-selection-placeholder"),style:hr?{visibility:"hidden"}:void 0},_)},[ur,hr,_,D]);return h.createElement("span",{className:"".concat(D,"-selection-wrap")},h.createElement("span",{className:"".concat(D,"-selection-search")},h.createElement(X,{ref:x,prefixCls:D,id:m,open:J,inputElement:H,disabled:fe,autoFocus:ce,autoComplete:Pe,editable:Ut,activeDescendantId:Ce,value:tr,onKeyDown:Yt,onMouseDown:zt,onChange:function(_r){wt(!0),cr(_r)},onPaste:Ct,onCompositionStart:dr,onCompositionEnd:Wr,onBlur:Ht,tabIndex:Ze,attrs:(0,Ve.Z)(v,!0),maxLength:pt?Ft:void 0})),!pt&&ur?h.createElement("span",{className:"".concat(D,"-selection-item"),title:jt,style:hr?{visibility:"hidden"}:void 0},ur.label):null,Ot)},St=xt,Ie=function(v,H){var D=(0,h.useRef)(null),m=(0,h.useRef)(!1),x=v.prefixCls,fe=v.open,ce=v.mode,Pe=v.showSearch,Ce=v.tokenWithEnter,ke=v.disabled,J=v.prefix,Me=v.autoClearSearchValue,_=v.onSearch,Ze=v.onSearchSubmit,Se=v.onToggleOpen,ze=v.onInputKeyDown,Tt=v.onInputBlur,Ft=v.domRef;h.useImperativeHandle(H,function(){return{focus:function(jt){D.current.focus(jt)},blur:function(){D.current.blur()}}});var Yt=yt(0),zt=(0,P.Z)(Yt,2),cr=zt[0],Ct=zt[1],dr=function(jt){var Ot=jt.which,Cr=D.current instanceof HTMLTextAreaElement;!Cr&&fe&&(Ot===re.Z.UP||Ot===re.Z.DOWN)&&jt.preventDefault(),ze&&ze(jt),Ot===re.Z.ENTER&&ce==="tags"&&!m.current&&!fe&&(Ze==null||Ze(jt.target.value)),!(Cr&&!fe&&~[re.Z.UP,re.Z.DOWN,re.Z.LEFT,re.Z.RIGHT].indexOf(Ot))&&bt(Ot)&&Se(!0)},Wr=function(){Ct(!0)},Ht=(0,h.useRef)(null),Wt=function(jt){_(jt,!0,m.current)!==!1&&Se(!0)},Bt=function(){m.current=!0},vr=function(jt){m.current=!1,ce!=="combobox"&&Wt(jt.target.value)},Nt=function(jt){var Ot=jt.target.value;if(Ce&&Ht.current&&/[\r\n]/.test(Ht.current)){var Cr=Ht.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Ot=Ot.replace(Cr,Ht.current)}Ht.current=null,Wt(Ot)},wt=function(jt){var Ot=jt.clipboardData,Cr=Ot==null?void 0:Ot.getData("text");Ht.current=Cr||""},pt=function(jt){var Ot=jt.target;if(Ot!==D.current){var Cr=document.body.style.msTouchAction!==void 0;Cr?setTimeout(function(){D.current.focus()}):D.current.focus()}},Ut=function(jt){var Ot=cr();jt.target!==D.current&&!Ot&&!(ce==="combobox"&&ke)&&jt.preventDefault(),(ce!=="combobox"&&(!Pe||!Ot)||!fe)&&(fe&&Me!==!1&&_("",!0,!1),Se())},ur={inputRef:D,onInputKeyDown:dr,onInputMouseDown:Wr,onInputChange:Nt,onInputPaste:wt,onInputCompositionStart:Bt,onInputCompositionEnd:vr,onInputBlur:Tt},tr=ce==="multiple"||ce==="tags"?h.createElement(At,(0,B.Z)({},v,ur)):h.createElement(St,(0,B.Z)({},v,ur));return h.createElement("div",{ref:Ft,className:"".concat(x,"-selector"),onClick:pt,onMouseDown:Ut},J&&h.createElement("div",{className:"".concat(x,"-prefix")},J),tr)},ar=h.forwardRef(Ie),er=ar,N=b(65030),g=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],C=function(v){var H=v===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:H,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:H,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:H,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:H,adjustY:1},htmlRegion:"scroll"}}},p=function(v,H){var D=v.prefixCls,m=v.disabled,x=v.visible,fe=v.children,ce=v.popupElement,Pe=v.animation,Ce=v.transitionName,ke=v.dropdownStyle,J=v.dropdownClassName,Me=v.direction,_=Me===void 0?"ltr":Me,Ze=v.placement,Se=v.builtinPlacements,ze=v.dropdownMatchSelectWidth,Tt=v.dropdownRender,Ft=v.dropdownAlign,Yt=v.getPopupContainer,zt=v.empty,cr=v.getTriggerDOMNode,Ct=v.onPopupVisibleChange,dr=v.onPopupMouseEnter,Wr=(0,te.Z)(v,g),Ht="".concat(D,"-dropdown"),Wt=ce;Tt&&(Wt=Tt(ce));var Bt=h.useMemo(function(){return Se||C(ze)},[Se,ze]),vr=Pe?"".concat(Ht,"-").concat(Pe):Ce,Nt=typeof ze=="number",wt=h.useMemo(function(){return Nt?null:ze===!1?"minWidth":"width"},[ze,Nt]),pt=ke;Nt&&(pt=(0,ye.Z)((0,ye.Z)({},pt),{},{width:ze}));var Ut=h.useRef(null);return h.useImperativeHandle(H,function(){return{getPopupElement:function(){var tr;return(tr=Ut.current)===null||tr===void 0?void 0:tr.popupElement}}}),h.createElement(N.Z,(0,B.Z)({},Wr,{showAction:Ct?["click"]:[],hideAction:Ct?["click"]:[],popupPlacement:Ze||(_==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Bt,prefixCls:Ht,popupTransitionName:vr,popup:h.createElement("div",{onMouseEnter:dr},Wt),ref:Ut,stretch:wt,popupAlign:Ft,popupVisible:x,getPopupContainer:Yt,popupClassName:E()(J,(0,U.Z)({},"".concat(Ht,"-empty"),zt)),popupStyle:pt,getTriggerDOMNode:cr,onPopupVisibleChange:Ct}),fe)},w=h.forwardRef(p),I=w,A=b(40954);function z(d,v){var H=d.key,D;return"value"in d&&(D=d.value),H!=null?H:D!==void 0?D:"rc-index-key-".concat(v)}function oe(d){return typeof d!="undefined"&&!Number.isNaN(d)}function $(d,v){var H=d||{},D=H.label,m=H.value,x=H.options,fe=H.groupLabel,ce=D||(v?"children":"label");return{label:ce,value:m||"value",options:x||"options",groupLabel:fe||ce}}function de(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H=v.fieldNames,D=v.childrenAsData,m=[],x=$(H,!1),fe=x.label,ce=x.value,Pe=x.options,Ce=x.groupLabel;function ke(J,Me){Array.isArray(J)&&J.forEach(function(_){if(Me||!(Pe in _)){var Ze=_[ce];m.push({key:z(_,m.length),groupOption:Me,data:_,label:_[fe],value:Ze})}else{var Se=_[Ce];Se===void 0&&D&&(Se=_.label),m.push({key:z(_,m.length),group:!0,data:_,label:Se}),ke(_[Pe],!0)}})}return ke(d,!1),m}function ie(d){var v=(0,ye.Z)({},d);return"props"in v||Object.defineProperty(v,"props",{get:function(){return(0,ee.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),v}}),v}var ne=function(v,H,D){if(!H||!H.length)return null;var m=!1,x=function ce(Pe,Ce){var ke=(0,A.Z)(Ce),J=ke[0],Me=ke.slice(1);if(!J)return[Pe];var _=Pe.split(J);return m=m||_.length>1,_.reduce(function(Ze,Se){return[].concat((0,q.Z)(Ze),(0,q.Z)(ce(Se,Me)))},[]).filter(Boolean)},fe=x(v,H);return m?typeof D!="undefined"?fe.slice(0,D):fe:null},pe=h.createContext(null),k=pe;function ve(d){var v=d.visible,H=d.values;if(!v)return null;var D=50;return h.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(H.slice(0,D).map(function(m){var x=m.label,fe=m.value;return["number","string"].includes((0,ae.Z)(x))?x:fe}).join(", ")),H.length>D?", ...":null)}var K=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Ge=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],ge=function(v){return v==="tags"||v==="multiple"},Re=h.forwardRef(function(d,v){var H,D=d.id,m=d.prefixCls,x=d.className,fe=d.showSearch,ce=d.tagRender,Pe=d.direction,Ce=d.omitDomProps,ke=d.displayValues,J=d.onDisplayValuesChange,Me=d.emptyOptions,_=d.notFoundContent,Ze=_===void 0?"Not Found":_,Se=d.onClear,ze=d.mode,Tt=d.disabled,Ft=d.loading,Yt=d.getInputElement,zt=d.getRawInputElement,cr=d.open,Ct=d.defaultOpen,dr=d.onDropdownVisibleChange,Wr=d.activeValue,Ht=d.onActiveValueChange,Wt=d.activeDescendantId,Bt=d.searchValue,vr=d.autoClearSearchValue,Nt=d.onSearch,wt=d.onSearchSplit,pt=d.tokenSeparators,Ut=d.allowClear,ur=d.prefix,tr=d.suffixIcon,hr=d.clearIcon,jt=d.OptionList,Ot=d.animation,Cr=d.transitionName,_r=d.dropdownStyle,jr=d.dropdownClassName,fr=d.dropdownMatchSelectWidth,en=d.dropdownRender,Lr=d.dropdownAlign,Gr=d.placement,Kr=d.builtinPlacements,wr=d.getPopupContainer,ot=d.showAction,G=ot===void 0?[]:ot,j=d.onFocus,Oe=d.onBlur,me=d.onKeyUp,nt=d.onKeyDown,Kt=d.onMouseDown,Jt=(0,te.Z)(d,K),qt=ge(ze),Rr=(fe!==void 0?fe:qt)||ze==="combobox",Xr=(0,ye.Z)({},Jt);Ge.forEach(function(ir){delete Xr[ir]}),Ce==null||Ce.forEach(function(ir){delete Xr[ir]});var Tr=h.useState(!1),tn=(0,P.Z)(Tr,2),Or=tn[0],an=tn[1];h.useEffect(function(){an((0,T.Z)())},[]);var Pn=h.useRef(null),un=h.useRef(null),Zr=h.useRef(null),Yr=h.useRef(null),Ar=h.useRef(null),on=h.useRef(!1),Nn=F(),Hn=(0,P.Z)(Nn,3),Sn=Hn[0],vn=Hn[1],Qn=Hn[2];h.useImperativeHandle(v,function(){var ir,Zt;return{focus:(ir=Yr.current)===null||ir===void 0?void 0:ir.focus,blur:(Zt=Yr.current)===null||Zt===void 0?void 0:Zt.blur,scrollTo:function(En){var rn;return(rn=Ar.current)===null||rn===void 0?void 0:rn.scrollTo(En)},nativeElement:Pn.current||un.current}});var xn=h.useMemo(function(){var ir;if(ze!=="combobox")return Bt;var Zt=(ir=ke[0])===null||ir===void 0?void 0:ir.value;return typeof Zt=="string"||typeof Zt=="number"?String(Zt):""},[Bt,ze,ke]),ni=ze==="combobox"&&typeof Yt=="function"&&Yt()||null,$r=typeof zt=="function"&&zt(),Bn=(0,mt.x1)(un,$r==null||(H=$r.props)===null||H===void 0?void 0:H.ref),ui=h.useState(!1),ii=(0,P.Z)(ui,2),di=ii[0],Kn=ii[1];(0,De.Z)(function(){Kn(!0)},[]);var Hr=(0,Qe.Z)(!1,{defaultValue:Ct,value:cr}),fn=(0,P.Z)(Hr,2),Un=fn[0],On=fn[1],gr=di?Un:!1,Gn=!Ze&&Me;(Tt||Gn&&gr&&ze==="combobox")&&(gr=!1);var Vn=Gn?!1:gr,Ye=h.useCallback(function(ir){var Zt=ir!==void 0?ir:!gr;Tt||(On(Zt),gr!==Zt&&(dr==null||dr(Zt)))},[Tt,gr,On,dr]),ut=h.useMemo(function(){return(pt||[]).some(function(ir){return[`
`,`\r
`].includes(ir)})},[pt]),at=h.useContext(k)||{},vt=at.maxCount,rr=at.rawValues,Dr=function(Zt,Cn,En){if(!(qt&&oe(vt)&&(rr==null?void 0:rr.size)>=vt)){var rn=!0,cn=Zt;Ht==null||Ht(null);var ai=ne(Zt,pt,oe(vt)?vt-rr.size:void 0),ri=En?null:ai;return ze!=="combobox"&&ri&&(cn="",wt==null||wt(ri),Ye(!1),rn=!1),Nt&&xn!==cn&&Nt(cn,{source:Cn?"typing":"effect"}),rn}},In=function(Zt){!Zt||!Zt.trim()||Nt(Zt,{source:"submit"})};h.useEffect(function(){!gr&&!qt&&ze!=="combobox"&&Dr("",!1,!1)},[gr]),h.useEffect(function(){Un&&Tt&&On(!1),Tt&&!on.current&&vn(!1)},[Tt]);var Te=yt(),Je=(0,P.Z)(Te,2),It=Je[0],Pr=Je[1],xr=h.useRef(!1),hn=function(Zt){var Cn=It(),En=Zt.key,rn=En==="Enter";if(rn&&(ze!=="combobox"&&Zt.preventDefault(),gr||Ye(!0)),Pr(!!xn),En==="Backspace"&&!Cn&&qt&&!xn&&ke.length){for(var cn=(0,q.Z)(ke),ai=null,ri=cn.length-1;ri>=0;ri-=1){var vi=cn[ri];if(!vi.disabled){cn.splice(ri,1),ai=vi;break}}ai&&J(cn,{type:"remove",values:[ai]})}for(var jn=arguments.length,Xn=new Array(jn>1?jn-1:0),oi=1;oi<jn;oi++)Xn[oi-1]=arguments[oi];if(gr&&(!rn||!xr.current)){var mi;rn&&(xr.current=!0),(mi=Ar.current)===null||mi===void 0||mi.onKeyDown.apply(mi,[Zt].concat(Xn))}nt==null||nt.apply(void 0,[Zt].concat(Xn))},_n=function(Zt){for(var Cn=arguments.length,En=new Array(Cn>1?Cn-1:0),rn=1;rn<Cn;rn++)En[rn-1]=arguments[rn];if(gr){var cn;(cn=Ar.current)===null||cn===void 0||cn.onKeyUp.apply(cn,[Zt].concat(En))}Zt.key==="Enter"&&(xr.current=!1),me==null||me.apply(void 0,[Zt].concat(En))},ei=function(Zt){var Cn=ke.filter(function(En){return En!==Zt});J(Cn,{type:"remove",values:[Zt]})},Rn=function(){xr.current=!1},ki=h.useRef(!1),Ya=function(){vn(!0),Tt||(j&&!ki.current&&j.apply(void 0,arguments),G.includes("focus")&&Ye(!0)),ki.current=!0},xa=function(){on.current=!0,vn(!1,function(){ki.current=!1,on.current=!1,Ye(!1)}),!Tt&&(xn&&(ze==="tags"?Nt(xn,{source:"submit"}):ze==="multiple"&&Nt("",{source:"blur"})),Oe&&Oe.apply(void 0,arguments))},fi=[];h.useEffect(function(){return function(){fi.forEach(function(ir){return clearTimeout(ir)}),fi.splice(0,fi.length)}},[]);var pi=function(Zt){var Cn,En=Zt.target,rn=(Cn=Zr.current)===null||Cn===void 0?void 0:Cn.getPopupElement();if(rn&&rn.contains(En)){var cn=setTimeout(function(){var jn=fi.indexOf(cn);if(jn!==-1&&fi.splice(jn,1),Qn(),!Or&&!rn.contains(document.activeElement)){var Xn;(Xn=Yr.current)===null||Xn===void 0||Xn.focus()}});fi.push(cn)}for(var ai=arguments.length,ri=new Array(ai>1?ai-1:0),vi=1;vi<ai;vi++)ri[vi-1]=arguments[vi];Kt==null||Kt.apply(void 0,[Zt].concat(ri))},ti=h.useState({}),Ea=(0,P.Z)(ti,2),Ma=Ea[1];function Ja(){Ma({})}var La;$r&&(La=function(Zt){Ye(Zt)}),Be(function(){var ir;return[Pn.current,(ir=Zr.current)===null||ir===void 0?void 0:ir.getPopupElement()]},Vn,Ye,!!$r);var Qa=h.useMemo(function(){return(0,ye.Z)((0,ye.Z)({},d),{},{notFoundContent:Ze,open:gr,triggerOpen:Vn,id:D,showSearch:Rr,multiple:qt,toggleOpen:Ye})},[d,Ze,Vn,gr,D,Rr,qt,Ye]),$i=!!tr||Ft,qi;$i&&(qi=h.createElement(ct,{className:E()("".concat(m,"-arrow"),(0,U.Z)({},"".concat(m,"-arrow-loading"),Ft)),customizeIcon:tr,customizeIconProps:{loading:Ft,searchValue:xn,open:gr,focused:Sn,showSearch:Rr}}));var Li=function(){var Zt;Se==null||Se(),(Zt=Yr.current)===null||Zt===void 0||Zt.focus(),J([],{type:"clear",values:ke}),Dr("",!1,!1)},ea=Mt(m,Li,ke,Ut,hr,Tt,xn,ze),Ra=ea.allowClear,ta=ea.clearIcon,Zi=h.createElement(jt,{ref:Ar}),Ta=E()(m,x,(0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)({},"".concat(m,"-focused"),Sn),"".concat(m,"-multiple"),qt),"".concat(m,"-single"),!qt),"".concat(m,"-allow-clear"),Ut),"".concat(m,"-show-arrow"),$i),"".concat(m,"-disabled"),Tt),"".concat(m,"-loading"),Ft),"".concat(m,"-open"),gr),"".concat(m,"-customize-input"),ni),"".concat(m,"-show-search"),Rr)),Fi=h.createElement(I,{ref:Zr,disabled:Tt,prefixCls:m,visible:Vn,popupElement:Zi,animation:Ot,transitionName:Cr,dropdownStyle:_r,dropdownClassName:jr,direction:Pe,dropdownMatchSelectWidth:fr,dropdownRender:en,dropdownAlign:Lr,placement:Gr,builtinPlacements:Kr,getPopupContainer:wr,empty:Me,getTriggerDOMNode:function(Zt){return un.current||Zt},onPopupVisibleChange:La,onPopupMouseEnter:Ja},$r?h.cloneElement($r,{ref:Bn}):h.createElement(er,(0,B.Z)({},d,{domRef:un,prefixCls:m,inputElement:ni,ref:Yr,id:D,prefix:ur,showSearch:Rr,autoClearSearchValue:vr,mode:ze,activeDescendantId:Wt,tagRender:ce,values:ke,open:gr,onToggleOpen:Ye,activeValue:Wr,searchValue:xn,onSearch:Dr,onSearchSubmit:In,onRemove:ei,tokenWithEnter:ut,onInputBlur:Rn}))),An;return $r?An=Fi:An=h.createElement("div",(0,B.Z)({className:Ta},Xr,{ref:Pn,onMouseDown:pi,onKeyDown:hn,onKeyUp:_n,onFocus:Ya,onBlur:xa}),h.createElement(ve,{visible:Sn&&!gr,values:ke}),Fi,qi,Ra&&ta),h.createElement(dt.Provider,{value:Qa},An)}),Le=Re,gt=function(){return null};gt.isSelectOptGroup=!0;var Xe=gt,be=function(){return null};be.isSelectOption=!0;var qe=be,Qt=b(80547),Er=b(2738),$t=b(6790);function Mr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var et=["disabled","title","children","style","className"];function it(d){return typeof d=="string"||typeof d=="number"}var kt=function(v,H){var D=he(),m=D.prefixCls,x=D.id,fe=D.open,ce=D.multiple,Pe=D.mode,Ce=D.searchValue,ke=D.toggleOpen,J=D.notFoundContent,Me=D.onPopupScroll,_=h.useContext(k),Ze=_.maxCount,Se=_.flattenOptions,ze=_.onActiveValue,Tt=_.defaultActiveFirstOption,Ft=_.onSelect,Yt=_.menuItemSelectedIcon,zt=_.rawValues,cr=_.fieldNames,Ct=_.virtual,dr=_.direction,Wr=_.listHeight,Ht=_.listItemHeight,Wt=_.optionRender,Bt="".concat(m,"-item"),vr=(0,Qt.Z)(function(){return Se},[fe,Se],function(ot,G){return G[0]&&ot[1]!==G[1]}),Nt=h.useRef(null),wt=h.useMemo(function(){return ce&&oe(Ze)&&(zt==null?void 0:zt.size)>=Ze},[ce,Ze,zt==null?void 0:zt.size]),pt=function(G){G.preventDefault()},Ut=function(G){var j;(j=Nt.current)===null||j===void 0||j.scrollTo(typeof G=="number"?{index:G}:G)},ur=h.useCallback(function(ot){return Pe==="combobox"?!1:zt.has(ot)},[Pe,(0,q.Z)(zt).toString(),zt.size]),tr=function(G){for(var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Oe=vr.length,me=0;me<Oe;me+=1){var nt=(G+me*j+Oe)%Oe,Kt=vr[nt]||{},Jt=Kt.group,qt=Kt.data;if(!Jt&&!(qt!=null&&qt.disabled)&&(ur(qt.value)||!wt))return nt}return-1},hr=h.useState(function(){return tr(0)}),jt=(0,P.Z)(hr,2),Ot=jt[0],Cr=jt[1],_r=function(G){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Cr(G);var Oe={source:j?"keyboard":"mouse"},me=vr[G];if(!me){ze(null,-1,Oe);return}ze(me.value,G,Oe)};(0,h.useEffect)(function(){_r(Tt!==!1?tr(0):-1)},[vr.length,Ce]);var jr=h.useCallback(function(ot){return Pe==="combobox"?String(ot).toLowerCase()===Ce.toLowerCase():zt.has(ot)},[Pe,Ce,(0,q.Z)(zt).toString(),zt.size]);(0,h.useEffect)(function(){var ot=setTimeout(function(){if(!ce&&fe&&zt.size===1){var j=Array.from(zt)[0],Oe=vr.findIndex(function(me){var nt=me.data;return Ce?String(nt.value).startsWith(Ce):nt.value===j});Oe!==-1&&(_r(Oe),Ut(Oe))}});if(fe){var G;(G=Nt.current)===null||G===void 0||G.scrollTo(void 0)}return function(){return clearTimeout(ot)}},[fe,Ce]);var fr=function(G){G!==void 0&&Ft(G,{selected:!zt.has(G)}),ce||ke(!1)};if(h.useImperativeHandle(H,function(){return{onKeyDown:function(G){var j=G.which,Oe=G.ctrlKey;switch(j){case re.Z.N:case re.Z.P:case re.Z.UP:case re.Z.DOWN:{var me=0;if(j===re.Z.UP?me=-1:j===re.Z.DOWN?me=1:Mr()&&Oe&&(j===re.Z.N?me=1:j===re.Z.P&&(me=-1)),me!==0){var nt=tr(Ot+me,me);Ut(nt),_r(nt,!0)}break}case re.Z.TAB:case re.Z.ENTER:{var Kt,Jt=vr[Ot];Jt&&!(Jt!=null&&(Kt=Jt.data)!==null&&Kt!==void 0&&Kt.disabled)&&!wt?fr(Jt.value):fr(void 0),fe&&G.preventDefault();break}case re.Z.ESC:ke(!1),fe&&G.stopPropagation()}},onKeyUp:function(){},scrollTo:function(G){Ut(G)}}}),vr.length===0)return h.createElement("div",{role:"listbox",id:"".concat(x,"_list"),className:"".concat(Bt,"-empty"),onMouseDown:pt},J);var en=Object.keys(cr).map(function(ot){return cr[ot]}),Lr=function(G){return G.label};function Gr(ot,G){var j=ot.group;return{role:j?"presentation":"option",id:"".concat(x,"_list_").concat(G)}}var Kr=function(G){var j=vr[G];if(!j)return null;var Oe=j.data||{},me=Oe.value,nt=j.group,Kt=(0,Ve.Z)(Oe,!0),Jt=Lr(j);return j?h.createElement("div",(0,B.Z)({"aria-label":typeof Jt=="string"&&!nt?Jt:null},Kt,{key:G},Gr(j,G),{"aria-selected":jr(me)}),me):null},wr={role:"listbox",id:"".concat(x,"_list")};return h.createElement(h.Fragment,null,Ct&&h.createElement("div",(0,B.Z)({},wr,{style:{height:0,width:0,overflow:"hidden"}}),Kr(Ot-1),Kr(Ot),Kr(Ot+1)),h.createElement($t.Z,{itemKey:"key",ref:Nt,data:vr,height:Wr,itemHeight:Ht,fullHeight:!1,onMouseDown:pt,onScroll:Me,virtual:Ct,direction:dr,innerProps:Ct?null:wr},function(ot,G){var j=ot.group,Oe=ot.groupOption,me=ot.data,nt=ot.label,Kt=ot.value,Jt=me.key;if(j){var qt,Rr=(qt=me.title)!==null&&qt!==void 0?qt:it(nt)?nt.toString():void 0;return h.createElement("div",{className:E()(Bt,"".concat(Bt,"-group"),me.className),title:Rr},nt!==void 0?nt:Jt)}var Xr=me.disabled,Tr=me.title,tn=me.children,Or=me.style,an=me.className,Pn=(0,te.Z)(me,et),un=(0,Er.Z)(Pn,en),Zr=ur(Kt),Yr=Xr||!Zr&&wt,Ar="".concat(Bt,"-option"),on=E()(Bt,Ar,an,(0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)({},"".concat(Ar,"-grouped"),Oe),"".concat(Ar,"-active"),Ot===G&&!Yr),"".concat(Ar,"-disabled"),Yr),"".concat(Ar,"-selected"),Zr)),Nn=Lr(ot),Hn=!Yt||typeof Yt=="function"||Zr,Sn=typeof Nn=="number"?Nn:Nn||Kt,vn=it(Sn)?Sn.toString():void 0;return Tr!==void 0&&(vn=Tr),h.createElement("div",(0,B.Z)({},(0,Ve.Z)(un),Ct?{}:Gr(ot,G),{"aria-selected":jr(Kt),className:on,title:vn,onMouseMove:function(){Ot===G||Yr||_r(G)},onClick:function(){Yr||fr(Kt)},style:Or}),h.createElement("div",{className:"".concat(Ar,"-content")},typeof Wt=="function"?Wt(ot,{index:G}):Sn),h.isValidElement(Yt)||Zr,Hn&&h.createElement(ct,{className:"".concat(Bt,"-option-state"),customizeIcon:Yt,customizeIconProps:{value:Kt,disabled:Yr,isSelected:Zr}},Zr?"\u2713":null))}))},Vt=h.forwardRef(kt),Dt=Vt,Pt=function(d,v){var H=h.useRef({values:new Map,options:new Map}),D=h.useMemo(function(){var x=H.current,fe=x.values,ce=x.options,Pe=d.map(function(J){if(J.label===void 0){var Me;return(0,ye.Z)((0,ye.Z)({},J),{},{label:(Me=fe.get(J.value))===null||Me===void 0?void 0:Me.label})}return J}),Ce=new Map,ke=new Map;return Pe.forEach(function(J){Ce.set(J.value,J),ke.set(J.value,v.get(J.value)||ce.get(J.value))}),H.current.values=Ce,H.current.options=ke,Pe},[d,v]),m=h.useCallback(function(x){return v.get(x)||H.current.options.get(x)},[v]);return[D,m]};function $e(d,v){return W(d).join("").toUpperCase().includes(v)}var or=function(d,v,H,D,m){return h.useMemo(function(){if(!H||D===!1)return d;var x=v.options,fe=v.label,ce=v.value,Pe=[],Ce=typeof D=="function",ke=H.toUpperCase(),J=Ce?D:function(_,Ze){return m?$e(Ze[m],ke):Ze[x]?$e(Ze[fe!=="children"?fe:"label"],ke):$e(Ze[ce],ke)},Me=Ce?function(_){return ie(_)}:function(_){return _};return d.forEach(function(_){if(_[x]){var Ze=J(H,Me(_));if(Ze)Pe.push(_);else{var Se=_[x].filter(function(ze){return J(H,Me(ze))});Se.length&&Pe.push((0,ye.Z)((0,ye.Z)({},_),{},(0,U.Z)({},x,Se)))}return}J(H,Me(_))&&Pe.push(_)}),Pe},[d,D,m,H,v])},nr=b(6551),pr=b(11592),tt=["children","value"],Ir=["children"];function Br(d){var v=d,H=v.key,D=v.props,m=D.children,x=D.value,fe=(0,te.Z)(D,tt);return(0,ye.Z)({key:H,value:x!==void 0?x:H,children:m},fe)}function Qr(d){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,pr.Z)(d).map(function(H,D){if(!h.isValidElement(H)||!H.type)return null;var m=H,x=m.type.isSelectOptGroup,fe=m.key,ce=m.props,Pe=ce.children,Ce=(0,te.Z)(ce,Ir);return v||!x?Br(H):(0,ye.Z)((0,ye.Z)({key:"__RC_SELECT_GRP__".concat(fe===null?D:fe,"__"),label:fe},Ce),{},{options:Qr(Pe)})}).filter(function(H){return H})}var Ur=function(v,H,D,m,x){return h.useMemo(function(){var fe=v,ce=!v;ce&&(fe=Qr(H));var Pe=new Map,Ce=new Map,ke=function(_,Ze,Se){Se&&typeof Se=="string"&&_.set(Ze[Se],Ze)},J=function Me(_){for(var Ze=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=0;Se<_.length;Se+=1){var ze=_[Se];!ze[D.options]||Ze?(Pe.set(ze[D.value],ze),ke(Ce,ze,D.label),ke(Ce,ze,m),ke(Ce,ze,x)):Me(ze[D.options],!0)}};return J(fe),{options:fe,valueOptions:Pe,labelOptions:Ce}},[v,H,D,m,x])},Fr=Ur;function sr(d){var v=h.useRef();v.current=d;var H=h.useCallback(function(){return v.current.apply(v,arguments)},[]);return H}function mr(d){var v=d.mode,H=d.options,D=d.children,m=d.backfill,x=d.allowClear,fe=d.placeholder,ce=d.getInputElement,Pe=d.showSearch,Ce=d.onSearch,ke=d.defaultOpen,J=d.autoFocus,Me=d.labelInValue,_=d.value,Ze=d.inputValue,Se=d.optionLabelProp,ze=isMultiple(v),Tt=Pe!==void 0?Pe:ze||v==="combobox",Ft=H||convertChildrenToData(D);if(warning(v!=="tags"||Ft.every(function(Ct){return!Ct.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),v==="tags"||v==="combobox"){var Yt=Ft.some(function(Ct){return Ct.options?Ct.options.some(function(dr){return typeof("value"in dr?dr.value:dr.key)=="number"}):typeof("value"in Ct?Ct.value:Ct.key)=="number"});warning(!Yt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(v!=="combobox"||!Se,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(v==="combobox"||!m,"`backfill` only works with `combobox` mode."),warning(v==="combobox"||!ce,"`getInputElement` only work with `combobox` mode."),noteOnce(v!=="combobox"||!ce||!x||!fe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ce&&!Tt&&v!=="combobox"&&v!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!ke||J,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),_!=null){var zt=toArray(_);warning(!Me||zt.every(function(Ct){return _typeof(Ct)==="object"&&("key"in Ct||"value"in Ct)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!ze||Array.isArray(_),"`value` should be array when `mode` is `multiple` or `tags`")}if(D){var cr=null;toNodeArray(D).some(function(Ct){if(!React.isValidElement(Ct)||!Ct.type)return!1;var dr=Ct,Wr=dr.type;if(Wr.isSelectOption)return!1;if(Wr.isSelectOptGroup){var Ht=toNodeArray(Ct.props.children).every(function(Wt){return!React.isValidElement(Wt)||!Ct.type||Wt.type.isSelectOption?!0:(cr=Wt.type,!1)});return!Ht}return cr=Wr,!0}),cr&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(cr.displayName||cr.name||cr,"`.")),warning(Ze===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function lr(d,v){if(d){var H=function D(m){for(var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=0;fe<m.length;fe++){var ce=m[fe];if(ce[v==null?void 0:v.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!x&&Array.isArray(ce[v==null?void 0:v.options])&&D(ce[v==null?void 0:v.options],!0))break}};H(d)}}var _t=null,Xt=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],yr=["inputValue"];function Rt(d){return!d||(0,ae.Z)(d)!=="object"}var Y=h.forwardRef(function(d,v){var H=d.id,D=d.mode,m=d.prefixCls,x=m===void 0?"rc-select":m,fe=d.backfill,ce=d.fieldNames,Pe=d.inputValue,Ce=d.searchValue,ke=d.onSearch,J=d.autoClearSearchValue,Me=J===void 0?!0:J,_=d.onSelect,Ze=d.onDeselect,Se=d.dropdownMatchSelectWidth,ze=Se===void 0?!0:Se,Tt=d.filterOption,Ft=d.filterSort,Yt=d.optionFilterProp,zt=d.optionLabelProp,cr=d.options,Ct=d.optionRender,dr=d.children,Wr=d.defaultActiveFirstOption,Ht=d.menuItemSelectedIcon,Wt=d.virtual,Bt=d.direction,vr=d.listHeight,Nt=vr===void 0?200:vr,wt=d.listItemHeight,pt=wt===void 0?20:wt,Ut=d.labelRender,ur=d.value,tr=d.defaultValue,hr=d.labelInValue,jt=d.onChange,Ot=d.maxCount,Cr=(0,te.Z)(d,Xt),_r=(0,nr.ZP)(H),jr=ge(D),fr=!!(!cr&&dr),en=h.useMemo(function(){return Tt===void 0&&D==="combobox"?!1:Tt},[Tt,D]),Lr=h.useMemo(function(){return $(ce,fr)},[JSON.stringify(ce),fr]),Gr=(0,Qe.Z)("",{value:Ce!==void 0?Ce:Pe,postState:function(ut){return ut||""}}),Kr=(0,P.Z)(Gr,2),wr=Kr[0],ot=Kr[1],G=Fr(cr,dr,Lr,Yt,zt),j=G.valueOptions,Oe=G.labelOptions,me=G.options,nt=h.useCallback(function(Ye){var ut=W(Ye);return ut.map(function(at){var vt,rr,Dr,In,Te;if(Rt(at))vt=at;else{var Je;Dr=at.key,rr=at.label,vt=(Je=at.value)!==null&&Je!==void 0?Je:Dr}var It=j.get(vt);if(It){var Pr;if(rr===void 0&&(rr=It==null?void 0:It[zt||Lr.label]),Dr===void 0&&(Dr=(Pr=It==null?void 0:It.key)!==null&&Pr!==void 0?Pr:vt),In=It==null?void 0:It.disabled,Te=It==null?void 0:It.title,0)var xr}return{label:rr,value:vt,key:Dr,disabled:In,title:Te}})},[Lr,zt,j]),Kt=(0,Qe.Z)(tr,{value:ur}),Jt=(0,P.Z)(Kt,2),qt=Jt[0],Rr=Jt[1],Xr=h.useMemo(function(){var Ye,ut=jr&&qt===null?[]:qt,at=nt(ut);return D==="combobox"&&Ne((Ye=at[0])===null||Ye===void 0?void 0:Ye.value)?[]:at},[qt,nt,D,jr]),Tr=Pt(Xr,j),tn=(0,P.Z)(Tr,2),Or=tn[0],an=tn[1],Pn=h.useMemo(function(){if(!D&&Or.length===1){var Ye=Or[0];if(Ye.value===null&&(Ye.label===null||Ye.label===void 0))return[]}return Or.map(function(ut){var at;return(0,ye.Z)((0,ye.Z)({},ut),{},{label:(at=typeof Ut=="function"?Ut(ut):ut.label)!==null&&at!==void 0?at:ut.value})})},[D,Or,Ut]),un=h.useMemo(function(){return new Set(Or.map(function(Ye){return Ye.value}))},[Or]);h.useEffect(function(){if(D==="combobox"){var Ye,ut=(Ye=Or[0])===null||Ye===void 0?void 0:Ye.value;ot(se(ut)?String(ut):"")}},[Or]);var Zr=sr(function(Ye,ut){var at=ut!=null?ut:Ye;return(0,U.Z)((0,U.Z)({},Lr.value,Ye),Lr.label,at)}),Yr=h.useMemo(function(){if(D!=="tags")return me;var Ye=(0,q.Z)(me),ut=function(vt){return j.has(vt)};return(0,q.Z)(Or).sort(function(at,vt){return at.value<vt.value?-1:1}).forEach(function(at){var vt=at.value;ut(vt)||Ye.push(Zr(vt,at.label))}),Ye},[Zr,me,j,Or,D]),Ar=or(Yr,Lr,wr,en,Yt),on=h.useMemo(function(){return D!=="tags"||!wr||Ar.some(function(Ye){return Ye[Yt||"value"]===wr})||Ar.some(function(Ye){return Ye[Lr.value]===wr})?Ar:[Zr(wr)].concat((0,q.Z)(Ar))},[Zr,Yt,D,Ar,wr,Lr]),Nn=function Ye(ut){var at=(0,q.Z)(ut).sort(function(vt,rr){return Ft(vt,rr,{searchValue:wr})});return at.map(function(vt){return Array.isArray(vt.options)?(0,ye.Z)((0,ye.Z)({},vt),{},{options:vt.options.length>0?Ye(vt.options):vt.options}):vt})},Hn=h.useMemo(function(){return Ft?Nn(on):on},[on,Ft,wr]),Sn=h.useMemo(function(){return de(Hn,{fieldNames:Lr,childrenAsData:fr})},[Hn,Lr,fr]),vn=function(ut){var at=nt(ut);if(Rr(at),jt&&(at.length!==Or.length||at.some(function(Dr,In){var Te;return((Te=Or[In])===null||Te===void 0?void 0:Te.value)!==(Dr==null?void 0:Dr.value)}))){var vt=hr?at:at.map(function(Dr){return Dr.value}),rr=at.map(function(Dr){return ie(an(Dr.value))});jt(jr?vt:vt[0],jr?rr:rr[0])}},Qn=h.useState(null),xn=(0,P.Z)(Qn,2),ni=xn[0],$r=xn[1],Bn=h.useState(0),ui=(0,P.Z)(Bn,2),ii=ui[0],di=ui[1],Kn=Wr!==void 0?Wr:D!=="combobox",Hr=h.useCallback(function(Ye,ut){var at=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},vt=at.source,rr=vt===void 0?"keyboard":vt;di(ut),fe&&D==="combobox"&&Ye!==null&&rr==="keyboard"&&$r(String(Ye))},[fe,D]),fn=function(ut,at,vt){var rr=function(){var ei,Rn=an(ut);return[hr?{label:Rn==null?void 0:Rn[Lr.label],value:ut,key:(ei=Rn==null?void 0:Rn.key)!==null&&ei!==void 0?ei:ut}:ut,ie(Rn)]};if(at&&_){var Dr=rr(),In=(0,P.Z)(Dr,2),Te=In[0],Je=In[1];_(Te,Je)}else if(!at&&Ze&&vt!=="clear"){var It=rr(),Pr=(0,P.Z)(It,2),xr=Pr[0],hn=Pr[1];Ze(xr,hn)}},Un=sr(function(Ye,ut){var at,vt=jr?ut.selected:!0;vt?at=jr?[].concat((0,q.Z)(Or),[Ye]):[Ye]:at=Or.filter(function(rr){return rr.value!==Ye}),vn(at),fn(Ye,vt),D==="combobox"?$r(""):(!ge||Me)&&(ot(""),$r(""))}),On=function(ut,at){vn(ut);var vt=at.type,rr=at.values;(vt==="remove"||vt==="clear")&&rr.forEach(function(Dr){fn(Dr.value,!1,vt)})},gr=function(ut,at){if(ot(ut),$r(null),at.source==="submit"){var vt=(ut||"").trim();if(vt){var rr=Array.from(new Set([].concat((0,q.Z)(un),[vt])));vn(rr),fn(vt,!0),ot("")}return}at.source!=="blur"&&(D==="combobox"&&vn(ut),ke==null||ke(ut))},Gn=function(ut){var at=ut;D!=="tags"&&(at=ut.map(function(rr){var Dr=Oe.get(rr);return Dr==null?void 0:Dr.value}).filter(function(rr){return rr!==void 0}));var vt=Array.from(new Set([].concat((0,q.Z)(un),(0,q.Z)(at))));vn(vt),vt.forEach(function(rr){fn(rr,!0)})},Vn=h.useMemo(function(){var Ye=Wt!==!1&&ze!==!1;return(0,ye.Z)((0,ye.Z)({},G),{},{flattenOptions:Sn,onActiveValue:Hr,defaultActiveFirstOption:Kn,onSelect:Un,menuItemSelectedIcon:Ht,rawValues:un,fieldNames:Lr,virtual:Ye,direction:Bt,listHeight:Nt,listItemHeight:pt,childrenAsData:fr,maxCount:Ot,optionRender:Ct})},[Ot,G,Sn,Hr,Kn,Un,Ht,un,Lr,Wt,ze,Bt,Nt,pt,fr,Ct]);return h.createElement(k.Provider,{value:Vn},h.createElement(Le,(0,B.Z)({},Cr,{id:_r,prefixCls:x,ref:v,omitDomProps:yr,mode:D,displayValues:Pn,onDisplayValuesChange:On,direction:Bt,searchValue:wr,onSearch:gr,autoClearSearchValue:Me,onSearchSplit:Gn,dropdownMatchSelectWidth:ze,OptionList:Dt,emptyOptions:!Sn.length,activeValue:ni,activeDescendantId:"".concat(_r,"_list_").concat(ii)})))}),st=Y;st.Option=qe,st.OptGroup=Xe;var br=st,Sr=br},22711:function(bn,ft,b){"use strict";b.r(ft),b.d(ft,{ResizableTextArea:function(){return Lt},default:function(){return X}});var B=b(32855),q=b(74430),U=b(27247),ye=b(3300),P=b(11913),te=b(43079),ae=b(92310),Qe=b.n(ae),ee=b(36901),h=b(66003),He=b(30292),E=b(18929),De=b(59301),T=b(34666),mt=b(29301),Et=b(34280),ct=b(16089),Mt=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`,dt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],he={},F;function yt(W){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=W.getAttribute("id")||W.getAttribute("data-reactid")||W.getAttribute("name");if(Ae&&he[L])return he[L];var se=window.getComputedStyle(W),Ne=se.getPropertyValue("box-sizing")||se.getPropertyValue("-moz-box-sizing")||se.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(se.getPropertyValue("padding-bottom"))+parseFloat(se.getPropertyValue("padding-top")),je=parseFloat(se.getPropertyValue("border-bottom-width"))+parseFloat(se.getPropertyValue("border-top-width")),_e=dt.map(function(Ue){return"".concat(Ue,":").concat(se.getPropertyValue(Ue))}).join(";"),Ee={sizingStyle:_e,paddingSize:ue,borderSize:je,boxSizing:Ne};return Ae&&L&&(he[L]=Ee),Ee}function Be(W){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;F||(F=document.createElement("textarea"),F.setAttribute("tab-index","-1"),F.setAttribute("aria-hidden","true"),F.setAttribute("name","hiddenTextarea"),document.body.appendChild(F)),W.getAttribute("wrap")?F.setAttribute("wrap",W.getAttribute("wrap")):F.removeAttribute("wrap");var Ne=yt(W,Ae),ue=Ne.paddingSize,je=Ne.borderSize,_e=Ne.boxSizing,Ee=Ne.sizingStyle;F.setAttribute("style","".concat(Ee,";").concat(Mt)),F.value=W.value||W.placeholder||"";var Ue=void 0,We=void 0,At,xt=F.scrollHeight;if(_e==="border-box"?xt+=je:_e==="content-box"&&(xt-=ue),L!==null||se!==null){F.value=" ";var St=F.scrollHeight-ue;L!==null&&(Ue=St*L,_e==="border-box"&&(Ue=Ue+ue+je),xt=Math.max(Ue,xt)),se!==null&&(We=St*se,_e==="border-box"&&(We=We+ue+je),At=xt>We?"":"hidden",xt=Math.min(We,xt))}var Ie={height:xt,overflowY:At,resize:"none"};return Ue&&(Ie.minHeight=Ue),We&&(Ie.maxHeight=We),Ie}var re=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],bt=0,Ve=1,Q=2,lt=De.forwardRef(function(W,Ae){var L=W,se=L.prefixCls,Ne=L.defaultValue,ue=L.value,je=L.autoSize,_e=L.onResize,Ee=L.className,Ue=L.style,We=L.disabled,At=L.onChange,xt=L.onInternalAutoSize,St=(0,te.Z)(L,re),Ie=(0,E.Z)(Ne,{value:ue,postState:function(qe){return qe!=null?qe:""}}),ar=(0,P.Z)(Ie,2),er=ar[0],N=ar[1],g=function(qe){N(qe.target.value),At==null||At(qe)},C=De.useRef();De.useImperativeHandle(Ae,function(){return{textArea:C.current}});var p=De.useMemo(function(){return je&&(0,T.Z)(je)==="object"?[je.minRows,je.maxRows]:[]},[je]),w=(0,P.Z)(p,2),I=w[0],A=w[1],z=!!je,oe=function(){try{if(document.activeElement===C.current){var qe=C.current,Qt=qe.selectionStart,Er=qe.selectionEnd,$t=qe.scrollTop;C.current.setSelectionRange(Qt,Er),C.current.scrollTop=$t}}catch(Mr){}},$=De.useState(Q),de=(0,P.Z)($,2),ie=de[0],ne=de[1],pe=De.useState(),k=(0,P.Z)(pe,2),ve=k[0],K=k[1],Ge=function(){ne(bt)};(0,Et.Z)(function(){z&&Ge()},[ue,I,A,z]),(0,Et.Z)(function(){if(ie===bt)ne(Ve);else if(ie===Ve){var be=Be(C.current,!1,I,A);ne(Q),K(be)}else oe()},[ie]);var ge=De.useRef(),Re=function(){ct.Z.cancel(ge.current)},Le=function(qe){ie===Q&&(_e==null||_e(qe),je&&(Re(),ge.current=(0,ct.Z)(function(){Ge()})))};De.useEffect(function(){return Re},[]);var gt=z?ve:null,Xe=(0,U.Z)((0,U.Z)({},Ue),gt);return(ie===bt||ie===Ve)&&(Xe.overflowY="hidden",Xe.overflowX="hidden"),De.createElement(mt.Z,{onResize:Le,disabled:!(je||_e)},De.createElement("textarea",(0,B.Z)({},St,{ref:C,style:Xe,className:Qe()(se,Ee,(0,q.Z)({},"".concat(se,"-disabled"),We)),disabled:We,value:er,onChange:g})))}),Lt=lt,O=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],M=De.forwardRef(function(W,Ae){var L,se=W.defaultValue,Ne=W.value,ue=W.onFocus,je=W.onBlur,_e=W.onChange,Ee=W.allowClear,Ue=W.maxLength,We=W.onCompositionStart,At=W.onCompositionEnd,xt=W.suffix,St=W.prefixCls,Ie=St===void 0?"rc-textarea":St,ar=W.showCount,er=W.count,N=W.className,g=W.style,C=W.disabled,p=W.hidden,w=W.classNames,I=W.styles,A=W.onResize,z=W.onClear,oe=W.onPressEnter,$=W.readOnly,de=W.autoSize,ie=W.onKeyDown,ne=(0,te.Z)(W,O),pe=(0,E.Z)(se,{value:Ne,defaultValue:se}),k=(0,P.Z)(pe,2),ve=k[0],K=k[1],Ge=ve==null?"":String(ve),ge=De.useState(!1),Re=(0,P.Z)(ge,2),Le=Re[0],gt=Re[1],Xe=De.useRef(!1),be=De.useState(null),qe=(0,P.Z)(be,2),Qt=qe[0],Er=qe[1],$t=(0,De.useRef)(null),Mr=(0,De.useRef)(null),et=function(){var st;return(st=Mr.current)===null||st===void 0?void 0:st.textArea},it=function(){et().focus()};(0,De.useImperativeHandle)(Ae,function(){var Y;return{resizableTextArea:Mr.current,focus:it,blur:function(){et().blur()},nativeElement:((Y=$t.current)===null||Y===void 0?void 0:Y.nativeElement)||et()}}),(0,De.useEffect)(function(){gt(function(Y){return!C&&Y})},[C]);var kt=De.useState(null),Vt=(0,P.Z)(kt,2),Dt=Vt[0],Pt=Vt[1];De.useEffect(function(){if(Dt){var Y;(Y=et()).setSelectionRange.apply(Y,(0,ye.Z)(Dt))}},[Dt]);var $e=(0,h.Z)(er,ar),or=(L=$e.max)!==null&&L!==void 0?L:Ue,nr=Number(or)>0,pr=$e.strategy(Ge),tt=!!or&&pr>or,Ir=function(st,br){var Sr=br;!Xe.current&&$e.exceedFormatter&&$e.max&&$e.strategy(br)>$e.max&&(Sr=$e.exceedFormatter(br,{max:$e.max}),br!==Sr&&Pt([et().selectionStart||0,et().selectionEnd||0])),K(Sr),(0,He.rJ)(st.currentTarget,st,_e,Sr)},Br=function(st){Xe.current=!0,We==null||We(st)},Qr=function(st){Xe.current=!1,Ir(st,st.currentTarget.value),At==null||At(st)},Ur=function(st){Ir(st,st.target.value)},Fr=function(st){st.key==="Enter"&&oe&&oe(st),ie==null||ie(st)},sr=function(st){gt(!0),ue==null||ue(st)},mr=function(st){gt(!1),je==null||je(st)},lr=function(st){K(""),it(),(0,He.rJ)(et(),st,_e)},_t=xt,Xt;$e.show&&($e.showFormatter?Xt=$e.showFormatter({value:Ge,count:pr,maxLength:or}):Xt="".concat(pr).concat(nr?" / ".concat(or):""),_t=De.createElement(De.Fragment,null,_t,De.createElement("span",{className:Qe()("".concat(Ie,"-data-count"),w==null?void 0:w.count),style:I==null?void 0:I.count},Xt)));var yr=function(st){var br;A==null||A(st),(br=et())!==null&&br!==void 0&&br.style.height&&Er(!0)},Rt=!de&&!ar&&!Ee;return De.createElement(ee.BaseInput,{ref:$t,value:Ge,allowClear:Ee,handleReset:lr,suffix:_t,prefixCls:Ie,classNames:(0,U.Z)((0,U.Z)({},w),{},{affixWrapper:Qe()(w==null?void 0:w.affixWrapper,(0,q.Z)((0,q.Z)({},"".concat(Ie,"-show-count"),ar),"".concat(Ie,"-textarea-allow-clear"),Ee))}),disabled:C,focused:Le,className:Qe()(N,tt&&"".concat(Ie,"-out-of-range")),style:(0,U.Z)((0,U.Z)({},g),Qt&&!Rt?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Xt=="string"?Xt:void 0}},hidden:p,readOnly:$,onClear:z},De.createElement(Lt,(0,B.Z)({},ne,{autoSize:de,maxLength:Ue,onKeyDown:Fr,onChange:Ur,onFocus:sr,onBlur:mr,onCompositionStart:Br,onCompositionEnd:Qr,className:Qe()(w==null?void 0:w.textarea),style:(0,U.Z)((0,U.Z)({},I==null?void 0:I.textarea),{},{resize:g==null?void 0:g.resize}),disabled:C,prefixCls:Ie,onResize:yr,ref:Mr,readOnly:$})))}),Z=M,X=Z},29125:function(bn,ft,b){"use strict";b.d(ft,{G:function(){return ye},Z:function(){return Mt}});var B=b(92310),q=b.n(B),U=b(59301);function ye(dt){var he=dt.children,F=dt.prefixCls,yt=dt.id,Be=dt.overlayInnerStyle,re=dt.bodyClassName,bt=dt.className,Ve=dt.style;return U.createElement("div",{className:q()("".concat(F,"-content"),bt),style:Ve},U.createElement("div",{className:q()("".concat(F,"-inner"),re),id:yt,role:"tooltip",style:Be},typeof he=="function"?he():he))}var P=b(32855),te=b(27247),ae=b(43079),Qe=b(65030),ee={shiftX:64,adjustY:1},h={adjustX:1,shiftY:!0},He=[0,0],E={left:{points:["cr","cl"],overflow:h,offset:[-4,0],targetOffset:He},right:{points:["cl","cr"],overflow:h,offset:[4,0],targetOffset:He},top:{points:["bc","tc"],overflow:ee,offset:[0,-4],targetOffset:He},bottom:{points:["tc","bc"],overflow:ee,offset:[0,4],targetOffset:He},topLeft:{points:["bl","tl"],overflow:ee,offset:[0,-4],targetOffset:He},leftTop:{points:["tr","tl"],overflow:h,offset:[-4,0],targetOffset:He},topRight:{points:["br","tr"],overflow:ee,offset:[0,-4],targetOffset:He},rightTop:{points:["tl","tr"],overflow:h,offset:[4,0],targetOffset:He},bottomRight:{points:["tr","br"],overflow:ee,offset:[0,4],targetOffset:He},rightBottom:{points:["bl","br"],overflow:h,offset:[4,0],targetOffset:He},bottomLeft:{points:["tl","bl"],overflow:ee,offset:[0,4],targetOffset:He},leftBottom:{points:["br","bl"],overflow:h,offset:[-4,0],targetOffset:He}},De=null,T=b(80402),mt=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],Et=function(he,F){var yt=he.overlayClassName,Be=he.trigger,re=Be===void 0?["hover"]:Be,bt=he.mouseEnterDelay,Ve=bt===void 0?0:bt,Q=he.mouseLeaveDelay,lt=Q===void 0?.1:Q,Lt=he.overlayStyle,O=he.prefixCls,M=O===void 0?"rc-tooltip":O,Z=he.children,X=he.onVisibleChange,W=he.afterVisibleChange,Ae=he.transitionName,L=he.animation,se=he.motion,Ne=he.placement,ue=Ne===void 0?"right":Ne,je=he.align,_e=je===void 0?{}:je,Ee=he.destroyTooltipOnHide,Ue=Ee===void 0?!1:Ee,We=he.defaultVisible,At=he.getTooltipContainer,xt=he.overlayInnerStyle,St=he.arrowContent,Ie=he.overlay,ar=he.id,er=he.showArrow,N=er===void 0?!0:er,g=he.classNames,C=he.styles,p=(0,ae.Z)(he,mt),w=(0,T.Z)(ar),I=(0,U.useRef)(null);(0,U.useImperativeHandle)(F,function(){return I.current});var A=(0,te.Z)({},p);"visible"in he&&(A.popupVisible=he.visible);var z=function(){return U.createElement(ye,{key:"content",prefixCls:M,id:w,bodyClassName:g==null?void 0:g.body,overlayInnerStyle:(0,te.Z)((0,te.Z)({},xt),C==null?void 0:C.body)},Ie)},oe=function(){var de=U.Children.only(Z),ie=(de==null?void 0:de.props)||{},ne=(0,te.Z)((0,te.Z)({},ie),{},{"aria-describedby":Ie?w:null});return U.cloneElement(Z,ne)};return U.createElement(Qe.Z,(0,P.Z)({popupClassName:q()(yt,g==null?void 0:g.root),prefixCls:M,popup:z,action:re,builtinPlacements:E,popupPlacement:ue,ref:I,popupAlign:_e,getPopupContainer:At,onPopupVisibleChange:X,afterPopupVisibleChange:W,popupTransitionName:Ae,popupAnimation:L,popupMotion:se,defaultPopupVisible:We,autoDestroy:Ue,mouseLeaveDelay:lt,popupStyle:(0,te.Z)((0,te.Z)({},Lt),C==null?void 0:C.root),mouseEnterDelay:Ve,arrow:N},A),oe())},ct=(0,U.forwardRef)(Et),Mt=ct},49658:function(bn,ft){"use strict";ft.Z=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var b=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(b)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(b==null?void 0:b.substr(0,4))}},6790:function(bn,ft,b){"use strict";b.d(ft,{Z:function(){return er}});var B=b(32855),q=b(34666),U=b(27247),ye=b(74430),P=b(11913),te=b(43079),ae=b(92310),Qe=b.n(ae),ee=b(29301),h=b(70425),He=b(34280),E=b(59301),De=b(4676),T=E.forwardRef(function(N,g){var C=N.height,p=N.offsetY,w=N.offsetX,I=N.children,A=N.prefixCls,z=N.onInnerResize,oe=N.innerProps,$=N.rtl,de=N.extra,ie={},ne={display:"flex",flexDirection:"column"};return p!==void 0&&(ie={height:C,position:"relative",overflow:"hidden"},ne=(0,U.Z)((0,U.Z)({},ne),{},(0,ye.Z)((0,ye.Z)((0,ye.Z)((0,ye.Z)((0,ye.Z)({transform:"translateY(".concat(p,"px)")},$?"marginRight":"marginLeft",-w),"position","absolute"),"left",0),"right",0),"top",0))),E.createElement("div",{style:ie},E.createElement(ee.Z,{onResize:function(k){var ve=k.offsetHeight;ve&&z&&z()}},E.createElement("div",(0,B.Z)({style:ne,className:Qe()((0,ye.Z)({},"".concat(A,"-holder-inner"),A)),ref:g},oe),I,de)))});T.displayName="Filler";var mt=T;function Et(N){var g=N.children,C=N.setRef,p=E.useCallback(function(w){C(w)},[]);return E.cloneElement(g,{ref:p})}function ct(N,g,C,p,w,I,A,z){var oe=z.getKey;return N.slice(g,C+1).map(function($,de){var ie=g+de,ne=A($,ie,{style:{width:p},offsetX:w}),pe=oe($);return E.createElement(Et,{key:pe,setRef:function(ve){return I($,ve)}},ne)})}function Mt(N,g,C,p){var w=C-N,I=g-C,A=Math.min(w,I)*2;if(p<=A){var z=Math.floor(p/2);return p%2?C+z+1:C-z}return w>I?C-(p-I):C+(p-w)}function dt(N,g,C){var p=N.length,w=g.length,I,A;if(p===0&&w===0)return null;p<w?(I=N,A=g):(I=g,A=N);var z={__EMPTY_ITEM__:!0};function oe(k){return k!==void 0?C(k):z}for(var $=null,de=Math.abs(p-w)!==1,ie=0;ie<A.length;ie+=1){var ne=oe(I[ie]),pe=oe(A[ie]);if(ne!==pe){$=ie,de=de||ne!==oe(A[ie+1]);break}}return $===null?null:{index:$,multiple:de}}function he(N,g,C){var p=E.useState(N),w=(0,P.Z)(p,2),I=w[0],A=w[1],z=E.useState(null),oe=(0,P.Z)(z,2),$=oe[0],de=oe[1];return E.useEffect(function(){var ie=dt(I||[],N||[],g);(ie==null?void 0:ie.index)!==void 0&&(C==null||C(ie.index),de(N[ie.index])),A(N)},[N]),[$]}var F=b(16089),yt=(typeof navigator=="undefined"?"undefined":(0,q.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Be=yt,re=function(N,g,C,p){var w=(0,E.useRef)(!1),I=(0,E.useRef)(null);function A(){clearTimeout(I.current),w.current=!0,I.current=setTimeout(function(){w.current=!1},50)}var z=(0,E.useRef)({top:N,bottom:g,left:C,right:p});return z.current.top=N,z.current.bottom=g,z.current.left=C,z.current.right=p,function(oe,$){var de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ie=oe?$<0&&z.current.left||$>0&&z.current.right:$<0&&z.current.top||$>0&&z.current.bottom;return de&&ie?(clearTimeout(I.current),w.current=!1):(!ie||w.current)&&A(),!w.current&&ie}};function bt(N,g,C,p,w,I,A){var z=(0,E.useRef)(0),oe=(0,E.useRef)(null),$=(0,E.useRef)(null),de=(0,E.useRef)(!1),ie=re(g,C,p,w);function ne(ge,Re){if(F.Z.cancel(oe.current),!ie(!1,Re)){var Le=ge;if(!Le._virtualHandled)Le._virtualHandled=!0;else return;z.current+=Re,$.current=Re,Be||Le.preventDefault(),oe.current=(0,F.Z)(function(){var gt=de.current?10:1;A(z.current*gt,!1),z.current=0})}}function pe(ge,Re){A(Re,!0),Be||ge.preventDefault()}var k=(0,E.useRef)(null),ve=(0,E.useRef)(null);function K(ge){if(N){F.Z.cancel(ve.current),ve.current=(0,F.Z)(function(){k.current=null},2);var Re=ge.deltaX,Le=ge.deltaY,gt=ge.shiftKey,Xe=Re,be=Le;(k.current==="sx"||!k.current&&gt&&Le&&!Re)&&(Xe=Le,be=0,k.current="sx");var qe=Math.abs(Xe),Qt=Math.abs(be);k.current===null&&(k.current=I&&qe>Qt?"x":"y"),k.current==="y"?ne(ge,be):pe(ge,Xe)}}function Ge(ge){N&&(de.current=ge.detail===$.current)}return[K,Ge]}function Ve(N,g,C,p){var w=E.useMemo(function(){return[new Map,[]]},[N,C.id,p]),I=(0,P.Z)(w,2),A=I[0],z=I[1],oe=function(de){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:de,ne=A.get(de),pe=A.get(ie);if(ne===void 0||pe===void 0)for(var k=N.length,ve=z.length;ve<k;ve+=1){var K,Ge=N[ve],ge=g(Ge);A.set(ge,ve);var Re=(K=C.get(ge))!==null&&K!==void 0?K:p;if(z[ve]=(z[ve-1]||0)+Re,ge===de&&(ne=ve),ge===ie&&(pe=ve),ne!==void 0&&pe!==void 0)break}return{top:z[ne-1]||0,bottom:z[pe]}};return oe}var Q=b(33377),lt=b(93912),Lt=function(){function N(){(0,Q.Z)(this,N),(0,ye.Z)(this,"maps",void 0),(0,ye.Z)(this,"id",0),(0,ye.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,lt.Z)(N,[{key:"set",value:function(C,p){this.diffRecords.set(C,this.maps[C]),this.maps[C]=p,this.id+=1}},{key:"get",value:function(C){return this.maps[C]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),N}(),O=Lt;function M(N){var g=parseFloat(N);return isNaN(g)?0:g}function Z(N,g,C){var p=E.useState(0),w=(0,P.Z)(p,2),I=w[0],A=w[1],z=(0,E.useRef)(new Map),oe=(0,E.useRef)(new O),$=(0,E.useRef)(0);function de(){$.current+=1}function ie(){var pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;de();var k=function(){var Ge=!1;z.current.forEach(function(ge,Re){if(ge&&ge.offsetParent){var Le=ge.offsetHeight,gt=getComputedStyle(ge),Xe=gt.marginTop,be=gt.marginBottom,qe=M(Xe),Qt=M(be),Er=Le+qe+Qt;oe.current.get(Re)!==Er&&(oe.current.set(Re,Er),Ge=!0)}}),Ge&&A(function(ge){return ge+1})};if(pe)k();else{$.current+=1;var ve=$.current;Promise.resolve().then(function(){ve===$.current&&k()})}}function ne(pe,k){var ve=N(pe),K=z.current.get(ve);k?(z.current.set(ve,k),ie()):z.current.delete(ve),!K!=!k&&(k?g==null||g(pe):C==null||C(pe))}return(0,E.useEffect)(function(){return de},[]),[ne,ie,oe.current,I]}var X=14/15;function W(N,g,C){var p=(0,E.useRef)(!1),w=(0,E.useRef)(0),I=(0,E.useRef)(0),A=(0,E.useRef)(null),z=(0,E.useRef)(null),oe,$=function(pe){if(p.current){var k=Math.ceil(pe.touches[0].pageX),ve=Math.ceil(pe.touches[0].pageY),K=w.current-k,Ge=I.current-ve,ge=Math.abs(K)>Math.abs(Ge);ge?w.current=k:I.current=ve;var Re=C(ge,ge?K:Ge,!1,pe);Re&&pe.preventDefault(),clearInterval(z.current),Re&&(z.current=setInterval(function(){ge?K*=X:Ge*=X;var Le=Math.floor(ge?K:Ge);(!C(ge,Le,!0)||Math.abs(Le)<=.1)&&clearInterval(z.current)},16))}},de=function(){p.current=!1,oe()},ie=function(pe){oe(),pe.touches.length===1&&!p.current&&(p.current=!0,w.current=Math.ceil(pe.touches[0].pageX),I.current=Math.ceil(pe.touches[0].pageY),A.current=pe.target,A.current.addEventListener("touchmove",$,{passive:!1}),A.current.addEventListener("touchend",de,{passive:!0}))};oe=function(){A.current&&(A.current.removeEventListener("touchmove",$),A.current.removeEventListener("touchend",de))},(0,He.Z)(function(){return N&&g.current.addEventListener("touchstart",ie,{passive:!0}),function(){var ne;(ne=g.current)===null||ne===void 0||ne.removeEventListener("touchstart",ie),oe(),clearInterval(z.current)}},[N])}function Ae(N){return Math.floor(Math.pow(N,.5))}function L(N,g){var C="touches"in N?N.touches[0]:N;return C[g?"pageX":"pageY"]-window[g?"scrollX":"scrollY"]}function se(N,g,C){E.useEffect(function(){var p=g.current;if(N&&p){var w=!1,I,A,z=function(){F.Z.cancel(I)},oe=function ne(){z(),I=(0,F.Z)(function(){C(A),ne()})},$=function(pe){if(!(pe.target.draggable||pe.button!==0)){var k=pe;k._virtualHandled||(k._virtualHandled=!0,w=!0)}},de=function(){w=!1,z()},ie=function(pe){if(w){var k=L(pe,!1),ve=p.getBoundingClientRect(),K=ve.top,Ge=ve.bottom;if(k<=K){var ge=K-k;A=-Ae(ge),oe()}else if(k>=Ge){var Re=k-Ge;A=Ae(Re),oe()}else z()}};return p.addEventListener("mousedown",$),p.ownerDocument.addEventListener("mouseup",de),p.ownerDocument.addEventListener("mousemove",ie),function(){p.removeEventListener("mousedown",$),p.ownerDocument.removeEventListener("mouseup",de),p.ownerDocument.removeEventListener("mousemove",ie),z()}}},[N])}var Ne=10;function ue(N,g,C,p,w,I,A,z){var oe=E.useRef(),$=E.useState(null),de=(0,P.Z)($,2),ie=de[0],ne=de[1];return(0,He.Z)(function(){if(ie&&ie.times<Ne){if(!N.current){ne(function($e){return(0,U.Z)({},$e)});return}I();var pe=ie.targetAlign,k=ie.originAlign,ve=ie.index,K=ie.offset,Ge=N.current.clientHeight,ge=!1,Re=pe,Le=null;if(Ge){for(var gt=pe||k,Xe=0,be=0,qe=0,Qt=Math.min(g.length-1,ve),Er=0;Er<=Qt;Er+=1){var $t=w(g[Er]);be=Xe;var Mr=C.get($t);qe=be+(Mr===void 0?p:Mr),Xe=qe}for(var et=gt==="top"?K:Ge-K,it=Qt;it>=0;it-=1){var kt=w(g[it]),Vt=C.get(kt);if(Vt===void 0){ge=!0;break}if(et-=Vt,et<=0)break}switch(gt){case"top":Le=be-K;break;case"bottom":Le=qe-Ge+K;break;default:{var Dt=N.current.scrollTop,Pt=Dt+Ge;be<Dt?Re="top":qe>Pt&&(Re="bottom")}}Le!==null&&A(Le),Le!==ie.lastTop&&(ge=!0)}ge&&ne((0,U.Z)((0,U.Z)({},ie),{},{times:ie.times+1,targetAlign:Re,lastTop:Le}))}},[ie,N.current]),function(pe){if(pe==null){z();return}if(F.Z.cancel(oe.current),typeof pe=="number")A(pe);else if(pe&&(0,q.Z)(pe)==="object"){var k,ve=pe.align;"index"in pe?k=pe.index:k=g.findIndex(function(ge){return w(ge)===pe.key});var K=pe.offset,Ge=K===void 0?0:K;ne({times:0,index:k,offset:Ge,originAlign:ve})}}}var je=E.forwardRef(function(N,g){var C=N.prefixCls,p=N.rtl,w=N.scrollOffset,I=N.scrollRange,A=N.onStartMove,z=N.onStopMove,oe=N.onScroll,$=N.horizontal,de=N.spinSize,ie=N.containerSize,ne=N.style,pe=N.thumbStyle,k=N.showScrollBar,ve=E.useState(!1),K=(0,P.Z)(ve,2),Ge=K[0],ge=K[1],Re=E.useState(null),Le=(0,P.Z)(Re,2),gt=Le[0],Xe=Le[1],be=E.useState(null),qe=(0,P.Z)(be,2),Qt=qe[0],Er=qe[1],$t=!p,Mr=E.useRef(),et=E.useRef(),it=E.useState(k),kt=(0,P.Z)(it,2),Vt=kt[0],Dt=kt[1],Pt=E.useRef(),$e=function(){k===!0||k===!1||(clearTimeout(Pt.current),Dt(!0),Pt.current=setTimeout(function(){Dt(!1)},3e3))},or=I-ie||0,nr=ie-de||0,pr=E.useMemo(function(){if(w===0||or===0)return 0;var lr=w/or;return lr*nr},[w,or,nr]),tt=function(_t){_t.stopPropagation(),_t.preventDefault()},Ir=E.useRef({top:pr,dragging:Ge,pageY:gt,startTop:Qt});Ir.current={top:pr,dragging:Ge,pageY:gt,startTop:Qt};var Br=function(_t){ge(!0),Xe(L(_t,$)),Er(Ir.current.top),A(),_t.stopPropagation(),_t.preventDefault()};E.useEffect(function(){var lr=function(Rt){Rt.preventDefault()},_t=Mr.current,Xt=et.current;return _t.addEventListener("touchstart",lr,{passive:!1}),Xt.addEventListener("touchstart",Br,{passive:!1}),function(){_t.removeEventListener("touchstart",lr),Xt.removeEventListener("touchstart",Br)}},[]);var Qr=E.useRef();Qr.current=or;var Ur=E.useRef();Ur.current=nr,E.useEffect(function(){if(Ge){var lr,_t=function(Rt){var Y=Ir.current,st=Y.dragging,br=Y.pageY,Sr=Y.startTop;F.Z.cancel(lr);var d=Mr.current.getBoundingClientRect(),v=ie/($?d.width:d.height);if(st){var H=(L(Rt,$)-br)*v,D=Sr;!$t&&$?D-=H:D+=H;var m=Qr.current,x=Ur.current,fe=x?D/x:0,ce=Math.ceil(fe*m);ce=Math.max(ce,0),ce=Math.min(ce,m),lr=(0,F.Z)(function(){oe(ce,$)})}},Xt=function(){ge(!1),z()};return window.addEventListener("mousemove",_t,{passive:!0}),window.addEventListener("touchmove",_t,{passive:!0}),window.addEventListener("mouseup",Xt,{passive:!0}),window.addEventListener("touchend",Xt,{passive:!0}),function(){window.removeEventListener("mousemove",_t),window.removeEventListener("touchmove",_t),window.removeEventListener("mouseup",Xt),window.removeEventListener("touchend",Xt),F.Z.cancel(lr)}}},[Ge]),E.useEffect(function(){return $e(),function(){clearTimeout(Pt.current)}},[w]),E.useImperativeHandle(g,function(){return{delayHidden:$e}});var Fr="".concat(C,"-scrollbar"),sr={position:"absolute",visibility:Vt?null:"hidden"},mr={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return $?(Object.assign(sr,{height:8,left:0,right:0,bottom:0}),Object.assign(mr,(0,ye.Z)({height:"100%",width:de},$t?"left":"right",pr))):(Object.assign(sr,(0,ye.Z)({width:8,top:0,bottom:0},$t?"right":"left",0)),Object.assign(mr,{width:"100%",height:de,top:pr})),E.createElement("div",{ref:Mr,className:Qe()(Fr,(0,ye.Z)((0,ye.Z)((0,ye.Z)({},"".concat(Fr,"-horizontal"),$),"".concat(Fr,"-vertical"),!$),"".concat(Fr,"-visible"),Vt)),style:(0,U.Z)((0,U.Z)({},sr),ne),onMouseDown:tt,onMouseMove:$e},E.createElement("div",{ref:et,className:Qe()("".concat(Fr,"-thumb"),(0,ye.Z)({},"".concat(Fr,"-thumb-moving"),Ge)),style:(0,U.Z)((0,U.Z)({},mr),pe),onMouseDown:Br}))}),_e=je,Ee=20;function Ue(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=N/g*N;return isNaN(C)&&(C=0),C=Math.max(C,Ee),Math.floor(C)}var We=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],At=[],xt={overflowY:"auto",overflowAnchor:"none"};function St(N,g){var C=N.prefixCls,p=C===void 0?"rc-virtual-list":C,w=N.className,I=N.height,A=N.itemHeight,z=N.fullHeight,oe=z===void 0?!0:z,$=N.style,de=N.data,ie=N.children,ne=N.itemKey,pe=N.virtual,k=N.direction,ve=N.scrollWidth,K=N.component,Ge=K===void 0?"div":K,ge=N.onScroll,Re=N.onVirtualScroll,Le=N.onVisibleChange,gt=N.innerProps,Xe=N.extraRender,be=N.styles,qe=N.showScrollBar,Qt=qe===void 0?"optional":qe,Er=(0,te.Z)(N,We),$t=E.useCallback(function(G){return typeof ne=="function"?ne(G):G==null?void 0:G[ne]},[ne]),Mr=Z($t,null,null),et=(0,P.Z)(Mr,4),it=et[0],kt=et[1],Vt=et[2],Dt=et[3],Pt=!!(pe!==!1&&I&&A),$e=E.useMemo(function(){return Object.values(Vt.maps).reduce(function(G,j){return G+j},0)},[Vt.id,Vt.maps]),or=Pt&&de&&(Math.max(A*de.length,$e)>I||!!ve),nr=k==="rtl",pr=Qe()(p,(0,ye.Z)({},"".concat(p,"-rtl"),nr),w),tt=de||At,Ir=(0,E.useRef)(),Br=(0,E.useRef)(),Qr=(0,E.useRef)(),Ur=(0,E.useState)(0),Fr=(0,P.Z)(Ur,2),sr=Fr[0],mr=Fr[1],lr=(0,E.useState)(0),_t=(0,P.Z)(lr,2),Xt=_t[0],yr=_t[1],Rt=(0,E.useState)(!1),Y=(0,P.Z)(Rt,2),st=Y[0],br=Y[1],Sr=function(){br(!0)},d=function(){br(!1)},v={getKey:$t};function H(G){mr(function(j){var Oe;typeof G=="function"?Oe=G(j):Oe=G;var me=Wr(Oe);return Ir.current.scrollTop=me,me})}var D=(0,E.useRef)({start:0,end:tt.length}),m=(0,E.useRef)(),x=he(tt,$t),fe=(0,P.Z)(x,1),ce=fe[0];m.current=ce;var Pe=E.useMemo(function(){if(!Pt)return{scrollHeight:void 0,start:0,end:tt.length-1,offset:void 0};if(!or){var G;return{scrollHeight:((G=Br.current)===null||G===void 0?void 0:G.offsetHeight)||0,start:0,end:tt.length-1,offset:void 0}}for(var j=0,Oe,me,nt,Kt=tt.length,Jt=0;Jt<Kt;Jt+=1){var qt=tt[Jt],Rr=$t(qt),Xr=Vt.get(Rr),Tr=j+(Xr===void 0?A:Xr);Tr>=sr&&Oe===void 0&&(Oe=Jt,me=j),Tr>sr+I&&nt===void 0&&(nt=Jt),j=Tr}return Oe===void 0&&(Oe=0,me=0,nt=Math.ceil(I/A)),nt===void 0&&(nt=tt.length-1),nt=Math.min(nt+1,tt.length-1),{scrollHeight:j,start:Oe,end:nt,offset:me}},[or,Pt,sr,tt,Dt,I]),Ce=Pe.scrollHeight,ke=Pe.start,J=Pe.end,Me=Pe.offset;D.current.start=ke,D.current.end=J,E.useLayoutEffect(function(){var G=Vt.getRecord();if(G.size===1){var j=Array.from(G.keys())[0],Oe=G.get(j),me=tt[ke];if(me&&Oe===void 0){var nt=$t(me);if(nt===j){var Kt=Vt.get(j),Jt=Kt-A;H(function(qt){return qt+Jt})}}}Vt.resetRecord()},[Ce]);var _=E.useState({width:0,height:I}),Ze=(0,P.Z)(_,2),Se=Ze[0],ze=Ze[1],Tt=function(j){ze({width:j.offsetWidth,height:j.offsetHeight})},Ft=(0,E.useRef)(),Yt=(0,E.useRef)(),zt=E.useMemo(function(){return Ue(Se.width,ve)},[Se.width,ve]),cr=E.useMemo(function(){return Ue(Se.height,Ce)},[Se.height,Ce]),Ct=Ce-I,dr=(0,E.useRef)(Ct);dr.current=Ct;function Wr(G){var j=G;return Number.isNaN(dr.current)||(j=Math.min(j,dr.current)),j=Math.max(j,0),j}var Ht=sr<=0,Wt=sr>=Ct,Bt=Xt<=0,vr=Xt>=ve,Nt=re(Ht,Wt,Bt,vr),wt=function(){return{x:nr?-Xt:Xt,y:sr}},pt=(0,E.useRef)(wt()),Ut=(0,h.zX)(function(G){if(Re){var j=(0,U.Z)((0,U.Z)({},wt()),G);(pt.current.x!==j.x||pt.current.y!==j.y)&&(Re(j),pt.current=j)}});function ur(G,j){var Oe=G;j?((0,De.flushSync)(function(){yr(Oe)}),Ut()):H(Oe)}function tr(G){var j=G.currentTarget.scrollTop;j!==sr&&H(j),ge==null||ge(G),Ut()}var hr=function(j){var Oe=j,me=ve?ve-Se.width:0;return Oe=Math.max(Oe,0),Oe=Math.min(Oe,me),Oe},jt=(0,h.zX)(function(G,j){j?((0,De.flushSync)(function(){yr(function(Oe){var me=Oe+(nr?-G:G);return hr(me)})}),Ut()):H(function(Oe){var me=Oe+G;return me})}),Ot=bt(Pt,Ht,Wt,Bt,vr,!!ve,jt),Cr=(0,P.Z)(Ot,2),_r=Cr[0],jr=Cr[1];W(Pt,Ir,function(G,j,Oe,me){var nt=me;return Nt(G,j,Oe)?!1:!nt||!nt._virtualHandled?(nt&&(nt._virtualHandled=!0),_r({preventDefault:function(){},deltaX:G?j:0,deltaY:G?0:j}),!0):!1}),se(or,Ir,function(G){H(function(j){return j+G})}),(0,He.Z)(function(){function G(Oe){var me=Ht&&Oe.detail<0,nt=Wt&&Oe.detail>0;Pt&&!me&&!nt&&Oe.preventDefault()}var j=Ir.current;return j.addEventListener("wheel",_r,{passive:!1}),j.addEventListener("DOMMouseScroll",jr,{passive:!0}),j.addEventListener("MozMousePixelScroll",G,{passive:!1}),function(){j.removeEventListener("wheel",_r),j.removeEventListener("DOMMouseScroll",jr),j.removeEventListener("MozMousePixelScroll",G)}},[Pt,Ht,Wt]),(0,He.Z)(function(){if(ve){var G=hr(Xt);yr(G),Ut({x:G})}},[Se.width,ve]);var fr=function(){var j,Oe;(j=Ft.current)===null||j===void 0||j.delayHidden(),(Oe=Yt.current)===null||Oe===void 0||Oe.delayHidden()},en=ue(Ir,tt,Vt,A,$t,function(){return kt(!0)},H,fr);E.useImperativeHandle(g,function(){return{nativeElement:Qr.current,getScrollInfo:wt,scrollTo:function(j){function Oe(me){return me&&(0,q.Z)(me)==="object"&&("left"in me||"top"in me)}Oe(j)?(j.left!==void 0&&yr(hr(j.left)),en(j.top)):en(j)}}}),(0,He.Z)(function(){if(Le){var G=tt.slice(ke,J+1);Le(G,tt)}},[ke,J,tt]);var Lr=Ve(tt,$t,Vt,A),Gr=Xe==null?void 0:Xe({start:ke,end:J,virtual:or,offsetX:Xt,offsetY:Me,rtl:nr,getSize:Lr}),Kr=ct(tt,ke,J,ve,Xt,it,ie,v),wr=null;I&&(wr=(0,U.Z)((0,ye.Z)({},oe?"height":"maxHeight",I),xt),Pt&&(wr.overflowY="hidden",ve&&(wr.overflowX="hidden"),st&&(wr.pointerEvents="none")));var ot={};return nr&&(ot.dir="rtl"),E.createElement("div",(0,B.Z)({ref:Qr,style:(0,U.Z)((0,U.Z)({},$),{},{position:"relative"}),className:pr},ot,Er),E.createElement(ee.Z,{onResize:Tt},E.createElement(Ge,{className:"".concat(p,"-holder"),style:wr,ref:Ir,onScroll:tr,onMouseEnter:fr},E.createElement(mt,{prefixCls:p,height:Ce,offsetX:Xt,offsetY:Me,scrollWidth:ve,onInnerResize:kt,ref:Br,innerProps:gt,rtl:nr,extra:Gr},Kr))),or&&Ce>I&&E.createElement(_e,{ref:Ft,prefixCls:p,scrollOffset:sr,scrollRange:Ce,rtl:nr,onScroll:ur,onStartMove:Sr,onStopMove:d,spinSize:cr,containerSize:Se.height,style:be==null?void 0:be.verticalScrollBar,thumbStyle:be==null?void 0:be.verticalScrollBarThumb,showScrollBar:Qt}),or&&ve>Se.width&&E.createElement(_e,{ref:Yt,prefixCls:p,scrollOffset:Xt,scrollRange:ve,rtl:nr,onScroll:ur,onStartMove:Sr,onStopMove:d,spinSize:zt,containerSize:Se.width,horizontal:!0,style:be==null?void 0:be.horizontalScrollBar,thumbStyle:be==null?void 0:be.horizontalScrollBarThumb,showScrollBar:Qt}))}var Ie=E.forwardRef(St);Ie.displayName="List";var ar=Ie,er=ar},76374:function(bn,ft,b){"use strict";var B=function(){if(typeof Map!="undefined")return Map;function O(M,Z){var X=-1;return M.some(function(W,Ae){return W[0]===Z?(X=Ae,!0):!1}),X}return function(){function M(){this.__entries__=[]}return Object.defineProperty(M.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),M.prototype.get=function(Z){var X=O(this.__entries__,Z),W=this.__entries__[X];return W&&W[1]},M.prototype.set=function(Z,X){var W=O(this.__entries__,Z);~W?this.__entries__[W][1]=X:this.__entries__.push([Z,X])},M.prototype.delete=function(Z){var X=this.__entries__,W=O(X,Z);~W&&X.splice(W,1)},M.prototype.has=function(Z){return!!~O(this.__entries__,Z)},M.prototype.clear=function(){this.__entries__.splice(0)},M.prototype.forEach=function(Z,X){X===void 0&&(X=null);for(var W=0,Ae=this.__entries__;W<Ae.length;W++){var L=Ae[W];Z.call(X,L[1],L[0])}},M}()}(),q=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,U=function(){return typeof b.g!="undefined"&&b.g.Math===Math?b.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),ye=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(U):function(O){return setTimeout(function(){return O(Date.now())},1e3/60)}}(),P=2;function te(O,M){var Z=!1,X=!1,W=0;function Ae(){Z&&(Z=!1,O()),X&&se()}function L(){ye(Ae)}function se(){var Ne=Date.now();if(Z){if(Ne-W<P)return;X=!0}else Z=!0,X=!1,setTimeout(L,M);W=Ne}return se}var ae=20,Qe=["top","right","bottom","left","width","height","size","weight"],ee=typeof MutationObserver!="undefined",h=function(){function O(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=te(this.refresh.bind(this),ae)}return O.prototype.addObserver=function(M){~this.observers_.indexOf(M)||this.observers_.push(M),this.connected_||this.connect_()},O.prototype.removeObserver=function(M){var Z=this.observers_,X=Z.indexOf(M);~X&&Z.splice(X,1),!Z.length&&this.connected_&&this.disconnect_()},O.prototype.refresh=function(){var M=this.updateObservers_();M&&this.refresh()},O.prototype.updateObservers_=function(){var M=this.observers_.filter(function(Z){return Z.gatherActive(),Z.hasActive()});return M.forEach(function(Z){return Z.broadcastActive()}),M.length>0},O.prototype.connect_=function(){!q||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ee?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},O.prototype.disconnect_=function(){!q||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},O.prototype.onTransitionEnd_=function(M){var Z=M.propertyName,X=Z===void 0?"":Z,W=Qe.some(function(Ae){return!!~X.indexOf(Ae)});W&&this.refresh()},O.getInstance=function(){return this.instance_||(this.instance_=new O),this.instance_},O.instance_=null,O}(),He=function(O,M){for(var Z=0,X=Object.keys(M);Z<X.length;Z++){var W=X[Z];Object.defineProperty(O,W,{value:M[W],enumerable:!1,writable:!1,configurable:!0})}return O},E=function(O){var M=O&&O.ownerDocument&&O.ownerDocument.defaultView;return M||U},De=Be(0,0,0,0);function T(O){return parseFloat(O)||0}function mt(O){for(var M=[],Z=1;Z<arguments.length;Z++)M[Z-1]=arguments[Z];return M.reduce(function(X,W){var Ae=O["border-"+W+"-width"];return X+T(Ae)},0)}function Et(O){for(var M=["top","right","bottom","left"],Z={},X=0,W=M;X<W.length;X++){var Ae=W[X],L=O["padding-"+Ae];Z[Ae]=T(L)}return Z}function ct(O){var M=O.getBBox();return Be(0,0,M.width,M.height)}function Mt(O){var M=O.clientWidth,Z=O.clientHeight;if(!M&&!Z)return De;var X=E(O).getComputedStyle(O),W=Et(X),Ae=W.left+W.right,L=W.top+W.bottom,se=T(X.width),Ne=T(X.height);if(X.boxSizing==="border-box"&&(Math.round(se+Ae)!==M&&(se-=mt(X,"left","right")+Ae),Math.round(Ne+L)!==Z&&(Ne-=mt(X,"top","bottom")+L)),!he(O)){var ue=Math.round(se+Ae)-M,je=Math.round(Ne+L)-Z;Math.abs(ue)!==1&&(se-=ue),Math.abs(je)!==1&&(Ne-=je)}return Be(W.left,W.top,se,Ne)}var dt=function(){return typeof SVGGraphicsElement!="undefined"?function(O){return O instanceof E(O).SVGGraphicsElement}:function(O){return O instanceof E(O).SVGElement&&typeof O.getBBox=="function"}}();function he(O){return O===E(O).document.documentElement}function F(O){return q?dt(O)?ct(O):Mt(O):De}function yt(O){var M=O.x,Z=O.y,X=O.width,W=O.height,Ae=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,L=Object.create(Ae.prototype);return He(L,{x:M,y:Z,width:X,height:W,top:Z,right:M+X,bottom:W+Z,left:M}),L}function Be(O,M,Z,X){return{x:O,y:M,width:Z,height:X}}var re=function(){function O(M){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Be(0,0,0,0),this.target=M}return O.prototype.isActive=function(){var M=F(this.target);return this.contentRect_=M,M.width!==this.broadcastWidth||M.height!==this.broadcastHeight},O.prototype.broadcastRect=function(){var M=this.contentRect_;return this.broadcastWidth=M.width,this.broadcastHeight=M.height,M},O}(),bt=function(){function O(M,Z){var X=yt(Z);He(this,{target:M,contentRect:X})}return O}(),Ve=function(){function O(M,Z,X){if(this.activeObservations_=[],this.observations_=new B,typeof M!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=M,this.controller_=Z,this.callbackCtx_=X}return O.prototype.observe=function(M){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(M instanceof E(M).Element))throw new TypeError('parameter 1 is not of type "Element".');var Z=this.observations_;Z.has(M)||(Z.set(M,new re(M)),this.controller_.addObserver(this),this.controller_.refresh())}},O.prototype.unobserve=function(M){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(M instanceof E(M).Element))throw new TypeError('parameter 1 is not of type "Element".');var Z=this.observations_;Z.has(M)&&(Z.delete(M),Z.size||this.controller_.removeObserver(this))}},O.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},O.prototype.gatherActive=function(){var M=this;this.clearActive(),this.observations_.forEach(function(Z){Z.isActive()&&M.activeObservations_.push(Z)})},O.prototype.broadcastActive=function(){if(this.hasActive()){var M=this.callbackCtx_,Z=this.activeObservations_.map(function(X){return new bt(X.target,X.broadcastRect())});this.callback_.call(M,Z,M),this.clearActive()}},O.prototype.clearActive=function(){this.activeObservations_.splice(0)},O.prototype.hasActive=function(){return this.activeObservations_.length>0},O}(),Q=typeof WeakMap!="undefined"?new WeakMap:new B,lt=function(){function O(M){if(!(this instanceof O))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var Z=h.getInstance(),X=new Ve(M,Z,this);Q.set(this,X)}return O}();["observe","unobserve","disconnect"].forEach(function(O){lt.prototype[O]=function(){var M;return(M=Q.get(this))[O].apply(M,arguments)}});var Lt=function(){return typeof U.ResizeObserver!="undefined"?U.ResizeObserver:lt}();ft.Z=Lt},16722:function(bn,ft,b){"use strict";b.d(ft,{Z:function(){return Qe}});const B=ee=>typeof ee=="object"&&ee!=null&&ee.nodeType===1,q=(ee,h)=>(!h||ee!=="hidden")&&ee!=="visible"&&ee!=="clip",U=(ee,h)=>{if(ee.clientHeight<ee.scrollHeight||ee.clientWidth<ee.scrollWidth){const He=getComputedStyle(ee,null);return q(He.overflowY,h)||q(He.overflowX,h)||(E=>{const De=(T=>{if(!T.ownerDocument||!T.ownerDocument.defaultView)return null;try{return T.ownerDocument.defaultView.frameElement}catch(mt){return null}})(E);return!!De&&(De.clientHeight<E.scrollHeight||De.clientWidth<E.scrollWidth)})(ee)}return!1},ye=(ee,h,He,E,De,T,mt,Et)=>T<ee&&mt>h||T>ee&&mt<h?0:T<=ee&&Et<=He||mt>=h&&Et>=He?T-ee-E:mt>h&&Et<He||T<ee&&Et>He?mt-h+De:0,P=ee=>{const h=ee.parentElement;return h==null?ee.getRootNode().host||null:h},te=(ee,h)=>{var He,E,De,T;if(typeof document=="undefined")return[];const{scrollMode:mt,block:Et,inline:ct,boundary:Mt,skipOverflowHiddenElements:dt}=h,he=typeof Mt=="function"?Mt:_e=>_e!==Mt;if(!B(ee))throw new TypeError("Invalid target");const F=document.scrollingElement||document.documentElement,yt=[];let Be=ee;for(;B(Be)&&he(Be);){if(Be=P(Be),Be===F){yt.push(Be);break}Be!=null&&Be===document.body&&U(Be)&&!U(document.documentElement)||Be!=null&&U(Be,dt)&&yt.push(Be)}const re=(E=(He=window.visualViewport)==null?void 0:He.width)!=null?E:innerWidth,bt=(T=(De=window.visualViewport)==null?void 0:De.height)!=null?T:innerHeight,{scrollX:Ve,scrollY:Q}=window,{height:lt,width:Lt,top:O,right:M,bottom:Z,left:X}=ee.getBoundingClientRect(),{top:W,right:Ae,bottom:L,left:se}=(_e=>{const Ee=window.getComputedStyle(_e);return{top:parseFloat(Ee.scrollMarginTop)||0,right:parseFloat(Ee.scrollMarginRight)||0,bottom:parseFloat(Ee.scrollMarginBottom)||0,left:parseFloat(Ee.scrollMarginLeft)||0}})(ee);let Ne=Et==="start"||Et==="nearest"?O-W:Et==="end"?Z+L:O+lt/2-W+L,ue=ct==="center"?X+Lt/2-se+Ae:ct==="end"?M+Ae:X-se;const je=[];for(let _e=0;_e<yt.length;_e++){const Ee=yt[_e],{height:Ue,width:We,top:At,right:xt,bottom:St,left:Ie}=Ee.getBoundingClientRect();if(mt==="if-needed"&&O>=0&&X>=0&&Z<=bt&&M<=re&&(Ee===F&&!U(Ee)||O>=At&&Z<=St&&X>=Ie&&M<=xt))return je;const ar=getComputedStyle(Ee),er=parseInt(ar.borderLeftWidth,10),N=parseInt(ar.borderTopWidth,10),g=parseInt(ar.borderRightWidth,10),C=parseInt(ar.borderBottomWidth,10);let p=0,w=0;const I="offsetWidth"in Ee?Ee.offsetWidth-Ee.clientWidth-er-g:0,A="offsetHeight"in Ee?Ee.offsetHeight-Ee.clientHeight-N-C:0,z="offsetWidth"in Ee?Ee.offsetWidth===0?0:We/Ee.offsetWidth:0,oe="offsetHeight"in Ee?Ee.offsetHeight===0?0:Ue/Ee.offsetHeight:0;if(F===Ee)p=Et==="start"?Ne:Et==="end"?Ne-bt:Et==="nearest"?ye(Q,Q+bt,bt,N,C,Q+Ne,Q+Ne+lt,lt):Ne-bt/2,w=ct==="start"?ue:ct==="center"?ue-re/2:ct==="end"?ue-re:ye(Ve,Ve+re,re,er,g,Ve+ue,Ve+ue+Lt,Lt),p=Math.max(0,p+Q),w=Math.max(0,w+Ve);else{p=Et==="start"?Ne-At-N:Et==="end"?Ne-St+C+A:Et==="nearest"?ye(At,St,Ue,N,C+A,Ne,Ne+lt,lt):Ne-(At+Ue/2)+A/2,w=ct==="start"?ue-Ie-er:ct==="center"?ue-(Ie+We/2)+I/2:ct==="end"?ue-xt+g+I:ye(Ie,xt,We,er,g+I,ue,ue+Lt,Lt);const{scrollLeft:$,scrollTop:de}=Ee;p=oe===0?0:Math.max(0,Math.min(de+p/oe,Ee.scrollHeight-Ue/oe+A)),w=z===0?0:Math.max(0,Math.min($+w/z,Ee.scrollWidth-We/z+I)),Ne+=de-p,ue+=$-w}je.push({el:Ee,top:p,left:w})}return je},ae=ee=>ee===!1?{block:"end",inline:"nearest"}:(h=>h===Object(h)&&Object.keys(h).length!==0)(ee)?ee:{block:"start",inline:"nearest"};function Qe(ee,h){if(!ee.isConnected||!(De=>{let T=De;for(;T&&T.parentNode;){if(T.parentNode===document)return!0;T=T.parentNode instanceof ShadowRoot?T.parentNode.host:T.parentNode}return!1})(ee))return;const He=(De=>{const T=window.getComputedStyle(De);return{top:parseFloat(T.scrollMarginTop)||0,right:parseFloat(T.scrollMarginRight)||0,bottom:parseFloat(T.scrollMarginBottom)||0,left:parseFloat(T.scrollMarginLeft)||0}})(ee);if((De=>typeof De=="object"&&typeof De.behavior=="function")(h))return h.behavior(te(ee,h));const E=typeof h=="boolean"||h==null?void 0:h.behavior;for(const{el:De,top:T,left:mt}of te(ee,ae(h))){const Et=T-He.top+He.bottom,ct=mt-He.left+He.right;De.scroll({top:Et,left:ct,behavior:E})}}}}]);