(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;z1&&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&>!==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"&&(GrUt||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"&&(wrUt||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"&&(wrx.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"&&(Grx.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;xr1?It-1:0),xr=1;xrT 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)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=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"\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:tn?-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;at||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;it)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-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;i0}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.post},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.lastColumnPos0?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=e.first&&tn?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;rthis.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;Sy&&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(;Ve.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&&ut.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.pose.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(;so;--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.highlightFrontiern;r--){var i=Y(e,r).stateAfter;if(i&&(!(i instanceof Ze)||r+i.lookAhead=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=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.from0&&l)for(var Ke=0;Ke0)){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;nt)&&(!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=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;it.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;iu&&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;os||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=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;a2&&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;rn)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=n.lineN&&tt)&&(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=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+l0&&(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=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=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=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=Vle)&&(f=y,c=le)}}return f||(f=i[i.length-1]),f.fromu&&(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;o0&&(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;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Nt&&Jt(e.doc,t)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=i.lineN&&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;s0){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.viewFromn&&(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=e.display.viewTo||l.to().line0?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.005||f<-.005)&&(Sr(i.line,o),Io(i.line),i.rest))for(var c=0;ce.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=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.topl-r;if(t.topi+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.lefty+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.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=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&&Sn)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=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.viewFromo&&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-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;oo.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=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;a0: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;r1&&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;l1&&!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-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=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=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=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;re.lastLine())){if(t.from.linea&&(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&>(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){n1||!(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;t50){for(var o=i.lines.length%25+25,l=o;l10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.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;i0||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=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.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=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;re)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.linet&&(t=e.from),e.to!=null&&e.to-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=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=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&&we0==(ht.level!=1),Gt=rt?xe.begin:l(xe.end,-1);if(ht.from<=Gt&&Gt0?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.line0)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;re&&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.liney.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=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;l20*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(So,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=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-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;ra&&(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;c0&&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]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;u0&&f(a.charAt(o-1));)--o;for(;l.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+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&&Ul(t,r)||{node:l[0].measure.map[2],offset:0},u=i.linee.firstLine()&&(r=m(r.line-1,Y(e.doc,r.line-1).length)),i.ch==Y(e.doc,i.line).text.length&&i.linet.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);yr.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=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);o1e3||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;CeYt&&(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;oi1?Cn-1:0),rn=1;rn1?ai-1:0),vi=1;vi=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;me1&&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;fe0?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;p2&&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&>&&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;ve0&&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=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;bePt&&(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=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__;W0},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);Z0},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{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.clientHeightTh||T>ee&&mt=h&&Et>=He?T-ee-E:mt>h&&EtHe?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=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})}}}}]);