You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
297 KiB
38 lines
297 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[7046],{65352:function(yn,vt,b){"use strict";b.d(vt,{Z:function(){return P}});var H=b(77321),Q=b(52487),K=b(74416),we=b(43403),T=b(92310),re=b.n(T),ae=b(29301),Je=b(76846),$=b(96452),h=b(6089),We=b(80402),M=b(34280),De=b(49658),D=b(59301),St=b(72308),Dt=b(77900),ht=b(8654);function Pt(g){var C=g.prefixCls,p=g.align,x=g.arrow,O=g.arrowPos,I=x||{},z=I.className,le=I.content,q=O.x,de=q===void 0?0:q,ie=O.y,ne=ie===void 0?0:ie,ge=D.useRef();if(!p||!p.points)return null;var k={position:"absolute"};if(p.autoArrow!==!1){var ce=p.points[0],B=p.points[1],Ke=ce[0],pe=ce[1],Te=B[0],Me=B[1];Ke===Te||!["t","b"].includes(Ke)?k.top=ne:Ke==="t"?k.top=0:k.bottom=0,pe===Me||!["l","r"].includes(pe)?k.left=de:pe==="l"?k.left=0:k.right=0}return D.createElement("div",{ref:ge,className:re()("".concat(C,"-arrow"),z),style:k},le)}function gt(g){var C=g.prefixCls,p=g.open,x=g.zIndex,O=g.mask,I=g.motion;return O?D.createElement(Dt.default,(0,St.Z)({},I,{motionAppear:!0,visible:p,removeOnLeave:!0}),function(z){var le=z.className;return D.createElement("div",{style:{zIndex:x},className:re()("".concat(C,"-mask"),le)})}):null}var he=D.memo(function(g){var C=g.children;return C},function(g,C){return C.cache}),F=he,xt=D.forwardRef(function(g,C){var p=g.popup,x=g.className,O=g.prefixCls,I=g.style,z=g.target,le=g.onVisibleChanged,q=g.open,de=g.keepDom,ie=g.fresh,ne=g.onClick,ge=g.mask,k=g.arrow,ce=g.arrowPos,B=g.align,Ke=g.motion,pe=g.maskMotion,Te=g.forceRender,Me=g.getPopupContainer,mt=g.autoDestroy,je=g.portal,be=g.zIndex,et=g.onMouseEnter,cr=g.onMouseLeave,yr=g.onPointerEnter,tr=g.onPointerDownCapture,Cr=g.ready,tt=g.offsetX,ut=g.offsetY,zt=g.offsetR,Gt=g.offsetB,Xt=g.onAlign,$t=g.onPrepare,Ot=g.stretch,rr=g.targetWidth,yt=g.targetHeight,Fr=typeof p=="function"?p():p,Kt=q||de,sr=(Me==null?void 0:Me.length)>0,kt=D.useState(!Me||!sr),Or=(0,Q.Z)(kt,2),dn=Or[0],Wr=Or[1];if((0,M.Z)(function(){!dn&&sr&&z&&Wr(!0)},[dn,sr,z]),!dn)return null;var nr="auto",ar={left:"-1000vw",top:"-1000vh",right:nr,bottom:nr};if(Cr||!q){var ur,Yt=B.points,Ut=B.dynamicInset||((ur=B._experimental)===null||ur===void 0?void 0:ur.dynamicInset),pr=Ut&&Yt[0][1]==="r",Zt=Ut&&Yt[0][0]==="b";pr?(ar.right=zt,ar.left=nr):(ar.left=tt,ar.right=nr),Zt?(ar.bottom=Gt,ar.top=nr):(ar.top=ut,ar.bottom=nr)}var X={};return Ot&&(Ot.includes("height")&&yt?X.height=yt:Ot.includes("minHeight")&&yt&&(X.minHeight=yt),Ot.includes("width")&&rr?X.width=rr:Ot.includes("minWidth")&&rr&&(X.minWidth=rr)),q||(X.pointerEvents="none"),D.createElement(je,{open:Te||Kt,getContainer:Me&&function(){return Me(z)},autoDestroy:mt},D.createElement(gt,{prefixCls:O,open:q,zIndex:be,mask:ge,motion:pe}),D.createElement(ae.Z,{onResize:Xt,disabled:!q},function(v){return D.createElement(Dt.default,(0,St.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Te,leavedClassName:"".concat(O,"-hidden")},Ke,{onAppearPrepare:$t,onEnterPrepare:$t,visible:q,onVisibleChanged:function(Z){var w;Ke==null||(w=Ke.onVisibleChanged)===null||w===void 0||w.call(Ke,Z),le(Z)}}),function(d,Z){var w=d.className,Y=d.style,te=re()(O,w,x);return D.createElement("div",{ref:(0,ht.sQ)(v,C,Z),className:te,style:(0,H.Z)((0,H.Z)((0,H.Z)((0,H.Z)({"--arrow-x":"".concat(ce.x||0,"px"),"--arrow-y":"".concat(ce.y||0,"px")},ar),X),Y),{},{boxSizing:"border-box",zIndex:be},I),onMouseEnter:et,onMouseLeave:cr,onPointerEnter:yr,onClick:ne,onPointerDownCapture:tr},k&&D.createElement(Pt,{prefixCls:O,arrow:k,arrowPos:ce,align:B}),D.createElement(F,{cache:!q&&!ie},Fr))})}))}),ze=xt,ee=D.forwardRef(function(g,C){var p=g.children,x=g.getTriggerDOMNode,O=(0,ht.Yr)(p),I=D.useCallback(function(le){(0,ht.mH)(C,x?x(le):le)},[x]),z=(0,ht.x1)(I,(0,ht.C4)(p));return O?D.cloneElement(p,{ref:z}):p}),Et=ee,_e=D.createContext(null),j=_e;function ft(g){return g?Array.isArray(g)?g:[g]:[]}function Nt(g,C,p,x){return D.useMemo(function(){var O=ft(p!=null?p:C),I=ft(x!=null?x:C),z=new Set(O),le=new Set(I);return g&&(z.has("hover")&&(z.delete("hover"),z.add("click")),le.has("hover")&&(le.delete("hover"),le.add("click"))),[z,le]},[g,C,p,x])}var N=b(29194);function E(){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 A(g,C,p,x){for(var O=p.points,I=Object.keys(g),z=0;z<I.length;z+=1){var le,q=I[z];if(E((le=g[q])===null||le===void 0?void 0:le.points,O,x))return"".concat(C,"-placement-").concat(q)}return""}function J(g,C,p,x){return C||(p?{motionName:"".concat(g,"-").concat(p)}:x?{motionName:x}:null)}function W(g){return g.ownerDocument.defaultView}function Oe(g){for(var C=[],p=g==null?void 0:g.parentElement,x=["hidden","scroll","clip","auto"];p;){var O=W(p).getComputedStyle(p),I=O.overflowX,z=O.overflowY,le=O.overflow;[I,z,le].some(function(q){return x.includes(q)})&&C.push(p),p=p.parentElement}return C}function L(g){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(g)?C:g}function se(g){return L(parseFloat(g),0)}function Pe(g,C){var p=(0,H.Z)({},g);return(C||[]).forEach(function(x){if(!(x instanceof HTMLBodyElement||x instanceof HTMLHtmlElement)){var O=W(x).getComputedStyle(x),I=O.overflow,z=O.overflowClipMargin,le=O.borderTopWidth,q=O.borderBottomWidth,de=O.borderLeftWidth,ie=O.borderRightWidth,ne=x.getBoundingClientRect(),ge=x.offsetHeight,k=x.clientHeight,ce=x.offsetWidth,B=x.clientWidth,Ke=se(le),pe=se(q),Te=se(de),Me=se(ie),mt=L(Math.round(ne.width/ce*1e3)/1e3),je=L(Math.round(ne.height/ge*1e3)/1e3),be=(ce-B-Te-Me)*mt,et=(ge-k-Ke-pe)*je,cr=Ke*je,yr=pe*je,tr=Te*mt,Cr=Me*mt,tt=0,ut=0;if(I==="clip"){var zt=se(z);tt=zt*mt,ut=zt*je}var Gt=ne.x+tr-tt,Xt=ne.y+cr-ut,$t=Gt+ne.width+2*tt-tr-Cr-be,Ot=Xt+ne.height+2*ut-cr-yr-et;p.left=Math.max(p.left,Gt),p.top=Math.max(p.top,Xt),p.right=Math.min(p.right,$t),p.bottom=Math.min(p.bottom,Ot)}}),p}function fe(g){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p="".concat(C),x=p.match(/^(.*)\%$/);return x?g*(parseFloat(x[1])/100):parseFloat(p)}function Ye(g,C){var p=C||[],x=(0,Q.Z)(p,2),O=x[0],I=x[1];return[fe(g.width,O),fe(g.height,I)]}function Ge(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[g[0],g[1]]}function xe(g,C){var p=C[0],x=C[1],O,I;return p==="t"?I=g.y:p==="b"?I=g.y+g.height:I=g.y+g.height/2,x==="l"?O=g.x:x==="r"?O=g.x+g.width:O=g.x+g.width/2,{x:O,y:I}}function Ve(g,C){var p={t:"b",b:"t",l:"r",r:"l"};return g.map(function(x,O){return O===C?p[x]||"c":x}).join("")}function Fe(g,C,p,x,O,I,z){var le=D.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:O[x]||{}}),q=(0,Q.Z)(le,2),de=q[0],ie=q[1],ne=D.useRef(0),ge=D.useMemo(function(){return C?Oe(C):[]},[C]),k=D.useRef({}),ce=function(){k.current={}};g||ce();var B=(0,h.Z)(function(){if(C&&p&&g){let Vr=function(bt,it){var at=arguments.length>2&&arguments[2]!==void 0?arguments[2]:U,ir=kt.x+bt,xr=kt.y+it,Nn=ir+pr,xn=xr+Ut,On=Math.max(ir,at.left),Re=Math.max(xr,at.top),qe=Math.min(Nn,at.right),Jt=Math.min(xn,at.bottom);return Math.max(0,(qe-On)*(Jt-Re))},ot=function(){Lr=kt.y+Ct,ct=Lr+Ut,Ue=kt.x+rt,wt=Ue+pr};var Te,Me,mt,je,be=C,et=be.ownerDocument,cr=W(be),yr=cr.getComputedStyle(be),tr=yr.width,Cr=yr.height,tt=yr.position,ut=be.style.left,zt=be.style.top,Gt=be.style.right,Xt=be.style.bottom,$t=be.style.overflow,Ot=(0,H.Z)((0,H.Z)({},O[x]),I),rr=et.createElement("div");(Te=be.parentElement)===null||Te===void 0||Te.appendChild(rr),rr.style.left="".concat(be.offsetLeft,"px"),rr.style.top="".concat(be.offsetTop,"px"),rr.style.position=tt,rr.style.height="".concat(be.offsetHeight,"px"),rr.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 yt;if(Array.isArray(p))yt={x:p[0],y:p[1],width:0,height:0};else{var Fr,Kt,sr=p.getBoundingClientRect();sr.x=(Fr=sr.x)!==null&&Fr!==void 0?Fr:sr.left,sr.y=(Kt=sr.y)!==null&&Kt!==void 0?Kt:sr.top,yt={x:sr.x,y:sr.y,width:sr.width,height:sr.height}}var kt=be.getBoundingClientRect();kt.x=(Me=kt.x)!==null&&Me!==void 0?Me:kt.left,kt.y=(mt=kt.y)!==null&&mt!==void 0?mt:kt.top;var Or=et.documentElement,dn=Or.clientWidth,Wr=Or.clientHeight,nr=Or.scrollWidth,ar=Or.scrollHeight,ur=Or.scrollTop,Yt=Or.scrollLeft,Ut=kt.height,pr=kt.width,Zt=yt.height,X=yt.width,v={left:0,top:0,right:dn,bottom:Wr},d={left:-Yt,top:-ur,right:nr-Yt,bottom:ar-ur},Z=Ot.htmlRegion,w="visible",Y="visibleFirst";Z!=="scroll"&&Z!==Y&&(Z=w);var te=Z===Y,ye=Pe(d,ge),m=Pe(v,ge),U=Z===w?m:ye,Ae=te?m:U;be.style.left="auto",be.style.top="auto",be.style.right="0",be.style.bottom="0";var Ee=be.getBoundingClientRect();be.style.left=ut,be.style.top=zt,be.style.right=Gt,be.style.bottom=Xt,be.style.overflow=$t,(je=be.parentElement)===null||je===void 0||je.removeChild(rr);var Ze=L(Math.round(pr/parseFloat(tr)*1e3)/1e3),$e=L(Math.round(Ut/parseFloat(Cr)*1e3)/1e3);if(Ze===0||$e===0||(0,Je.Sh)(p)&&!(0,N.Z)(p))return;var Le=Ot.offset,oe=Ot.targetOffset,me=Ye(kt,Le),ve=(0,Q.Z)(me,2),He=ve[0],Xe=ve[1],qt=Ye(yt,oe),Tt=(0,Q.Z)(qt,2),It=Tt[0],st=Tt[1];yt.x-=It,yt.y-=st;var br=Ot.points||[],hr=(0,Q.Z)(br,2),or=hr[0],mr=hr[1],Ht=Ge(mr),At=Ge(or),fr=xe(yt,Ht),Vt=xe(kt,At),jt=(0,H.Z)({},Ot),rt=fr.x-Vt.x+He,Ct=fr.y-Vt.y+Xe,er=Vr(rt,Ct),Ft=Vr(rt,Ct,m),Qe=xe(yt,["t","l"]),Mt=xe(kt,["t","l"]),Pr=xe(yt,["b","r"]),Jr=xe(kt,["b","r"]),zr=Ot.overflow||{},Sr=zr.adjustX,nn=zr.adjustY,Mr=zr.shiftX,tn=zr.shiftY,Qr=function(it){return typeof it=="boolean"?it:it>=0},Lr,ct,Ue,wt;ot();var _t=Qr(nn),V=At[0]===Ht[0];if(_t&&At[0]==="t"&&(ct>Ae.bottom||k.current.bt)){var G=Ct;V?G-=Ut-Zt:G=Qe.y-Jr.y-Xe;var ke=Vr(rt,G),nt=Vr(rt,G,m);ke>er||ke===er&&(!te||nt>=Ft)?(k.current.bt=!0,Ct=G,Xe=-Xe,jt.points=[Ve(At,0),Ve(Ht,0)]):k.current.bt=!1}if(_t&&At[0]==="b"&&(Lr<Ae.top||k.current.tb)){var dt=Ct;V?dt+=Ut-Zt:dt=Pr.y-Mt.y-Xe;var Ir=Vr(rt,dt),Ar=Vr(rt,dt,m);Ir>er||Ir===er&&(!te||Ar>=Ft)?(k.current.tb=!0,Ct=dt,Xe=-Xe,jt.points=[Ve(At,0),Ve(Ht,0)]):k.current.tb=!1}var ln=Qr(Sr),Kr=At[1]===Ht[1];if(ln&&At[1]==="l"&&(wt>Ae.right||k.current.rl)){var gr=rt;Kr?gr-=pr-X:gr=Qe.x-Jr.x-He;var Ur=Vr(gr,Ct),vn=Vr(gr,Ct,m);Ur>er||Ur===er&&(!te||vn>=Ft)?(k.current.rl=!0,rt=gr,He=-He,jt.points=[Ve(At,1),Ve(Ht,1)]):k.current.rl=!1}if(ln&&At[1]==="r"&&(Ue<Ae.left||k.current.lr)){var _r=rt;Kr?_r+=pr-X:_r=Pr.x-Mt.x-He;var Hr=Vr(_r,Ct),sn=Vr(_r,Ct,m);Hr>er||Hr===er&&(!te||sn>=Ft)?(k.current.lr=!0,rt=_r,He=-He,jt.points=[Ve(At,1),Ve(Ht,1)]):k.current.lr=!1}ot();var Rr=Mr===!0?0:Mr;typeof Rr=="number"&&(Ue<m.left&&(rt-=Ue-m.left-He,yt.x+X<m.left+Rr&&(rt+=yt.x-m.left+X-Rr)),wt>m.right&&(rt-=wt-m.right-He,yt.x>m.right-Rr&&(rt+=yt.x-m.right+Rr)));var $r=tn===!0?0:tn;typeof $r=="number"&&(Lr<m.top&&(Ct-=Lr-m.top-Xe,yt.y+Zt<m.top+$r&&(Ct+=yt.y-m.top+Zt-$r)),ct>m.bottom&&(Ct-=ct-m.bottom-Xe,yt.y>m.bottom-$r&&(Ct+=yt.y-m.bottom+$r)));var Rn=kt.x+rt,bn=Rn+pr,Gr=kt.y+Ct,Sn=Gr+Ut,Yn=yt.x,wn=Yn+X,jn=yt.y,un=jn+Zt,si=Math.max(Rn,Yn),qn=Math.min(bn,wn),Wn=(si+qn)/2,zn=Wn-Rn,ai=Math.max(Gr,jn),ei=Math.min(Sn,un),Un=(ai+ei)/2,Pn=Un-Gr;z==null||z(C,jt);var Tr=Ee.right-kt.x-(rt+kt.width),wr=Ee.bottom-kt.y-(Ct+kt.height);Ze===1&&(rt=Math.round(rt),Tr=Math.round(Tr)),$e===1&&(Ct=Math.round(Ct),wr=Math.round(wr));var ti={ready:!0,offsetX:rt/Ze,offsetY:Ct/$e,offsetR:Tr/Ze,offsetB:wr/$e,arrowX:zn/Ze,arrowY:Pn/$e,scaleX:Ze,scaleY:$e,align:jt};ie(ti)}}),Ke=function(){ne.current+=1;var Me=ne.current;Promise.resolve().then(function(){ne.current===Me&&B()})},pe=function(){ie(function(Me){return(0,H.Z)((0,H.Z)({},Me),{},{ready:!1})})};return(0,M.Z)(pe,[x]),(0,M.Z)(function(){g||pe()},[g]),[de.ready,de.offsetX,de.offsetY,de.offsetR,de.offsetB,de.arrowX,de.arrowY,de.scaleX,de.scaleY,de.align,Ke]}var Wt=b(80702);function Rt(g,C,p,x,O){(0,M.Z)(function(){if(g&&C&&p){let ne=function(){x(),O()};var I=C,z=p,le=Oe(I),q=Oe(z),de=W(z),ie=new Set([de].concat((0,Wt.Z)(le),(0,Wt.Z)(q)));return ie.forEach(function(ge){ge.addEventListener("scroll",ne,{passive:!0})}),de.addEventListener("resize",ne,{passive:!0}),x(),function(){ie.forEach(function(ge){ge.removeEventListener("scroll",ne),de.removeEventListener("resize",ne)})}}},[g,C,p])}var Lt=b(48736);function Ne(g,C,p,x,O,I,z,le){var q=D.useRef(g);q.current=g;var de=D.useRef(!1);D.useEffect(function(){if(C&&x&&(!O||I)){var ne=function(){de.current=!1},ge=function(mt){var je;q.current&&!z(((je=mt.composedPath)===null||je===void 0||(je=je.call(mt))===null||je===void 0?void 0:je[0])||mt.target)&&!de.current&&le(!1)},k=W(x);k.addEventListener("pointerdown",ne,!0),k.addEventListener("mousedown",ge,!0),k.addEventListener("contextmenu",ge,!0);var ce=(0,$.A)(p);if(ce&&(ce.addEventListener("mousedown",ge,!0),ce.addEventListener("contextmenu",ge,!0)),0)var B,Ke,pe,Te;return function(){k.removeEventListener("pointerdown",ne,!0),k.removeEventListener("mousedown",ge,!0),k.removeEventListener("contextmenu",ge,!0),ce&&(ce.removeEventListener("mousedown",ge,!0),ce.removeEventListener("contextmenu",ge,!0))}}},[C,p,x,O,I]);function ie(){de.current=!0}return ie}var vr=["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 lr(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:we.Z,C=D.forwardRef(function(p,x){var O=p.prefixCls,I=O===void 0?"rc-trigger-popup":O,z=p.children,le=p.action,q=le===void 0?"hover":le,de=p.showAction,ie=p.hideAction,ne=p.popupVisible,ge=p.defaultPopupVisible,k=p.onPopupVisibleChange,ce=p.afterPopupVisibleChange,B=p.mouseEnterDelay,Ke=p.mouseLeaveDelay,pe=Ke===void 0?.1:Ke,Te=p.focusDelay,Me=p.blurDelay,mt=p.mask,je=p.maskClosable,be=je===void 0?!0:je,et=p.getPopupContainer,cr=p.forceRender,yr=p.autoDestroy,tr=p.destroyPopupOnHide,Cr=p.popup,tt=p.popupClassName,ut=p.popupStyle,zt=p.popupPlacement,Gt=p.builtinPlacements,Xt=Gt===void 0?{}:Gt,$t=p.popupAlign,Ot=p.zIndex,rr=p.stretch,yt=p.getPopupClassNameFromAlign,Fr=p.fresh,Kt=p.alignPoint,sr=p.onPopupClick,kt=p.onPopupAlign,Or=p.arrow,dn=p.popupMotion,Wr=p.maskMotion,nr=p.popupTransitionName,ar=p.popupAnimation,ur=p.maskTransitionName,Yt=p.maskAnimation,Ut=p.className,pr=p.getTriggerDOMNode,Zt=(0,K.Z)(p,vr),X=yr||tr||!1,v=D.useState(!1),d=(0,Q.Z)(v,2),Z=d[0],w=d[1];(0,M.Z)(function(){w((0,De.Z)())},[]);var Y=D.useRef({}),te=D.useContext(j),ye=D.useMemo(function(){return{registerSubPopup:function(qe,Jt){Y.current[qe]=Jt,te==null||te.registerSubPopup(qe,Jt)}}},[te]),m=(0,We.Z)(),U=D.useState(null),Ae=(0,Q.Z)(U,2),Ee=Ae[0],Ze=Ae[1],$e=D.useRef(null),Le=(0,h.Z)(function(Re){$e.current=Re,(0,Je.Sh)(Re)&&Ee!==Re&&Ze(Re),te==null||te.registerSubPopup(m,Re)}),oe=D.useState(null),me=(0,Q.Z)(oe,2),ve=me[0],He=me[1],Xe=D.useRef(null),qt=(0,h.Z)(function(Re){(0,Je.Sh)(Re)&&ve!==Re&&(He(Re),Xe.current=Re)}),Tt=D.Children.only(z),It=(Tt==null?void 0:Tt.props)||{},st={},br=(0,h.Z)(function(Re){var qe,Jt,kr=ve;return(kr==null?void 0:kr.contains(Re))||((qe=(0,$.A)(kr))===null||qe===void 0?void 0:qe.host)===Re||Re===kr||(Ee==null?void 0:Ee.contains(Re))||((Jt=(0,$.A)(Ee))===null||Jt===void 0?void 0:Jt.host)===Re||Re===Ee||Object.values(Y.current).some(function(Nr){return(Nr==null?void 0:Nr.contains(Re))||Re===Nr})}),hr=J(I,dn,ar,nr),or=J(I,Wr,Yt,ur),mr=D.useState(ge||!1),Ht=(0,Q.Z)(mr,2),At=Ht[0],fr=Ht[1],Vt=ne!=null?ne:At,jt=(0,h.Z)(function(Re){ne===void 0&&fr(Re)});(0,M.Z)(function(){fr(ne||!1)},[ne]);var rt=D.useRef(Vt);rt.current=Vt;var Ct=D.useRef([]);Ct.current=[];var er=(0,h.Z)(function(Re){var qe;jt(Re),((qe=Ct.current[Ct.current.length-1])!==null&&qe!==void 0?qe:Vt)!==Re&&(Ct.current.push(Re),k==null||k(Re))}),Ft=D.useRef(),Qe=function(){clearTimeout(Ft.current)},Mt=function(qe){var Jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;Qe(),Jt===0?er(qe):Ft.current=setTimeout(function(){er(qe)},Jt*1e3)};D.useEffect(function(){return Qe},[]);var Pr=D.useState(!1),Jr=(0,Q.Z)(Pr,2),zr=Jr[0],Sr=Jr[1];(0,M.Z)(function(Re){(!Re||Vt)&&Sr(!0)},[Vt]);var nn=D.useState(null),Mr=(0,Q.Z)(nn,2),tn=Mr[0],Qr=Mr[1],Lr=D.useState(null),ct=(0,Q.Z)(Lr,2),Ue=ct[0],wt=ct[1],_t=function(qe){wt([qe.clientX,qe.clientY])},V=Fe(Vt,Ee,Kt&&Ue!==null?Ue:ve,zt,Xt,$t,kt),G=(0,Q.Z)(V,11),ke=G[0],nt=G[1],dt=G[2],Ir=G[3],Ar=G[4],ln=G[5],Kr=G[6],gr=G[7],Ur=G[8],vn=G[9],_r=G[10],Hr=Nt(Z,q,de,ie),sn=(0,Q.Z)(Hr,2),Rr=sn[0],$r=sn[1],Rn=Rr.has("click"),bn=$r.has("click")||$r.has("contextMenu"),Gr=(0,h.Z)(function(){zr||_r()}),Sn=function(){rt.current&&Kt&&bn&&Mt(!1)};Rt(Vt,ve,Ee,Gr,Sn),(0,M.Z)(function(){Gr()},[Ue,zt]),(0,M.Z)(function(){Vt&&!(Xt!=null&&Xt[zt])&&Gr()},[JSON.stringify($t)]);var Yn=D.useMemo(function(){var Re=A(Xt,I,vn,Kt);return re()(Re,yt==null?void 0:yt(vn))},[vn,yt,Xt,I,Kt]);D.useImperativeHandle(x,function(){return{nativeElement:Xe.current,popupElement:$e.current,forceAlign:Gr}});var wn=D.useState(0),jn=(0,Q.Z)(wn,2),un=jn[0],si=jn[1],qn=D.useState(0),Wn=(0,Q.Z)(qn,2),zn=Wn[0],ai=Wn[1],ei=function(){if(rr&&ve){var qe=ve.getBoundingClientRect();si(qe.width),ai(qe.height)}},Un=function(){ei(),Gr()},Pn=function(qe){Sr(!1),_r(),ce==null||ce(qe)},Tr=function(){return new Promise(function(qe){ei(),Qr(function(){return qe})})};(0,M.Z)(function(){tn&&(_r(),tn(),Qr(null))},[tn]);function wr(Re,qe,Jt,kr){st[Re]=function(Nr){var _n;kr==null||kr(Nr),Mt(qe,Jt);for(var Yr=arguments.length,Hn=new Array(Yr>1?Yr-1:0),oi=1;oi<Yr;oi++)Hn[oi-1]=arguments[oi];(_n=It[Re])===null||_n===void 0||_n.call.apply(_n,[It,Nr].concat(Hn))}}(Rn||bn)&&(st.onClick=function(Re){var qe;rt.current&&bn?Mt(!1):!rt.current&&Rn&&(_t(Re),Mt(!0));for(var Jt=arguments.length,kr=new Array(Jt>1?Jt-1:0),Nr=1;Nr<Jt;Nr++)kr[Nr-1]=arguments[Nr];(qe=It.onClick)===null||qe===void 0||qe.call.apply(qe,[It,Re].concat(kr))});var ti=Ne(Vt,bn,ve,Ee,mt,be,br,Mt),Vr=Rr.has("hover"),ot=$r.has("hover"),bt,it;Vr&&(wr("onMouseEnter",!0,B,function(Re){_t(Re)}),wr("onPointerEnter",!0,B,function(Re){_t(Re)}),bt=function(qe){(Vt||zr)&&Ee!==null&&Ee!==void 0&&Ee.contains(qe.target)&&Mt(!0,B)},Kt&&(st.onMouseMove=function(Re){var qe;(qe=It.onMouseMove)===null||qe===void 0||qe.call(It,Re)})),ot&&(wr("onMouseLeave",!1,pe),wr("onPointerLeave",!1,pe),it=function(){Mt(!1,pe)}),Rr.has("focus")&&wr("onFocus",!0,Te),$r.has("focus")&&wr("onBlur",!1,Me),Rr.has("contextMenu")&&(st.onContextMenu=function(Re){var qe;rt.current&&$r.has("contextMenu")?Mt(!1):(_t(Re),Mt(!0)),Re.preventDefault();for(var Jt=arguments.length,kr=new Array(Jt>1?Jt-1:0),Nr=1;Nr<Jt;Nr++)kr[Nr-1]=arguments[Nr];(qe=It.onContextMenu)===null||qe===void 0||qe.call.apply(qe,[It,Re].concat(kr))}),Ut&&(st.className=re()(It.className,Ut));var at=(0,H.Z)((0,H.Z)({},It),st),ir={},xr=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];xr.forEach(function(Re){Zt[Re]&&(ir[Re]=function(){for(var qe,Jt=arguments.length,kr=new Array(Jt),Nr=0;Nr<Jt;Nr++)kr[Nr]=arguments[Nr];(qe=at[Re])===null||qe===void 0||qe.call.apply(qe,[at].concat(kr)),Zt[Re].apply(Zt,kr)})});var Nn=D.cloneElement(Tt,(0,H.Z)((0,H.Z)({},at),ir)),xn={x:ln,y:Kr},On=Or?(0,H.Z)({},Or!==!0?Or:{}):null;return D.createElement(D.Fragment,null,D.createElement(ae.Z,{disabled:!Vt,ref:qt,onResize:Un},D.createElement(Et,{getTriggerDOMNode:pr},Nn)),D.createElement(j.Provider,{value:ye},D.createElement(ze,{portal:g,ref:Le,prefixCls:I,popup:Cr,className:re()(tt,Yn),style:ut,target:ve,onMouseEnter:bt,onMouseLeave:it,onPointerEnter:bt,zIndex:Ot,open:Vt,keepDom:zr,fresh:Fr,onClick:sr,onPointerDownCapture:ti,mask:mt,motion:hr,maskMotion:or,onVisibleChanged:Pn,onPrepare:Tr,forceRender:cr,autoDestroy:X,getPopupContainer:et,align:vn,arrow:On,arrowPos:xn,ready:ke,offsetX:nt,offsetY:dt,offsetR:Ir,offsetB:Ar,onAlign:Gr,stretch:rr,targetWidth:un/gr,targetHeight:zn/Ur})))});return C}var P=lr(we.Z)},88540:function(){"use strict"},42271:function(){"use strict"},13912:function(yn,vt,b){"use strict";b.d(vt,{t:function(){return M}});var H=b(59301),Q=b(99571),K={buttonFixed:"buttonFixed___vyq30",button:"button___hxmYv",buttonWrap:"buttonWrap___uK8dl"},we=b(92310),T=b.n(we),re=Object.defineProperty,ae=Object.getOwnPropertySymbols,Je=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable,h=(De,D,St)=>D in De?re(De,D,{enumerable:!0,configurable:!0,writable:!0,value:St}):De[D]=St,We=(De,D)=>{for(var St in D||(D={}))Je.call(D,St)&&h(De,St,D[St]);if(ae)for(var St of ae(D))$.call(D,St)&&h(De,St,D[St]);return De};const M=({cancelText:De="\u53D6\u6D88",okText:D="\u786E\u5B9A",loading:St=!1,hasOkBtn:Dt=!0,hasCancelBtn:ht=!0,okButtonProps:Pt={},onCancel:gt=()=>{},onOk:he=()=>{},className:F=""})=>H.createElement("div",{className:T()(K.buttonFixed,F)},H.createElement("div",{className:K.buttonWrap},ht&&H.createElement(Q.ZP,{size:"middle",className:`${K.button} mr20`,onClick:gt},De),Dt&&H.createElement(Q.ZP,We({size:"middle",type:"primary",className:`${K.button} mr20`,loading:St,onClick:he},Pt),D)))},77531:function(yn,vt,b){"use strict";b.d(vt,{h:function(){return F}});var H=b(59301),Q=b(82326),K=b(28284),we=b(99571),T=b(89780),re=b.n(T),ae=b(88540),Je=b(42271),$=Object.defineProperty,h=Object.defineProperties,We=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable,St=(xt,ze,ee)=>ze in xt?$(xt,ze,{enumerable:!0,configurable:!0,writable:!0,value:ee}):xt[ze]=ee,Dt=(xt,ze)=>{for(var ee in ze||(ze={}))De.call(ze,ee)&&St(xt,ee,ze[ee]);if(M)for(var ee of M(ze))D.call(ze,ee)&&St(xt,ee,ze[ee]);return xt},ht=(xt,ze)=>h(xt,We(ze));const Pt=Q.default.Option,gt={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"]};vt.Z=({callback:xt,onCancel:ze})=>{const[ee,Et]=(0,H.useState)("python");function _e(ft){Et(he[ft][1])}function j(ft){xt(ft)}return H.createElement(K.default,ht(Dt({},gt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:j,style:{width:500}}),H.createElement(K.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},H.createElement(Q.default,{getPopupContainer:ft=>ft.parentNode,onChange:_e},Object.keys(he).map(ft=>H.createElement(Pt,{key:ft,value:ft},he[ft][0])))),H.createElement(K.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},H.createElement(F,{mode:ee})),H.createElement("div",{className:"flex-container flex-end"},H.createElement(we.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),H.createElement(we.ZP,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function F({value:xt,onChange:ze,mode:ee,options:Et={}}){const _e=(0,H.useRef)(),[j,ft]=(0,H.useState)();return(0,H.useEffect)(()=>{if(j){let Nt=function(N){const E=N.getValue();ze&&ze(E)};return j.on("change",Nt),()=>{j.off("change",Nt)}}},[j,ze]),(0,H.useEffect)(()=>{j&&j.setOption("mode",ee)},[j,ee]),(0,H.useEffect)(()=>{j&&(xt!==j.getValue()||xt==="")&&setTimeout(()=>{j.setValue(xt||"")},300)},[j,xt]),(0,H.useEffect)(()=>{if(_e.current&&!j){const Nt=re().fromTextArea(_e.current,Dt({mode:ee,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Et));ft(Nt)}},[_e.current,j]),H.createElement("div",{className:"my-codemirror-container"},H.createElement("textarea",{ref:_e}))}},85923:function(yn,vt,b){"use strict";b.r(vt),b.d(vt,{default:function(){return ht}});var H=b(59301),Q=b(71570),K=b(28284),we=b(37568),T=b(77531),re=b(13912),ae={bg:"bg___YV4bB",wrap:"wrap___kzW1f",title:"title___qum64",path:"path___G15kO",colorBlue:"colorBlue___LDjoN",width240:"width240___QOLSj"},Je=Object.defineProperty,$=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,M=(Pt,gt,he)=>gt in Pt?Je(Pt,gt,{enumerable:!0,configurable:!0,writable:!0,value:he}):Pt[gt]=he,De=(Pt,gt)=>{for(var he in gt||(gt={}))h.call(gt,he)&&M(Pt,he,gt[he]);if($)for(var he of $(gt))We.call(gt,he)&&M(Pt,he,gt[he]);return Pt},D=(Pt,gt)=>{var he={};for(var F in Pt)h.call(Pt,F)&>.indexOf(F)<0&&(he[F]=Pt[F]);if(Pt!=null&&$)for(var F of $(Pt))gt.indexOf(F)<0&&We.call(Pt,F)&&(he[F]=Pt[F]);return he},St=(Pt,gt,he)=>new Promise((F,xt)=>{var ze=_e=>{try{Et(he.next(_e))}catch(j){xt(j)}},ee=_e=>{try{Et(he.throw(_e))}catch(j){xt(j)}},Et=_e=>_e.done?F(_e.value):Promise.resolve(_e.value).then(ze,ee);Et((he=he.apply(Pt,gt)).next())});const Dt=Pt=>{var gt=Pt,{shixunsDetail:he,globalSetting:F,loading:xt,user:ze,dispatch:ee}=gt,Et=D(gt,["shixunsDetail","globalSetting","loading","user","dispatch"]);const _e=(0,Q.useLocation)(),[j,ft]=(0,H.useState)({}),Nt=(0,H.useRef)(),N=(0,H.useRef)(),[E]=K.default.useForm(),[A,J]=(0,H.useState)("");(0,H.useEffect)(()=>(ee({type:"globalSetting/footerToggle",payload:!1}),()=>{ee({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,H.useEffect)(()=>{const L=sessionStorage.getItem("pathArray");if(L){const se=L.split(",").join("/"),Pe=se.indexOf("/")===0?se.substr(1):se;J(Pe)}},[]),(0,H.useEffect)(()=>{var L,se,Pe,fe;N.current=(se=(L=_e.pathname)==null?void 0:L.split("/"))==null?void 0:se[2],Nt.current=((fe=(Pe=_e.pathname)==null?void 0:Pe.split("/"))==null?void 0:fe[3])==="repository"},[]);const W=(...L)=>St(void 0,[...L],function*(se={}){if(yield ee({type:"shixunsDetail/addRepositoryFile",payload:{id:N.current,message:se.commitMessage,content:se.codeMirror,path:`${A?`${A}/`:""}${se.path||""}`,secret_repository:Nt.current?void 0:!0}})){const fe=Nt.current?`/shixuns/${N.current}/repository${A?`/master/shixun_show/${A}`:""}`:`/shixuns/${N.current}/secret_repository`;Q.history.replace(fe)}}),Oe=()=>{var L,se;Q.history.push(`/shixuns/${N.current}/${(se=(L=_e.pathname)==null?void 0:L.split("/"))==null?void 0:se[3]}${A?`/master/shixun_show/${A}`:""}`)};return H.createElement("section",{className:ae.bg},H.createElement("div",{className:ae.wrap},H.createElement("div",{className:ae.title},"\u65B0\u5EFA\u6587\u4EF6"),H.createElement(K.default,{className:"mt10",form:E,scrollToFirstError:!0,layout:"vertical",onFinish:W,onValuesChange:()=>ft(De({},E.getFieldsValue()))},H.createElement(K.default.Item,{label:"\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84\uFF1A"},H.createElement(K.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},H.createElement("span",null,H.createElement("span",{className:"mr5"},A?`${A}/`:""),H.createElement(we.default,{className:ae.width240,placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0\u6216\u6587\u4EF6\u8DEF\u5F84"}))),H.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")),H.createElement(K.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"}]},H.createElement(we.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"})),H.createElement("div",{className:"mt10 mb20"},H.createElement(K.default.Item,{name:"codeMirror",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5185\u5BB9"}]},H.createElement(T.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"]}}))),H.createElement(K.default.Item,{noStyle:!0},H.createElement(re.t,{okButtonProps:{htmlType:"submit"},onCancel:Oe})))))};var ht=(0,Q.connect)(({shixunsDetail:Pt,loading:gt,globalSetting:he,user:F})=>({shixunsDetail:Pt,globalSetting:he,user:F,loading:gt.models.index}))(Dt)},89780:function(yn){(function(vt,b){yn.exports=b()})(this,function(){"use strict";var vt=navigator.userAgent,b=navigator.platform,H=/gecko\/\d/i.test(vt),Q=/MSIE \d/.test(vt),K=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vt),we=/Edge\/(\d+)/.exec(vt),T=Q||K||we,re=T&&(Q?document.documentMode||6:+(we||K)[1]),ae=!we&&/WebKit\//.test(vt),Je=ae&&/Qt\/\d+\.\d+/.test(vt),$=!we&&/Chrome\//.test(vt),h=/Opera\//.test(vt),We=/Apple Computer/.test(navigator.vendor),M=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(vt),De=/PhantomJS/.test(vt),D=!we&&/AppleWebKit/.test(vt)&&/Mobile\/\w+/.test(vt),St=/Android/.test(vt),Dt=D||St||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(vt),ht=D||/Mac/.test(b),Pt=/\bCrOS\b/.test(vt),gt=/win/i.test(b),he=h&&vt.match(/Version\/(\d*\.\d*)/);he&&(he=Number(he[1])),he&&he>=15&&(h=!1,ae=!0);var F=ht&&(Je||h&&(he==null||he<12.11)),xt=H||T&&re>=9;function ze(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ee=function(e,t){var n=e.className,r=ze(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 Et(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function _e(e,t){return Et(e).appendChild(t)}function j(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function ft(e,t,n,r){var i=j(e,t,n,r);return i.setAttribute("role","presentation"),i}var Nt;document.createRange?Nt=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:Nt=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function N(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function E(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function A(e,t){var n=e.className;ze(t).test(n)||(e.className+=(n?" ":"")+t)}function J(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!ze(n[r]).test(t)&&(t+=" "+n[r]);return t}var W=function(e){e.select()};D?W=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:T&&(W=function(e){try{e.select()}catch(t){}});function Oe(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function L(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function se(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=i||0;;){var l=e.indexOf(" ",a);if(l<0||l>=t)return o+(t-a);o+=l-a,o+=n-o%n,a=l+1}}var Pe=function(){this.id=null,this.f=null,this.time=0,this.handler=Oe(this.onTimeout,this)};Pe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Pe.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function fe(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var Ye=50,Ge={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Ve={origin:"*mouse"},Fe={origin:"+move"};function Wt(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(" ",r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var Rt=[""];function Lt(e){for(;Rt.length<=e;)Rt.push(Ne(Rt)+" ");return Rt[e]}function Ne(e){return e[e.length-1]}function vr(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function lr(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function P(){}function g(e,t){var n;return Object.create?n=Object.create(e):(P.prototype=e,n=new P),t&&L(t,n),n}var C=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function p(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||C.test(e))}function x(e,t){return t?t.source.indexOf("\\w")>-1&&p(e)?!0:t.test(e):p(e)}function O(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var I=/[\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&&I.test(e)}function le(e,t,n){for(;(n<0?t>0:t<e.length)&&z(e.charAt(t));)t+=n;return t}function q(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function de(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?"rtl":"ltr",a),i=!0)}i||r(t,n,"ltr")}var ie=null;function ne(e,t,n){var r;ie=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n=="before"?r=i:ie=i),a.from==t&&(a.from!=a.to&&n!="before"?r=i:ie=i)}return r!=null?r:ie}var ge=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,o=/[Lb1n]/,l=/[1n]/;function s(u,f,c){this.level=u,this.from=f,this.to=c}return function(u,f){var c=f=="ltr"?"L":"R";if(u.length==0||f=="ltr"&&!r.test(u))return!1;for(var S=u.length,y=[],R=0;R<S;++R)y.push(n(u.charCodeAt(R)));for(var _=0,ue=c;_<S;++_){var Se=y[_];Se=="m"?y[_]=ue:ue=Se}for(var Ie=0,Ce=c;Ie<S;++Ie){var Be=y[Ie];Be=="1"&&Ce=="r"?y[Ie]="n":a.test(Be)&&(Ce=Be,Be=="r"&&(y[Ie]="R"))}for(var pt=1,lt=y[0];pt<S-1;++pt){var Qt=y[pt];Qt=="+"&<=="1"&&y[pt+1]=="1"?y[pt]="1":Qt==","&<==y[pt+1]&&(lt=="1"||lt=="n")&&(y[pt]=lt),lt=Qt}for(var Zr=0;Zr<S;++Zr){var pn=y[Zr];if(pn==",")y[Zr]="N";else if(pn=="%"){var jr=void 0;for(jr=Zr+1;jr<S&&y[jr]=="%";++jr);for(var Kn=Zr&&y[Zr-1]=="!"||jr<S&&y[jr]=="1"?"1":"N",kn=Zr;kn<jr;++kn)y[kn]=Kn;Zr=jr-1}}for(var an=0,Zn=c;an<S;++an){var Cn=y[an];Zn=="L"&&Cn=="1"?y[an]="L":a.test(Cn)&&(Zn=Cn)}for(var cn=0;cn<S;++cn)if(i.test(y[cn])){var on=void 0;for(on=cn+1;on<S&&i.test(y[on]);++on);for(var en=(cn?y[cn-1]:c)=="L",Fn=(on<S?y[on]:c)=="L",ji=en==Fn?en?"L":"R":c,xi=cn;xi<on;++xi)y[xi]=ji;cn=on-1}for(var Ln=[],li,mn=0;mn<S;)if(o.test(y[mn])){var Mo=mn;for(++mn;mn<S&&o.test(y[mn]);++mn);Ln.push(new s(0,Mo,mn))}else{var di=mn,Ni=Ln.length,Oi=f=="rtl"?1:0;for(++mn;mn<S&&y[mn]!="L";++mn);for(var Dn=di;Dn<mn;)if(l.test(y[Dn])){di<Dn&&(Ln.splice(Ni,0,new s(1,di,Dn)),Ni+=Oi);var Ji=Dn;for(++Dn;Dn<mn&&l.test(y[Dn]);++Dn);Ln.splice(Ni,0,new s(2,Ji,Dn)),Ni+=Oi,di=Dn}else++Dn;di<mn&&Ln.splice(Ni,0,new s(1,di,mn))}return f=="ltr"&&(Ln[0].level==1&&(li=u.match(/^\s+/))&&(Ln[0].from=li[0].length,Ln.unshift(new s(0,0,li[0].length))),Ne(Ln).level==1&&(li=u.match(/\s+$/))&&(Ne(Ln).to-=li[0].length,Ln.push(new s(0,S-li[0].length,S)))),f=="rtl"?Ln.reverse():Ln}}();function k(e,t){var n=e.order;return n==null&&(n=e.order=ge(e.text,t)),n}var ce=[],B=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ce).concat(n)}};function Ke(e,t){return e._handlers&&e._handlers[t]||ce}function pe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=fe(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Te(e,t){var n=Ke(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Me(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Te(e,n||t.type,e,t),yr(t)||t.codemirrorIgnore}function mt(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)fe(n,t[r])==-1&&n.push(t[r])}function je(e,t){return Ke(e,t).length>0}function be(e){e.prototype.on=function(t,n){B(this,t,n)},e.prototype.off=function(t,n){pe(this,t,n)}}function et(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function cr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function yr(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function tr(e){et(e),cr(e)}function Cr(e){return e.target||e.srcElement}function tt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ht&&e.ctrlKey&&t==1&&(t=3),t}var ut=function(){if(T&&re<9)return!1;var e=j("div");return"draggable"in e||"dragDrop"in e}(),zt;function Gt(e){if(zt==null){var t=j("span","\u200B");_e(e,j("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(zt=t.offsetWidth<=1&&t.offsetHeight>2&&!(T&&re<8))}var n=zt?j("span","\u200B"):j("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Xt;function $t(e){if(Xt!=null)return Xt;var t=_e(e,document.createTextNode("A\u062EA")),n=Nt(t,0,1).getBoundingClientRect(),r=Nt(t,1,2).getBoundingClientRect();return Et(e),!n||n.left==n.right?!1:Xt=r.right-n.right<3}var Ot=`
|
|
|
|
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/)},rr=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},yt=function(){var e=j("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Fr=null;function Kt(e){if(Fr!=null)return Fr;var t=_e(e,j("span","x")),n=t.getBoundingClientRect(),r=Nt(t,0,1).getBoundingClientRect();return Fr=Math.abs(n.left-r.left)>1}var sr={},kt={};function Or(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),sr[e]=t}function dn(e,t){kt[e]=t}function Wr(e){if(typeof e=="string"&&kt.hasOwnProperty(e))e=kt[e];else if(e&&typeof e.name=="string"&&kt.hasOwnProperty(e.name)){var t=kt[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 Wr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Wr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function nr(e,t){t=Wr(t);var n=sr[t.name];if(!n)return nr(e,"text/plain");var r=n(e,t);if(ar.hasOwnProperty(t.name)){var i=ar[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 ar={};function ur(e,t){var n=ar.hasOwnProperty(e)?ar[e]:ar[e]={};L(t,n)}function Yt(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 Ut(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 pr(e,t,n){return e.startState?e.startState(t,n):!0}var Zt=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};Zt.prototype.eol=function(){return this.pos>=this.string.length},Zt.prototype.sol=function(){return this.pos==this.lineStart},Zt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Zt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Zt.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},Zt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Zt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Zt.prototype.skipToEnd=function(){this.pos=this.string.length},Zt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Zt.prototype.backUp=function(e){this.pos-=e},Zt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=se(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?se(this.string,this.lineStart,this.tabSize):0)},Zt.prototype.indentation=function(){return se(this.string,null,this.tabSize)-(this.lineStart?se(this.string,this.lineStart,this.tabSize):0)},Zt.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(o){return n?o.toLowerCase():o},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},Zt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Zt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Zt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Zt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function X(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function v(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(a){var o=a.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function d(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Z(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function w(e){if(e.parent==null)return null;for(var t=e.parent,n=fe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Y(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue e}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var l=e.lines[o],s=l.height;if(t<s)break;t-=s}return n+o}function te(e,t){return t>=e.first&&t<e.first+e.size}function ye(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function m(e,t,n){if(n===void 0&&(n=null),!(this instanceof m))return new m(e,t,n);this.line=e,this.ch=t,this.sticky=n}function U(e,t){return e.line-t.line||e.ch-t.ch}function Ae(e,t){return e.sticky==t.sticky&&U(e,t)==0}function Ee(e){return m(e.line,e.ch)}function Ze(e,t){return U(e,t)<0?t:e}function $e(e,t){return U(e,t)<0?e:t}function Le(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function oe(e,t){if(t.line<e.first)return m(e.first,0);var n=e.first+e.size-1;return t.line>n?m(n,X(e,n).text.length):me(t,X(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 ve(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=oe(e,t[r]);return n}var He=function(e,t){this.state=e,this.lookAhead=t},Xe=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Xe.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Xe.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}},Xe.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Xe.fromSaved=function(e,t,n){return t instanceof He?new Xe(e,Yt(e.mode,t.state),n,t.lookAhead):new Xe(e,Yt(e.mode,t),n)},Xe.prototype.save=function(e){var t=e!==!1?Yt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new He(t,this.maxLookAhead):t};function qt(e,t,n,r){var i=[e.state.modeGen],a={};At(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,At(e,t.text,f.mode,n,function(y,R){for(var _=c;S<y;){var ue=i[c];ue>y&&i.splice(c,1,y,i[c+1],ue),c+=2,S=Math.min(y,ue)}if(R)if(f.opaque)i.splice(_,c-_,y,"overlay "+R),c=_+2;else for(;_<c;_+=2){var Se=i[_+1];i[_+1]=(Se?Se+" ":"")+"overlay "+R}},a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Tt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=It(e,w(t)),i=t.text.length>e.options.maxHighlightLength&&Yt(e.doc.mode,r.state),a=qt(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 It(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Xe(r,!0,t);var a=fr(e,t,n),o=a>r.first&&X(r,a-1).stateAfter,l=o?Xe.fromSaved(r,o,a):new Xe(r,pr(r.mode),a);return r.iter(a,t,function(s){st(e,s.text,l);var u=l.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function st(e,t,n,r){var i=e.doc.mode,a=new Zt(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==""&&br(i,n.state);!a.eol();)hr(i,a,n.state),a.start=a.pos}function br(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ut(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function hr(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ut(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var or=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function mr(e,t,n,r){var i=e.doc,a=i.mode,o;t=oe(i,t);var l=X(i,t.line),s=It(e,t.line,n),u=new Zt(l.text,e.options.tabSize,s),f;for(r&&(f=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=hr(a,u,s.state),r&&f.push(new or(u,o,Yt(i.mode,s.state)));return r?f:new or(u,o,s.state)}function Ht(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function At(e,t,n,r,i,a,o){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,u=null,f=new Zt(t,e.options.tabSize,r),c,S=e.options.addModeClass&&[null];for(t==""&&Ht(br(n,r.state),a);!f.eol();){if(f.pos>e.options.maxHighlightLength?(l=!1,o&&st(e,t,r,f.pos),f.pos=t.length,c=null):c=Ht(hr(n,f,r.state,S),a),S){var y=S[0].name;y&&(c="m-"+(c?y+" "+c:y))}if(!l||u!=c){for(;s<f.start;)s=Math.min(f.start,s+5e3),i(s,u);u=c}f.start=f.pos}for(;s<f.pos;){var R=Math.min(f.pos,s+5e3);i(R,u),s=R}}function fr(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>o;--l){if(l<=a.first)return a.first;var s=X(a,l-1),u=s.stateAfter;if(u&&(!n||l+(u instanceof He?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 Vt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=X(e,r).stateAfter;if(i&&(!(i instanceof He)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var jt=!1,rt=!1;function Ct(){jt=!0}function er(){rt=!0}function Ft(e,t,n){this.marker=e,this.from=t,this.to=n}function Qe(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Mt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Pr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Jr(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,l=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);if(l||a.from==t&&o.type=="bookmark"&&(!n||!a.marker.insertLeft)){var s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(r||(r=[])).push(new Ft(o,a.from,s?null:a.to))}}return r}function zr(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,l=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);if(l||a.from==t&&o.type=="bookmark"&&(!n||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(r||(r=[])).push(new Ft(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function Sr(e,t){if(t.full)return null;var n=te(e,t.from.line)&&X(e,t.from.line).markedSpans,r=te(e,t.to.line)&&X(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=U(t.from,t.to)==0,l=Jr(n,i,o),s=zr(r,a,o),u=t.text.length==1,f=Ne(t.text).length+(u?i:0);if(l)for(var c=0;c<l.length;++c){var S=l[c];if(S.to==null){var y=Qe(s,S.marker);y?u&&(S.to=y.to==null?null:y.to+f):S.to=i}}if(s)for(var R=0;R<s.length;++R){var _=s[R];if(_.to!=null&&(_.to+=f),_.from==null){var ue=Qe(l,_.marker);ue||(_.from=f,u&&(l||(l=[])).push(_))}else _.from+=f,u&&(l||(l=[])).push(_)}l&&(l=nn(l)),s&&s!=l&&(s=nn(s));var Se=[l];if(!u){var Ie=t.text.length-2,Ce;if(Ie>0&&l)for(var Be=0;Be<l.length;++Be)l[Be].to==null&&(Ce||(Ce=[])).push(new Ft(l[Be].marker,null,null));for(var pt=0;pt<Ie;++pt)Se.push(Ce);Se.push(s)}return Se}function nn(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Mr(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(y){if(y.markedSpans)for(var R=0;R<y.markedSpans.length;++R){var _=y.markedSpans[R].marker;_.readOnly&&(!r||fe(r,_)==-1)&&(r||(r=[])).push(_)}}),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],l=o.find(0),s=0;s<i.length;++s){var u=i[s];if(!(U(u.to,l.from)<0||U(u.from,l.to)>0)){var f=[s,1],c=U(u.from,l.from),S=U(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 tn(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Qr(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Lr(e){return e.inclusiveLeft?-1:0}function ct(e){return e.inclusiveRight?1:0}function Ue(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=U(r.from,i.from)||Lr(e)-Lr(t);if(a)return-a;var o=U(r.to,i.to)||ct(e)-ct(t);return o||t.id-e.id}function wt(e,t){var n=rt&&e.markedSpans,r;if(n)for(var i=void 0,a=0;a<n.length;++a)i=n[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Ue(r,i.marker)<0)&&(r=i.marker);return r}function _t(e){return wt(e,!0)}function V(e){return wt(e,!1)}function G(e,t){var n=rt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var a=n[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||Ue(r,a.marker)<0)&&(r=a.marker)}return r}function ke(e,t,n,r,i){var a=X(e,t),o=rt&&a.markedSpans;if(o)for(var l=0;l<o.length;++l){var s=o[l];if(s.marker.collapsed){var u=s.marker.find(0),f=U(u.from,n)||Lr(s.marker)-Lr(i),c=U(u.to,r)||ct(s.marker)-ct(i);if(!(f>=0&&c<=0||f<=0&&c>=0)&&(f<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?U(u.to,n)>=0:U(u.to,n)>0)||f>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?U(u.from,r)<=0:U(u.from,r)<0)))return!0}}}function nt(e){for(var t;t=_t(e);)e=t.find(-1,!0).line;return e}function dt(e){for(var t;t=V(e);)e=t.find(1,!0).line;return e}function Ir(e){for(var t,n;t=V(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Ar(e,t){var n=X(e,t),r=nt(n);return n==r?t:w(r)}function ln(e,t){if(t>e.lastLine())return t;var n=X(e,t),r;if(!Kr(e,n))return t;for(;r=V(n);)n=r.find(1,!0).line;return w(n)+1}function Kr(e,t){var n=rt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&gr(e,t,r))return!0}}}function gr(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return gr(e,r.line,Qe(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&gr(e,t,i))return!0}function Ur(e){e=nt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;n=a,a=n.parent)for(var o=0;o<a.children.length;++o){var l=a.children[o];if(l==n)break;t+=l.height}return t}function vn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=_t(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=V(r);){var a=n.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function _r(e){var t=e.display,n=e.doc;t.maxLine=X(n,n.first),t.maxLineLength=vn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=vn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Hr=function(e,t,n){this.text=e,Qr(this,t),this.height=n?n(this):1};Hr.prototype.lineNo=function(){return w(this)},be(Hr);function sn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),tn(e),Qr(e,n);var i=r?r(e):1;i!=e.height&&Z(e,i)}function Rr(e){e.parent=null,tn(e)}var $r={},Rn={};function bn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Rn:$r;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Gr(e,t){var n=ft("span",null,null,ae?"padding-right: .1px":null),r={pre:ft("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=Yn,$t(e.display.measure)&&(o=k(a,e.doc.direction))&&(r.addToken=jn(r.addToken,o)),r.map=[];var l=t!=e.display.externalMeasured&&w(a);si(a,r,Tt(e,a,l)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=J(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=J(a.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Gt(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 Te(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=J(r.pre.className,r.textClass||"")),r}function Sn(e){var t=j("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Yn(e,t,n,r,i,a,o){if(t){var l=e.splitSpaces?wn(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),T&&re<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));T&&re<9?f.appendChild(j("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 _=void 0;if(S[0]==" "){var ue=e.cm.options.tabSize,Se=ue-e.col%ue;_=f.appendChild(j("span",Lt(Se),"cm-tab")),_.setAttribute("role","presentation"),_.setAttribute("cm-text"," "),e.col+=Se}else S[0]=="\r"||S[0]==`
|
|
`?(_=f.appendChild(j("span",S[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_.setAttribute("cm-text",S[0]),e.col+=1):(_=e.cm.options.specialCharPlaceholder(S[0]),_.setAttribute("cm-text",S[0]),T&&re<9?f.appendChild(j("span",[_])):f.appendChild(_),e.col+=1);e.map.push(e.pos,e.pos+1,_),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||u||a||o){var Ie=n||"";r&&(Ie+=r),i&&(Ie+=i);var Ce=j("span",[f],Ie,a);if(o)for(var Be in o)o.hasOwnProperty(Be)&&Be!="style"&&Be!="class"&&Ce.setAttribute(Be,o[Be]);return e.content.appendChild(Ce)}e.content.appendChild(f)}}function wn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a="\xA0"),r+=a,n=a==" "}return r}function jn(e,t){return function(n,r,i,a,o,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,f=u+r.length;;){for(var c=void 0,S=0;S<t.length&&(c=t[S],!(c.to>u&&c.from<=u));S++);if(c.to>=f)return e(n,r,i,a,o,l,s);e(n,r.slice(0,c.to-u),i,a,null,l,s),a=null,r=r.slice(c.to-u),u=c.to}}}function un(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 si(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(a,a=n[o]),bn(n[o+1],t.cm.options));return}for(var l=i.length,s=0,u=1,f="",c,S,y=0,R,_,ue,Se,Ie;;){if(y==s){R=_=ue=S="",Ie=null,Se=null,y=1/0;for(var Ce=[],Be=void 0,pt=0;pt<r.length;++pt){var lt=r[pt],Qt=lt.marker;if(Qt.type=="bookmark"&<.from==s&&Qt.widgetNode)Ce.push(Qt);else if(lt.from<=s&&(lt.to==null||lt.to>s||Qt.collapsed&<.to==s&<.from==s)){if(lt.to!=null&<.to!=s&&y>lt.to&&(y=lt.to,_=""),Qt.className&&(R+=" "+Qt.className),Qt.css&&(S=(S?S+";":"")+Qt.css),Qt.startStyle&<.from==s&&(ue+=" "+Qt.startStyle),Qt.endStyle&<.to==y&&(Be||(Be=[])).push(Qt.endStyle,lt.to),Qt.title&&((Ie||(Ie={})).title=Qt.title),Qt.attributes)for(var Zr in Qt.attributes)(Ie||(Ie={}))[Zr]=Qt.attributes[Zr];Qt.collapsed&&(!Se||Ue(Se.marker,Qt)<0)&&(Se=lt)}else lt.from>s&&y>lt.from&&(y=lt.from)}if(Be)for(var pn=0;pn<Be.length;pn+=2)Be[pn+1]==y&&(_+=" "+Be[pn]);if(!Se||Se.from==s)for(var jr=0;jr<Ce.length;++jr)un(t,0,Ce[jr]);if(Se&&(Se.from||0)==s){if(un(t,(Se.to==null?l+1:Se.to)-s,Se.marker,Se.from==null),Se.to==null)return;Se.to==s&&(Se=!1)}}if(s>=l)break;for(var Kn=Math.min(l,y);;){if(f){var kn=s+f.length;if(!Se){var an=kn>Kn?f.slice(0,Kn-s):f;t.addToken(t,an,c?c+R:R,ue,s+an.length==y?_:"",S,Ie)}if(kn>=Kn){f=f.slice(Kn-s),s=Kn;break}s=kn,ue=""}f=i.slice(a,a=n[u++]),c=bn(n[u++],t.cm.options)}}}function qn(e,t,n){this.line=t,this.rest=Ir(t),this.size=this.rest?w(Ne(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Kr(e,t)}function Wn(e,t,n){for(var r=[],i,a=t;a<n;a=i){var o=new qn(e.doc,X(e.doc,a),a);i=a+o.size,r.push(o)}return r}var zn=null;function ai(e){zn?zn.ops.push(e):e.ownsGroup=zn={ops:[e],delayedCallbacks:[]}}function ei(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Un(e,t){var n=e.ownsGroup;if(n)try{ei(n)}finally{zn=null,t(n)}}var Pn=null;function Tr(e,t){var n=Ke(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;zn?i=zn.delayedCallbacks:Pn?i=Pn:(i=Pn=[],setTimeout(wr,0));for(var a=function(l){i.push(function(){return n[l].apply(null,r)})},o=0;o<n.length;++o)a(o)}}function wr(){var e=Pn;Pn=null;for(var t=0;t<e.length;++t)e[t]()}function ti(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?it(e,t):a=="gutter"?ir(e,t,n,r):a=="class"?at(e,t):a=="widget"&&xr(e,t,r)}t.changes=null}function Vr(e){return e.node==e.text&&(e.node=j("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),T&&re<8&&(e.node.style.zIndex=2)),e.node}function ot(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=Vr(t);t.background=r.insertBefore(j("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function bt(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Gr(e,t)}function it(e,t){var n=t.text.className,r=bt(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,at(e,t)):n&&(t.text.className=n)}function at(e,t){ot(e,t),t.line.wrapClass?Vr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function ir(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=Vr(t);t.gutterBackground=j("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=Vr(t),l=t.gutter=j("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),o.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(j("div",ye(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,f=a.hasOwnProperty(u)&&a[u];f&&l.appendChild(j("div",[f],"CodeMirror-gutter-elt","left: "+r.gutterLeft[u]+"px; width: "+r.gutterWidth[u]+"px"))}}}function xr(e,t,n){t.alignable&&(t.alignable=null);for(var r=ze("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);xn(e,t,n)}function Nn(e,t,n,r){var i=bt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),at(e,t),ir(e,t,n,r),xn(e,t,r),t.node}function xn(e,t,n){if(On(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)On(e,t.rest[r],t,n,!1)}function On(e,t,n,r,i){if(t.widgets)for(var a=Vr(n),o=0,l=t.widgets;o<l.length;++o){var s=l[o],u=j("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Re(s,u,n,r),e.display.input.setUneditable(u),i&&s.above?a.insertBefore(u,n.gutter||n.text):a.appendChild(u),Tr(s,"redraw")}}function Re(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function qe(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!N(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),_e(t.display.measure,j("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Jt(e,t){for(var n=Cr(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function kr(e){return e.lineSpace.offsetTop}function Nr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function _n(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=_e(e.measure,j("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Yr(e){return Ye-e.display.nativeBarWidth}function Hn(e){return e.display.scroller.clientWidth-Yr(e)-e.display.barWidth}function oi(e){return e.display.scroller.clientHeight-Yr(e)-e.display.barHeight}function Ya(e,t,n){var r=e.options.lineWrapping,i=r&&Hn(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),l=0;l<o.length-1;l++){var s=o[l],u=o[l+1];Math.abs(s.bottom-u.bottom)>2&&a.push((s.bottom+u.top)/2-n.top)}}a.push(n.bottom-n.top)}}function ui(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(w(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function ja(e,t){t=nt(t);var n=w(t),r=e.display.externalMeasured=new qn(e.doc,t,n);r.lineN=n;var i=r.built=Gr(e,r);return r.text=i.pre,_e(e.display.lineMeasure,i.pre),r}function Ca(e,t,n,r){return Jn(e,vi(e,t),n,r)}function Qi(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Li(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function vi(e,t){var n=w(t),r=Qi(e,n);r&&!r.text?r=null:r&&r.changes&&(ti(e,r,n,Qa(e)),e.curOp.forceUpdate=!0),r||(r=ja(e,t));var i=ui(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Jn(e,t,n,r,i){t.before&&(n=-1);var a=n+(r||""),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ya(e,t.view,t.rect),t.hasHeights=!0),o=Ea(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var $i={left:0,right:0,top:0,bottom:0};function wa(e,t,n){for(var r,i,a,o,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,a=1,o="left"):t<s?(i=t-l,a=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(a=s-l,i=a-1,t>=s&&(o="right")),i!=null){if(r=e[u+2],l==s&&n==(r.insertLeft?"left":"right")&&(o=n),n=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)r=e[(u-=3)+2],o="left";if(n=="right"&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)r=e[(u+=3)+2],o="right";break}return{node:r,start:i,end:a,collapse:o,coverStart:l,coverEnd:s}}function xa(e,t){var n=$i;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Ea(e,t,n,r){var i=wa(t.map,n,r),a=i.node,o=i.start,l=i.end,s=i.collapse,u;if(a.nodeType==3){for(var f=0;f<4;f++){for(;o&&z(t.line.text.charAt(i.coverStart+o));)--o;for(;i.coverStart+l<i.coverEnd&&z(t.line.text.charAt(i.coverStart+l));)++l;if(T&&re<9&&o==0&&l==i.coverEnd-i.coverStart?u=a.parentNode.getBoundingClientRect():u=xa(Nt(a,o,l).getClientRects(),r),u.left||u.right||o==0)break;l=o,o=o-1,s="right"}T&&re<11&&(u=Ja(e.display.measure,u))}else{o>0&&(s=r="right");var c;e.options.lineWrapping&&(c=a.getClientRects()).length>1?u=c[r=="right"?c.length-1:0]:u=a.getBoundingClientRect()}if(T&&re<9&&!o&&(!u||!u.left&&!u.right)){var S=a.parentNode.getClientRects()[0];S?u={left:S.left,right:S.left+Zi(e.display),top:S.top,bottom:S.bottom}:u=$i}for(var y=u.top-t.rect.top,R=u.bottom-t.rect.top,_=(y+R)/2,ue=t.view.measure.heights,Se=0;Se<ue.length-1&&!(_<ue[Se]);Se++);var Ie=Se?ue[Se-1]:0,Ce=ue[Se],Be={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:Ie,bottom:Ce};return!u.left&&!u.right&&(Be.bogus=!0),e.options.singleCursorHeightPerLine||(Be.rtop=y,Be.rbottom=R),Be}function Ja(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Kt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function qi(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Ma(e){e.display.externalMeasure=null,Et(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)qi(e.display.view[t])}function Ei(e){Ma(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function La(){return $&&St?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ra(){return $&&St?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ii(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=qe(e.widgets[n]));return t}function hi(e,t,n,r,i){if(!i){var a=Ii(t);n.top+=a,n.bottom+=a}if(r=="line")return n;r||(r="local");var o=Ur(t);if(r=="local"?o+=kr(e.display):o-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();o+=l.top+(r=="window"?0:Ra());var s=l.left+(r=="window"?0:La());n.left+=s,n.right+=s}return n.top+=o,n.bottom+=o,n}function dr(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=La(),i-=Ra();else if(n=="local"||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Bt(e,t,n,r,i){return r||(r=X(e.doc,t.line)),hi(e,r,Ca(e,r,t.ch,i),n)}function Br(e,t,n,r,i,a){r=r||X(e.doc,t.line),i||(i=vi(e,r));function o(R,_){var ue=Jn(e,i,R,_?"right":"left",a);return _?ue.left=ue.right:ue.right=ue.left,hi(e,r,ue,n)}var l=k(r,e.doc.direction),s=t.ch,u=t.sticky;if(s>=r.text.length?(s=r.text.length,u="before"):s<=0&&(s=0,u="after"),!l)return o(u=="before"?s-1:s,u=="before");function f(R,_,ue){var Se=l[_],Ie=Se.level==1;return o(ue?R-1:R,Ie!=ue)}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 En(e,t){var n=0;t=oe(e.doc,t),e.options.lineWrapping||(n=Zi(e.display)*t.ch);var r=X(e.doc,t.line),i=Ur(r)+kr(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function qr(e,t,n,r,i){var a=m(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function fn(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return qr(r.first,0,null,-1,-1);var i=Y(r,n),a=r.first+r.size-1;if(i>a)return qr(r.first+r.size-1,X(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=X(r,i);;){var l=gi(e,o,i,t,n),s=G(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=X(r,i=u.line)}}function Qn(e,t,n,r){r-=Ii(t);var i=t.text.length,a=q(function(o){return Jn(e,n,o-1).bottom<=r},i,0);return i=q(function(o){return Jn(e,n,o).top>r},a,i),{begin:a,end:i}}function Gn(e,t,n,r){n||(n=vi(e,t));var i=hi(e,t,Jn(e,n,r),"line").top;return Qn(e,t,n,i)}function ri(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function gi(e,t,n,r,i){i-=Ur(t);var a=vi(e,t),o=Ii(t),l=0,s=t.text.length,u=!0,f=k(t,e.doc.direction);if(f){var c=(e.options.lineWrapping?Ai:fi)(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=q(function(pt){var lt=Jn(e,a,pt);return lt.top+=o,lt.bottom+=o,ri(lt,r,i,!1)?(lt.top<=i&<.left<=r&&(S=pt,y=lt),!0):!1},l,s),_,ue,Se=!1;if(y){var Ie=r-y.left<y.right-r,Ce=Ie==u;R=S+(Ce?0:1),ue=Ce?"after":"before",_=Ie?y.left:y.right}else{!u&&(R==s||R==l)&&R++,ue=R==0?"after":R==t.text.length?"before":Jn(e,a,R-(u?1:0)).bottom+o<=i==u?"after":"before";var Be=Br(e,m(n,R,ue),"line",t,a);_=Be.left,Se=i<Be.top?-1:i>=Be.bottom?1:0}return R=le(t.text,R,1),qr(n,R,ue,Se,r-_)}function fi(e,t,n,r,i,a,o){var l=q(function(c){var S=i[c],y=S.level!=1;return ri(Br(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=Br(e,m(n,u?s.from:s.to,u?"after":"before"),"line",t,r);ri(f,a,o,!0)&&f.top>o&&(s=i[l-1])}return s}function Ai(e,t,n,r,i,a,o){var l=Qn(e,t,r,o),s=l.begin,u=l.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var f=null,c=null,S=0;S<i.length;S++){var y=i[S];if(!(y.from>=u||y.to<=s)){var R=y.level!=1,_=Jn(e,r,R?Math.min(u,y.to)-1:Math.max(s,y.from)).right,ue=_<a?a-_+1e9:_-a;(!f||c>ue)&&(f=y,c=ue)}}return f||(f=i[i.length-1]),f.from<s&&(f={from:s,to:f.to,level:f.level}),f.to>u&&(f={from:f.from,to:u,level:f.level}),f}var $n;function ki(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if($n==null){$n=j("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)$n.appendChild(document.createTextNode("x")),$n.appendChild(j("br"));$n.appendChild(document.createTextNode("x"))}_e(e.measure,$n);var n=$n.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Et(e.measure),n||1}function Zi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=j("span","xxxxxxxxxx"),n=j("pre",[t],"CodeMirror-line-like");_e(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Qa(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=ki(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Zi(e.display)-3);return function(i){if(Kr(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function qa(e){var t=e.doc,n=Ro(e);t.iter(function(r){var i=n(r);i!=r.height&&Z(r,i)})}function Mi(e,t,n,r){var i=e.display;if(!n&&Cr(t).getAttribute("cm-not-content")=="true")return null;var a,o,l=i.lineSpace.getBoundingClientRect();try{a=t.clientX-l.left,o=t.clientY-l.top}catch(c){return null}var s=fn(e,a,o),u;if(r&&s.xRel>0&&(u=X(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-_n(e.display).left)/Zi(e.display))-f))}return s}function Li(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function In(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)rt&&Ar(e.doc,t)<i.viewTo&&mi(e);else if(n<=i.viewFrom)rt&&ln(e.doc,n+r)>i.viewFrom?mi(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)mi(e);else if(t<=i.viewFrom){var a=Ta(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):mi(e)}else if(n>=i.viewTo){var o=Ta(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):mi(e)}else{var l=Ta(e,t,t,-1),s=Ta(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Wn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):mi(e)}var u=i.externalMeasured;u&&(n<u.lineN?u.lineN+=r:t<u.lineN+u.size&&(i.externalMeasured=null))}function pi(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[Li(e,t)];if(a.node!=null){var o=a.changes||(a.changes=[]);fe(o,n)==-1&&o.push(n)}}}function mi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ta(e,t,n,r){var i=Li(e,t),a,o=e.display.view;if(!rt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s<i;s++)l+=o[s].size;if(l!=t){if(r>0){if(i==o.length-1)return null;a=l+o[i].size-t,i++}else a=l-t;t+=a,n+=a}for(;Ar(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 _l(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Wn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Wn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Li(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Wn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Li(e,n)))),r.viewTo=n}function To(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function ea(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Do(e,t){t===void 0&&(t=!0);for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=0;o<n.sel.ranges.length;o++)if(!(!t&&o==n.sel.primIndex)){var l=n.sel.ranges[o];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&Po(e,l.head,i),s||Gl(e,l,a)}}return r}function Po(e,t,n){var r=Br(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(j("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var a=n.appendChild(j("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=r.other.left+"px",a.style.top=r.other.top+"px",a.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Da(e,t){return e.top-t.top||e.left-t.left}function Gl(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=_n(e.display),l=o.left,s=Math.max(r.sizerWidth,Hn(e)-r.sizer.offsetLeft)-o.right,u=i.direction=="ltr";function f(Ce,Be,pt,lt){Be<0&&(Be=0),Be=Math.round(Be),lt=Math.round(lt),a.appendChild(j("div",null,"CodeMirror-selected","position: absolute; left: "+Ce+`px;
|
|
top: `+Be+"px; width: "+(pt==null?s-Ce:pt)+`px;
|
|
height: `+(lt-Be)+"px"))}function c(Ce,Be,pt){var lt=X(i,Ce),Qt=lt.text.length,Zr,pn;function jr(an,Zn){return Bt(e,m(Ce,an),"div",lt,Zn)}function Kn(an,Zn,Cn){var cn=Gn(e,lt,null,an),on=Zn=="ltr"==(Cn=="after")?"left":"right",en=Cn=="after"?cn.begin:cn.end-(/\s/.test(lt.text.charAt(cn.end-1))?2:1);return jr(en,on)[on]}var kn=k(lt,i.direction);return de(kn,Be||0,pt==null?Qt:pt,function(an,Zn,Cn,cn){var on=Cn=="ltr",en=jr(an,on?"left":"right"),Fn=jr(Zn-1,on?"right":"left"),ji=Be==null&&an==0,xi=pt==null&&Zn==Qt,Ln=cn==0,li=!kn||cn==kn.length-1;if(Fn.top-en.top<=3){var mn=(u?ji:xi)&&Ln,Mo=(u?xi:ji)&&li,di=mn?l:(on?en:Fn).left,Ni=Mo?s:(on?Fn:en).right;f(di,en.top,Ni-di,en.bottom)}else{var Oi,Dn,Ji,Lo;on?(Oi=u&&ji&&Ln?l:en.left,Dn=u?s:Kn(an,Cn,"before"),Ji=u?l:Kn(Zn,Cn,"after"),Lo=u&&xi&&li?s:Fn.right):(Oi=u?Kn(an,Cn,"before"):l,Dn=!u&&ji&&Ln?s:en.right,Ji=!u&&xi&&li?l:Fn.left,Lo=u?Kn(Zn,Cn,"after"):s),f(Oi,en.top,Dn-Oi,en.bottom),en.bottom<Fn.top&&f(l,en.bottom,null,Fn.top),f(Ji,Fn.top,Lo-Ji,Fn.bottom)}(!Zr||Da(en,Zr)<0)&&(Zr=en),Da(Fn,Zr)<0&&(Zr=Fn),(!pn||Da(en,pn)<0)&&(pn=en),Da(Fn,pn)<0&&(pn=Fn)}),{start:Zr,end:pn}}var S=t.from(),y=t.to();if(S.line==y.line)c(S.line,S.ch,y.ch);else{var R=X(i,S.line),_=X(i,y.line),ue=nt(R)==nt(_),Se=c(S.line,S.ch,ue?R.text.length+1:null).end,Ie=c(y.line,ue?0:null,y.ch).start;ue&&(Se.top<Ie.top-2?(f(Se.right,Se.top,null,Se.bottom),f(l,Ie.top,Ie.left,Ie.bottom)):f(Se.right,Se.top,Ie.left-Se.right,Se.bottom)),Se.bottom<Ie.top&&f(l,Se.bottom,null,Ie.top)}n.appendChild(a)}function eo(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Fi(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,Fi(e))},100)}function to(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Te(e,"focus",e,t),e.state.focused=!0,A(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 Fi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Te(e,"blur",e,t),e.state.focused=!1,ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Pa(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i=t.view[r],a=e.options.lineWrapping,o=void 0,l=0;if(!i.hidden){if(T&&re<8){var s=i.node.offsetTop+i.node.offsetHeight;o=s-n,n=s}else{var u=i.node.getBoundingClientRect();o=u.bottom-u.top,!a&&i.text.firstChild&&(l=i.text.firstChild.getBoundingClientRect().right-u.left-1)}var f=i.line.height-o;if((f>.005||f<-.005)&&(Z(i.line,o),Io(i.line),i.rest))for(var c=0;c<i.rest.length;c++)Io(i.rest[c]);if(l>e.display.sizerWidth){var S=Math.ceil(l/Zi(e.display));S>e.display.maxLineLength&&(e.display.maxLineLength=S,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Io(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Na(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-kr(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=Y(t,r),o=Y(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<a?(a=l,o=Y(t,Ur(X(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=o&&(a=Y(t,Ur(X(t,s))-e.wrapper.clientHeight),o=s)}return{from:a,to:Math.max(o,a+1)}}function Vl(e,t){if(!Me(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=j("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-n.viewOffset-kr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+Yr(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 Xl(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=Br(e,t),s=!n||n==t?l:Br(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&&(ra(e,u.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(o=!0)),u.scrollLeft!=null&&(Ri(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return i}function Yl(e,t){var n=ro(e,t);n.scrollTop!=null&&ra(e,n.scrollTop),n.scrollLeft!=null&&Ri(e,n.scrollLeft)}function ro(e,t){var n=e.display,r=ki(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=oi(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var l=e.doc.height+Nr(n),s=t.top<r,u=t.bottom>l-r;if(t.top<i)o.scrollTop=s?0:t.top;else if(t.bottom>i+a){var f=Math.min(t.top,(u?l:t.bottom)-a);f!=i&&(o.scrollTop=f)}var c=e.options.fixedGutter?0:n.gutters.offsetWidth,S=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-c,y=Hn(e)-n.gutters.offsetWidth,R=t.right-t.left>y;return R&&(t.right=t.left+y),t.left<10?o.scrollLeft=0:t.left<S?o.scrollLeft=Math.max(0,t.left+c-(R?0:10)):t.right>y+S-3&&(o.scrollLeft=t.right+(R?0:10)-y),o}function no(e,t){t!=null&&(Oa(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Wi(e){Oa(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ta(e,t,n){(t!=null||n!=null)&&Oa(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function jl(e,t){Oa(e),e.curOp.scrollToPos=t}function Oa(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=En(e,t.from),r=En(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});ta(e,i.scrollLeft,i.scrollTop)}function ra(e,t){Math.abs(e.doc.scrollTop-t)<2||(H||ao(e,{top:t}),ko(e,t,!0),H&&ao(e),aa(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 Ri(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 na(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Nr(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+Yr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Ti=function(e,t,n){this.cm=n;var r=this.vert=j("div",[j("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=j("div",[j("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),B(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),B(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,T&&re<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ti.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}},Ti.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ti.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ti.prototype.zeroWidthHack=function(){var e=ht&&!M?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Pe,this.disableVert=new Pe},Ti.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)},Ti.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ia=function(){};ia.prototype.update=function(){return{bottom:0,right:0}},ia.prototype.setScrollLeft=function(){},ia.prototype.setScrollTop=function(){},ia.prototype.clear=function(){};function zi(e,t){t||(t=na(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&&Pa(e),Zo(e,na(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:Ti,null:ia};function Wo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ee(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),B(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"?Ri(e,t):ra(e,t)},e),e.display.scrollbars.addClass&&A(e.display.wrapper,e.display.scrollbars.addClass)}var Jl=0;function Di(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},ai(e.curOp)}function Pi(e){var t=e.curOp;t&&Un(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;Ql(n)})}function Ql(e){for(var t=e.ops,n=0;n<t.length;n++)$l(t[n]);for(var r=0;r<t.length;r++)ql(t[r]);for(var i=0;i<t.length;i++)es(t[i]);for(var a=0;a<t.length;a++)ts(t[a]);for(var o=0;o<t.length;o++)rs(t[o])}function $l(e){var t=e.cm,n=t.display;is(t),e.updateMaxLine&&_r(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ia(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&&Pa(t),e.barMeasure=na(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ca(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+Yr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Hn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ts(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ri(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==E();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&zi(t,e.barMeasure),e.updatedDisplay&&lo(t,e.barMeasure),e.selectionChanged&&eo(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&No(e.cm)}function rs(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&zo(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&ko(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ri(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Xl(t,oe(r,e.scrollToPos.from),oe(r,e.scrollToPos.to),e.scrollToPos.margin);Vl(t,i)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var l=0;l<a.length;++l)a[l].lines.length||Te(a[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&Te(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Te(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Bn(e,t){if(e.curOp)return t();Di(e);try{return t()}finally{Pi(e)}}function hn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Di(e);try{return t.apply(e,arguments)}finally{Pi(e)}}}function Tn(e){return function(){if(this.curOp)return e.apply(this,arguments);Di(this);try{return e.apply(this,arguments)}finally{Pi(this)}}}function gn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Di(t);try{return e.apply(this,arguments)}finally{Pi(t)}}}function aa(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,Oe(ns,e))}function ns(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=It(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?Yt(t.mode,r.state):null,s=qt(e,a,r,!0);l&&(r.state=l),a.styles=s.styles;var u=a.styleClasses,f=s.classes;f?a.styleClasses=f:u&&(a.styleClasses=null);for(var c=!o||o.length!=a.styles.length||u!=f&&(!u||!f||u.bgClass!=f.bgClass||u.textClass!=f.textClass),S=0;!c&&S<o.length;++S)c=o[S]!=a.styles[S];c&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&st(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return aa(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Bn(e,function(){for(var a=0;a<i.length;a++)pi(e,i[a],"text")})}}var Ia=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Na(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Hn(e),this.force=n,this.dims=Qa(e),this.events=[]};Ia.prototype.signal=function(e,t){je(e,t)&&this.events.push(arguments)},Ia.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Te.apply(null,this.events[e])};function is(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Yr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Yr(e)+"px",t.scrollbarsClipped=!0)}function as(e){if(e.hasFocus())return null;var t=E();if(!t||!N(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&N(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function os(e){if(!(!e||!e.activeElt||e.activeElt==E())&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&N(document.body,e.anchorNode)&&N(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function io(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return mi(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&To(e)==0)return!1;Bo(e)&&(mi(e),t.dims=Qa(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),rt&&(a=Ar(e.doc,a),o=ln(e.doc,o));var l=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;_l(e,a,o),n.viewOffset=Ur(X(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),Et(n.cursorDiv),Et(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,aa(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==Hn(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Nr(e.display)-oi(e),n.top)}),t.visible=Na(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Na(e.display,e.doc,n));if(!io(e,t))break;Pa(e);var i=na(e);ea(e),zi(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 Ia(e,t);if(io(e,n)){Pa(e),zo(e,n);var r=na(e);ea(e),zi(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 _=R.nextSibling;return ae&&ht&&e.display.currentWheelTarget==R?R.style.display="none":R.parentNode.removeChild(R),_}for(var s=r.view,u=r.viewFrom,f=0;f<s.length;f++){var c=s[f];if(!c.hidden)if(!c.node||c.node.parentNode!=a){var S=Nn(e,c,u,n);a.insertBefore(S,o)}else{for(;o!=c.node;)o=l(o);var y=i&&t!=null&&t<=u&&c.lineNumber;c.changes&&(fe(c.changes,"gutter")>-1&&(y=!1),ti(e,c,u,n)),y&&(Et(c.lineNumber),c.lineNumber.appendChild(document.createTextNode(ye(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+Yr(e)+"px"}function Ho(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=$a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+"px",o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var l=n[o].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Bo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ye(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(j("div",[j("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",oo(e.display),!0}return!1}function so(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!="string"&&(o=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:a,style:o})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Ko(e){var t=e.gutters,n=e.gutterSpecs;Et(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,l=t.appendChild(j("div",null,"CodeMirror-gutter "+a));o&&(l.style.cssText=o),a=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",oo(e)}function oa(e){Ko(e.display),In(e),Ho(e)}function ss(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=j("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=j("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=ft("div",null,"CodeMirror-code"),i.selectionDiv=j("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=j("div",null,"CodeMirror-cursors"),i.measure=j("div",null,"CodeMirror-measure"),i.lineMeasure=j("div",null,"CodeMirror-measure"),i.lineSpace=ft("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=ft("div",[i.lineSpace],"CodeMirror-lines");i.mover=j("div",[a],null,"position: relative"),i.sizer=j("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=j("div",null,null,"position: absolute; height: "+Ye+"px; width: 1px;"),i.gutters=j("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=j("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=j("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),T&&re<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!ae&&!(H&&Dt)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=so(r.gutters,r.lineNumbers),Ko(i),n.init(i)}var Aa=0,Vn=null;T?Vn=-.53:H?Vn=15:$?Vn=-.7:We&&(Vn=-1/3);function Uo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function us(e){var t=Uo(e);return t.x*=Vn,t.y*=Vn,t}function _o(e,t){var n=Uo(t),r=n.x,i=n.y,a=e.display,o=a.scroller,l=o.scrollWidth>o.clientWidth,s=o.scrollHeight>o.clientHeight;if(r&&l||i&&s){if(i&&ht&&ae){e:for(var u=t.target,f=a.view;u!=o;u=u.parentNode)for(var c=0;c<f.length;c++)if(f[c].node==u){e.display.currentWheelTarget=u;break e}}if(r&&!H&&!h&&Vn!=null){i&&s&&ra(e,Math.max(0,o.scrollTop+i*Vn)),Ri(e,Math.max(0,o.scrollLeft+r*Vn)),(!i||i&&s)&&et(t),a.wheelStartX=null;return}if(i&&Vn!=null){var S=i*Vn,y=e.doc.scrollTop,R=y+a.wrapper.clientHeight;S<0?y=Math.max(0,y+S-50):R=Math.min(e.doc.height,R+S+50),ao(e,{top:y,bottom:R})}Aa<20&&(a.wheelStartX==null?(a.wheelStartX=o.scrollLeft,a.wheelStartY=o.scrollTop,a.wheelDX=r,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX!=null){var _=o.scrollLeft-a.wheelStartX,ue=o.scrollTop-a.wheelStartY,Se=ue&&a.wheelDY&&ue/a.wheelDY||_&&a.wheelDX&&_/a.wheelDX;a.wheelStartX=a.wheelStartY=null,Se&&(Vn=(Vn*Aa+Se)/(Aa+1),++Aa)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var Xn=function(e,t){this.ranges=e,this.primIndex=t};Xn.prototype.primary=function(){return this.ranges[this.primIndex]},Xn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!Ae(n.anchor,r.anchor)||!Ae(n.head,r.head))return!1}return!0},Xn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Er(Ee(this.ranges[t].anchor),Ee(this.ranges[t].head));return new Xn(e,this.primIndex)},Xn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Xn.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(U(t,r.from())>=0&&U(e,r.to())<=0)return n}return-1};var Er=function(e,t){this.anchor=e,this.head=t};Er.prototype.from=function(){return $e(this.anchor,this.head)},Er.prototype.to=function(){return Ze(this.anchor,this.head)},Er.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ni(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(S,y){return U(S.from(),y.from())}),n=fe(t,i);for(var a=1;a<t.length;a++){var o=t[a],l=t[a-1],s=U(l.to(),o.from());if(r&&!o.empty()?s>0:s>=0){var u=$e(l.from(),o.from()),f=Ze(l.to(),o.to()),c=l.empty()?o.from()==o.head:l.from()==l.head;a<=n&&--n,t.splice(--a,2,new Er(c?f:u,c?u:f))}}return new Xn(t,n)}function yi(e,t){return new Xn([new Er(e,t||e)],0)}function bi(e){return e.text?m(e.from.line+e.text.length-1,Ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Go(e,t){if(U(e,t.from)<0)return e;if(U(e,t.to)<=0)return bi(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+=bi(t).ch-t.to.ch),m(n,r)}function uo(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Er(Go(i.anchor,t),Go(i.head,t)))}return ni(e.cm,n,e.sel.primIndex)}function Vo(e,t,n){return e.line==t.line?m(n.line,e.ch-t.ch+n.ch):m(n.line+(e.line-t.line),e.ch)}function fs(e,t,n){for(var r=[],i=m(e.first,0),a=i,o=0;o<t.length;o++){var l=t[o],s=Vo(l.from,i,a),u=Vo(bi(l),i,a);if(i=l.to,a=u,n=="around"){var f=e.sel.ranges[o],c=U(f.head,f.anchor)<0;r[o]=new Er(c?u:s,c?s:u)}else r[o]=new Er(s,s)}return new Xn(r,e.sel.primIndex)}function fo(e){e.doc.mode=nr(e.options,e.doc.modeOption),la(e)}function la(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,aa(e,100),e.state.modeGen++,e.curOp&&In(e)}function Xo(e,t){return t.from.ch==0&&t.to.ch==0&&Ne(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function co(e,t,n,r){function i(Ie){return n?n[Ie]:null}function a(Ie,Ce,Be){sn(Ie,Ce,Be,r),Tr(Ie,"change",Ie,t)}function o(Ie,Ce){for(var Be=[],pt=Ie;pt<Ce;++pt)Be.push(new Hr(u[pt],i(pt),r));return Be}var l=t.from,s=t.to,u=t.text,f=X(e,l.line),c=X(e,s.line),S=Ne(u),y=i(u.length-1),R=s.line-l.line;if(t.full)e.insert(0,o(0,u.length)),e.remove(u.length,e.size-u.length);else if(Xo(e,t)){var _=o(0,u.length-1);a(c,c.text,y),R&&e.remove(l.line,R),_.length&&e.insert(l.line,_)}else if(f==c)if(u.length==1)a(f,f.text.slice(0,l.ch)+S+f.text.slice(s.ch),y);else{var ue=o(1,u.length-1);ue.push(new Hr(S+f.text.slice(s.ch),y,r)),a(f,f.text.slice(0,l.ch)+u[0],i(0)),e.insert(l.line+1,ue)}else if(u.length==1)a(f,f.text.slice(0,l.ch)+u[0]+c.text.slice(s.ch),i(0)),e.remove(l.line+1,R);else{a(f,f.text.slice(0,l.ch)+u[0],i(0)),a(c,S+c.text.slice(s.ch),y);var Se=o(1,u.length-1);R>1&&e.remove(l.line+1,R-1),e.insert(l.line+1,Se)}Tr(e,"change",e,t)}function Si(e,t,n){function r(i,a,o){if(i.linked)for(var l=0;l<i.linked.length;++l){var s=i.linked[l];if(s.doc!=a){var u=o&&s.sharedHist;n&&!u||(t(s.doc,u),r(s.doc,i,u))}}}r(e,null,!0)}function Yo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,qa(e),fo(e),jo(e),e.options.lineWrapping||_r(e),e.options.mode=t.modeOption,In(e)}function jo(e){(e.doc.direction=="rtl"?A:ee)(e.display.lineDiv,"CodeMirror-rtl")}function cs(e){Bn(e,function(){jo(e),In(e)})}function ka(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function vo(e,t){var n={from:Ee(t.from),to:bi(t),text:v(e,t.from,t.to)};return $o(e,n,t.from.line,t.to.line+1),Si(e,function(r){return $o(r,n,t.from.line,t.to.line+1)},!0),n}function Jo(e){for(;e.length;){var t=Ne(e);if(t.ranges)e.pop();else break}}function ds(e,t){if(t)return Jo(e.done),Ne(e.done);if(e.done.length&&!Ne(e.done).ranges)return Ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ne(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=Ne(o.changes),U(t.from,t.to)==0&&U(t.from,l.to)==0?l.to=bi(t):o.changes.push(vo(e,t));else{var s=Ne(i.done);for((!s||!s.ranges)&&Za(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||Te(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,Ne(i.done),t))?i.done[i.done.length-1]=t:Za(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Jo(i.undone)}function Za(e,t){var n=Ne(t);n&&n.ranges&&n.equals(e)||t.push(e)}function $o(e,t,n,r){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(o){o.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=o.markedSpans),++a})}function gs(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function ps(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(gs(n[i]));return r}function qo(e,t){var n=ps(e,t),r=Sr(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)e:for(var l=0;l<o.length;++l){for(var s=o[l],u=0;u<a.length;++u)if(a[u].marker==s.marker)continue e;a.push(s)}else o&&(n[i]=o)}return n}function Hi(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?Xn.prototype.deepCopy.call(a):a);continue}var o=a.changes,l=[];r.push({changes:l});for(var s=0;s<o.length;++s){var u=o[s],f=void 0;if(l.push({from:u.from,to:u.to,text:u.text}),t)for(var c in u)(f=c.match(/^spans_(\d+)$/))&&fe(t,Number(f[1]))>-1&&(Ne(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=U(t,i)<0;a!=U(n,i)<0?(i=t,t=n):a!=U(t,n)<0&&(t=n)}return new Er(i,t)}else return new Er(n||t,t)}function Fa(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Mn(e,new Xn([ho(e.sel.primary(),t,n,i)],0),r)}function el(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=ho(e.sel.ranges[a],t[a],null,i);var o=ni(e.cm,r,e.sel.primIndex);Mn(e,o,n)}function go(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Mn(e,ni(e.cm,i,e.sel.primIndex),r)}function tl(e,t,n,r){Mn(e,yi(t,n),r)}function ms(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var a=0;a<i.length;a++)this.ranges[a]=new Er(oe(e,i[a].anchor),oe(e,i[a].head))},origin:n&&n.origin};return Te(e,"beforeSelectionChange",e,r),e.cm&&Te(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?ni(e.cm,r.ranges,r.ranges.length-1):t}function rl(e,t,n){var r=e.history.done,i=Ne(r);i&&i.ranges?(r[r.length-1]=t,Wa(e,t,n)):Mn(e,t,n)}function Mn(e,t,n){Wa(e,t,n),hs(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Wa(e,t,n){(je(e,"beforeSelectionChange")||e.cm&&je(e.cm,"beforeSelectionChange"))&&(t=ms(e,t,n));var r=n&&n.bias||(U(t.primary().head,e.sel.primary().head)<0?-1:1);nl(e,al(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&Wi(e.cm)}function nl(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,mt(e.cm)),Tr(e,"cursorActivity",e))}function il(e){nl(e,al(e,e.sel,null,!1))}function al(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],s=za(e,o.anchor,l&&l.anchor,n,r),u=za(e,o.head,l&&l.head,n,r);(i||s!=o.anchor||u!=o.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new Er(s,u))}return i?ni(e.cm,i,t.primIndex):t}function Bi(e,t,n,r,i){var a=X(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var l=a.markedSpans[o],s=l.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,f="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(u?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(f?l.to>=t.ch:l.to>t.ch))){if(i&&(Te(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=U(c,n))&&(r<0?S<0:S>0))return Bi(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?Bi(e,y,t,r,i):null}}return t}function za(e,t,n,r,i){var a=r||1,o=Bi(e,t,n,a,i)||!i&&Bi(e,t,n,a,!0)||Bi(e,t,n,-a,i)||!i&&Bi(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?oe(e,m(t.line-1)):null:n>0&&t.ch==(r||X(e,t.line)).text.length?t.line<e.first+e.size-1?m(t.line+1,0):null:new m(t.line,t.ch+n)}function ll(e){e.setSelection(m(e.firstLine(),0),m(e.lastLine()),xe)}function sl(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,a,o,l){i&&(r.from=oe(e,i)),a&&(r.to=oe(e,a)),o&&(r.text=o),l!==void 0&&(r.origin=l)}),Te(e,"beforeChange",e,r),e.cm&&Te(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Ki(e,t,n){if(e.cm){if(!e.cm.curOp)return hn(e.cm,Ki)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((je(e,"beforeChange")||e.cm&&je(e.cm,"beforeChange"))&&(t=sl(e,t,!0),!t))){var r=jt&&!n&&Mr(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)ul(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ul(e,t)}}function ul(e,t){if(!(t.text.length==1&&t.text[0]==""&&U(t.from,t.to)==0)){var n=uo(e,t);Qo(e,t,n,e.cm?e.cm.curOp.id:NaN),sa(e,t,n,Sr(e,t));var r=[];Si(e,function(i,a){!a&&fe(r,i.history)==-1&&(vl(i.history,t),r.push(i.history)),sa(i,t,null,Sr(i,t))})}}function Ha(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,a,o=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<l.length&&(a=l[u],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));u++);if(u!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=l.pop(),a.ranges){if(Za(a,s),n&&!a.equals(e.sel)){Mn(e,a,{clearRedo:!1});return}o=a}else if(r){l.push(a);return}else break;var f=[];Za(o,s),s.push({changes:f,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var c=je(e,"beforeChange")||e.cm&&je(e.cm,"beforeChange"),S=function(_){var ue=a.changes[_];if(ue.origin=t,c&&!sl(e,ue,!1))return l.length=0,{};f.push(vo(e,ue));var Se=_?uo(e,ue):Ne(l);sa(e,ue,Se,qo(e,ue)),!_&&e.cm&&e.cm.scrollIntoView({from:ue.from,to:bi(ue)});var Ie=[];Si(e,function(Ce,Be){!Be&&fe(Ie,Ce.history)==-1&&(vl(Ce.history,ue),Ie.push(Ce.history)),sa(Ce,ue,null,qo(Ce,ue))})},y=a.changes.length-1;y>=0;--y){var R=S(y);if(R)return R.v}}}}function fl(e,t){if(t!=0&&(e.first+=t,e.sel=new Xn(vr(e.sel.ranges,function(i){return new Er(m(i.anchor.line+t,i.anchor.ch),m(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){In(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)pi(e.cm,r,"gutter")}}function sa(e,t,n,r){if(e.cm&&!e.cm.curOp)return hn(e.cm,sa)(e,t,n,r);if(t.to.line<e.first){fl(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);fl(e,i),t={from:m(e.first,0),to:m(t.to.line+i,t.to.ch),text:[Ne(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:m(a,X(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=v(e,t.from,t.to),n||(n=uo(e,t)),e.cm?ys(e.cm,t,r):co(e,t,r),Wa(e,n,xe),e.cantEdit&&za(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=w(nt(X(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&&mt(e),co(r,t,n,Ro(e)),e.options.lineWrapping||(r.iter(s,a.line+t.text.length,function(y){var R=vn(y);R>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=R,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Vt(r,a.line),aa(e,400);var u=t.text.length-(o.line-a.line)-1;t.full?In(e):a.line==o.line&&t.text.length==1&&!Xo(e.doc,t)?pi(e,a.line,"text"):In(e,a.line,o.line+1,u);var f=je(e,"changes"),c=je(e,"change");if(c||f){var S={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};c&&Tr(e,"change",e,S),f&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(S)}e.display.selForContextMenu=null}function Ui(e,t,n,r,i){var a;r||(r=n),U(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Ki(e,{from:n,to:r,text:t,origin:i})}function cl(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function dl(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var l=0;l<a.ranges.length;l++)cl(a.ranges[l].anchor,t,n,r),cl(a.ranges[l].head,t,n,r);continue}for(var s=0;s<a.changes.length;++s){var u=a.changes[s];if(n<u.from.line)u.from=m(u.from.line+r,u.from.ch),u.to=m(u.to.line+r,u.to.ch);else if(t<=u.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function vl(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;dl(e.done,n,r,i),dl(e.undone,n,r,i)}function ua(e,t,n,r){var i=t,a=t;return typeof t=="number"?a=X(e,Le(e,t)):i=w(t),i==null?null:(r(a,i)&&e.cm&&pi(e.cm,i,n),a)}function fa(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}fa.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Rr(i),Tr(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function ca(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}ca.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof fa))){var l=[];this.collapse(l),this.children=[new fa(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,l=o;l<i.lines.length;){var s=new fa(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new ca(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=fe(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new ca(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var da=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};da.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=w(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=qe(this);Z(n,Math.max(0,n.height-a)),e&&(Bn(e,function(){hl(e,n,-a),pi(e,r,"widget")}),Tr(e,"lineWidgetCleared",e,this,r))}},da.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=qe(this)-t;i&&(Kr(this.doc,r)||Z(r,r.height+i),n&&Bn(n,function(){n.curOp.forceUpdate=!0,hl(n,r,i),Tr(n,"lineWidgetChanged",n,e,w(r))}))},be(da);function hl(e,t,n){Ur(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&no(e,n)}function bs(e,t,n,r){var i=new da(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),ua(e,t,"widget",function(o){var l=o.widgets||(o.widgets=[]);if(i.insertAt==null?l.push(i):l.splice(Math.min(l.length-1,Math.max(0,i.insertAt)),0,i),i.line=o,a&&!Kr(e,o)){var s=Ur(o)<e.scrollTop;Z(o,o.height+qe(i)),s&&no(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Tr(a,"lineWidgetAdded",a,i,typeof t=="number"?t:w(t)),i}var gl=0,Ci=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++gl};Ci.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Di(e),je(this,"clear")){var n=this.find();n&&Tr(this,"clear",n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],l=Qe(o.markedSpans,this);e&&!this.collapsed?pi(e,w(o),"text"):e&&(l.to!=null&&(i=w(o)),l.from!=null&&(r=w(o))),o.markedSpans=Mt(o.markedSpans,l),l.from==null&&this.collapsed&&!Kr(this.doc,o)&&e&&Z(o,ki(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=nt(this.lines[s]),f=vn(u);f>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&In(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&&Tr(e,"markerCleared",e,this,r,i),t&&Pi(e),this.parent&&this.parent.clear()}},Ci.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Qe(a.markedSpans,this);if(o.from!=null&&(n=m(t?a:w(a),o.from),e==-1))return n;if(o.to!=null&&(r=m(t?a:w(a),o.to),e==1))return r}return n&&{from:n,to:r}},Ci.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Bn(r,function(){var i=t.line,a=w(t.line),o=Qi(r,a);if(o&&(qi(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Kr(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=qe(n)-l;s&&Z(i,i.height+s)}Tr(r,"markerChanged",r,e)})},Ci.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||fe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ci.prototype.detachLine=function(e){if(this.lines.splice(fe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},be(Ci);function _i(e,t,n,r,i){if(r&&r.shared)return Ss(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return hn(e.cm,_i)(e,t,n,r,i);var a=new Ci(e,i),o=U(t,n);if(r&&L(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=ft("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(ke(e,t.line,t,n,a)||t.line!=n.line&&ke(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");er()}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&&nt(c)==s.display.maxLine&&(u=!0),a.collapsed&&l!=t.line&&Z(c,0),Pr(c,new Ft(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){Kr(e,c)&&Z(c,0)}),a.clearOnEnter&&B(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(Ct(),(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)In(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++)pi(s,f,"text");a.atomic&&il(s.doc),Tr(s,"markerAdded",s,a)}return a}var va=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};va.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Tr(this,"clear")}},va.prototype.find=function(e,t){return this.primary.find(e,t)},be(va);function Ss(e,t,n,r,i){r=L(r),r.shared=!1;var a=[_i(e,t,n,r,i)],o=a[0],l=r.widgetNode;return Si(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),a.push(_i(s,oe(s,t),oe(s,n),r,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;o=Ne(a)}),new va(a,o)}function pl(e){return e.findMarks(m(e.first,0),e.clipPos(m(e.lastLine())),function(t){return t.parent})}function Cs(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(U(a,o)){var l=_i(e,a,o,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function ws(e){for(var t=function(r){var i=e[r],a=[i.primary.doc];Si(i.primary.doc,function(s){return a.push(s)});for(var o=0;o<i.markers.length;o++){var l=i.markers[o];fe(a,l.doc)==-1&&(l.parent=null,i.markers.splice(o--,1))}},n=0;n<e.length;n++)t(n)}var xs=0,An=function(e,t,n,r,i){if(!(this instanceof An))return new An(e,t,n,r,i);n==null&&(n=0),ca.call(this,[new fa([new Hr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=m(n,0);this.sel=yi(a),this.history=new ka(null),this.id=++xs,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),co(this,{from:a,to:a,text:e}),Mn(this,yi(a),xe)};An.prototype=g(ca.prototype,{constructor:An,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=d(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:gn(function(e){var t=m(this.first,0),n=this.first+this.size-1;Ki(this,{from:t,to:m(n,X(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ta(this.cm,0,0),Mn(this,yi(t),xe)}),replaceRange:function(e,t,n,r){t=oe(this,t),n=n?oe(this,n):t,Ui(this,e,t,n,r)},getRange:function(e,t,n){var r=v(this,oe(this,e),oe(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(te(this,e))return X(this,e)},getLineNumber:function(e){return w(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=X(this,e)),nt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return oe(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:gn(function(e,t,n){tl(this,oe(this,typeof e=="number"?m(e,t||0):e),null,n)}),setSelection:gn(function(e,t,n){tl(this,oe(this,e),oe(this,t||e),n)}),extendSelection:gn(function(e,t,n){Fa(this,oe(this,e),t&&oe(this,t),n)}),extendSelections:gn(function(e,t){el(this,ve(this,e),t)}),extendSelectionsBy:gn(function(e,t){var n=vr(this.sel.ranges,e);el(this,ve(this,n),t)}),setSelections:gn(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Er(oe(this,e[i].anchor),oe(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Mn(this,ni(this.cm,r,t),n)}}),addSelection:gn(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Er(oe(this,e),oe(this,t||e))),Mn(this,ni(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=v(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=v(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:gn(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var l=t&&t!="end"&&fs(this,r,t),s=r.length-1;s>=0;s--)Ki(this,r[s]);l?rl(this,l):this.cm&&Wi(this.cm)}),undo:gn(function(){Ha(this,"undo")}),redo:gn(function(){Ha(this,"redo")}),undoSelection:gn(function(){Ha(this,"undo",!0)}),redoSelection:gn(function(){Ha(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ka(this.history.maxGeneration),Si(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Hi(this.history.done),undone:Hi(this.history.undone)}},setHistory:function(e){var t=this.history=new ka(this.history.maxGeneration);t.done=Hi(e.done.slice(0),null,!0),t.undone=Hi(e.undone.slice(0),null,!0)},setGutterMarker:gn(function(e,t,n){return ua(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&O(i)&&(r.gutterMarkers=null),!0})}),clearGutter:gn(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&ua(t,n,"gutter",function(){return n.gutterMarkers[e]=null,O(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!te(this,e)||(t=e,e=X(this,e),!e))return null}else if(t=w(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:gn(function(e,t,n){return ua(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(ze(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:gn(function(e,t,n){return ua(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=r[i];if(a)if(n==null)r[i]=null;else{var o=a.match(ze(n));if(!o)return!1;var l=o.index+o[0].length;r[i]=a.slice(0,o.index)+(!o.index||l==a.length?"":" ")+a.slice(l)||null}else return!1;return!0})}),addLineWidget:gn(function(e,t,n){return bs(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return _i(this,oe(this,e),oe(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=oe(this,e),_i(this,e,e,n,"bookmark")},findMarksAt:function(e){e=oe(this,e);var t=[],n=X(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=oe(this,e),t=oe(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var l=0;l<o.length;l++){var s=o[l];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),oe(this,m(n,t))},indexFromPos:function(e){e=oe(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new An(d(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new An(d(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cs(r,pl(this)),r},unlinkDoc:function(e){if(e instanceof Xr&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),ws(pl(this));break}}if(e.history==this.history){var r=[e.id];Si(e,function(i){return r.push(i.id)},!0),e.history=new ka(null),e.history.done=Hi(this.history.done,r),e.history.undone=Hi(this.history.undone,r)}},iterLinkedDocs:function(e){Si(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ot(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:gn(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&cs(this.cm))})}),An.prototype.eachLine=An.prototype.iter;var ml=0;function Es(e){var t=this;if(yl(t),!(Me(t,e)||Jt(t.display,e))){et(e),T&&(ml=+new Date);var n=Mi(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),o=0,l=function(){++o==i&&hn(t,function(){n=oe(t.doc,n);var y={from:n,to:n,text:t.doc.splitLines(a.filter(function(R){return R!=null}).join(t.doc.lineSeparator())),origin:"paste"};Ki(t.doc,y),rl(t.doc,yi(oe(t.doc,n),oe(t.doc,bi(y))))})()},s=function(y,R){if(t.options.allowDropFileTypes&&fe(t.options.allowDropFileTypes,y.type)==-1){l();return}var _=new FileReader;_.onerror=function(){return l()},_.onload=function(){var ue=_.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ue)){l();return}a[R]=ue,l()},_.readAsText(y)},u=0;u<r.length;u++)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var f=e.dataTransfer.getData("Text");if(f){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),Wa(t.doc,yi(n,n)),c)for(var S=0;S<c.length;++S)Ui(t.doc,"",c[S].anchor,c[S].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(y){}}}}function Ms(e,t){if(T&&(!e.state.draggingText||+new Date-ml<100)){tr(t);return}if(!(Me(e,t)||Jt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!We)){var n=j("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}function Ls(e,t){var n=Mi(e,t);if(n){var r=document.createDocumentFragment();Po(e,n,r),e.display.dragCursor||(e.display.dragCursor=j("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),_e(e.display.dragCursor,r)}}function yl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function bl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var a=0;a<n.length;a++)e(n[a])})}}var Sl=!1;function Rs(){Sl||(Ts(),Sl=!0)}function Ts(){var e;B(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,bl(Ds)},100))}),B(window,"blur",function(){return bl(Fi)})}function Ds(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var wi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ha=0;ha<10;ha++)wi[ha+48]=wi[ha+96]=String(ha);for(var Ba=65;Ba<=90;Ba++)wi[Ba]=String.fromCharCode(Ba);for(var ga=1;ga<=12;ga++)wi[ga+111]=wi[ga+63235]="F"+ga;var ci={};ci.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ci.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ci.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ci.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ci.default=ht?ci.macDefault:ci.pcDefault;function Ps(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,a,o=0;o<t.length-1;o++){var l=t[o];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ns(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=vr(n.split(" "),Ps),a=0;a<i.length;a++){var o=void 0,l=void 0;a==i.length-1?(l=i.join(" "),o=r):(l=i.slice(0,a+1).join(" "),o="...");var s=t[l];if(!s)t[l]=o;else if(s!=o)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var u in t)e[u]=t[u];return e}function Gi(e,t,n,r){t=Ka(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Gi(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=Gi(e,t.fallthrough[a],n,r);if(o)return o}}}function Cl(e){var t=typeof e=="string"?e:wi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function wl(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(F?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(F?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function xl(e,t){if(h&&e.keyCode==34&&e.char)return!1;var n=wi[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),wl(n,e,t))}function Ka(e){return typeof e=="string"?ci[e]:e}function Vi(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&U(a.from,Ne(r).to)<=0;){var o=r.pop();if(U(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}Bn(e,function(){for(var l=r.length-1;l>=0;l--)Ui(e.doc,"",r[l].from,r[l].to,"+delete");Wi(e)})}function po(e,t,n){var r=le(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?Ne(a):a[0],l=i<0==(o.level==1),s=l?"after":"before",u;if(o.level>0||t.doc.direction=="rtl"){var f=vi(t,n);u=i<0?n.text.length-1:0;var c=Jn(t,f,u).top;u=q(function(S){return Jn(t,f,S).top==c},i<0==(o.level==1)?o.from:o.to-1,u),s=="before"&&(u=po(n,u,1))}else u=i<0?o.to:o.from;return new m(r,u,s)}}return new m(r,i<0?n.text.length:0,i<0?"before":"after")}function Os(e,t,n,r){var i=k(t,e.doc.direction);if(!i)return mo(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var a=ne(i,n.ch,n.sticky),o=i[a];if(e.doc.direction=="ltr"&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return mo(t,n,r);var l=function(Se,Ie){return po(t,Se instanceof m?Se.ch:Se,Ie)},s,u=function(Se){return e.options.lineWrapping?(s=s||vi(e,t),Gn(e,t,s,Se)):{begin:0,end:t.text.length}},f=u(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||o.level==1){var c=o.level==1==r<0,S=l(n,c?1:-1);if(S!=null&&(c?S<=o.to&&S<=f.end:S>=o.from&&S>=f.begin)){var y=c?"before":"after";return new m(n.line,S,y)}}var R=function(Se,Ie,Ce){for(var Be=function(Zr,pn){return pn?new m(n.line,l(Zr,1),"before"):new m(n.line,Zr,"after")};Se>=0&&Se<i.length;Se+=Ie){var pt=i[Se],lt=Ie>0==(pt.level!=1),Qt=lt?Ce.begin:l(Ce.end,-1);if(pt.from<=Qt&&Qt<pt.to||(Qt=lt?pt.from:l(pt.to,-1),Ce.begin<=Qt&&Qt<Ce.end))return Be(Qt,lt)}},_=R(a+r,r,f);if(_)return _;var ue=r>0?f.end:l(f.begin,-1);return ue!=null&&!(r>0&&ue==t.text.length)&&(_=R(r>0?0:i.length-1,r,u(ue)),_)?_:null}var pa={selectAll:ll,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return Vi(e,function(t){if(t.empty()){var n=X(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:m(t.head.line+1,0)}:{from:t.head,to:m(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Vi(e,function(t){return{from:m(t.from().line,0),to:oe(e.doc,m(t.to().line+1,0))}})},delLineLeft:function(e){return Vi(e,function(t){return{from:m(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Vi(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Vi(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(m(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(m(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return El(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Ml(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Is(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Fe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Ml(e,t.head):r},Fe)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=se(e.getLine(a.line),a.ch,r);t.push(Lt(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Bn(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=X(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new m(i.line,i.ch-1)),i.ch>0)i=new m(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),m(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=X(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 Er(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Bn(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Wi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function El(e,t){var n=X(e.doc,t),r=nt(n);return r!=n&&(t=w(r)),yo(!0,e,r,t,1)}function Is(e,t){var n=X(e.doc,t),r=dt(n);return r!=n&&(t=w(r)),yo(!0,e,n,t,-1)}function Ml(e,t){var n=El(e,t.line),r=X(e.doc,n.line),i=k(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return m(n.line,o?0:a,n.sticky)}return n}function Ua(e,t,n){if(typeof t=="string"&&(t=pa[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ge}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function As(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Gi(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Gi(t,e.options.extraKeys,n,e)||Gi(t,e.options.keyMap,n,e)}var ks=new Pe;function ma(e,t,n,r){var i=e.state.keySeq;if(i){if(Cl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ks.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Ll(e,i+" "+t,n,r))return!0}return Ll(e,t,n,r)}function Ll(e,t,n,r){var i=As(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Tr(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(et(n),eo(e)),!!i}function Rl(e,t){var n=xl(t,!0);return n?t.shiftKey&&!e.state.keySeq?ma(e,"Shift-"+n,t,function(r){return Ua(e,r,!0)})||ma(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Ua(e,r)}):ma(e,n,t,function(r){return Ua(e,r)}):!1}function Zs(e,t,n){return ma(e,"'"+n+"'",t,function(r){return Ua(e,r,!0)})}var bo=null;function Tl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=E(),!Me(t,e))){T&&re<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Rl(t,e);h&&(bo=r?n:null,!r&&n==88&&!yt&&(ht?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),H&&!ht&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fs(t)}}function Fs(e){var t=e.display.lineDiv;A(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(ee(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n))}B(document,"keyup",n),B(document,"mouseover",n)}function Dl(e){e.keyCode==16&&(this.doc.sel.shift=!1),Me(this,e)}function Pl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(Jt(t.display,e)||Me(t,e)||e.ctrlKey&&!e.altKey||ht&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(h&&n==bo){bo=null,et(e);return}if(!(h&&(!e.which||e.which<10)&&Rl(t,e))){var i=String.fromCharCode(r==null?n:r);i!="\b"&&(Zs(t,e,i)||t.display.input.onKeyPress(e))}}}var Ws=400,So=function(e,t,n){this.time=e,this.pos=t,this.button=n};So.prototype.compare=function(e,t,n){return this.time+Ws>e&&U(t,this.pos)==0&&n==this.button};var ya,ba;function zs(e,t){var n=+new Date;return ba&&ba.compare(n,e,t)?(ya=ba=null,"triple"):ya&&ya.compare(n,e,t)?(ba=new So(n,e,t),ya=null,"double"):(ya=new So(n,e,t),ba=null,"single")}function Nl(e){var t=this,n=t.display;if(!(Me(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,Jt(n,e)){ae||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Co(t,e)){var r=Mi(t,e),i=tt(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):Cr(e)==n.scroller&&et(e):i==2?(r&&Fa(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(xt?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,ma(e,wl(a,i),i,function(o){if(typeof o=="string"&&(o=pa[o]),!o)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=o(e,n)!=Ge}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=Pt?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=ht?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(ht?n.altKey:n.ctrlKey)),i}function Ks(e,t,n,r){T?setTimeout(Oe(No,e),0):e.curOp.focus=E();var i=Bs(e,n,r),a=e.doc.sel,o;e.options.dragDrop&&ut&&!e.isReadOnly()&&n=="single"&&(o=a.contains(t))>-1&&(U((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(U(o.to(),t)>0||t.xRel<0)?Us(e,r,t,i):_s(e,r,t,i)}function Us(e,t,n,r){var i=e.display,a=!1,o=hn(e,function(u){ae&&(i.scroller.draggable=!1),e.state.draggingText=!1,pe(i.wrapper.ownerDocument,"mouseup",o),pe(i.wrapper.ownerDocument,"mousemove",l),pe(i.scroller,"dragstart",s),pe(i.scroller,"drop",o),a||(et(u),r.addNew||Fa(e.doc,n,null,null,r.extend),ae&&!We||T&&re==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(),B(i.wrapper.ownerDocument,"mouseup",o),B(i.wrapper.ownerDocument,"mousemove",l),B(i.scroller,"dragstart",s),B(i.scroller,"drop",o),Oo(e),setTimeout(function(){return i.input.focus()},20)}function Ol(e,t,n){if(n=="char")return new Er(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Er(m(t.line,0),oe(e.doc,m(t.line+1,0)));var r=n(e,t);return new Er(r.from,r.to)}function _s(e,t,n,r){var i=e.display,a=e.doc;et(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 Er(n,n)):(o=a.sel.primary(),l=a.sel.primIndex),r.unit=="rectangle")r.addNew||(o=new Er(n,n)),n=Mi(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,ni(e,u.concat([o]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&r.unit=="char"&&!r.extend?(Mn(a,ni(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=a.sel):go(a,l,o,Ve):(l=0,Mn(a,new Xn([o],0),Ve),s=a.sel);var c=n;function S(Ce){if(U(c,Ce)!=0)if(c=Ce,r.unit=="rectangle"){for(var Be=[],pt=e.options.tabSize,lt=se(X(a,n.line).text,n.ch,pt),Qt=se(X(a,Ce.line).text,Ce.ch,pt),Zr=Math.min(lt,Qt),pn=Math.max(lt,Qt),jr=Math.min(n.line,Ce.line),Kn=Math.min(e.lastLine(),Math.max(n.line,Ce.line));jr<=Kn;jr++){var kn=X(a,jr).text,an=Wt(kn,Zr,pt);Zr==pn?Be.push(new Er(m(jr,an),m(jr,an))):kn.length>an&&Be.push(new Er(m(jr,an),m(jr,Wt(kn,pn,pt))))}Be.length||Be.push(new Er(n,n)),Mn(a,ni(e,s.ranges.slice(0,l).concat(Be),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ce)}else{var Zn=o,Cn=Ol(e,Ce,r.unit),cn=Zn.anchor,on;U(Cn.anchor,cn)>0?(on=Cn.head,cn=$e(Zn.from(),Cn.anchor)):(on=Cn.anchor,cn=Ze(Zn.to(),Cn.head));var en=s.ranges.slice(0);en[l]=Gs(e,new Er(oe(a,cn),on)),Mn(a,ni(e,en,l),Ve)}}var y=i.wrapper.getBoundingClientRect(),R=0;function _(Ce){var Be=++R,pt=Mi(e,Ce,!0,r.unit=="rectangle");if(pt)if(U(pt,c)!=0){e.curOp.focus=E(),S(pt);var lt=Na(i,a);(pt.line>=lt.to||pt.line<lt.from)&&setTimeout(hn(e,function(){R==Be&&_(Ce)}),150)}else{var Qt=Ce.clientY<y.top?-20:Ce.clientY>y.bottom?20:0;Qt&&setTimeout(hn(e,function(){R==Be&&(i.scroller.scrollTop+=Qt,_(Ce))}),50)}}function ue(Ce){e.state.selectingText=!1,R=1/0,Ce&&(et(Ce),i.input.focus()),pe(i.wrapper.ownerDocument,"mousemove",Se),pe(i.wrapper.ownerDocument,"mouseup",Ie),a.history.lastSelOrigin=null}var Se=hn(e,function(Ce){Ce.buttons===0||!tt(Ce)?ue(Ce):_(Ce)}),Ie=hn(e,ue);e.state.selectingText=Ie,B(i.wrapper.ownerDocument,"mousemove",Se),B(i.wrapper.ownerDocument,"mouseup",Ie)}function Gs(e,t){var n=t.anchor,r=t.head,i=X(e.doc,n.line);if(U(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,_=y?"after":"before";return n.ch==R&&n.sticky==_?t:new Er(new m(n.line,R,_),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&&et(t);var o=e.display,l=o.lineDiv.getBoundingClientRect();if(a>l.bottom||!je(e,n))return yr(t);a-=l.top-o.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=o.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var f=Y(e.doc,a),c=e.display.gutterSpecs[s];return Te(e,n,e,f,c.className,t),yr(t)}}}function Co(e,t){return Il(e,t,"gutterClick",!0)}function Al(e,t){Jt(e.display,t)||Vs(e,t)||Me(e,t,"contextmenu")||xt||e.display.input.onContextMenu(t)}function Vs(e,t){return je(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-"),Ei(e)}var Xi={toString:function(){return"CodeMirror.Init"}},Zl={},_a={};function Xs(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){la(r),Ei(r),In(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--)Ui(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",Sn,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",Dt?"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",!gt),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){kl(r),oa(r)},!0),n("keyMap","default",function(r,i,a){var o=Ka(i),l=a!=Xi&&Ka(a);l&&l.detach&&l.detach(r,o),o.attach&&o.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,js,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=so(i,r.options.lineNumbers),oa(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 zi(r)},!0),n("scrollbarStyle","native",function(r){Wo(r),zi(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),oa(r)},!0),n("firstLineNumber",1,oa,!0),n("lineNumberFormatter",function(r){return r},oa,!0),n("showCursorWhenSelecting",!1,ea,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Fi(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,Ys),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ea,!0),n("singleCursorHeightPerLine",!0,ea,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,la,!0),n("addModeClass",!1,la,!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,la,!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 Ys(e,t,n){var r=n&&n!=Xi;if(!t!=!r){var i=e.display.dragFunctions,a=t?B:pe;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 js(e){e.options.lineWrapping?(A(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ee(e.display.wrapper,"CodeMirror-wrap"),_r(e)),qa(e),In(e),Ei(e),setTimeout(function(){return zi(e)},100)}function Xr(e,t){var n=this;if(!(this instanceof Xr))return new Xr(e,t);this.options=t=t?L(t):{},L(Zl,t,!1);var r=t.value;typeof r=="string"?r=new An(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Xr.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 Pe,keySeq:null,specialChars:null},t.autofocus&&!Dt&&a.input.focus(),T&&re<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Js(this),Rs(),Di(this),this.curOp.forceUpdate=!0,Yo(this,r),t.autofocus&&!Dt||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&to(n)},20):Fi(this);for(var o in _a)_a.hasOwnProperty(o)&&_a[o](this,t[o],Xi);Bo(this),t.finishInit&&t.finishInit(this);for(var l=0;l<wo.length;++l)wo[l](this);Pi(this),ae&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}Xr.defaults=Zl,Xr.optionHandlers=_a;function Js(e){var t=e.display;B(t.scroller,"mousedown",hn(e,Nl)),T&&re<11?B(t.scroller,"dblclick",hn(e,function(s){if(!Me(e,s)){var u=Mi(e,s);if(!(!u||Co(e,s)||Jt(e.display,s))){et(s);var f=e.findWordAt(u);Fa(e.doc,f.anchor,f.head)}}})):B(t.scroller,"dblclick",function(s){return Me(e,s)||et(s)}),B(t.scroller,"contextmenu",function(s){return Al(e,s)}),B(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||Al(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function o(s,u){if(u.left==null)return!0;var f=u.left-s.left,c=u.top-s.top;return f*f+c*c>20*20}B(t.scroller,"touchstart",function(s){if(!Me(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)}}),B(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),B(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!Jt(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 Er(f,f):!u.prev.prev||o(u,u.prev.prev)?c=e.findWordAt(f):c=new Er(m(f.line,0),oe(e.doc,m(f.line+1,0))),e.setSelection(c.anchor,c.head),e.focus(),et(s)}i()}),B(t.scroller,"touchcancel",i),B(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ra(e,t.scroller.scrollTop),Ri(e,t.scroller.scrollLeft,!0),Te(e,"scroll",e))}),B(t.scroller,"mousewheel",function(s){return _o(e,s)}),B(t.scroller,"DOMMouseScroll",function(s){return _o(e,s)}),B(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Me(e,s)||tr(s)},over:function(s){Me(e,s)||(Ls(e,s),tr(s))},start:function(s){return Ms(e,s)},drop:hn(e,Es),leave:function(s){Me(e,s)||yl(e)}};var l=t.input.getField();B(l,"keyup",function(s){return Dl.call(e,s)}),B(l,"keydown",hn(e,Tl)),B(l,"keypress",hn(e,Pl)),B(l,"focus",function(s){return to(e,s)}),B(l,"blur",function(s){return Fi(e,s)})}var wo=[];Xr.defineInitHook=function(e){return wo.push(e)};function Sa(e,t,n,r){var i=e.doc,a;n==null&&(n="add"),n=="smart"&&(i.mode.indent?a=It(e,t).state:n="prev");var o=e.options.tabSize,l=X(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==Ge||f>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?f=se(X(i,t-1).text,null,o):f=0:n=="add"?f=s+e.options.indentUnit:n=="subtract"?f=s-e.options.indentUnit:typeof n=="number"&&(f=s+n),f=Math.max(0,f);var c="",S=0;if(e.options.indentWithTabs)for(var y=Math.floor(f/o);y;--y)S+=o,c+=" ";if(S<f&&(c+=Lt(f-S)),c!=u)return Ui(i,c,m(t,0),m(t,u.length),"+input"),l.stateAfter=null,!0;for(var R=0;R<i.sel.ranges.length;R++){var _=i.sel.ranges[R];if(_.head.line==t&&_.head.ch<u.length){var ue=m(t,u.length);go(i,R,new Er(ue,ue));break}}}var ii=null;function Ga(e){ii=e}function xo(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||(r=a.sel);var o=+new Date-200,l=i=="paste"||e.state.pasteIncoming>o,s=Ot(t),u=null;if(l&&r.ranges.length>1)if(ii&&ii.text.join(`
|
|
`)==t){if(r.ranges.length%ii.text.length==0){u=[];for(var f=0;f<ii.text.length;f++)u.push(a.splitLines(ii.text[f]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(u=vr(s,function(Se){return[Se]}));for(var c=e.curOp.updateInput,S=r.ranges.length-1;S>=0;S--){var y=r.ranges[S],R=y.from(),_=y.to();y.empty()&&(n&&n>0?R=m(R.line,R.ch-n):e.state.overwrite&&!l?_=m(_.line,Math.min(X(a,_.line).text.length,_.ch+Ne(s).length)):l&&ii&&ii.lineWise&&ii.text.join(`
|
|
`)==s.join(`
|
|
`)&&(R=_=m(R.line,0)));var ue={from:R,to:_,text:u?u[S%u.length]:s,origin:i||(l?"paste":e.state.cutIncoming>o?"cut":"+input")};Ki(e.doc,ue),Tr(e,"inputRead",e,ue)}t&&!l&&Wl(e,t),Wi(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&&Bn(t,function(){return xo(t,n,0,null,"paste")}),!0}function Wl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var l=0;l<a.electricChars.length;l++)if(t.indexOf(a.electricChars.charAt(l))>-1){o=Sa(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(X(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Sa(e,i.head.line,"smart"));o&&Tr(e,"electricInput",e,i.head.line)}}}function zl(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:m(i,0),head:m(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function Hl(e,t,n,r){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Bl(){var e=j("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=j("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ae?e.style.width="1000px":e.setAttribute("wrap","off"),D&&(e.style.border="1px solid black"),Hl(e),t}function Qs(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(r,i){var a=this.options,o=a[r];a[r]==i&&r!="mode"||(a[r]=i,t.hasOwnProperty(r)&&hn(this,t[r])(this,i,o),Te(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Ka(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==r||i[a].name==r)return i.splice(a,1),!0},addOverlay:Tn(function(r,i){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");lr(this.state.overlays,{mode:a,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(o){return o.priority}),this.state.modeGen++,In(this)}),removeOverlay:Tn(function(r){for(var i=this.state.overlays,a=0;a<i.length;++a){var o=i[a].modeSpec;if(o==r||typeof r=="string"&&o.name==r){i.splice(a,1),this.state.modeGen++,In(this);return}}}),indentLine:Tn(function(r,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),te(this.doc,r)&&Sa(this,r,i,a)}),indentSelection:Tn(function(r){for(var i=this.doc.sel.ranges,a=-1,o=0;o<i.length;o++){var l=i[o];if(l.empty())l.head.line>a&&(Sa(this,l.head.line,r,!0),a=l.head.line,o==this.doc.sel.primIndex&&Wi(this));else{var s=l.from(),u=l.to(),f=Math.max(a,s.line);a=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var c=f;c<a;++c)Sa(this,c,r);var S=this.doc.sel.ranges;s.ch==0&&i.length==S.length&&S[o].from().ch>0&&go(this.doc,o,new Er(s,S[o].to()),xe)}}}),getTokenAt:function(r,i){return mr(this,r,i)},getLineTokens:function(r,i){return mr(this,m(r),i,!0)},getTokenTypeAt:function(r){r=oe(this.doc,r);var i=Tt(this,X(this.doc,r.line)),a=0,o=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var u=a+o>>1;if((u?i[u*2-1]:0)>=l)o=u;else if(i[u*2+1]<l)a=u+1;else{s=i[u*2+2];break}}var f=s?s.indexOf("overlay "):-1;return f<0?s:f==0?null:s.slice(0,f-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var a=[];if(!n.hasOwnProperty(i))return a;var o=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")o[l[i]]&&a.push(o[l[i]]);else if(l[i])for(var s=0;s<l[i].length;s++){var u=o[l[i][s]];u&&a.push(u)}else l.helperType&&o[l.helperType]?a.push(o[l.helperType]):o[l.name]&&a.push(o[l.name]);for(var f=0;f<o._global.length;f++){var c=o._global[f];c.pred(l,this)&&fe(a,c.val)==-1&&a.push(c.val)}return a},getStateAfter:function(r,i){var a=this.doc;return r=Le(a,r==null?a.first+a.size-1:r),It(this,r+1,i).state},cursorCoords:function(r,i){var a,o=this.doc.sel.primary();return r==null?a=o.head:typeof r=="object"?a=oe(this.doc,r):a=r?o.from():o.to(),Br(this,a,i||"page")},charCoords:function(r,i){return Bt(this,oe(this.doc,r),i||"page")},coordsChar:function(r,i){return r=dr(this,r,i||"page"),fn(this,r.left,r.top)},lineAtHeight:function(r,i){return r=dr(this,{top:r,left:0},i||"page").top,Y(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,a){var o=!1,l;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,o=!0),l=X(this.doc,r)}else l=r;return hi(this,l,{top:0,left:0},i||"page",a||o).top+(o?this.doc.height-Ur(l):0)},defaultTextHeight:function(){return ki(this.display)},defaultCharWidth:function(){return Zi(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=Br(this,oe(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&&Yl(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(pa.hasOwnProperty(r))return pa[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=oe(this.doc,r),u=0;u<i&&(s=Eo(this.doc,s,l,a,o),!s.hitSide);++u);return s},moveH:Tn(function(r,i){var a=this;this.extendSelectionsBy(function(o){return a.display.shift||a.doc.extend||o.empty()?Eo(a.doc,o.head,r,i,a.options.rtlMoveVisually):r<0?o.from():o.to()},Fe)}),deleteH:Tn(function(r,i){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):Vi(this,function(l){var s=Eo(o,l.head,r,i,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,i,a,o){var l=1,s=o;i<0&&(l=-1,i=-i);for(var u=oe(this.doc,r),f=0;f<i;++f){var c=Br(this,u,"div");if(s==null?s=c.left:c.left=s,u=Kl(this,c,l,a),u.hitSide)break}return u},moveV:Tn(function(r,i){var a=this,o=this.doc,l=[],s=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(f){if(s)return r<0?f.from():f.to();var c=Br(a,f.head,"div");f.goalColumn!=null&&(c.left=f.goalColumn),l.push(c.left);var S=Kl(a,c,r,i);return i=="page"&&f==o.sel.primary()&&no(a,Bt(a,S,"div").top-c.top),S},Fe),l.length)for(var u=0;u<o.sel.ranges.length;u++)o.sel.ranges[u].goalColumn=l[u]}),findWordAt:function(r){var i=this.doc,a=X(i,r.line).text,o=r.ch,l=r.ch;if(a){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==a.length)&&o?--o:++l;for(var u=a.charAt(o),f=x(u,s)?function(c){return x(c,s)}:/\s/.test(u)?function(c){return/\s/.test(c)}:function(c){return!/\s/.test(c)&&!x(c)};o>0&&f(a.charAt(o-1));)--o;for(;l<a.length&&f(a.charAt(l));)++l}return new Er(m(r.line,o),m(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?A(this.display.cursorDiv,"CodeMirror-overwrite"):ee(this.display.cursorDiv,"CodeMirror-overwrite"),Te(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==E()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Tn(function(r,i){ta(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Yr(this)-this.display.barHeight,width:r.scrollWidth-Yr(this)-this.display.barWidth,clientHeight:oi(this),clientWidth:Hn(this)}},scrollIntoView:Tn(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:m(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?jl(this,r):Ao(this,r.from,r.to,r.margin)}),setSize:Tn(function(r,i){var a=this,o=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=o(r)),i!=null&&(this.display.wrapper.style.height=o(i)),this.options.lineWrapping&&Ma(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){pi(a,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,Te(this,"refresh",this)}),operation:function(r){return Bn(this,r)},startOperation:function(){return Di(this)},endOperation:function(){return Pi(this)},refresh:Tn(function(){var r=this.display.cachedTextHeight;In(this),this.curOp.forceUpdate=!0,Ei(this),ta(this,this.doc.scrollLeft,this.doc.scrollTop),oo(this.display),(r==null||Math.abs(r-ki(this.display))>.5||this.options.lineWrapping)&&qa(this),Te(this,"refresh",this)}),swapDoc:Tn(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Yo(this,r),Ei(this),this.display.input.reset(),ta(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Tr(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=X(e,t.line),s=i&&e.direction=="rtl"?-n:n;function u(){var Ie=t.line+s;return Ie<e.first||Ie>=e.first+e.size?!1:(t=new m(Ie,t.ch,t.sticky),l=X(e,Ie))}function f(Ie){var Ce;if(r=="codepoint"){var Be=l.text.charCodeAt(t.ch+(r>0?0:-1));isNaN(Be)?Ce=null:Ce=new m(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(Be>=55296&&Be<56320?2:1))),-n)}else i?Ce=Os(e.cm,l,t,n):Ce=mo(l,t,n);if(Ce==null)if(!Ie&&u())t=yo(i,e.cm,l,t.line,s);else return!1;else t=Ce;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 _=l.text.charAt(t.ch)||`
|
|
`,ue=x(_,y)?"w":S&&_==`
|
|
`?"n":!S||/\s/.test(_)?null:"p";if(S&&!R&&!ue&&(ue="s"),c&&c!=ue){n<0&&(n=1,f(),t.sticky="after");break}if(ue&&(c=ue),n>0&&!f(!R))break}var Se=za(e,t,a,o,!0);return Ae(a,Se)&&(Se.hitSide=!0),Se}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*ki(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=fn(e,a,o),!!u.outside;){if(n<0?o<=0:o>=i.height){u.hitSide=!0;break}o+=n*5}return u}var Dr=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Pe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Dr.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}B(i,"paste",function(l){!a(l)||Me(r,l)||Fl(l,r)||re<=11&&setTimeout(hn(r,function(){return t.updateFromDOM()}),20)}),B(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),B(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),B(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),B(i,"touchstart",function(){return n.forceCompositionEnd()}),B(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(l){if(!(!a(l)||Me(r,l))){if(r.somethingSelected())Ga({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=zl(r);Ga({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,xe),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var u=ii.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=ii.text.join(`
|
|
`);var S=document.activeElement;W(c),setTimeout(function(){r.display.lineSpace.removeChild(f),S.focus(),S==i&&n.showPrimarySelection()},50)}}B(i,"copy",o),B(i,"cut",o)},Dr.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Dr.prototype.prepareSelection=function(){var e=Do(this.cm,!1);return e.focus=document.activeElement==this.div,e},Dr.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Dr.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Dr.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=Va(t,e.anchorNode,e.anchorOffset),o=Va(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&o&&!o.bad&&U($e(a,o),r)==0&&U(Ze(a,o),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&Ul(t,r)||{node:l[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Ul(t,i);if(!u){var f=l[l.length-1].measure,c=f.maps?f.maps[f.maps.length-1]:f.map;u={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}if(!s||!u){e.removeAllRanges();return}var S=e.rangeCount&&e.getRangeAt(0),y;try{y=Nt(s.node,s.offset,u.offset,u.node)}catch(R){}y&&(!H&&t.state.focused?(e.collapse(s.node,s.offset),y.collapsed||(e.removeAllRanges(),e.addRange(y))):(e.removeAllRanges(),e.addRange(y)),S&&e.anchorNode==null?e.addRange(S):H&&this.startGracePeriod()),this.rememberSelection()}},Dr.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Dr.prototype.showMultipleSelections=function(e){_e(this.cm.display.cursorDiv,e.cursors),_e(this.cm.display.selectionDiv,e.selection)},Dr.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Dr.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return N(this.div,t)},Dr.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Dr.prototype.blur=function(){this.div.blur()},Dr.prototype.getField=function(){return this.div},Dr.prototype.supportsTouch=function(){return!0},Dr.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Bn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Dr.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Dr.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(St&&$&&this.cm.display.gutterSpecs.length&&$s(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=Va(t,e.anchorNode,e.anchorOffset),r=Va(t,e.focusNode,e.focusOffset);n&&r&&Bn(t,function(){Mn(t.doc,yi(n,r),xe),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Dr.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=m(r.line-1,X(e.doc,r.line-1).length)),i.ch==X(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=m(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,l;r.line==t.viewFrom||(a=Li(e,r.line))==0?(o=w(t.view[0].line),l=t.view[0].node):(o=w(t.view[a].line),l=t.view[a-1].node.nextSibling);var s=Li(e,i.line),u,f;if(s==t.view.length-1?(u=t.viewTo-1,f=t.lineDiv.lastChild):(u=w(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=v(e.doc,m(o,0),m(u,X(e.doc,u).text.length));c.length>1&&S.length>1;)if(Ne(c)==Ne(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,_=c[0],ue=S[0],Se=Math.min(_.length,ue.length);y<Se&&_.charCodeAt(y)==ue.charCodeAt(y);)++y;for(var Ie=Ne(c),Ce=Ne(S),Be=Math.min(Ie.length-(c.length==1?y:0),Ce.length-(S.length==1?y:0));R<Be&&Ie.charCodeAt(Ie.length-R-1)==Ce.charCodeAt(Ce.length-R-1);)++R;if(c.length==1&&S.length==1&&o==r.line)for(;y&&y>r.ch&&Ie.charCodeAt(Ie.length-R-1)==Ce.charCodeAt(Ce.length-R-1);)y--,R++;c[c.length-1]=Ie.slice(0,Ie.length-R).replace(/^\u200b+/,""),c[0]=c[0].slice(y).replace(/\u200b+$/,"");var pt=m(o,y),lt=m(u,S.length?Ne(S).length-R:0);if(c.length>1||c[0]||U(pt,lt))return Ui(e.doc,c,pt,lt,"+input"),!0},Dr.prototype.ensurePolled=function(){this.forceCompositionEnd()},Dr.prototype.reset=function(){this.forceCompositionEnd()},Dr.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Dr.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))},Dr.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Bn(this.cm,function(){return In(e.cm)})},Dr.prototype.setUneditable=function(e){e.contentEditable="false"},Dr.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||hn(this.cm,xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Dr.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Dr.prototype.onContextMenu=function(){},Dr.prototype.resetPosition=function(){},Dr.prototype.needsContentAttribute=!0;function Ul(e,t){var n=Qi(e,t.line);if(!n||n.hidden)return null;var r=X(e.doc,t.line),i=ui(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=wa(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 _=y.getAttribute("cm-marker"),ue;if(_){var Se=e.findMarks(m(r,0),m(i+1,0),u(+_));Se.length&&(ue=Se[0].find(0))&&c(v(e.doc,ue.from,ue.to).join(l));return}if(y.getAttribute("contenteditable")=="false")return;var Ie=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;Ie&&f();for(var Ce=0;Ce<y.childNodes.length;Ce++)S(y.childNodes[Ce]);/^(pre|p)$/i.test(y.nodeName)&&(s=!0),Ie&&(o=!0)}else y.nodeType==3&&c(y.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;S(t),t!=n;)t=t.nextSibling,s=!1;return a}function Va(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return Yi(e.clipPos(m(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return eu(a,t,n)}}function eu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!N(r,t))return Yi(m(w(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?Ne(e.rest):e.line;return Yi(m(w(a),a.text.length),i)}var o=t.nodeType==3?t:null,l=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&(n=o.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,u=s.maps;function f(ue,Se,Ie){for(var Ce=-1;Ce<(u?u.length:0);Ce++)for(var Be=Ce<0?s.map:u[Ce],pt=0;pt<Be.length;pt+=3){var lt=Be[pt+2];if(lt==ue||lt==Se){var Qt=w(Ce<0?e.line:e.rest[Ce]),Zr=Be[pt]+Ie;return(Ie<0||lt!=ue)&&(Zr=Be[pt+(Ie?1:0)]),m(Qt,Zr)}}}var c=f(o,l,n);if(c)return Yi(c,i);for(var S=l.nextSibling,y=o?o.nodeValue.length-n:0;S;S=S.nextSibling){if(c=f(S,S.firstChild,0),c)return Yi(m(c.line,c.ch-y),i);y+=S.textContent.length}for(var R=l.previousSibling,_=n;R;R=R.previousSibling){if(c=f(R,R.firstChild,-1),c)return Yi(m(c.line,c.ch+_),i);_+=R.textContent.length}}var rn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Pe,this.hasSelection=!1,this.composing=null};rn.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),D&&(i.style.width="0px"),B(i,"input",function(){T&&re>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),B(i,"paste",function(o){Me(r,o)||Fl(o,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(o){if(!Me(r,o)){if(r.somethingSelected())Ga({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=zl(r);Ga({lineWise:!0,text:l.text}),o.type=="cut"?r.setSelections(l.ranges,null,xe):(n.prevInput="",i.value=l.text.join(`
|
|
`),W(i))}else return;o.type=="cut"&&(r.state.cutIncoming=+new Date)}}B(i,"cut",a),B(i,"copy",a),B(e.scroller,"paste",function(o){if(!(Jt(e,o)||Me(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)}}),B(e.lineSpace,"selectstart",function(o){Jt(e,o)||et(o)}),B(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"})}}),B(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},rn.prototype.createField=function(e){this.wrapper=Bl(),this.textarea=this.wrapper.firstChild},rn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},rn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Do(e);if(e.options.moveInputWithCursor){var i=Br(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},rn.prototype.showSelection=function(e){var t=this.cm,n=t.display;_e(n.cursorDiv,e.cursors),_e(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},rn.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),T&&re>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",T&&re>=9&&(this.hasSelection=null))}},rn.prototype.getField=function(){return this.textarea},rn.prototype.supportsTouch=function(){return!1},rn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Dt||E()!=this.textarea))try{this.textarea.focus()}catch(e){}},rn.prototype.blur=function(){this.textarea.blur()},rn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},rn.prototype.receivedFocus=function(){this.slowPoll()},rn.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},rn.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)},rn.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||rr(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(T&&re>=9&&this.hasSelection===i||ht&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(r.length,i.length);o<l&&r.charCodeAt(o)==i.charCodeAt(o);)++o;return Bn(t,function(){xo(t,i.slice(o),r.length-o,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},rn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},rn.prototype.onKeyPress=function(){T&&re>=9&&(this.hasSelection=null),this.fastPoll()},rn.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Mi(n,e),o=r.scroller.scrollTop;if(!a||h)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(a)==-1&&hn(n,Mn)(n.doc,yi(a),xe);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: `+(T?"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 _=n.somethingSelected(),ue="\u200B"+(_?i.value:"");i.value="\u21DA",i.value=ue,t.prevInput=_?"":"\u200B",i.selectionStart=1,i.selectionEnd=ue.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,T&&re<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=o),i.selectionStart!=null)){(!T||T&&re<9)&&S();var _=0,ue=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?hn(n,ll)(n):_++<10?r.detectingSelectAll=setTimeout(ue,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(ue,200)}}if(T&&re>=9&&S(),xt){tr(e);var R=function(){pe(window,"mouseup",R),setTimeout(y,20)};B(window,"mouseup",R)}else setTimeout(y,50)},rn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},rn.prototype.setUneditable=function(){},rn.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=E();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(B(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&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=Xr(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function ru(e){e.off=pe,e.on=B,e.wheelEventPixels=us,e.Doc=An,e.splitLines=Ot,e.countColumn=se,e.findColumn=Wt,e.isWordChar=p,e.Pass=Ge,e.signal=Te,e.Line=Hr,e.changeEnd=bi,e.scrollbarModel=Fo,e.Pos=m,e.cmpPos=U,e.modes=sr,e.mimeModes=kt,e.resolveMode=Wr,e.getMode=nr,e.modeExtensions=ar,e.extendMode=ur,e.copyState=Yt,e.startState=pr,e.innerMode=Ut,e.commands=pa,e.keyMap=ci,e.keyName=xl,e.isModifierKey=Cl,e.lookupKey=Gi,e.normalizeKeyMap=Ns,e.StringStream=Zt,e.SharedTextMarker=va,e.TextMarker=Ci,e.LineWidget=da,e.e_preventDefault=et,e.e_stopPropagation=cr,e.e_stop=tr,e.addClass=A,e.contains=N,e.rmClass=ee,e.keyNames=wi}Xs(Xr),Qs(Xr);var nu="iter insert remove copy getEditor constructor".split(" ");for(var Xa in An.prototype)An.prototype.hasOwnProperty(Xa)&&fe(nu,Xa)<0&&(Xr.prototype[Xa]=function(e){return function(){return e.apply(this.doc,arguments)}}(An.prototype[Xa]));return be(An),Xr.inputStyles={textarea:rn,contenteditable:Dr},Xr.defineMode=function(e){!Xr.defaults.mode&&e!="null"&&(Xr.defaults.mode=e),Or.apply(this,arguments)},Xr.defineMIME=dn,Xr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Xr.defineMIME("text/plain","null"),Xr.defineExtension=function(e,t){Xr.prototype[e]=t},Xr.defineDocExtension=function(e,t){An.prototype[e]=t},Xr.fromTextArea=tu,ru(Xr),Xr.version="5.58.2",Xr})},66003:function(yn,vt,b){"use strict";b.d(vt,{Z:function(){return ae}});var H=b(74416),Q=b(77321),K=b(62853),we=b(59301),T=["show"];function re(Je,$){if(!$.max)return!0;var h=$.strategy(Je);return h<=$.max}function ae(Je,$){return we.useMemo(function(){var h={};$&&(h.show=(0,K.Z)($)==="object"&&$.formatter?$.formatter:!!$),h=(0,Q.Z)((0,Q.Z)({},h),Je);var We=h,M=We.show,De=(0,H.Z)(We,T);return(0,Q.Z)((0,Q.Z)({},De),{},{show:!!M,showFormatter:typeof M=="function"?M:void 0,strategy:De.strategy||function(D){return D.length}})},[Je,$])}},36901:function(yn,vt,b){"use strict";b.r(vt),b.d(vt,{BaseInput:function(){return h},default:function(){return he}});var H=b(77321),Q=b(72308),K=b(49618),we=b(62853),T=b(92310),re=b.n(T),ae=b(59301),Je=b(30292),$=ae.forwardRef(function(F,xt){var ze,ee,Et,_e=F.inputElement,j=F.children,ft=F.prefixCls,Nt=F.prefix,N=F.suffix,E=F.addonBefore,A=F.addonAfter,J=F.className,W=F.style,Oe=F.disabled,L=F.readOnly,se=F.focused,Pe=F.triggerFocus,fe=F.allowClear,Ye=F.value,Ge=F.handleReset,xe=F.hidden,Ve=F.classes,Fe=F.classNames,Wt=F.dataAttrs,Rt=F.styles,Lt=F.components,Ne=F.onClear,vr=j!=null?j:_e,lr=(Lt==null?void 0:Lt.affixWrapper)||"span",P=(Lt==null?void 0:Lt.groupWrapper)||"span",g=(Lt==null?void 0:Lt.wrapper)||"span",C=(Lt==null?void 0:Lt.groupAddon)||"span",p=(0,ae.useRef)(null),x=function(mt){var je;(je=p.current)!==null&&je!==void 0&&je.contains(mt.target)&&(Pe==null||Pe())},O=(0,Je.X3)(F),I=(0,ae.cloneElement)(vr,{value:Ye,className:re()((ze=vr.props)===null||ze===void 0?void 0:ze.className,!O&&(Fe==null?void 0:Fe.variant))||null}),z=(0,ae.useRef)(null);if(ae.useImperativeHandle(xt,function(){return{nativeElement:z.current||p.current}}),O){var le=null;if(fe){var q=!Oe&&!L&&Ye,de="".concat(ft,"-clear-icon"),ie=(0,we.Z)(fe)==="object"&&fe!==null&&fe!==void 0&&fe.clearIcon?fe.clearIcon:"\u2716";le=ae.createElement("button",{type:"button",tabIndex:-1,onClick:function(mt){Ge==null||Ge(mt),Ne==null||Ne()},onMouseDown:function(mt){return mt.preventDefault()},className:re()(de,(0,K.Z)((0,K.Z)({},"".concat(de,"-hidden"),!q),"".concat(de,"-has-suffix"),!!N))},ie)}var ne="".concat(ft,"-affix-wrapper"),ge=re()(ne,(0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)({},"".concat(ft,"-disabled"),Oe),"".concat(ne,"-disabled"),Oe),"".concat(ne,"-focused"),se),"".concat(ne,"-readonly"),L),"".concat(ne,"-input-with-clear-btn"),N&&fe&&Ye),Ve==null?void 0:Ve.affixWrapper,Fe==null?void 0:Fe.affixWrapper,Fe==null?void 0:Fe.variant),k=(N||fe)&&ae.createElement("span",{className:re()("".concat(ft,"-suffix"),Fe==null?void 0:Fe.suffix),style:Rt==null?void 0:Rt.suffix},le,N);I=ae.createElement(lr,(0,Q.Z)({className:ge,style:Rt==null?void 0:Rt.affixWrapper,onClick:x},Wt==null?void 0:Wt.affixWrapper,{ref:p}),Nt&&ae.createElement("span",{className:re()("".concat(ft,"-prefix"),Fe==null?void 0:Fe.prefix),style:Rt==null?void 0:Rt.prefix},Nt),I,k)}if((0,Je.He)(F)){var ce="".concat(ft,"-group"),B="".concat(ce,"-addon"),Ke="".concat(ce,"-wrapper"),pe=re()("".concat(ft,"-wrapper"),ce,Ve==null?void 0:Ve.wrapper,Fe==null?void 0:Fe.wrapper),Te=re()(Ke,(0,K.Z)({},"".concat(Ke,"-disabled"),Oe),Ve==null?void 0:Ve.group,Fe==null?void 0:Fe.groupWrapper);I=ae.createElement(P,{className:Te,ref:z},ae.createElement(g,{className:pe},E&&ae.createElement(C,{className:B},E),I,A&&ae.createElement(C,{className:B},A)))}return ae.cloneElement(I,{className:re()((ee=I.props)===null||ee===void 0?void 0:ee.className,J)||null,style:(0,H.Z)((0,H.Z)({},(Et=I.props)===null||Et===void 0?void 0:Et.style),W),hidden:xe})}),h=$,We=b(80702),M=b(52487),De=b(74416),D=b(18929),St=b(2738),Dt=b(66003),ht=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],Pt=(0,ae.forwardRef)(function(F,xt){var ze=F.autoComplete,ee=F.onChange,Et=F.onFocus,_e=F.onBlur,j=F.onPressEnter,ft=F.onKeyDown,Nt=F.onKeyUp,N=F.prefixCls,E=N===void 0?"rc-input":N,A=F.disabled,J=F.htmlSize,W=F.className,Oe=F.maxLength,L=F.suffix,se=F.showCount,Pe=F.count,fe=F.type,Ye=fe===void 0?"text":fe,Ge=F.classes,xe=F.classNames,Ve=F.styles,Fe=F.onCompositionStart,Wt=F.onCompositionEnd,Rt=(0,De.Z)(F,ht),Lt=(0,ae.useState)(!1),Ne=(0,M.Z)(Lt,2),vr=Ne[0],lr=Ne[1],P=(0,ae.useRef)(!1),g=(0,ae.useRef)(!1),C=(0,ae.useRef)(null),p=(0,ae.useRef)(null),x=function(ut){C.current&&(0,Je.nH)(C.current,ut)},O=(0,D.Z)(F.defaultValue,{value:F.value}),I=(0,M.Z)(O,2),z=I[0],le=I[1],q=z==null?"":String(z),de=(0,ae.useState)(null),ie=(0,M.Z)(de,2),ne=ie[0],ge=ie[1],k=(0,Dt.Z)(Pe,se),ce=k.max||Oe,B=k.strategy(q),Ke=!!ce&&B>ce;(0,ae.useImperativeHandle)(xt,function(){var tt;return{focus:x,blur:function(){var zt;(zt=C.current)===null||zt===void 0||zt.blur()},setSelectionRange:function(zt,Gt,Xt){var $t;($t=C.current)===null||$t===void 0||$t.setSelectionRange(zt,Gt,Xt)},select:function(){var zt;(zt=C.current)===null||zt===void 0||zt.select()},input:C.current,nativeElement:((tt=p.current)===null||tt===void 0?void 0:tt.nativeElement)||C.current}}),(0,ae.useEffect)(function(){g.current&&(g.current=!1),lr(function(tt){return tt&&A?!1:tt})},[A]);var pe=function(ut,zt,Gt){var Xt=zt;if(!P.current&&k.exceedFormatter&&k.max&&k.strategy(zt)>k.max){if(Xt=k.exceedFormatter(zt,{max:k.max}),zt!==Xt){var $t,Ot;ge([(($t=C.current)===null||$t===void 0?void 0:$t.selectionStart)||0,((Ot=C.current)===null||Ot===void 0?void 0:Ot.selectionEnd)||0])}}else if(Gt.source==="compositionEnd")return;le(Xt),C.current&&(0,Je.rJ)(C.current,ut,ee,Xt)};(0,ae.useEffect)(function(){if(ne){var tt;(tt=C.current)===null||tt===void 0||tt.setSelectionRange.apply(tt,(0,We.Z)(ne))}},[ne]);var Te=function(ut){pe(ut,ut.target.value,{source:"change"})},Me=function(ut){P.current=!1,pe(ut,ut.currentTarget.value,{source:"compositionEnd"}),Wt==null||Wt(ut)},mt=function(ut){j&&ut.key==="Enter"&&!g.current&&(g.current=!0,j(ut)),ft==null||ft(ut)},je=function(ut){ut.key==="Enter"&&(g.current=!1),Nt==null||Nt(ut)},be=function(ut){lr(!0),Et==null||Et(ut)},et=function(ut){g.current&&(g.current=!1),lr(!1),_e==null||_e(ut)},cr=function(ut){le(""),x(),C.current&&(0,Je.rJ)(C.current,ut,ee)},yr=Ke&&"".concat(E,"-out-of-range"),tr=function(){var ut=(0,St.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:ze},ut,{onChange:Te,onFocus:be,onBlur:et,onKeyDown:mt,onKeyUp:je,className:re()(E,(0,K.Z)({},"".concat(E,"-disabled"),A),xe==null?void 0:xe.input),style:Ve==null?void 0:Ve.input,ref:C,size:J,type:Ye,onCompositionStart:function(Gt){P.current=!0,Fe==null||Fe(Gt)},onCompositionEnd:Me}))},Cr=function(){var ut=Number(ce)>0;if(L||k.show){var zt=k.showFormatter?k.showFormatter({value:q,count:B,maxLength:ce}):"".concat(B).concat(ut?" / ".concat(ce):"");return ae.createElement(ae.Fragment,null,k.show&&ae.createElement("span",{className:re()("".concat(E,"-show-count-suffix"),(0,K.Z)({},"".concat(E,"-show-count-has-suffix"),!!L),xe==null?void 0:xe.count),style:(0,H.Z)({},Ve==null?void 0:Ve.count)},zt),L)}return null};return ae.createElement(h,(0,Q.Z)({},Rt,{prefixCls:E,className:re()(W,yr),handleReset:cr,value:q,focused:vr,triggerFocus:x,suffix:Cr(),disabled:A,classes:Ge,classNames:xe,styles:Ve}),tr())}),gt=Pt,he=gt},30292:function(yn,vt,b){"use strict";b.d(vt,{He:function(){return H},X3:function(){return Q},nH:function(){return T},rJ:function(){return we}});function H(re){return!!(re.addonBefore||re.addonAfter)}function Q(re){return!!(re.prefix||re.suffix||re.allowClear)}function K(re,ae,Je){var $=ae.cloneNode(!0),h=Object.create(re,{target:{value:$},currentTarget:{value:$}});return $.value=Je,typeof ae.selectionStart=="number"&&typeof ae.selectionEnd=="number"&&($.selectionStart=ae.selectionStart,$.selectionEnd=ae.selectionEnd),$.setSelectionRange=function(){ae.setSelectionRange.apply(ae,arguments)},h}function we(re,ae,Je,$){if(Je){var h=ae;if(ae.type==="click"){h=K(ae,re,""),Je(h);return}if(re.type!=="file"&&$!==void 0){h=K(ae,re,$),Je(h);return}Je(h)}}function T(re,ae){if(re){re.focus(ae);var Je=ae||{},$=Je.cursor;if($){var h=re.value.length;switch($){case"start":re.setSelectionRange(0,0);break;case"end":re.setSelectionRange(h,h);break;default:re.setSelectionRange(0,h)}}}}},11780:function(yn,vt,b){"use strict";b.d(vt,{Z:function(){return Oe}});var H=b(72308),Q=b(77321),K=b(52487),we=b(74416),T=b(59301),re=b(92310),ae=b.n(re),Je=b(29301),$=b(34280),h=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],We=void 0;function M(L,se){var Pe=L.prefixCls,fe=L.invalidate,Ye=L.item,Ge=L.renderItem,xe=L.responsive,Ve=L.responsiveDisabled,Fe=L.registerSize,Wt=L.itemKey,Rt=L.className,Lt=L.style,Ne=L.children,vr=L.display,lr=L.order,P=L.component,g=P===void 0?"div":P,C=(0,we.Z)(L,h),p=xe&&!vr;function x(q){Fe(Wt,q)}T.useEffect(function(){return function(){x(null)}},[]);var O=Ge&&Ye!==We?Ge(Ye,{index:lr}):Ne,I;fe||(I={opacity:p?0:1,height:p?0:We,overflowY:p?"hidden":We,order:xe?lr:We,pointerEvents:p?"none":We,position:p?"absolute":We});var z={};p&&(z["aria-hidden"]=!0);var le=T.createElement(g,(0,H.Z)({className:ae()(!fe&&Pe,Rt),style:(0,Q.Z)((0,Q.Z)({},I),Lt)},z,C,{ref:se}),O);return xe&&(le=T.createElement(Je.Z,{onResize:function(de){var ie=de.offsetWidth;x(ie)},disabled:Ve},le)),le}var De=T.forwardRef(M);De.displayName="Item";var D=De,St=b(6089),Dt=b(4676),ht=b(16089);function Pt(L){if(typeof MessageChannel=="undefined")(0,ht.Z)(L);else{var se=new MessageChannel;se.port1.onmessage=function(){return L()},se.port2.postMessage(void 0)}}function gt(){var L=T.useRef(null),se=function(fe){L.current||(L.current=[],Pt(function(){(0,Dt.unstable_batchedUpdates)(function(){L.current.forEach(function(Ye){Ye()}),L.current=null})})),L.current.push(fe)};return se}function he(L,se){var Pe=T.useState(se),fe=(0,K.Z)(Pe,2),Ye=fe[0],Ge=fe[1],xe=(0,St.Z)(function(Ve){L(function(){Ge(Ve)})});return[Ye,xe]}var F=T.createContext(null),xt=["component"],ze=["className"],ee=["className"],Et=function(se,Pe){var fe=T.useContext(F);if(!fe){var Ye=se.component,Ge=Ye===void 0?"div":Ye,xe=(0,we.Z)(se,xt);return T.createElement(Ge,(0,H.Z)({},xe,{ref:Pe}))}var Ve=fe.className,Fe=(0,we.Z)(fe,ze),Wt=se.className,Rt=(0,we.Z)(se,ee);return T.createElement(F.Provider,{value:null},T.createElement(D,(0,H.Z)({ref:Pe,className:ae()(Ve,Wt)},Fe,Rt)))},_e=T.forwardRef(Et);_e.displayName="RawItem";var j=_e,ft=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Nt="responsive",N="invalidate";function E(L){return"+ ".concat(L.length," ...")}function A(L,se){var Pe=L.prefixCls,fe=Pe===void 0?"rc-overflow":Pe,Ye=L.data,Ge=Ye===void 0?[]:Ye,xe=L.renderItem,Ve=L.renderRawItem,Fe=L.itemKey,Wt=L.itemWidth,Rt=Wt===void 0?10:Wt,Lt=L.ssr,Ne=L.style,vr=L.className,lr=L.maxCount,P=L.renderRest,g=L.renderRawRest,C=L.suffix,p=L.component,x=p===void 0?"div":p,O=L.itemComponent,I=L.onVisibleChange,z=(0,we.Z)(L,ft),le=Lt==="full",q=gt(),de=he(q,null),ie=(0,K.Z)(de,2),ne=ie[0],ge=ie[1],k=ne||0,ce=he(q,new Map),B=(0,K.Z)(ce,2),Ke=B[0],pe=B[1],Te=he(q,0),Me=(0,K.Z)(Te,2),mt=Me[0],je=Me[1],be=he(q,0),et=(0,K.Z)(be,2),cr=et[0],yr=et[1],tr=he(q,0),Cr=(0,K.Z)(tr,2),tt=Cr[0],ut=Cr[1],zt=(0,T.useState)(null),Gt=(0,K.Z)(zt,2),Xt=Gt[0],$t=Gt[1],Ot=(0,T.useState)(null),rr=(0,K.Z)(Ot,2),yt=rr[0],Fr=rr[1],Kt=T.useMemo(function(){return yt===null&&le?Number.MAX_SAFE_INTEGER:yt||0},[yt,ne]),sr=(0,T.useState)(!1),kt=(0,K.Z)(sr,2),Or=kt[0],dn=kt[1],Wr="".concat(fe,"-item"),nr=Math.max(mt,cr),ar=lr===Nt,ur=Ge.length&&ar,Yt=lr===N,Ut=ur||typeof lr=="number"&&Ge.length>lr,pr=(0,T.useMemo)(function(){var me=Ge;return ur?ne===null&&le?me=Ge:me=Ge.slice(0,Math.min(Ge.length,k/Rt)):typeof lr=="number"&&(me=Ge.slice(0,lr)),me},[Ge,Rt,ne,lr,ur]),Zt=(0,T.useMemo)(function(){return ur?Ge.slice(Kt+1):Ge.slice(pr.length)},[Ge,pr,ur,Kt]),X=(0,T.useCallback)(function(me,ve){var He;return typeof Fe=="function"?Fe(me):(He=Fe&&(me==null?void 0:me[Fe]))!==null&&He!==void 0?He:ve},[Fe]),v=(0,T.useCallback)(xe||function(me){return me},[xe]);function d(me,ve,He){yt===me&&(ve===void 0||ve===Xt)||(Fr(me),He||(dn(me<Ge.length-1),I==null||I(me)),ve!==void 0&&$t(ve))}function Z(me,ve){ge(ve.clientWidth)}function w(me,ve){pe(function(He){var Xe=new Map(He);return ve===null?Xe.delete(me):Xe.set(me,ve),Xe})}function Y(me,ve){yr(ve),je(cr)}function te(me,ve){ut(ve)}function ye(me){return Ke.get(X(pr[me],me))}(0,$.Z)(function(){if(k&&typeof nr=="number"&&pr){var me=tt,ve=pr.length,He=ve-1;if(!ve){d(0,null);return}for(var Xe=0;Xe<ve;Xe+=1){var qt=ye(Xe);if(le&&(qt=qt||0),qt===void 0){d(Xe-1,void 0,!0);break}if(me+=qt,He===0&&me<=k||Xe===He-1&&me+ye(He)<=k){d(He,null);break}else if(me+nr>k){d(Xe-1,me-qt-tt+cr);break}}C&&ye(0)+tt>k&&$t(null)}},[k,Ke,cr,tt,X,pr]);var m=Or&&!!Zt.length,U={};Xt!==null&&ur&&(U={position:"absolute",left:Xt,top:0});var Ae={prefixCls:Wr,responsive:ur,component:O,invalidate:Yt},Ee=Ve?function(me,ve){var He=X(me,ve);return T.createElement(F.Provider,{key:He,value:(0,Q.Z)((0,Q.Z)({},Ae),{},{order:ve,item:me,itemKey:He,registerSize:w,display:ve<=Kt})},Ve(me,ve))}:function(me,ve){var He=X(me,ve);return T.createElement(D,(0,H.Z)({},Ae,{order:ve,key:He,item:me,renderItem:v,itemKey:He,registerSize:w,display:ve<=Kt}))},Ze={order:m?Kt:Number.MAX_SAFE_INTEGER,className:"".concat(Wr,"-rest"),registerSize:Y,display:m},$e=P||E,Le=g?T.createElement(F.Provider,{value:(0,Q.Z)((0,Q.Z)({},Ae),Ze)},g(Zt)):T.createElement(D,(0,H.Z)({},Ae,Ze),typeof $e=="function"?$e(Zt):$e),oe=T.createElement(x,(0,H.Z)({className:ae()(!Yt&&fe,vr),style:Ne,ref:se},z),pr.map(Ee),Ut?Le:null,C&&T.createElement(D,(0,H.Z)({},Ae,{responsive:ar,responsiveDisabled:!ur,order:Kt,className:"".concat(Wr,"-suffix"),registerSize:te,display:!0,style:U}),C));return ar?T.createElement(Je.Z,{onResize:Z,disabled:!ur},oe):oe}var J=T.forwardRef(A);J.displayName="Overflow",J.Item=j,J.RESPONSIVE=Nt,J.INVALIDATE=N;var W=J,Oe=W},29301:function(yn,vt,b){"use strict";b.d(vt,{Z:function(){return N}});var H=b(72308),Q=b(59301),K=b(11592),we=b(48736),T=b(77321),re=b(62853),ae=b(76846),Je=b(8654),$=Q.createContext(null);function h(E){var A=E.children,J=E.onBatchResize,W=Q.useRef(0),Oe=Q.useRef([]),L=Q.useContext($),se=Q.useCallback(function(Pe,fe,Ye){W.current+=1;var Ge=W.current;Oe.current.push({size:Pe,element:fe,data:Ye}),Promise.resolve().then(function(){Ge===W.current&&(J==null||J(Oe.current),Oe.current=[])}),L==null||L(Pe,fe,Ye)},[J,L]);return Q.createElement($.Provider,{value:se},A)}var We=b(76374),M=new Map;function De(E){E.forEach(function(A){var J,W=A.target;(J=M.get(W))===null||J===void 0||J.forEach(function(Oe){return Oe(W)})})}var D=new We.Z(De),St=null,Dt=null;function ht(E,A){M.has(E)||(M.set(E,new Set),D.observe(E)),M.get(E).add(A)}function Pt(E,A){M.has(E)&&(M.get(E).delete(A),M.get(E).size||(D.unobserve(E),M.delete(E)))}var gt=b(96949),he=b(55090),F=b(77205),xt=b(38793),ze=function(E){(0,F.Z)(J,E);var A=(0,xt.Z)(J);function J(){return(0,gt.Z)(this,J),A.apply(this,arguments)}return(0,he.Z)(J,[{key:"render",value:function(){return this.props.children}}]),J}(Q.Component);function ee(E,A){var J=E.children,W=E.disabled,Oe=Q.useRef(null),L=Q.useRef(null),se=Q.useContext($),Pe=typeof J=="function",fe=Pe?J(Oe):J,Ye=Q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Ge=!Pe&&Q.isValidElement(fe)&&(0,Je.Yr)(fe),xe=Ge?(0,Je.C4)(fe):null,Ve=(0,Je.x1)(xe,Oe),Fe=function(){var Ne;return(0,ae.ZP)(Oe.current)||(Oe.current&&(0,re.Z)(Oe.current)==="object"?(0,ae.ZP)((Ne=Oe.current)===null||Ne===void 0?void 0:Ne.nativeElement):null)||(0,ae.ZP)(L.current)};Q.useImperativeHandle(A,function(){return Fe()});var Wt=Q.useRef(E);Wt.current=E;var Rt=Q.useCallback(function(Lt){var Ne=Wt.current,vr=Ne.onResize,lr=Ne.data,P=Lt.getBoundingClientRect(),g=P.width,C=P.height,p=Lt.offsetWidth,x=Lt.offsetHeight,O=Math.floor(g),I=Math.floor(C);if(Ye.current.width!==O||Ye.current.height!==I||Ye.current.offsetWidth!==p||Ye.current.offsetHeight!==x){var z={width:O,height:I,offsetWidth:p,offsetHeight:x};Ye.current=z;var le=p===Math.round(g)?g:p,q=x===Math.round(C)?C:x,de=(0,T.Z)((0,T.Z)({},z),{},{offsetWidth:le,offsetHeight:q});se==null||se(de,Lt,lr),vr&&Promise.resolve().then(function(){vr(de,Lt)})}},[]);return Q.useEffect(function(){var Lt=Fe();return Lt&&!W&&ht(Lt,Rt),function(){return Pt(Lt,Rt)}},[Oe.current,W]),Q.createElement(ze,{ref:L},Ge?Q.cloneElement(fe,{ref:Ve}):fe)}var Et=Q.forwardRef(ee),_e=Et,j="rc-observer-key";function ft(E,A){var J=E.children,W=typeof J=="function"?[J]:(0,K.Z)(J);return W.map(function(Oe,L){var se=(Oe==null?void 0:Oe.key)||"".concat(j,"-").concat(L);return Q.createElement(_e,(0,H.Z)({},E,{key:se,ref:L===0?A:void 0}),Oe)})}var Nt=Q.forwardRef(ft);Nt.Collection=h;var N=Nt},69582:function(yn,vt,b){"use strict";b.d(vt,{ZP:function(){return ae}});var H=b(52487),Q=b(59301),K=b(47273),we=0,T=(0,K.Z)();function re(){var Je;return T?(Je=we,we+=1):Je="TEST_OR_SSR",Je}function ae(Je){var $=Q.useState(),h=(0,H.Z)($,2),We=h[0],M=h[1];return Q.useEffect(function(){M("rc_select_".concat(re()))},[]),Je||We}},45560:function(yn,vt,b){"use strict";b.d(vt,{Ac:function(){return Ke},Xo:function(){return Te},Wx:function(){return mt},ZP:function(){return X},lk:function(){return he}});var H=b(72308),Q=b(80702),K=b(49618),we=b(77321),T=b(52487),re=b(74416),ae=b(62853),Je=b(18929),$=b(48736),h=b(59301),We=b(92310),M=b.n(We),De=b(34280),D=b(49658),St=b(8654),Dt=function(d){var Z=d.className,w=d.customizeIcon,Y=d.customizeIconProps,te=d.children,ye=d.onMouseDown,m=d.onClick,U=typeof w=="function"?w(Y):w;return h.createElement("span",{className:Z,onMouseDown:function(Ee){Ee.preventDefault(),ye==null||ye(Ee)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:m,"aria-hidden":!0},U!==void 0?U:h.createElement("span",{className:M()(Z.split(/\s+/).map(function(Ae){return"".concat(Ae,"-icon")}))},te))},ht=Dt,Pt=function(d,Z,w,Y,te){var ye=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,m=arguments.length>6?arguments[6]:void 0,U=arguments.length>7?arguments[7]:void 0,Ae=h.useMemo(function(){if((0,ae.Z)(Y)==="object")return Y.clearIcon;if(te)return te},[Y,te]),Ee=h.useMemo(function(){return!!(!ye&&Y&&(w.length||m)&&!(U==="combobox"&&m===""))},[Y,ye,w.length,m,U]);return{allowClear:Ee,clearIcon:h.createElement(ht,{className:"".concat(d,"-clear"),onMouseDown:Z,customizeIcon:Ae},"\xD7")}},gt=h.createContext(null);function he(){return h.useContext(gt)}function F(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,d=h.useState(!1),Z=(0,T.Z)(d,2),w=Z[0],Y=Z[1],te=h.useRef(null),ye=function(){window.clearTimeout(te.current)};h.useEffect(function(){return ye},[]);var m=function(Ae,Ee){ye(),te.current=window.setTimeout(function(){Y(Ae),Ee&&Ee()},v)};return[w,m,ye]}function xt(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,d=h.useRef(null),Z=h.useRef(null);h.useEffect(function(){return function(){window.clearTimeout(Z.current)}},[]);function w(Y){(Y||d.current===null)&&(d.current=Y),window.clearTimeout(Z.current),Z.current=window.setTimeout(function(){d.current=null},v)}return[function(){return d.current},w]}function ze(v,d,Z,w){var Y=h.useRef(null);Y.current={open:d,triggerOpen:Z,customizedTrigger:w},h.useEffect(function(){function te(ye){var m;if(!((m=Y.current)!==null&&m!==void 0&&m.customizedTrigger)){var U=ye.target;U.shadowRoot&&ye.composed&&(U=ye.composedPath()[0]||U),Y.current.open&&v().filter(function(Ae){return Ae}).every(function(Ae){return!Ae.contains(U)&&Ae!==U})&&Y.current.triggerOpen(!1)}}return window.addEventListener("mousedown",te),function(){return window.removeEventListener("mousedown",te)}},[])}var ee=b(10228);function Et(v){return v&&![ee.Z.ESC,ee.Z.SHIFT,ee.Z.BACKSPACE,ee.Z.TAB,ee.Z.WIN_KEY,ee.Z.ALT,ee.Z.META,ee.Z.WIN_KEY_RIGHT,ee.Z.CTRL,ee.Z.SEMICOLON,ee.Z.EQUALS,ee.Z.CAPS_LOCK,ee.Z.CONTEXT_MENU,ee.Z.F1,ee.Z.F2,ee.Z.F3,ee.Z.F4,ee.Z.F5,ee.Z.F6,ee.Z.F7,ee.Z.F8,ee.Z.F9,ee.Z.F10,ee.Z.F11,ee.Z.F12].includes(v)}var _e=b(26112),j=b(11780),ft=function(d,Z){var w,Y=d.prefixCls,te=d.id,ye=d.inputElement,m=d.disabled,U=d.tabIndex,Ae=d.autoFocus,Ee=d.autoComplete,Ze=d.editable,$e=d.activeDescendantId,Le=d.value,oe=d.maxLength,me=d.onKeyDown,ve=d.onMouseDown,He=d.onChange,Xe=d.onPaste,qt=d.onCompositionStart,Tt=d.onCompositionEnd,It=d.onBlur,st=d.open,br=d.attrs,hr=ye||h.createElement("input",null),or=hr,mr=or.ref,Ht=or.props,At=Ht.onKeyDown,fr=Ht.onChange,Vt=Ht.onMouseDown,jt=Ht.onCompositionStart,rt=Ht.onCompositionEnd,Ct=Ht.onBlur,er=Ht.style;return(0,$.Kp)(!("maxLength"in hr.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),hr=h.cloneElement(hr,(0,we.Z)((0,we.Z)((0,we.Z)({type:"search"},Ht),{},{id:te,ref:(0,St.sQ)(Z,mr),disabled:m,tabIndex:U,autoComplete:Ee||"off",autoFocus:Ae,className:M()("".concat(Y,"-selection-search-input"),(w=hr)===null||w===void 0||(w=w.props)===null||w===void 0?void 0:w.className),role:"combobox","aria-expanded":st||!1,"aria-haspopup":"listbox","aria-owns":"".concat(te,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(te,"_list"),"aria-activedescendant":st?$e:void 0},br),{},{value:Ze?Le:"",maxLength:oe,readOnly:!Ze,unselectable:Ze?null:"on",style:(0,we.Z)((0,we.Z)({},er),{},{opacity:Ze?null:0}),onKeyDown:function(Qe){me(Qe),At&&At(Qe)},onMouseDown:function(Qe){ve(Qe),Vt&&Vt(Qe)},onChange:function(Qe){He(Qe),fr&&fr(Qe)},onCompositionStart:function(Qe){qt(Qe),jt&&jt(Qe)},onCompositionEnd:function(Qe){Tt(Qe),rt&&rt(Qe)},onPaste:Xe,onBlur:function(Qe){It(Qe),Ct&&Ct(Qe)}})),hr},Nt=h.forwardRef(ft),N=Nt;function E(v){return Array.isArray(v)?v:v!==void 0?[v]:[]}var A=typeof window!="undefined"&&window.document&&window.document.documentElement,J=A;function W(v){return v!=null}function Oe(v){return!v&&v!==0}function L(v){return["string","number"].includes((0,ae.Z)(v))}function se(v){var d=void 0;return v&&(L(v.title)?d=v.title.toString():L(v.label)&&(d=v.label.toString())),d}function Pe(v,d){J?h.useLayoutEffect(v,d):h.useEffect(v,d)}function fe(v){var d;return(d=v.key)!==null&&d!==void 0?d:v.value}var Ye=function(d){d.preventDefault(),d.stopPropagation()},Ge=function(d){var Z=d.id,w=d.prefixCls,Y=d.values,te=d.open,ye=d.searchValue,m=d.autoClearSearchValue,U=d.inputRef,Ae=d.placeholder,Ee=d.disabled,Ze=d.mode,$e=d.showSearch,Le=d.autoFocus,oe=d.autoComplete,me=d.activeDescendantId,ve=d.tabIndex,He=d.removeIcon,Xe=d.maxTagCount,qt=d.maxTagTextLength,Tt=d.maxTagPlaceholder,It=Tt===void 0?function(_t){return"+ ".concat(_t.length," ...")}:Tt,st=d.tagRender,br=d.onToggleOpen,hr=d.onRemove,or=d.onInputChange,mr=d.onInputPaste,Ht=d.onInputKeyDown,At=d.onInputMouseDown,fr=d.onInputCompositionStart,Vt=d.onInputCompositionEnd,jt=d.onInputBlur,rt=h.useRef(null),Ct=(0,h.useState)(0),er=(0,T.Z)(Ct,2),Ft=er[0],Qe=er[1],Mt=(0,h.useState)(!1),Pr=(0,T.Z)(Mt,2),Jr=Pr[0],zr=Pr[1],Sr="".concat(w,"-selection"),nn=te||Ze==="multiple"&&m===!1||Ze==="tags"?ye:"",Mr=Ze==="tags"||Ze==="multiple"&&m===!1||$e&&(te||Jr);Pe(function(){Qe(rt.current.scrollWidth)},[nn]);var tn=function(V,G,ke,nt,dt){return h.createElement("span",{title:se(V),className:M()("".concat(Sr,"-item"),(0,K.Z)({},"".concat(Sr,"-item-disabled"),ke))},h.createElement("span",{className:"".concat(Sr,"-item-content")},G),nt&&h.createElement(ht,{className:"".concat(Sr,"-item-remove"),onMouseDown:Ye,onClick:dt,customizeIcon:He},"\xD7"))},Qr=function(V,G,ke,nt,dt,Ir){var Ar=function(Kr){Ye(Kr),br(!te)};return h.createElement("span",{onMouseDown:Ar},st({label:G,value:V,disabled:ke,closable:nt,onClose:dt,isMaxTag:!!Ir}))},Lr=function(V){var G=V.disabled,ke=V.label,nt=V.value,dt=!Ee&&!G,Ir=ke;if(typeof qt=="number"&&(typeof ke=="string"||typeof ke=="number")){var Ar=String(Ir);Ar.length>qt&&(Ir="".concat(Ar.slice(0,qt),"..."))}var ln=function(gr){gr&&gr.stopPropagation(),hr(V)};return typeof st=="function"?Qr(nt,Ir,G,dt,ln):tn(V,Ir,G,dt,ln)},ct=function(V){if(!Y.length)return null;var G=typeof It=="function"?It(V):It;return typeof st=="function"?Qr(void 0,G,!1,!1,void 0,!0):tn({title:G},G,!1)},Ue=h.createElement("div",{className:"".concat(Sr,"-search"),style:{width:Ft},onFocus:function(){zr(!0)},onBlur:function(){zr(!1)}},h.createElement(N,{ref:U,open:te,prefixCls:w,id:Z,inputElement:null,disabled:Ee,autoFocus:Le,autoComplete:oe,editable:Mr,activeDescendantId:me,value:nn,onKeyDown:Ht,onMouseDown:At,onChange:or,onPaste:mr,onCompositionStart:fr,onCompositionEnd:Vt,onBlur:jt,tabIndex:ve,attrs:(0,_e.Z)(d,!0)}),h.createElement("span",{ref:rt,className:"".concat(Sr,"-search-mirror"),"aria-hidden":!0},nn,"\xA0")),wt=h.createElement(j.Z,{prefixCls:"".concat(Sr,"-overflow"),data:Y,renderItem:Lr,renderRest:ct,suffix:Ue,itemKey:fe,maxCount:Xe});return h.createElement("span",{className:"".concat(Sr,"-wrap")},wt,!Y.length&&!nn&&h.createElement("span",{className:"".concat(Sr,"-placeholder")},Ae))},xe=Ge,Ve=function(d){var Z=d.inputElement,w=d.prefixCls,Y=d.id,te=d.inputRef,ye=d.disabled,m=d.autoFocus,U=d.autoComplete,Ae=d.activeDescendantId,Ee=d.mode,Ze=d.open,$e=d.values,Le=d.placeholder,oe=d.tabIndex,me=d.showSearch,ve=d.searchValue,He=d.activeValue,Xe=d.maxLength,qt=d.onInputKeyDown,Tt=d.onInputMouseDown,It=d.onInputChange,st=d.onInputPaste,br=d.onInputCompositionStart,hr=d.onInputCompositionEnd,or=d.onInputBlur,mr=d.title,Ht=h.useState(!1),At=(0,T.Z)(Ht,2),fr=At[0],Vt=At[1],jt=Ee==="combobox",rt=jt||me,Ct=$e[0],er=ve||"";jt&&He&&!fr&&(er=He),h.useEffect(function(){jt&&Vt(!1)},[jt,He]);var Ft=Ee!=="combobox"&&!Ze&&!me?!1:!!er,Qe=mr===void 0?se(Ct):mr,Mt=h.useMemo(function(){return Ct?null:h.createElement("span",{className:"".concat(w,"-selection-placeholder"),style:Ft?{visibility:"hidden"}:void 0},Le)},[Ct,Ft,Le,w]);return h.createElement("span",{className:"".concat(w,"-selection-wrap")},h.createElement("span",{className:"".concat(w,"-selection-search")},h.createElement(N,{ref:te,prefixCls:w,id:Y,open:Ze,inputElement:Z,disabled:ye,autoFocus:m,autoComplete:U,editable:rt,activeDescendantId:Ae,value:er,onKeyDown:qt,onMouseDown:Tt,onChange:function(Jr){Vt(!0),It(Jr)},onPaste:st,onCompositionStart:br,onCompositionEnd:hr,onBlur:or,tabIndex:oe,attrs:(0,_e.Z)(d,!0),maxLength:jt?Xe:void 0})),!jt&&Ct?h.createElement("span",{className:"".concat(w,"-selection-item"),title:Qe,style:Ft?{visibility:"hidden"}:void 0},Ct.label):null,Mt)},Fe=Ve,Wt=function(d,Z){var w=(0,h.useRef)(null),Y=(0,h.useRef)(!1),te=d.prefixCls,ye=d.open,m=d.mode,U=d.showSearch,Ae=d.tokenWithEnter,Ee=d.disabled,Ze=d.prefix,$e=d.autoClearSearchValue,Le=d.onSearch,oe=d.onSearchSubmit,me=d.onToggleOpen,ve=d.onInputKeyDown,He=d.onInputBlur,Xe=d.domRef;h.useImperativeHandle(Z,function(){return{focus:function(Qe){w.current.focus(Qe)},blur:function(){w.current.blur()}}});var qt=xt(0),Tt=(0,T.Z)(qt,2),It=Tt[0],st=Tt[1],br=function(Qe){var Mt=Qe.which,Pr=w.current instanceof HTMLTextAreaElement;!Pr&&ye&&(Mt===ee.Z.UP||Mt===ee.Z.DOWN)&&Qe.preventDefault(),ve&&ve(Qe),Mt===ee.Z.ENTER&&m==="tags"&&!Y.current&&!ye&&(oe==null||oe(Qe.target.value)),!(Pr&&!ye&&~[ee.Z.UP,ee.Z.DOWN,ee.Z.LEFT,ee.Z.RIGHT].indexOf(Mt))&&Et(Mt)&&me(!0)},hr=function(){st(!0)},or=(0,h.useRef)(null),mr=function(Qe){Le(Qe,!0,Y.current)!==!1&&me(!0)},Ht=function(){Y.current=!0},At=function(Qe){Y.current=!1,m!=="combobox"&&mr(Qe.target.value)},fr=function(Qe){var Mt=Qe.target.value;if(Ae&&or.current&&/[\r\n]/.test(or.current)){var Pr=or.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Mt=Mt.replace(Pr,or.current)}or.current=null,mr(Mt)},Vt=function(Qe){var Mt=Qe.clipboardData,Pr=Mt==null?void 0:Mt.getData("text");or.current=Pr||""},jt=function(Qe){var Mt=Qe.target;if(Mt!==w.current){var Pr=document.body.style.msTouchAction!==void 0;Pr?setTimeout(function(){w.current.focus()}):w.current.focus()}},rt=function(Qe){var Mt=It();Qe.target!==w.current&&!Mt&&!(m==="combobox"&&Ee)&&Qe.preventDefault(),(m!=="combobox"&&(!U||!Mt)||!ye)&&(ye&&$e!==!1&&Le("",!0,!1),me())},Ct={inputRef:w,onInputKeyDown:br,onInputMouseDown:hr,onInputChange:fr,onInputPaste:Vt,onInputCompositionStart:Ht,onInputCompositionEnd:At,onInputBlur:He},er=m==="multiple"||m==="tags"?h.createElement(xe,(0,H.Z)({},d,Ct)):h.createElement(Fe,(0,H.Z)({},d,Ct));return h.createElement("div",{ref:Xe,className:"".concat(te,"-selector"),onClick:jt,onMouseDown:rt},Ze&&h.createElement("div",{className:"".concat(te,"-prefix")},Ze),er)},Rt=h.forwardRef(Wt),Lt=Rt,Ne=b(65352),vr=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],lr=function(d){var Z=d===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Z,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Z,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Z,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Z,adjustY:1},htmlRegion:"scroll"}}},P=function(d,Z){var w=d.prefixCls,Y=d.disabled,te=d.visible,ye=d.children,m=d.popupElement,U=d.animation,Ae=d.transitionName,Ee=d.dropdownStyle,Ze=d.dropdownClassName,$e=d.direction,Le=$e===void 0?"ltr":$e,oe=d.placement,me=d.builtinPlacements,ve=d.dropdownMatchSelectWidth,He=d.dropdownRender,Xe=d.dropdownAlign,qt=d.getPopupContainer,Tt=d.empty,It=d.getTriggerDOMNode,st=d.onPopupVisibleChange,br=d.onPopupMouseEnter,hr=(0,re.Z)(d,vr),or="".concat(w,"-dropdown"),mr=m;He&&(mr=He(m));var Ht=h.useMemo(function(){return me||lr(ve)},[me,ve]),At=U?"".concat(or,"-").concat(U):Ae,fr=typeof ve=="number",Vt=h.useMemo(function(){return fr?null:ve===!1?"minWidth":"width"},[ve,fr]),jt=Ee;fr&&(jt=(0,we.Z)((0,we.Z)({},jt),{},{width:ve}));var rt=h.useRef(null);return h.useImperativeHandle(Z,function(){return{getPopupElement:function(){var er;return(er=rt.current)===null||er===void 0?void 0:er.popupElement}}}),h.createElement(Ne.Z,(0,H.Z)({},hr,{showAction:st?["click"]:[],hideAction:st?["click"]:[],popupPlacement:oe||(Le==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Ht,prefixCls:or,popupTransitionName:At,popup:h.createElement("div",{onMouseEnter:br},mr),ref:rt,stretch:Vt,popupAlign:Xe,popupVisible:te,getPopupContainer:qt,popupClassName:M()(Ze,(0,K.Z)({},"".concat(or,"-empty"),Tt)),popupStyle:jt,getTriggerDOMNode:It,onPopupVisibleChange:st}),ye)},g=h.forwardRef(P),C=g,p=b(68413);function x(v,d){var Z=v.key,w;return"value"in v&&(w=v.value),Z!=null?Z:w!==void 0?w:"rc-index-key-".concat(d)}function O(v){return typeof v!="undefined"&&!Number.isNaN(v)}function I(v,d){var Z=v||{},w=Z.label,Y=Z.value,te=Z.options,ye=Z.groupLabel,m=w||(d?"children":"label");return{label:m,value:Y||"value",options:te||"options",groupLabel:ye||m}}function z(v){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Z=d.fieldNames,w=d.childrenAsData,Y=[],te=I(Z,!1),ye=te.label,m=te.value,U=te.options,Ae=te.groupLabel;function Ee(Ze,$e){Array.isArray(Ze)&&Ze.forEach(function(Le){if($e||!(U in Le)){var oe=Le[m];Y.push({key:x(Le,Y.length),groupOption:$e,data:Le,label:Le[ye],value:oe})}else{var me=Le[Ae];me===void 0&&w&&(me=Le.label),Y.push({key:x(Le,Y.length),group:!0,data:Le,label:me}),Ee(Le[U],!0)}})}return Ee(v,!1),Y}function le(v){var d=(0,we.Z)({},v);return"props"in d||Object.defineProperty(d,"props",{get:function(){return(0,$.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),d}}),d}var q=function(d,Z,w){if(!Z||!Z.length)return null;var Y=!1,te=function m(U,Ae){var Ee=(0,p.Z)(Ae),Ze=Ee[0],$e=Ee.slice(1);if(!Ze)return[U];var Le=U.split(Ze);return Y=Y||Le.length>1,Le.reduce(function(oe,me){return[].concat((0,Q.Z)(oe),(0,Q.Z)(m(me,$e)))},[]).filter(Boolean)},ye=te(d,Z);return Y?typeof w!="undefined"?ye.slice(0,w):ye:null},de=h.createContext(null),ie=de;function ne(v){var d=v.visible,Z=v.values;if(!d)return null;var w=50;return h.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(Z.slice(0,w).map(function(Y){var te=Y.label,ye=Y.value;return["number","string"].includes((0,ae.Z)(te))?te:ye}).join(", ")),Z.length>w?", ...":null)}var ge=["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"],k=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],ce=function(d){return d==="tags"||d==="multiple"},B=h.forwardRef(function(v,d){var Z,w=v.id,Y=v.prefixCls,te=v.className,ye=v.showSearch,m=v.tagRender,U=v.direction,Ae=v.omitDomProps,Ee=v.displayValues,Ze=v.onDisplayValuesChange,$e=v.emptyOptions,Le=v.notFoundContent,oe=Le===void 0?"Not Found":Le,me=v.onClear,ve=v.mode,He=v.disabled,Xe=v.loading,qt=v.getInputElement,Tt=v.getRawInputElement,It=v.open,st=v.defaultOpen,br=v.onDropdownVisibleChange,hr=v.activeValue,or=v.onActiveValueChange,mr=v.activeDescendantId,Ht=v.searchValue,At=v.autoClearSearchValue,fr=v.onSearch,Vt=v.onSearchSplit,jt=v.tokenSeparators,rt=v.allowClear,Ct=v.prefix,er=v.suffixIcon,Ft=v.clearIcon,Qe=v.OptionList,Mt=v.animation,Pr=v.transitionName,Jr=v.dropdownStyle,zr=v.dropdownClassName,Sr=v.dropdownMatchSelectWidth,nn=v.dropdownRender,Mr=v.dropdownAlign,tn=v.placement,Qr=v.builtinPlacements,Lr=v.getPopupContainer,ct=v.showAction,Ue=ct===void 0?[]:ct,wt=v.onFocus,_t=v.onBlur,V=v.onKeyUp,G=v.onKeyDown,ke=v.onMouseDown,nt=(0,re.Z)(v,ge),dt=ce(ve),Ir=(ye!==void 0?ye:dt)||ve==="combobox",Ar=(0,we.Z)({},nt);k.forEach(function(dr){delete Ar[dr]}),Ae==null||Ae.forEach(function(dr){delete Ar[dr]});var ln=h.useState(!1),Kr=(0,T.Z)(ln,2),gr=Kr[0],Ur=Kr[1];h.useEffect(function(){Ur((0,D.Z)())},[]);var vn=h.useRef(null),_r=h.useRef(null),Hr=h.useRef(null),sn=h.useRef(null),Rr=h.useRef(null),$r=h.useRef(!1),Rn=F(),bn=(0,T.Z)(Rn,3),Gr=bn[0],Sn=bn[1],Yn=bn[2];h.useImperativeHandle(d,function(){var dr,Bt;return{focus:(dr=sn.current)===null||dr===void 0?void 0:dr.focus,blur:(Bt=sn.current)===null||Bt===void 0?void 0:Bt.blur,scrollTo:function(En){var qr;return(qr=Rr.current)===null||qr===void 0?void 0:qr.scrollTo(En)},nativeElement:vn.current||_r.current}});var wn=h.useMemo(function(){var dr;if(ve!=="combobox")return Ht;var Bt=(dr=Ee[0])===null||dr===void 0?void 0:dr.value;return typeof Bt=="string"||typeof Bt=="number"?String(Bt):""},[Ht,ve,Ee]),jn=ve==="combobox"&&typeof qt=="function"&&qt()||null,un=typeof Tt=="function"&&Tt(),si=(0,St.x1)(_r,un==null||(Z=un.props)===null||Z===void 0?void 0:Z.ref),qn=h.useState(!1),Wn=(0,T.Z)(qn,2),zn=Wn[0],ai=Wn[1];(0,De.Z)(function(){ai(!0)},[]);var ei=(0,Je.Z)(!1,{defaultValue:st,value:It}),Un=(0,T.Z)(ei,2),Pn=Un[0],Tr=Un[1],wr=zn?Pn:!1,ti=!oe&&$e;(He||ti&&wr&&ve==="combobox")&&(wr=!1);var Vr=ti?!1:wr,ot=h.useCallback(function(dr){var Bt=dr!==void 0?dr:!wr;He||(Tr(Bt),wr!==Bt&&(br==null||br(Bt)))},[He,wr,Tr,br]),bt=h.useMemo(function(){return(jt||[]).some(function(dr){return[`
|
|
`,`\r
|
|
`].includes(dr)})},[jt]),it=h.useContext(ie)||{},at=it.maxCount,ir=it.rawValues,xr=function(Bt,Br,En){if(!(dt&&O(at)&&(ir==null?void 0:ir.size)>=at)){var qr=!0,fn=Bt;or==null||or(null);var Qn=q(Bt,jt,O(at)?at-ir.size:void 0),Gn=En?null:Qn;return ve!=="combobox"&&Gn&&(fn="",Vt==null||Vt(Gn),ot(!1),qr=!1),fr&&wn!==fn&&fr(fn,{source:Br?"typing":"effect"}),qr}},Nn=function(Bt){!Bt||!Bt.trim()||fr(Bt,{source:"submit"})};h.useEffect(function(){!wr&&!dt&&ve!=="combobox"&&xr("",!1,!1)},[wr]),h.useEffect(function(){Pn&&He&&Tr(!1),He&&!$r.current&&Sn(!1)},[He]);var xn=xt(),On=(0,T.Z)(xn,2),Re=On[0],qe=On[1],Jt=h.useRef(!1),kr=function(Bt){var Br=Re(),En=Bt.key,qr=En==="Enter";if(qr&&(ve!=="combobox"&&Bt.preventDefault(),wr||ot(!0)),qe(!!wn),En==="Backspace"&&!Br&&dt&&!wn&&Ee.length){for(var fn=(0,Q.Z)(Ee),Qn=null,Gn=fn.length-1;Gn>=0;Gn-=1){var ri=fn[Gn];if(!ri.disabled){fn.splice(Gn,1),Qn=ri;break}}Qn&&Ze(fn,{type:"remove",values:[Qn]})}for(var gi=arguments.length,fi=new Array(gi>1?gi-1:0),Ai=1;Ai<gi;Ai++)fi[Ai-1]=arguments[Ai];if(wr&&(!qr||!Jt.current)){var $n;qr&&(Jt.current=!0),($n=Rr.current)===null||$n===void 0||$n.onKeyDown.apply($n,[Bt].concat(fi))}G==null||G.apply(void 0,[Bt].concat(fi))},Nr=function(Bt){for(var Br=arguments.length,En=new Array(Br>1?Br-1:0),qr=1;qr<Br;qr++)En[qr-1]=arguments[qr];if(wr){var fn;(fn=Rr.current)===null||fn===void 0||fn.onKeyUp.apply(fn,[Bt].concat(En))}Bt.key==="Enter"&&(Jt.current=!1),V==null||V.apply(void 0,[Bt].concat(En))},_n=function(Bt){var Br=Ee.filter(function(En){return En!==Bt});Ze(Br,{type:"remove",values:[Bt]})},Yr=function(){Jt.current=!1},Hn=h.useRef(!1),oi=function(){Sn(!0),He||(wt&&!Hn.current&&wt.apply(void 0,arguments),Ue.includes("focus")&&ot(!0)),Hn.current=!0},Ya=function(){$r.current=!0,Sn(!1,function(){Hn.current=!1,$r.current=!1,ot(!1)}),!He&&(wn&&(ve==="tags"?fr(wn,{source:"submit"}):ve==="multiple"&&fr("",{source:"blur"})),_t&&_t.apply(void 0,arguments))},ui=[];h.useEffect(function(){return function(){ui.forEach(function(dr){return clearTimeout(dr)}),ui.splice(0,ui.length)}},[]);var ja=function(Bt){var Br,En=Bt.target,qr=(Br=Hr.current)===null||Br===void 0?void 0:Br.getPopupElement();if(qr&&qr.contains(En)){var fn=setTimeout(function(){var gi=ui.indexOf(fn);if(gi!==-1&&ui.splice(gi,1),Yn(),!gr&&!qr.contains(document.activeElement)){var fi;(fi=sn.current)===null||fi===void 0||fi.focus()}});ui.push(fn)}for(var Qn=arguments.length,Gn=new Array(Qn>1?Qn-1:0),ri=1;ri<Qn;ri++)Gn[ri-1]=arguments[ri];ke==null||ke.apply(void 0,[Bt].concat(Gn))},Ca=h.useState({}),Qi=(0,T.Z)(Ca,2),vi=Qi[1];function Jn(){vi({})}var $i;un&&($i=function(Bt){ot(Bt)}),ze(function(){var dr;return[vn.current,(dr=Hr.current)===null||dr===void 0?void 0:dr.getPopupElement()]},Vr,ot,!!un);var wa=h.useMemo(function(){return(0,we.Z)((0,we.Z)({},v),{},{notFoundContent:oe,open:wr,triggerOpen:Vr,id:w,showSearch:Ir,multiple:dt,toggleOpen:ot})},[v,oe,Vr,wr,w,Ir,dt,ot]),xa=!!er||Xe,Ea;xa&&(Ea=h.createElement(ht,{className:M()("".concat(Y,"-arrow"),(0,K.Z)({},"".concat(Y,"-arrow-loading"),Xe)),customizeIcon:er,customizeIconProps:{loading:Xe,searchValue:wn,open:wr,focused:Gr,showSearch:Ir}}));var Ja=function(){var Bt;me==null||me(),(Bt=sn.current)===null||Bt===void 0||Bt.focus(),Ze([],{type:"clear",values:Ee}),xr("",!1,!1)},qi=Pt(Y,Ja,Ee,rt,Ft,He,wn,ve),Ma=qi.allowClear,Ei=qi.clearIcon,La=h.createElement(Qe,{ref:Rr}),Ra=M()(Y,te,(0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)({},"".concat(Y,"-focused"),Gr),"".concat(Y,"-multiple"),dt),"".concat(Y,"-single"),!dt),"".concat(Y,"-allow-clear"),rt),"".concat(Y,"-show-arrow"),xa),"".concat(Y,"-disabled"),He),"".concat(Y,"-loading"),Xe),"".concat(Y,"-open"),wr),"".concat(Y,"-customize-input"),jn),"".concat(Y,"-show-search"),Ir)),Ii=h.createElement(C,{ref:Hr,disabled:He,prefixCls:Y,visible:Vr,popupElement:La,animation:Mt,transitionName:Pr,dropdownStyle:Jr,dropdownClassName:zr,direction:U,dropdownMatchSelectWidth:Sr,dropdownRender:nn,dropdownAlign:Mr,placement:tn,builtinPlacements:Qr,getPopupContainer:Lr,empty:$e,getTriggerDOMNode:function(Bt){return _r.current||Bt},onPopupVisibleChange:$i,onPopupMouseEnter:Jn},un?h.cloneElement(un,{ref:si}):h.createElement(Lt,(0,H.Z)({},v,{domRef:_r,prefixCls:Y,inputElement:jn,ref:sn,id:w,prefix:Ct,showSearch:Ir,autoClearSearchValue:At,mode:ve,activeDescendantId:mr,tagRender:m,values:Ee,open:wr,onToggleOpen:ot,activeValue:hr,searchValue:wn,onSearch:xr,onSearchSubmit:Nn,onRemove:_n,tokenWithEnter:bt,onInputBlur:Yr}))),hi;return un?hi=Ii:hi=h.createElement("div",(0,H.Z)({className:Ra},Ar,{ref:vn,onMouseDown:ja,onKeyDown:kr,onKeyUp:Nr,onFocus:oi,onBlur:Ya}),h.createElement(ne,{visible:Gr&&!wr,values:Ee}),Ii,Ea,Ma&&Ei),h.createElement(gt.Provider,{value:wa},hi)}),Ke=B,pe=function(){return null};pe.isSelectOptGroup=!0;var Te=pe,Me=function(){return null};Me.isSelectOption=!0;var mt=Me,je=b(80547),be=b(2738),et=b(45680);function cr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var yr=["disabled","title","children","style","className"];function tr(v){return typeof v=="string"||typeof v=="number"}var Cr=function(d,Z){var w=he(),Y=w.prefixCls,te=w.id,ye=w.open,m=w.multiple,U=w.mode,Ae=w.searchValue,Ee=w.toggleOpen,Ze=w.notFoundContent,$e=w.onPopupScroll,Le=h.useContext(ie),oe=Le.maxCount,me=Le.flattenOptions,ve=Le.onActiveValue,He=Le.defaultActiveFirstOption,Xe=Le.onSelect,qt=Le.menuItemSelectedIcon,Tt=Le.rawValues,It=Le.fieldNames,st=Le.virtual,br=Le.direction,hr=Le.listHeight,or=Le.listItemHeight,mr=Le.optionRender,Ht="".concat(Y,"-item"),At=(0,je.Z)(function(){return me},[ye,me],function(ct,Ue){return Ue[0]&&ct[1]!==Ue[1]}),fr=h.useRef(null),Vt=h.useMemo(function(){return m&&O(oe)&&(Tt==null?void 0:Tt.size)>=oe},[m,oe,Tt==null?void 0:Tt.size]),jt=function(Ue){Ue.preventDefault()},rt=function(Ue){var wt;(wt=fr.current)===null||wt===void 0||wt.scrollTo(typeof Ue=="number"?{index:Ue}:Ue)},Ct=h.useCallback(function(ct){return U==="combobox"?!1:Tt.has(ct)},[U,(0,Q.Z)(Tt).toString(),Tt.size]),er=function(Ue){for(var wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,_t=At.length,V=0;V<_t;V+=1){var G=(Ue+V*wt+_t)%_t,ke=At[G]||{},nt=ke.group,dt=ke.data;if(!nt&&!(dt!=null&&dt.disabled)&&(Ct(dt.value)||!Vt))return G}return-1},Ft=h.useState(function(){return er(0)}),Qe=(0,T.Z)(Ft,2),Mt=Qe[0],Pr=Qe[1],Jr=function(Ue){var wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Pr(Ue);var _t={source:wt?"keyboard":"mouse"},V=At[Ue];if(!V){ve(null,-1,_t);return}ve(V.value,Ue,_t)};(0,h.useEffect)(function(){Jr(He!==!1?er(0):-1)},[At.length,Ae]);var zr=h.useCallback(function(ct){return U==="combobox"?String(ct).toLowerCase()===Ae.toLowerCase():Tt.has(ct)},[U,Ae,(0,Q.Z)(Tt).toString(),Tt.size]);(0,h.useEffect)(function(){var ct=setTimeout(function(){if(!m&&ye&&Tt.size===1){var wt=Array.from(Tt)[0],_t=At.findIndex(function(V){var G=V.data;return G.value===wt});_t!==-1&&(Jr(_t),rt(_t))}});if(ye){var Ue;(Ue=fr.current)===null||Ue===void 0||Ue.scrollTo(void 0)}return function(){return clearTimeout(ct)}},[ye,Ae]);var Sr=function(Ue){Ue!==void 0&&Xe(Ue,{selected:!Tt.has(Ue)}),m||Ee(!1)};if(h.useImperativeHandle(Z,function(){return{onKeyDown:function(Ue){var wt=Ue.which,_t=Ue.ctrlKey;switch(wt){case ee.Z.N:case ee.Z.P:case ee.Z.UP:case ee.Z.DOWN:{var V=0;if(wt===ee.Z.UP?V=-1:wt===ee.Z.DOWN?V=1:cr()&&_t&&(wt===ee.Z.N?V=1:wt===ee.Z.P&&(V=-1)),V!==0){var G=er(Mt+V,V);rt(G),Jr(G,!0)}break}case ee.Z.TAB:case ee.Z.ENTER:{var ke,nt=At[Mt];nt&&!(nt!=null&&(ke=nt.data)!==null&&ke!==void 0&&ke.disabled)&&!Vt?Sr(nt.value):Sr(void 0),ye&&Ue.preventDefault();break}case ee.Z.ESC:Ee(!1),ye&&Ue.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Ue){rt(Ue)}}}),At.length===0)return h.createElement("div",{role:"listbox",id:"".concat(te,"_list"),className:"".concat(Ht,"-empty"),onMouseDown:jt},Ze);var nn=Object.keys(It).map(function(ct){return It[ct]}),Mr=function(Ue){return Ue.label};function tn(ct,Ue){var wt=ct.group;return{role:wt?"presentation":"option",id:"".concat(te,"_list_").concat(Ue)}}var Qr=function(Ue){var wt=At[Ue];if(!wt)return null;var _t=wt.data||{},V=_t.value,G=wt.group,ke=(0,_e.Z)(_t,!0),nt=Mr(wt);return wt?h.createElement("div",(0,H.Z)({"aria-label":typeof nt=="string"&&!G?nt:null},ke,{key:Ue},tn(wt,Ue),{"aria-selected":zr(V)}),V):null},Lr={role:"listbox",id:"".concat(te,"_list")};return h.createElement(h.Fragment,null,st&&h.createElement("div",(0,H.Z)({},Lr,{style:{height:0,width:0,overflow:"hidden"}}),Qr(Mt-1),Qr(Mt),Qr(Mt+1)),h.createElement(et.Z,{itemKey:"key",ref:fr,data:At,height:hr,itemHeight:or,fullHeight:!1,onMouseDown:jt,onScroll:$e,virtual:st,direction:br,innerProps:st?null:Lr},function(ct,Ue){var wt=ct.group,_t=ct.groupOption,V=ct.data,G=ct.label,ke=ct.value,nt=V.key;if(wt){var dt,Ir=(dt=V.title)!==null&&dt!==void 0?dt:tr(G)?G.toString():void 0;return h.createElement("div",{className:M()(Ht,"".concat(Ht,"-group"),V.className),title:Ir},G!==void 0?G:nt)}var Ar=V.disabled,ln=V.title,Kr=V.children,gr=V.style,Ur=V.className,vn=(0,re.Z)(V,yr),_r=(0,be.Z)(vn,nn),Hr=Ct(ke),sn=Ar||!Hr&&Vt,Rr="".concat(Ht,"-option"),$r=M()(Ht,Rr,Ur,(0,K.Z)((0,K.Z)((0,K.Z)((0,K.Z)({},"".concat(Rr,"-grouped"),_t),"".concat(Rr,"-active"),Mt===Ue&&!sn),"".concat(Rr,"-disabled"),sn),"".concat(Rr,"-selected"),Hr)),Rn=Mr(ct),bn=!qt||typeof qt=="function"||Hr,Gr=typeof Rn=="number"?Rn:Rn||ke,Sn=tr(Gr)?Gr.toString():void 0;return ln!==void 0&&(Sn=ln),h.createElement("div",(0,H.Z)({},(0,_e.Z)(_r),st?{}:tn(ct,Ue),{"aria-selected":zr(ke),className:$r,title:Sn,onMouseMove:function(){Mt===Ue||sn||Jr(Ue)},onClick:function(){sn||Sr(ke)},style:gr}),h.createElement("div",{className:"".concat(Rr,"-content")},typeof mr=="function"?mr(ct,{index:Ue}):Gr),h.isValidElement(qt)||Hr,bn&&h.createElement(ht,{className:"".concat(Ht,"-option-state"),customizeIcon:qt,customizeIconProps:{value:ke,disabled:sn,isSelected:Hr}},Hr?"\u2713":null))}))},tt=h.forwardRef(Cr),ut=tt,zt=function(v,d){var Z=h.useRef({values:new Map,options:new Map}),w=h.useMemo(function(){var te=Z.current,ye=te.values,m=te.options,U=v.map(function(Ze){if(Ze.label===void 0){var $e;return(0,we.Z)((0,we.Z)({},Ze),{},{label:($e=ye.get(Ze.value))===null||$e===void 0?void 0:$e.label})}return Ze}),Ae=new Map,Ee=new Map;return U.forEach(function(Ze){Ae.set(Ze.value,Ze),Ee.set(Ze.value,d.get(Ze.value)||m.get(Ze.value))}),Z.current.values=Ae,Z.current.options=Ee,U},[v,d]),Y=h.useCallback(function(te){return d.get(te)||Z.current.options.get(te)},[d]);return[w,Y]};function Gt(v,d){return E(v).join("").toUpperCase().includes(d)}var Xt=function(v,d,Z,w,Y){return h.useMemo(function(){if(!Z||w===!1)return v;var te=d.options,ye=d.label,m=d.value,U=[],Ae=typeof w=="function",Ee=Z.toUpperCase(),Ze=Ae?w:function(Le,oe){return Y?Gt(oe[Y],Ee):oe[te]?Gt(oe[ye!=="children"?ye:"label"],Ee):Gt(oe[m],Ee)},$e=Ae?function(Le){return le(Le)}:function(Le){return Le};return v.forEach(function(Le){if(Le[te]){var oe=Ze(Z,$e(Le));if(oe)U.push(Le);else{var me=Le[te].filter(function(ve){return Ze(Z,$e(ve))});me.length&&U.push((0,we.Z)((0,we.Z)({},Le),{},(0,K.Z)({},te,me)))}return}Ze(Z,$e(Le))&&U.push(Le)}),U},[v,w,Y,Z,d])},$t=b(69582),Ot=b(11592),rr=["children","value"],yt=["children"];function Fr(v){var d=v,Z=d.key,w=d.props,Y=w.children,te=w.value,ye=(0,re.Z)(w,rr);return(0,we.Z)({key:Z,value:te!==void 0?te:Z,children:Y},ye)}function Kt(v){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Ot.Z)(v).map(function(Z,w){if(!h.isValidElement(Z)||!Z.type)return null;var Y=Z,te=Y.type.isSelectOptGroup,ye=Y.key,m=Y.props,U=m.children,Ae=(0,re.Z)(m,yt);return d||!te?Fr(Z):(0,we.Z)((0,we.Z)({key:"__RC_SELECT_GRP__".concat(ye===null?w:ye,"__"),label:ye},Ae),{},{options:Kt(U)})}).filter(function(Z){return Z})}var sr=function(d,Z,w,Y,te){return h.useMemo(function(){var ye=d,m=!d;m&&(ye=Kt(Z));var U=new Map,Ae=new Map,Ee=function(Le,oe,me){me&&typeof me=="string"&&Le.set(oe[me],oe)},Ze=function $e(Le){for(var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,me=0;me<Le.length;me+=1){var ve=Le[me];!ve[w.options]||oe?(U.set(ve[w.value],ve),Ee(Ae,ve,w.label),Ee(Ae,ve,Y),Ee(Ae,ve,te)):$e(ve[w.options],!0)}};return Ze(ye),{options:ye,valueOptions:U,labelOptions:Ae}},[d,Z,w,Y,te])},kt=sr;function Or(v){var d=h.useRef();d.current=v;var Z=h.useCallback(function(){return d.current.apply(d,arguments)},[]);return Z}function dn(v){var d=v.mode,Z=v.options,w=v.children,Y=v.backfill,te=v.allowClear,ye=v.placeholder,m=v.getInputElement,U=v.showSearch,Ae=v.onSearch,Ee=v.defaultOpen,Ze=v.autoFocus,$e=v.labelInValue,Le=v.value,oe=v.inputValue,me=v.optionLabelProp,ve=isMultiple(d),He=U!==void 0?U:ve||d==="combobox",Xe=Z||convertChildrenToData(w);if(warning(d!=="tags"||Xe.every(function(st){return!st.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),d==="tags"||d==="combobox"){var qt=Xe.some(function(st){return st.options?st.options.some(function(br){return typeof("value"in br?br.value:br.key)=="number"}):typeof("value"in st?st.value:st.key)=="number"});warning(!qt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(d!=="combobox"||!me,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(d==="combobox"||!Y,"`backfill` only works with `combobox` mode."),warning(d==="combobox"||!m,"`getInputElement` only work with `combobox` mode."),noteOnce(d!=="combobox"||!m||!te||!ye,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ae&&!He&&d!=="combobox"&&d!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Ee||Ze,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Le!=null){var Tt=toArray(Le);warning(!$e||Tt.every(function(st){return _typeof(st)==="object"&&("key"in st||"value"in st)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!ve||Array.isArray(Le),"`value` should be array when `mode` is `multiple` or `tags`")}if(w){var It=null;toNodeArray(w).some(function(st){if(!React.isValidElement(st)||!st.type)return!1;var br=st,hr=br.type;if(hr.isSelectOption)return!1;if(hr.isSelectOptGroup){var or=toNodeArray(st.props.children).every(function(mr){return!React.isValidElement(mr)||!st.type||mr.type.isSelectOption?!0:(It=mr.type,!1)});return!or}return It=hr,!0}),It&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(It.displayName||It.name||It,"`.")),warning(oe===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Wr(v,d){if(v){var Z=function w(Y){for(var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ye=0;ye<Y.length;ye++){var m=Y[ye];if(m[d==null?void 0:d.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!te&&Array.isArray(m[d==null?void 0:d.options])&&w(m[d==null?void 0:d.options],!0))break}};Z(v)}}var nr=null,ar=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],ur=["inputValue"];function Yt(v){return!v||(0,ae.Z)(v)!=="object"}var Ut=h.forwardRef(function(v,d){var Z=v.id,w=v.mode,Y=v.prefixCls,te=Y===void 0?"rc-select":Y,ye=v.backfill,m=v.fieldNames,U=v.inputValue,Ae=v.searchValue,Ee=v.onSearch,Ze=v.autoClearSearchValue,$e=Ze===void 0?!0:Ze,Le=v.onSelect,oe=v.onDeselect,me=v.dropdownMatchSelectWidth,ve=me===void 0?!0:me,He=v.filterOption,Xe=v.filterSort,qt=v.optionFilterProp,Tt=v.optionLabelProp,It=v.options,st=v.optionRender,br=v.children,hr=v.defaultActiveFirstOption,or=v.menuItemSelectedIcon,mr=v.virtual,Ht=v.direction,At=v.listHeight,fr=At===void 0?200:At,Vt=v.listItemHeight,jt=Vt===void 0?20:Vt,rt=v.labelRender,Ct=v.value,er=v.defaultValue,Ft=v.labelInValue,Qe=v.onChange,Mt=v.maxCount,Pr=(0,re.Z)(v,ar),Jr=(0,$t.ZP)(Z),zr=ce(w),Sr=!!(!It&&br),nn=h.useMemo(function(){return He===void 0&&w==="combobox"?!1:He},[He,w]),Mr=h.useMemo(function(){return I(m,Sr)},[JSON.stringify(m),Sr]),tn=(0,Je.Z)("",{value:Ae!==void 0?Ae:U,postState:function(bt){return bt||""}}),Qr=(0,T.Z)(tn,2),Lr=Qr[0],ct=Qr[1],Ue=kt(It,br,Mr,qt,Tt),wt=Ue.valueOptions,_t=Ue.labelOptions,V=Ue.options,G=h.useCallback(function(ot){var bt=E(ot);return bt.map(function(it){var at,ir,xr,Nn,xn;if(Yt(it))at=it;else{var On;xr=it.key,ir=it.label,at=(On=it.value)!==null&&On!==void 0?On:xr}var Re=wt.get(at);if(Re){var qe;if(ir===void 0&&(ir=Re==null?void 0:Re[Tt||Mr.label]),xr===void 0&&(xr=(qe=Re==null?void 0:Re.key)!==null&&qe!==void 0?qe:at),Nn=Re==null?void 0:Re.disabled,xn=Re==null?void 0:Re.title,0)var Jt}return{label:ir,value:at,key:xr,disabled:Nn,title:xn}})},[Mr,Tt,wt]),ke=(0,Je.Z)(er,{value:Ct}),nt=(0,T.Z)(ke,2),dt=nt[0],Ir=nt[1],Ar=h.useMemo(function(){var ot,bt=zr&&dt===null?[]:dt,it=G(bt);return w==="combobox"&&Oe((ot=it[0])===null||ot===void 0?void 0:ot.value)?[]:it},[dt,G,w,zr]),ln=zt(Ar,wt),Kr=(0,T.Z)(ln,2),gr=Kr[0],Ur=Kr[1],vn=h.useMemo(function(){if(!w&&gr.length===1){var ot=gr[0];if(ot.value===null&&(ot.label===null||ot.label===void 0))return[]}return gr.map(function(bt){var it;return(0,we.Z)((0,we.Z)({},bt),{},{label:(it=typeof rt=="function"?rt(bt):bt.label)!==null&&it!==void 0?it:bt.value})})},[w,gr,rt]),_r=h.useMemo(function(){return new Set(gr.map(function(ot){return ot.value}))},[gr]);h.useEffect(function(){if(w==="combobox"){var ot,bt=(ot=gr[0])===null||ot===void 0?void 0:ot.value;ct(W(bt)?String(bt):"")}},[gr]);var Hr=Or(function(ot,bt){var it=bt!=null?bt:ot;return(0,K.Z)((0,K.Z)({},Mr.value,ot),Mr.label,it)}),sn=h.useMemo(function(){if(w!=="tags")return V;var ot=(0,Q.Z)(V),bt=function(at){return wt.has(at)};return(0,Q.Z)(gr).sort(function(it,at){return it.value<at.value?-1:1}).forEach(function(it){var at=it.value;bt(at)||ot.push(Hr(at,it.label))}),ot},[Hr,V,wt,gr,w]),Rr=Xt(sn,Mr,Lr,nn,qt),$r=h.useMemo(function(){return w!=="tags"||!Lr||Rr.some(function(ot){return ot[qt||"value"]===Lr})||Rr.some(function(ot){return ot[Mr.value]===Lr})?Rr:[Hr(Lr)].concat((0,Q.Z)(Rr))},[Hr,qt,w,Rr,Lr,Mr]),Rn=function ot(bt){var it=(0,Q.Z)(bt).sort(function(at,ir){return Xe(at,ir,{searchValue:Lr})});return it.map(function(at){return Array.isArray(at.options)?(0,we.Z)((0,we.Z)({},at),{},{options:at.options.length>0?ot(at.options):at.options}):at})},bn=h.useMemo(function(){return Xe?Rn($r):$r},[$r,Xe,Lr]),Gr=h.useMemo(function(){return z(bn,{fieldNames:Mr,childrenAsData:Sr})},[bn,Mr,Sr]),Sn=function(bt){var it=G(bt);if(Ir(it),Qe&&(it.length!==gr.length||it.some(function(xr,Nn){var xn;return((xn=gr[Nn])===null||xn===void 0?void 0:xn.value)!==(xr==null?void 0:xr.value)}))){var at=Ft?it:it.map(function(xr){return xr.value}),ir=it.map(function(xr){return le(Ur(xr.value))});Qe(zr?at:at[0],zr?ir:ir[0])}},Yn=h.useState(null),wn=(0,T.Z)(Yn,2),jn=wn[0],un=wn[1],si=h.useState(0),qn=(0,T.Z)(si,2),Wn=qn[0],zn=qn[1],ai=hr!==void 0?hr:w!=="combobox",ei=h.useCallback(function(ot,bt){var it=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},at=it.source,ir=at===void 0?"keyboard":at;zn(bt),ye&&w==="combobox"&&ot!==null&&ir==="keyboard"&&un(String(ot))},[ye,w]),Un=function(bt,it,at){var ir=function(){var _n,Yr=Ur(bt);return[Ft?{label:Yr==null?void 0:Yr[Mr.label],value:bt,key:(_n=Yr==null?void 0:Yr.key)!==null&&_n!==void 0?_n:bt}:bt,le(Yr)]};if(it&&Le){var xr=ir(),Nn=(0,T.Z)(xr,2),xn=Nn[0],On=Nn[1];Le(xn,On)}else if(!it&&oe&&at!=="clear"){var Re=ir(),qe=(0,T.Z)(Re,2),Jt=qe[0],kr=qe[1];oe(Jt,kr)}},Pn=Or(function(ot,bt){var it,at=zr?bt.selected:!0;at?it=zr?[].concat((0,Q.Z)(gr),[ot]):[ot]:it=gr.filter(function(ir){return ir.value!==ot}),Sn(it),Un(ot,at),w==="combobox"?un(""):(!ce||$e)&&(ct(""),un(""))}),Tr=function(bt,it){Sn(bt);var at=it.type,ir=it.values;(at==="remove"||at==="clear")&&ir.forEach(function(xr){Un(xr.value,!1,at)})},wr=function(bt,it){if(ct(bt),un(null),it.source==="submit"){var at=(bt||"").trim();if(at){var ir=Array.from(new Set([].concat((0,Q.Z)(_r),[at])));Sn(ir),Un(at,!0),ct("")}return}it.source!=="blur"&&(w==="combobox"&&Sn(bt),Ee==null||Ee(bt))},ti=function(bt){var it=bt;w!=="tags"&&(it=bt.map(function(ir){var xr=_t.get(ir);return xr==null?void 0:xr.value}).filter(function(ir){return ir!==void 0}));var at=Array.from(new Set([].concat((0,Q.Z)(_r),(0,Q.Z)(it))));Sn(at),at.forEach(function(ir){Un(ir,!0)})},Vr=h.useMemo(function(){var ot=mr!==!1&&ve!==!1;return(0,we.Z)((0,we.Z)({},Ue),{},{flattenOptions:Gr,onActiveValue:ei,defaultActiveFirstOption:ai,onSelect:Pn,menuItemSelectedIcon:or,rawValues:_r,fieldNames:Mr,virtual:ot,direction:Ht,listHeight:fr,listItemHeight:jt,childrenAsData:Sr,maxCount:Mt,optionRender:st})},[Mt,Ue,Gr,ei,ai,Pn,or,_r,Mr,mr,ve,Ht,fr,jt,Sr,st]);return h.createElement(ie.Provider,{value:Vr},h.createElement(Ke,(0,H.Z)({},Pr,{id:Jr,prefixCls:te,ref:d,omitDomProps:ur,mode:w,displayValues:vn,onDisplayValuesChange:Tr,direction:Ht,searchValue:Lr,onSearch:wr,autoClearSearchValue:$e,onSearchSplit:ti,dropdownMatchSelectWidth:ve,OptionList:ut,emptyOptions:!Gr.length,activeValue:jn,activeDescendantId:"".concat(Jr,"_list_").concat(Wn)})))}),pr=Ut;pr.Option=mt,pr.OptGroup=Te;var Zt=pr,X=Zt},22711:function(yn,vt,b){"use strict";b.r(vt),b.d(vt,{ResizableTextArea:function(){return Nt},default:function(){return J}});var H=b(72308),Q=b(49618),K=b(77321),we=b(80702),T=b(52487),re=b(74416),ae=b(92310),Je=b.n(ae),$=b(36901),h=b(66003),We=b(30292),M=b(18929),De=b(59301),D=b(62853),St=b(29301),Dt=b(34280),ht=b(16089),Pt=`
|
|
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;
|
|
`,gt=["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 xt(W){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,L=W.getAttribute("id")||W.getAttribute("data-reactid")||W.getAttribute("name");if(Oe&&he[L])return he[L];var se=window.getComputedStyle(W),Pe=se.getPropertyValue("box-sizing")||se.getPropertyValue("-moz-box-sizing")||se.getPropertyValue("-webkit-box-sizing"),fe=parseFloat(se.getPropertyValue("padding-bottom"))+parseFloat(se.getPropertyValue("padding-top")),Ye=parseFloat(se.getPropertyValue("border-bottom-width"))+parseFloat(se.getPropertyValue("border-top-width")),Ge=gt.map(function(Ve){return"".concat(Ve,":").concat(se.getPropertyValue(Ve))}).join(";"),xe={sizingStyle:Ge,paddingSize:fe,borderSize:Ye,boxSizing:Pe};return Oe&&L&&(he[L]=xe),xe}function ze(W){var Oe=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 Pe=xt(W,Oe),fe=Pe.paddingSize,Ye=Pe.borderSize,Ge=Pe.boxSizing,xe=Pe.sizingStyle;F.setAttribute("style","".concat(xe,";").concat(Pt)),F.value=W.value||W.placeholder||"";var Ve=void 0,Fe=void 0,Wt,Rt=F.scrollHeight;if(Ge==="border-box"?Rt+=Ye:Ge==="content-box"&&(Rt-=fe),L!==null||se!==null){F.value=" ";var Lt=F.scrollHeight-fe;L!==null&&(Ve=Lt*L,Ge==="border-box"&&(Ve=Ve+fe+Ye),Rt=Math.max(Ve,Rt)),se!==null&&(Fe=Lt*se,Ge==="border-box"&&(Fe=Fe+fe+Ye),Wt=Rt>Fe?"":"hidden",Rt=Math.min(Fe,Rt))}var Ne={height:Rt,overflowY:Wt,resize:"none"};return Ve&&(Ne.minHeight=Ve),Fe&&(Ne.maxHeight=Fe),Ne}var ee=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Et=0,_e=1,j=2,ft=De.forwardRef(function(W,Oe){var L=W,se=L.prefixCls,Pe=L.defaultValue,fe=L.value,Ye=L.autoSize,Ge=L.onResize,xe=L.className,Ve=L.style,Fe=L.disabled,Wt=L.onChange,Rt=L.onInternalAutoSize,Lt=(0,re.Z)(L,ee),Ne=(0,M.Z)(Pe,{value:fe,postState:function(et){return et!=null?et:""}}),vr=(0,T.Z)(Ne,2),lr=vr[0],P=vr[1],g=function(et){P(et.target.value),Wt==null||Wt(et)},C=De.useRef();De.useImperativeHandle(Oe,function(){return{textArea:C.current}});var p=De.useMemo(function(){return Ye&&(0,D.Z)(Ye)==="object"?[Ye.minRows,Ye.maxRows]:[]},[Ye]),x=(0,T.Z)(p,2),O=x[0],I=x[1],z=!!Ye,le=function(){try{if(document.activeElement===C.current){var et=C.current,cr=et.selectionStart,yr=et.selectionEnd,tr=et.scrollTop;C.current.setSelectionRange(cr,yr),C.current.scrollTop=tr}}catch(Cr){}},q=De.useState(j),de=(0,T.Z)(q,2),ie=de[0],ne=de[1],ge=De.useState(),k=(0,T.Z)(ge,2),ce=k[0],B=k[1],Ke=function(){ne(Et)};(0,Dt.Z)(function(){z&&Ke()},[fe,O,I,z]),(0,Dt.Z)(function(){if(ie===Et)ne(_e);else if(ie===_e){var be=ze(C.current,!1,O,I);ne(j),B(be)}else le()},[ie]);var pe=De.useRef(),Te=function(){ht.Z.cancel(pe.current)},Me=function(et){ie===j&&(Ge==null||Ge(et),Ye&&(Te(),pe.current=(0,ht.Z)(function(){Ke()})))};De.useEffect(function(){return Te},[]);var mt=z?ce:null,je=(0,K.Z)((0,K.Z)({},Ve),mt);return(ie===Et||ie===_e)&&(je.overflowY="hidden",je.overflowX="hidden"),De.createElement(St.Z,{onResize:Me,disabled:!(Ye||Ge)},De.createElement("textarea",(0,H.Z)({},Lt,{ref:C,style:je,className:Je()(se,xe,(0,Q.Z)({},"".concat(se,"-disabled"),Fe)),disabled:Fe,value:lr,onChange:g})))}),Nt=ft,N=["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"],E=De.forwardRef(function(W,Oe){var L,se=W.defaultValue,Pe=W.value,fe=W.onFocus,Ye=W.onBlur,Ge=W.onChange,xe=W.allowClear,Ve=W.maxLength,Fe=W.onCompositionStart,Wt=W.onCompositionEnd,Rt=W.suffix,Lt=W.prefixCls,Ne=Lt===void 0?"rc-textarea":Lt,vr=W.showCount,lr=W.count,P=W.className,g=W.style,C=W.disabled,p=W.hidden,x=W.classNames,O=W.styles,I=W.onResize,z=W.onClear,le=W.onPressEnter,q=W.readOnly,de=W.autoSize,ie=W.onKeyDown,ne=(0,re.Z)(W,N),ge=(0,M.Z)(se,{value:Pe,defaultValue:se}),k=(0,T.Z)(ge,2),ce=k[0],B=k[1],Ke=ce==null?"":String(ce),pe=De.useState(!1),Te=(0,T.Z)(pe,2),Me=Te[0],mt=Te[1],je=De.useRef(!1),be=De.useState(null),et=(0,T.Z)(be,2),cr=et[0],yr=et[1],tr=(0,De.useRef)(null),Cr=(0,De.useRef)(null),tt=function(){var v;return(v=Cr.current)===null||v===void 0?void 0:v.textArea},ut=function(){tt().focus()};(0,De.useImperativeHandle)(Oe,function(){var X;return{resizableTextArea:Cr.current,focus:ut,blur:function(){tt().blur()},nativeElement:((X=tr.current)===null||X===void 0?void 0:X.nativeElement)||tt()}}),(0,De.useEffect)(function(){mt(function(X){return!C&&X})},[C]);var zt=De.useState(null),Gt=(0,T.Z)(zt,2),Xt=Gt[0],$t=Gt[1];De.useEffect(function(){if(Xt){var X;(X=tt()).setSelectionRange.apply(X,(0,we.Z)(Xt))}},[Xt]);var Ot=(0,h.Z)(lr,vr),rr=(L=Ot.max)!==null&&L!==void 0?L:Ve,yt=Number(rr)>0,Fr=Ot.strategy(Ke),Kt=!!rr&&Fr>rr,sr=function(v,d){var Z=d;!je.current&&Ot.exceedFormatter&&Ot.max&&Ot.strategy(d)>Ot.max&&(Z=Ot.exceedFormatter(d,{max:Ot.max}),d!==Z&&$t([tt().selectionStart||0,tt().selectionEnd||0])),B(Z),(0,We.rJ)(v.currentTarget,v,Ge,Z)},kt=function(v){je.current=!0,Fe==null||Fe(v)},Or=function(v){je.current=!1,sr(v,v.currentTarget.value),Wt==null||Wt(v)},dn=function(v){sr(v,v.target.value)},Wr=function(v){v.key==="Enter"&&le&&le(v),ie==null||ie(v)},nr=function(v){mt(!0),fe==null||fe(v)},ar=function(v){mt(!1),Ye==null||Ye(v)},ur=function(v){B(""),ut(),(0,We.rJ)(tt(),v,Ge)},Yt=Rt,Ut;Ot.show&&(Ot.showFormatter?Ut=Ot.showFormatter({value:Ke,count:Fr,maxLength:rr}):Ut="".concat(Fr).concat(yt?" / ".concat(rr):""),Yt=De.createElement(De.Fragment,null,Yt,De.createElement("span",{className:Je()("".concat(Ne,"-data-count"),x==null?void 0:x.count),style:O==null?void 0:O.count},Ut)));var pr=function(v){var d;I==null||I(v),(d=tt())!==null&&d!==void 0&&d.style.height&&yr(!0)},Zt=!de&&!vr&&!xe;return De.createElement($.BaseInput,{ref:tr,value:Ke,allowClear:xe,handleReset:ur,suffix:Yt,prefixCls:Ne,classNames:(0,K.Z)((0,K.Z)({},x),{},{affixWrapper:Je()(x==null?void 0:x.affixWrapper,(0,Q.Z)((0,Q.Z)({},"".concat(Ne,"-show-count"),vr),"".concat(Ne,"-textarea-allow-clear"),xe))}),disabled:C,focused:Me,className:Je()(P,Kt&&"".concat(Ne,"-out-of-range")),style:(0,K.Z)((0,K.Z)({},g),cr&&!Zt?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Ut=="string"?Ut:void 0}},hidden:p,readOnly:q,onClear:z},De.createElement(Nt,(0,H.Z)({},ne,{autoSize:de,maxLength:Ve,onKeyDown:Wr,onChange:dn,onFocus:nr,onBlur:ar,onCompositionStart:kt,onCompositionEnd:Or,className:Je()(x==null?void 0:x.textarea),style:(0,K.Z)((0,K.Z)({},O==null?void 0:O.textarea),{},{resize:g==null?void 0:g.resize}),disabled:C,prefixCls:Ne,onResize:pr,ref:Cr,readOnly:q})))}),A=E,J=A},29125:function(yn,vt,b){"use strict";b.d(vt,{G:function(){return we},Z:function(){return Pt}});var H=b(92310),Q=b.n(H),K=b(59301);function we(gt){var he=gt.children,F=gt.prefixCls,xt=gt.id,ze=gt.overlayInnerStyle,ee=gt.bodyClassName,Et=gt.className,_e=gt.style;return K.createElement("div",{className:Q()("".concat(F,"-content"),Et),style:_e},K.createElement("div",{className:Q()("".concat(F,"-inner"),ee),id:xt,role:"tooltip",style:ze},typeof he=="function"?he():he))}var T=b(72308),re=b(77321),ae=b(74416),Je=b(65352),$={shiftX:64,adjustY:1},h={adjustX:1,shiftY:!0},We=[0,0],M={left:{points:["cr","cl"],overflow:h,offset:[-4,0],targetOffset:We},right:{points:["cl","cr"],overflow:h,offset:[4,0],targetOffset:We},top:{points:["bc","tc"],overflow:$,offset:[0,-4],targetOffset:We},bottom:{points:["tc","bc"],overflow:$,offset:[0,4],targetOffset:We},topLeft:{points:["bl","tl"],overflow:$,offset:[0,-4],targetOffset:We},leftTop:{points:["tr","tl"],overflow:h,offset:[-4,0],targetOffset:We},topRight:{points:["br","tr"],overflow:$,offset:[0,-4],targetOffset:We},rightTop:{points:["tl","tr"],overflow:h,offset:[4,0],targetOffset:We},bottomRight:{points:["tr","br"],overflow:$,offset:[0,4],targetOffset:We},rightBottom:{points:["bl","br"],overflow:h,offset:[4,0],targetOffset:We},bottomLeft:{points:["tl","bl"],overflow:$,offset:[0,4],targetOffset:We},leftBottom:{points:["br","bl"],overflow:h,offset:[-4,0],targetOffset:We}},De=null,D=b(80402),St=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],Dt=function(he,F){var xt=he.overlayClassName,ze=he.trigger,ee=ze===void 0?["hover"]:ze,Et=he.mouseEnterDelay,_e=Et===void 0?0:Et,j=he.mouseLeaveDelay,ft=j===void 0?.1:j,Nt=he.overlayStyle,N=he.prefixCls,E=N===void 0?"rc-tooltip":N,A=he.children,J=he.onVisibleChange,W=he.afterVisibleChange,Oe=he.transitionName,L=he.animation,se=he.motion,Pe=he.placement,fe=Pe===void 0?"right":Pe,Ye=he.align,Ge=Ye===void 0?{}:Ye,xe=he.destroyTooltipOnHide,Ve=xe===void 0?!1:xe,Fe=he.defaultVisible,Wt=he.getTooltipContainer,Rt=he.overlayInnerStyle,Lt=he.arrowContent,Ne=he.overlay,vr=he.id,lr=he.showArrow,P=lr===void 0?!0:lr,g=he.classNames,C=he.styles,p=(0,ae.Z)(he,St),x=(0,D.Z)(vr),O=(0,K.useRef)(null);(0,K.useImperativeHandle)(F,function(){return O.current});var I=(0,re.Z)({},p);"visible"in he&&(I.popupVisible=he.visible);var z=function(){return K.createElement(we,{key:"content",prefixCls:E,id:x,bodyClassName:g==null?void 0:g.body,overlayInnerStyle:(0,re.Z)((0,re.Z)({},Rt),C==null?void 0:C.body)},Ne)},le=function(){var de=K.Children.only(A),ie=(de==null?void 0:de.props)||{},ne=(0,re.Z)((0,re.Z)({},ie),{},{"aria-describedby":Ne?x:null});return K.cloneElement(A,ne)};return K.createElement(Je.Z,(0,T.Z)({popupClassName:Q()(xt,g==null?void 0:g.root),prefixCls:E,popup:z,action:ee,builtinPlacements:M,popupPlacement:fe,ref:O,popupAlign:Ge,getPopupContainer:Wt,onPopupVisibleChange:J,afterPopupVisibleChange:W,popupTransitionName:Oe,popupAnimation:L,popupMotion:se,defaultPopupVisible:Fe,autoDestroy:Ve,mouseLeaveDelay:ft,popupStyle:(0,re.Z)((0,re.Z)({},Nt),C==null?void 0:C.root),mouseEnterDelay:_e,arrow:P},I),le())},ht=(0,K.forwardRef)(Dt),Pt=ht},49658:function(yn,vt){"use strict";vt.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))}},45680:function(yn,vt,b){"use strict";b.d(vt,{Z:function(){return lr}});var H=b(72308),Q=b(62853),K=b(77321),we=b(49618),T=b(52487),re=b(74416),ae=b(92310),Je=b.n(ae),$=b(29301),h=b(70425),We=b(34280),M=b(59301),De=b(4676),D=M.forwardRef(function(P,g){var C=P.height,p=P.offsetY,x=P.offsetX,O=P.children,I=P.prefixCls,z=P.onInnerResize,le=P.innerProps,q=P.rtl,de=P.extra,ie={},ne={display:"flex",flexDirection:"column"};return p!==void 0&&(ie={height:C,position:"relative",overflow:"hidden"},ne=(0,K.Z)((0,K.Z)({},ne),{},(0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)((0,we.Z)({transform:"translateY(".concat(p,"px)")},q?"marginRight":"marginLeft",-x),"position","absolute"),"left",0),"right",0),"top",0))),M.createElement("div",{style:ie},M.createElement($.Z,{onResize:function(k){var ce=k.offsetHeight;ce&&z&&z()}},M.createElement("div",(0,H.Z)({style:ne,className:Je()((0,we.Z)({},"".concat(I,"-holder-inner"),I)),ref:g},le),O,de)))});D.displayName="Filler";var St=D;function Dt(P){var g=P.children,C=P.setRef,p=M.useCallback(function(x){C(x)},[]);return M.cloneElement(g,{ref:p})}function ht(P,g,C,p,x,O,I,z){var le=z.getKey;return P.slice(g,C+1).map(function(q,de){var ie=g+de,ne=I(q,ie,{style:{width:p},offsetX:x}),ge=le(q);return M.createElement(Dt,{key:ge,setRef:function(ce){return O(q,ce)}},ne)})}function Pt(P,g,C,p){var x=C-P,O=g-C,I=Math.min(x,O)*2;if(p<=I){var z=Math.floor(p/2);return p%2?C+z+1:C-z}return x>O?C-(p-O):C+(p-x)}function gt(P,g,C){var p=P.length,x=g.length,O,I;if(p===0&&x===0)return null;p<x?(O=P,I=g):(O=g,I=P);var z={__EMPTY_ITEM__:!0};function le(k){return k!==void 0?C(k):z}for(var q=null,de=Math.abs(p-x)!==1,ie=0;ie<I.length;ie+=1){var ne=le(O[ie]),ge=le(I[ie]);if(ne!==ge){q=ie,de=de||ne!==le(I[ie+1]);break}}return q===null?null:{index:q,multiple:de}}function he(P,g,C){var p=M.useState(P),x=(0,T.Z)(p,2),O=x[0],I=x[1],z=M.useState(null),le=(0,T.Z)(z,2),q=le[0],de=le[1];return M.useEffect(function(){var ie=gt(O||[],P||[],g);(ie==null?void 0:ie.index)!==void 0&&(C==null||C(ie.index),de(P[ie.index])),I(P)},[P]),[q]}var F=b(16089),xt=(typeof navigator=="undefined"?"undefined":(0,Q.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),ze=xt,ee=function(P,g,C,p){var x=(0,M.useRef)(!1),O=(0,M.useRef)(null);function I(){clearTimeout(O.current),x.current=!0,O.current=setTimeout(function(){x.current=!1},50)}var z=(0,M.useRef)({top:P,bottom:g,left:C,right:p});return z.current.top=P,z.current.bottom=g,z.current.left=C,z.current.right=p,function(le,q){var de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,ie=le?q<0&&z.current.left||q>0&&z.current.right:q<0&&z.current.top||q>0&&z.current.bottom;return de&&ie?(clearTimeout(O.current),x.current=!1):(!ie||x.current)&&I(),!x.current&&ie}};function Et(P,g,C,p,x,O,I){var z=(0,M.useRef)(0),le=(0,M.useRef)(null),q=(0,M.useRef)(null),de=(0,M.useRef)(!1),ie=ee(g,C,p,x);function ne(pe,Te){if(F.Z.cancel(le.current),!ie(!1,Te)){var Me=pe;if(!Me._virtualHandled)Me._virtualHandled=!0;else return;z.current+=Te,q.current=Te,ze||Me.preventDefault(),le.current=(0,F.Z)(function(){var mt=de.current?10:1;I(z.current*mt,!1),z.current=0})}}function ge(pe,Te){I(Te,!0),ze||pe.preventDefault()}var k=(0,M.useRef)(null),ce=(0,M.useRef)(null);function B(pe){if(P){F.Z.cancel(ce.current),ce.current=(0,F.Z)(function(){k.current=null},2);var Te=pe.deltaX,Me=pe.deltaY,mt=pe.shiftKey,je=Te,be=Me;(k.current==="sx"||!k.current&&mt&&Me&&!Te)&&(je=Me,be=0,k.current="sx");var et=Math.abs(je),cr=Math.abs(be);k.current===null&&(k.current=O&&et>cr?"x":"y"),k.current==="y"?ne(pe,be):ge(pe,je)}}function Ke(pe){P&&(de.current=pe.detail===q.current)}return[B,Ke]}function _e(P,g,C,p){var x=M.useMemo(function(){return[new Map,[]]},[P,C.id,p]),O=(0,T.Z)(x,2),I=O[0],z=O[1],le=function(de){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:de,ne=I.get(de),ge=I.get(ie);if(ne===void 0||ge===void 0)for(var k=P.length,ce=z.length;ce<k;ce+=1){var B,Ke=P[ce],pe=g(Ke);I.set(pe,ce);var Te=(B=C.get(pe))!==null&&B!==void 0?B:p;if(z[ce]=(z[ce-1]||0)+Te,pe===de&&(ne=ce),pe===ie&&(ge=ce),ne!==void 0&&ge!==void 0)break}return{top:z[ne-1]||0,bottom:z[ge]}};return le}var j=b(96949),ft=b(55090),Nt=function(){function P(){(0,j.Z)(this,P),(0,we.Z)(this,"maps",void 0),(0,we.Z)(this,"id",0),(0,we.Z)(this,"diffKeys",new Set),this.maps=Object.create(null)}return(0,ft.Z)(P,[{key:"set",value:function(C,p){this.maps[C]=p,this.id+=1,this.diffKeys.add(C)}},{key:"get",value:function(C){return this.maps[C]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),P}(),N=Nt;function E(P){var g=parseFloat(P);return isNaN(g)?0:g}function A(P,g,C){var p=M.useState(0),x=(0,T.Z)(p,2),O=x[0],I=x[1],z=(0,M.useRef)(new Map),le=(0,M.useRef)(new N),q=(0,M.useRef)(0);function de(){q.current+=1}function ie(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;de();var k=function(){var Ke=!1;z.current.forEach(function(pe,Te){if(pe&&pe.offsetParent){var Me=pe.offsetHeight,mt=getComputedStyle(pe),je=mt.marginTop,be=mt.marginBottom,et=E(je),cr=E(be),yr=Me+et+cr;le.current.get(Te)!==yr&&(le.current.set(Te,yr),Ke=!0)}}),Ke&&I(function(pe){return pe+1})};if(ge)k();else{q.current+=1;var ce=q.current;Promise.resolve().then(function(){ce===q.current&&k()})}}function ne(ge,k){var ce=P(ge),B=z.current.get(ce);k?(z.current.set(ce,k),ie()):z.current.delete(ce),!B!=!k&&(k?g==null||g(ge):C==null||C(ge))}return(0,M.useEffect)(function(){return de},[]),[ne,ie,le.current,O]}var J=14/15;function W(P,g,C){var p=(0,M.useRef)(!1),x=(0,M.useRef)(0),O=(0,M.useRef)(0),I=(0,M.useRef)(null),z=(0,M.useRef)(null),le,q=function(ge){if(p.current){var k=Math.ceil(ge.touches[0].pageX),ce=Math.ceil(ge.touches[0].pageY),B=x.current-k,Ke=O.current-ce,pe=Math.abs(B)>Math.abs(Ke);pe?x.current=k:O.current=ce;var Te=C(pe,pe?B:Ke,!1,ge);Te&&ge.preventDefault(),clearInterval(z.current),Te&&(z.current=setInterval(function(){pe?B*=J:Ke*=J;var Me=Math.floor(pe?B:Ke);(!C(pe,Me,!0)||Math.abs(Me)<=.1)&&clearInterval(z.current)},16))}},de=function(){p.current=!1,le()},ie=function(ge){le(),ge.touches.length===1&&!p.current&&(p.current=!0,x.current=Math.ceil(ge.touches[0].pageX),O.current=Math.ceil(ge.touches[0].pageY),I.current=ge.target,I.current.addEventListener("touchmove",q,{passive:!1}),I.current.addEventListener("touchend",de,{passive:!0}))};le=function(){I.current&&(I.current.removeEventListener("touchmove",q),I.current.removeEventListener("touchend",de))},(0,We.Z)(function(){return P&&g.current.addEventListener("touchstart",ie,{passive:!0}),function(){var ne;(ne=g.current)===null||ne===void 0||ne.removeEventListener("touchstart",ie),le(),clearInterval(z.current)}},[P])}function Oe(P){return Math.floor(Math.pow(P,.5))}function L(P,g){var C="touches"in P?P.touches[0]:P;return C[g?"pageX":"pageY"]-window[g?"scrollX":"scrollY"]}function se(P,g,C){M.useEffect(function(){var p=g.current;if(P&&p){var x=!1,O,I,z=function(){F.Z.cancel(O)},le=function ne(){z(),O=(0,F.Z)(function(){C(I),ne()})},q=function(ge){if(!(ge.target.draggable||ge.button!==0)){var k=ge;k._virtualHandled||(k._virtualHandled=!0,x=!0)}},de=function(){x=!1,z()},ie=function(ge){if(x){var k=L(ge,!1),ce=p.getBoundingClientRect(),B=ce.top,Ke=ce.bottom;if(k<=B){var pe=B-k;I=-Oe(pe),le()}else if(k>=Ke){var Te=k-Ke;I=Oe(Te),le()}else z()}};return p.addEventListener("mousedown",q),p.ownerDocument.addEventListener("mouseup",de),p.ownerDocument.addEventListener("mousemove",ie),function(){p.removeEventListener("mousedown",q),p.ownerDocument.removeEventListener("mouseup",de),p.ownerDocument.removeEventListener("mousemove",ie),z()}}},[P])}var Pe=10;function fe(P,g,C,p,x,O,I,z){var le=M.useRef(),q=M.useState(null),de=(0,T.Z)(q,2),ie=de[0],ne=de[1];return(0,We.Z)(function(){if(ie&&ie.times<Pe){if(!P.current){ne(function(Ot){return(0,K.Z)({},Ot)});return}O();var ge=ie.targetAlign,k=ie.originAlign,ce=ie.index,B=ie.offset,Ke=P.current.clientHeight,pe=!1,Te=ge,Me=null;if(Ke){for(var mt=ge||k,je=0,be=0,et=0,cr=Math.min(g.length-1,ce),yr=0;yr<=cr;yr+=1){var tr=x(g[yr]);be=je;var Cr=C.get(tr);et=be+(Cr===void 0?p:Cr),je=et}for(var tt=mt==="top"?B:Ke-B,ut=cr;ut>=0;ut-=1){var zt=x(g[ut]),Gt=C.get(zt);if(Gt===void 0){pe=!0;break}if(tt-=Gt,tt<=0)break}switch(mt){case"top":Me=be-B;break;case"bottom":Me=et-Ke+B;break;default:{var Xt=P.current.scrollTop,$t=Xt+Ke;be<Xt?Te="top":et>$t&&(Te="bottom")}}Me!==null&&I(Me),Me!==ie.lastTop&&(pe=!0)}pe&&ne((0,K.Z)((0,K.Z)({},ie),{},{times:ie.times+1,targetAlign:Te,lastTop:Me}))}},[ie,P.current]),function(ge){if(ge==null){z();return}if(F.Z.cancel(le.current),typeof ge=="number")I(ge);else if(ge&&(0,Q.Z)(ge)==="object"){var k,ce=ge.align;"index"in ge?k=ge.index:k=g.findIndex(function(pe){return x(pe)===ge.key});var B=ge.offset,Ke=B===void 0?0:B;ne({times:0,index:k,offset:Ke,originAlign:ce})}}}var Ye=M.forwardRef(function(P,g){var C=P.prefixCls,p=P.rtl,x=P.scrollOffset,O=P.scrollRange,I=P.onStartMove,z=P.onStopMove,le=P.onScroll,q=P.horizontal,de=P.spinSize,ie=P.containerSize,ne=P.style,ge=P.thumbStyle,k=P.showScrollBar,ce=M.useState(!1),B=(0,T.Z)(ce,2),Ke=B[0],pe=B[1],Te=M.useState(null),Me=(0,T.Z)(Te,2),mt=Me[0],je=Me[1],be=M.useState(null),et=(0,T.Z)(be,2),cr=et[0],yr=et[1],tr=!p,Cr=M.useRef(),tt=M.useRef(),ut=M.useState(k),zt=(0,T.Z)(ut,2),Gt=zt[0],Xt=zt[1],$t=M.useRef(),Ot=function(){k===!0||k===!1||(clearTimeout($t.current),Xt(!0),$t.current=setTimeout(function(){Xt(!1)},3e3))},rr=O-ie||0,yt=ie-de||0,Fr=M.useMemo(function(){if(x===0||rr===0)return 0;var ur=x/rr;return ur*yt},[x,rr,yt]),Kt=function(Yt){Yt.stopPropagation(),Yt.preventDefault()},sr=M.useRef({top:Fr,dragging:Ke,pageY:mt,startTop:cr});sr.current={top:Fr,dragging:Ke,pageY:mt,startTop:cr};var kt=function(Yt){pe(!0),je(L(Yt,q)),yr(sr.current.top),I(),Yt.stopPropagation(),Yt.preventDefault()};M.useEffect(function(){var ur=function(Zt){Zt.preventDefault()},Yt=Cr.current,Ut=tt.current;return Yt.addEventListener("touchstart",ur,{passive:!1}),Ut.addEventListener("touchstart",kt,{passive:!1}),function(){Yt.removeEventListener("touchstart",ur),Ut.removeEventListener("touchstart",kt)}},[]);var Or=M.useRef();Or.current=rr;var dn=M.useRef();dn.current=yt,M.useEffect(function(){if(Ke){var ur,Yt=function(Zt){var X=sr.current,v=X.dragging,d=X.pageY,Z=X.startTop;F.Z.cancel(ur);var w=Cr.current.getBoundingClientRect(),Y=ie/(q?w.width:w.height);if(v){var te=(L(Zt,q)-d)*Y,ye=Z;!tr&&q?ye-=te:ye+=te;var m=Or.current,U=dn.current,Ae=U?ye/U:0,Ee=Math.ceil(Ae*m);Ee=Math.max(Ee,0),Ee=Math.min(Ee,m),ur=(0,F.Z)(function(){le(Ee,q)})}},Ut=function(){pe(!1),z()};return window.addEventListener("mousemove",Yt,{passive:!0}),window.addEventListener("touchmove",Yt,{passive:!0}),window.addEventListener("mouseup",Ut,{passive:!0}),window.addEventListener("touchend",Ut,{passive:!0}),function(){window.removeEventListener("mousemove",Yt),window.removeEventListener("touchmove",Yt),window.removeEventListener("mouseup",Ut),window.removeEventListener("touchend",Ut),F.Z.cancel(ur)}}},[Ke]),M.useEffect(function(){return Ot(),function(){clearTimeout($t.current)}},[x]),M.useImperativeHandle(g,function(){return{delayHidden:Ot}});var Wr="".concat(C,"-scrollbar"),nr={position:"absolute",visibility:Gt?null:"hidden"},ar={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return q?(nr.height=8,nr.left=0,nr.right=0,nr.bottom=0,ar.height="100%",ar.width=de,tr?ar.left=Fr:ar.right=Fr):(nr.width=8,nr.top=0,nr.bottom=0,tr?nr.right=0:nr.left=0,ar.width="100%",ar.height=de,ar.top=Fr),M.createElement("div",{ref:Cr,className:Je()(Wr,(0,we.Z)((0,we.Z)((0,we.Z)({},"".concat(Wr,"-horizontal"),q),"".concat(Wr,"-vertical"),!q),"".concat(Wr,"-visible"),Gt)),style:(0,K.Z)((0,K.Z)({},nr),ne),onMouseDown:Kt,onMouseMove:Ot},M.createElement("div",{ref:tt,className:Je()("".concat(Wr,"-thumb"),(0,we.Z)({},"".concat(Wr,"-thumb-moving"),Ke)),style:(0,K.Z)((0,K.Z)({},ar),ge),onMouseDown:kt}))}),Ge=Ye,xe=20;function Ve(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,C=P/g*P;return isNaN(C)&&(C=0),C=Math.max(C,xe),Math.floor(C)}var Fe=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],Wt=[],Rt={overflowY:"auto",overflowAnchor:"none"};function Lt(P,g){var C=P.prefixCls,p=C===void 0?"rc-virtual-list":C,x=P.className,O=P.height,I=P.itemHeight,z=P.fullHeight,le=z===void 0?!0:z,q=P.style,de=P.data,ie=P.children,ne=P.itemKey,ge=P.virtual,k=P.direction,ce=P.scrollWidth,B=P.component,Ke=B===void 0?"div":B,pe=P.onScroll,Te=P.onVirtualScroll,Me=P.onVisibleChange,mt=P.innerProps,je=P.extraRender,be=P.styles,et=P.showScrollBar,cr=et===void 0?"optional":et,yr=(0,re.Z)(P,Fe),tr=M.useCallback(function(V){return typeof ne=="function"?ne(V):V==null?void 0:V[ne]},[ne]),Cr=A(tr,null,null),tt=(0,T.Z)(Cr,4),ut=tt[0],zt=tt[1],Gt=tt[2],Xt=tt[3],$t=!!(ge!==!1&&O&&I),Ot=M.useMemo(function(){return Object.values(Gt.maps).reduce(function(V,G){return V+G},0)},[Gt.id,Gt.maps]),rr=$t&&de&&(Math.max(I*de.length,Ot)>O||!!ce),yt=k==="rtl",Fr=Je()(p,(0,we.Z)({},"".concat(p,"-rtl"),yt),x),Kt=de||Wt,sr=(0,M.useRef)(),kt=(0,M.useRef)(),Or=(0,M.useRef)(),dn=(0,M.useState)(0),Wr=(0,T.Z)(dn,2),nr=Wr[0],ar=Wr[1],ur=(0,M.useState)(0),Yt=(0,T.Z)(ur,2),Ut=Yt[0],pr=Yt[1],Zt=(0,M.useState)(!1),X=(0,T.Z)(Zt,2),v=X[0],d=X[1],Z=function(){d(!0)},w=function(){d(!1)},Y={getKey:tr};function te(V){ar(function(G){var ke;typeof V=="function"?ke=V(G):ke=V;var nt=Ht(ke);return sr.current.scrollTop=nt,nt})}var ye=(0,M.useRef)({start:0,end:Kt.length}),m=(0,M.useRef)(),U=he(Kt,tr),Ae=(0,T.Z)(U,1),Ee=Ae[0];m.current=Ee;var Ze=M.useMemo(function(){if(!$t)return{scrollHeight:void 0,start:0,end:Kt.length-1,offset:void 0};if(!rr){var V;return{scrollHeight:((V=kt.current)===null||V===void 0?void 0:V.offsetHeight)||0,start:0,end:Kt.length-1,offset:void 0}}for(var G=0,ke,nt,dt,Ir=Kt.length,Ar=0;Ar<Ir;Ar+=1){var ln=Kt[Ar],Kr=tr(ln),gr=Gt.get(Kr),Ur=G+(gr===void 0?I:gr);Ur>=nr&&ke===void 0&&(ke=Ar,nt=G),Ur>nr+O&&dt===void 0&&(dt=Ar),G=Ur}return ke===void 0&&(ke=0,nt=0,dt=Math.ceil(O/I)),dt===void 0&&(dt=Kt.length-1),dt=Math.min(dt+1,Kt.length-1),{scrollHeight:G,start:ke,end:dt,offset:nt}},[rr,$t,nr,Kt,Xt,O]),$e=Ze.scrollHeight,Le=Ze.start,oe=Ze.end,me=Ze.offset;ye.current.start=Le,ye.current.end=oe,M.useLayoutEffect(function(){var V=Gt.getRecord();if(V.size===1){var G=Array.from(V)[0],ke=Kt[Le];if(ke){var nt=tr(ke);if(nt===G){var dt=Gt.get(G),Ir=dt-I;te(function(Ar){return Ar+Ir})}}}Gt.resetRecord()},[$e]);var ve=M.useState({width:0,height:O}),He=(0,T.Z)(ve,2),Xe=He[0],qt=He[1],Tt=function(G){qt({width:G.offsetWidth,height:G.offsetHeight})},It=(0,M.useRef)(),st=(0,M.useRef)(),br=M.useMemo(function(){return Ve(Xe.width,ce)},[Xe.width,ce]),hr=M.useMemo(function(){return Ve(Xe.height,$e)},[Xe.height,$e]),or=$e-O,mr=(0,M.useRef)(or);mr.current=or;function Ht(V){var G=V;return Number.isNaN(mr.current)||(G=Math.min(G,mr.current)),G=Math.max(G,0),G}var At=nr<=0,fr=nr>=or,Vt=Ut<=0,jt=Ut>=ce,rt=ee(At,fr,Vt,jt),Ct=function(){return{x:yt?-Ut:Ut,y:nr}},er=(0,M.useRef)(Ct()),Ft=(0,h.zX)(function(V){if(Te){var G=(0,K.Z)((0,K.Z)({},Ct()),V);(er.current.x!==G.x||er.current.y!==G.y)&&(Te(G),er.current=G)}});function Qe(V,G){var ke=V;G?((0,De.flushSync)(function(){pr(ke)}),Ft()):te(ke)}function Mt(V){var G=V.currentTarget.scrollTop;G!==nr&&te(G),pe==null||pe(V),Ft()}var Pr=function(G){var ke=G,nt=ce?ce-Xe.width:0;return ke=Math.max(ke,0),ke=Math.min(ke,nt),ke},Jr=(0,h.zX)(function(V,G){G?((0,De.flushSync)(function(){pr(function(ke){var nt=ke+(yt?-V:V);return Pr(nt)})}),Ft()):te(function(ke){var nt=ke+V;return nt})}),zr=Et($t,At,fr,Vt,jt,!!ce,Jr),Sr=(0,T.Z)(zr,2),nn=Sr[0],Mr=Sr[1];W($t,sr,function(V,G,ke,nt){var dt=nt;return rt(V,G,ke)?!1:!dt||!dt._virtualHandled?(dt&&(dt._virtualHandled=!0),nn({preventDefault:function(){},deltaX:V?G:0,deltaY:V?0:G}),!0):!1}),se(rr,sr,function(V){te(function(G){return G+V})}),(0,We.Z)(function(){function V(ke){var nt=At&&ke.detail<0,dt=fr&&ke.detail>0;$t&&!nt&&!dt&&ke.preventDefault()}var G=sr.current;return G.addEventListener("wheel",nn,{passive:!1}),G.addEventListener("DOMMouseScroll",Mr,{passive:!0}),G.addEventListener("MozMousePixelScroll",V,{passive:!1}),function(){G.removeEventListener("wheel",nn),G.removeEventListener("DOMMouseScroll",Mr),G.removeEventListener("MozMousePixelScroll",V)}},[$t,At,fr]),(0,We.Z)(function(){if(ce){var V=Pr(Ut);pr(V),Ft({x:V})}},[Xe.width,ce]);var tn=function(){var G,ke;(G=It.current)===null||G===void 0||G.delayHidden(),(ke=st.current)===null||ke===void 0||ke.delayHidden()},Qr=fe(sr,Kt,Gt,I,tr,function(){return zt(!0)},te,tn);M.useImperativeHandle(g,function(){return{nativeElement:Or.current,getScrollInfo:Ct,scrollTo:function(G){function ke(nt){return nt&&(0,Q.Z)(nt)==="object"&&("left"in nt||"top"in nt)}ke(G)?(G.left!==void 0&&pr(Pr(G.left)),Qr(G.top)):Qr(G)}}}),(0,We.Z)(function(){if(Me){var V=Kt.slice(Le,oe+1);Me(V,Kt)}},[Le,oe,Kt]);var Lr=_e(Kt,tr,Gt,I),ct=je==null?void 0:je({start:Le,end:oe,virtual:rr,offsetX:Ut,offsetY:me,rtl:yt,getSize:Lr}),Ue=ht(Kt,Le,oe,ce,Ut,ut,ie,Y),wt=null;O&&(wt=(0,K.Z)((0,we.Z)({},le?"height":"maxHeight",O),Rt),$t&&(wt.overflowY="hidden",ce&&(wt.overflowX="hidden"),v&&(wt.pointerEvents="none")));var _t={};return yt&&(_t.dir="rtl"),M.createElement("div",(0,H.Z)({ref:Or,style:(0,K.Z)((0,K.Z)({},q),{},{position:"relative"}),className:Fr},_t,yr),M.createElement($.Z,{onResize:Tt},M.createElement(Ke,{className:"".concat(p,"-holder"),style:wt,ref:sr,onScroll:Mt,onMouseEnter:tn},M.createElement(St,{prefixCls:p,height:$e,offsetX:Ut,offsetY:me,scrollWidth:ce,onInnerResize:zt,ref:kt,innerProps:mt,rtl:yt,extra:ct},Ue))),rr&&$e>O&&M.createElement(Ge,{ref:It,prefixCls:p,scrollOffset:nr,scrollRange:$e,rtl:yt,onScroll:Qe,onStartMove:Z,onStopMove:w,spinSize:hr,containerSize:Xe.height,style:be==null?void 0:be.verticalScrollBar,thumbStyle:be==null?void 0:be.verticalScrollBarThumb,showScrollBar:cr}),rr&&ce>Xe.width&&M.createElement(Ge,{ref:st,prefixCls:p,scrollOffset:Ut,scrollRange:ce,rtl:yt,onScroll:Qe,onStartMove:Z,onStopMove:w,spinSize:br,containerSize:Xe.width,horizontal:!0,style:be==null?void 0:be.horizontalScrollBar,thumbStyle:be==null?void 0:be.horizontalScrollBarThumb,showScrollBar:cr}))}var Ne=M.forwardRef(Lt);Ne.displayName="List";var vr=Ne,lr=vr},76374:function(yn,vt,b){"use strict";var H=function(){if(typeof Map!="undefined")return Map;function N(E,A){var J=-1;return E.some(function(W,Oe){return W[0]===A?(J=Oe,!0):!1}),J}return function(){function E(){this.__entries__=[]}return Object.defineProperty(E.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),E.prototype.get=function(A){var J=N(this.__entries__,A),W=this.__entries__[J];return W&&W[1]},E.prototype.set=function(A,J){var W=N(this.__entries__,A);~W?this.__entries__[W][1]=J:this.__entries__.push([A,J])},E.prototype.delete=function(A){var J=this.__entries__,W=N(J,A);~W&&J.splice(W,1)},E.prototype.has=function(A){return!!~N(this.__entries__,A)},E.prototype.clear=function(){this.__entries__.splice(0)},E.prototype.forEach=function(A,J){J===void 0&&(J=null);for(var W=0,Oe=this.__entries__;W<Oe.length;W++){var L=Oe[W];A.call(J,L[1],L[0])}},E}()}(),Q=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,K=function(){return typeof b.g!="undefined"&&b.g.Math===Math?b.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),we=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(K):function(N){return setTimeout(function(){return N(Date.now())},1e3/60)}}(),T=2;function re(N,E){var A=!1,J=!1,W=0;function Oe(){A&&(A=!1,N()),J&&se()}function L(){we(Oe)}function se(){var Pe=Date.now();if(A){if(Pe-W<T)return;J=!0}else A=!0,J=!1,setTimeout(L,E);W=Pe}return se}var ae=20,Je=["top","right","bottom","left","width","height","size","weight"],$=typeof MutationObserver!="undefined",h=function(){function N(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=re(this.refresh.bind(this),ae)}return N.prototype.addObserver=function(E){~this.observers_.indexOf(E)||this.observers_.push(E),this.connected_||this.connect_()},N.prototype.removeObserver=function(E){var A=this.observers_,J=A.indexOf(E);~J&&A.splice(J,1),!A.length&&this.connected_&&this.disconnect_()},N.prototype.refresh=function(){var E=this.updateObservers_();E&&this.refresh()},N.prototype.updateObservers_=function(){var E=this.observers_.filter(function(A){return A.gatherActive(),A.hasActive()});return E.forEach(function(A){return A.broadcastActive()}),E.length>0},N.prototype.connect_=function(){!Q||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),$?(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)},N.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)},N.prototype.onTransitionEnd_=function(E){var A=E.propertyName,J=A===void 0?"":A,W=Je.some(function(Oe){return!!~J.indexOf(Oe)});W&&this.refresh()},N.getInstance=function(){return this.instance_||(this.instance_=new N),this.instance_},N.instance_=null,N}(),We=function(N,E){for(var A=0,J=Object.keys(E);A<J.length;A++){var W=J[A];Object.defineProperty(N,W,{value:E[W],enumerable:!1,writable:!1,configurable:!0})}return N},M=function(N){var E=N&&N.ownerDocument&&N.ownerDocument.defaultView;return E||K},De=ze(0,0,0,0);function D(N){return parseFloat(N)||0}function St(N){for(var E=[],A=1;A<arguments.length;A++)E[A-1]=arguments[A];return E.reduce(function(J,W){var Oe=N["border-"+W+"-width"];return J+D(Oe)},0)}function Dt(N){for(var E=["top","right","bottom","left"],A={},J=0,W=E;J<W.length;J++){var Oe=W[J],L=N["padding-"+Oe];A[Oe]=D(L)}return A}function ht(N){var E=N.getBBox();return ze(0,0,E.width,E.height)}function Pt(N){var E=N.clientWidth,A=N.clientHeight;if(!E&&!A)return De;var J=M(N).getComputedStyle(N),W=Dt(J),Oe=W.left+W.right,L=W.top+W.bottom,se=D(J.width),Pe=D(J.height);if(J.boxSizing==="border-box"&&(Math.round(se+Oe)!==E&&(se-=St(J,"left","right")+Oe),Math.round(Pe+L)!==A&&(Pe-=St(J,"top","bottom")+L)),!he(N)){var fe=Math.round(se+Oe)-E,Ye=Math.round(Pe+L)-A;Math.abs(fe)!==1&&(se-=fe),Math.abs(Ye)!==1&&(Pe-=Ye)}return ze(W.left,W.top,se,Pe)}var gt=function(){return typeof SVGGraphicsElement!="undefined"?function(N){return N instanceof M(N).SVGGraphicsElement}:function(N){return N instanceof M(N).SVGElement&&typeof N.getBBox=="function"}}();function he(N){return N===M(N).document.documentElement}function F(N){return Q?gt(N)?ht(N):Pt(N):De}function xt(N){var E=N.x,A=N.y,J=N.width,W=N.height,Oe=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,L=Object.create(Oe.prototype);return We(L,{x:E,y:A,width:J,height:W,top:A,right:E+J,bottom:W+A,left:E}),L}function ze(N,E,A,J){return{x:N,y:E,width:A,height:J}}var ee=function(){function N(E){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ze(0,0,0,0),this.target=E}return N.prototype.isActive=function(){var E=F(this.target);return this.contentRect_=E,E.width!==this.broadcastWidth||E.height!==this.broadcastHeight},N.prototype.broadcastRect=function(){var E=this.contentRect_;return this.broadcastWidth=E.width,this.broadcastHeight=E.height,E},N}(),Et=function(){function N(E,A){var J=xt(A);We(this,{target:E,contentRect:J})}return N}(),_e=function(){function N(E,A,J){if(this.activeObservations_=[],this.observations_=new H,typeof E!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=E,this.controller_=A,this.callbackCtx_=J}return N.prototype.observe=function(E){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(E instanceof M(E).Element))throw new TypeError('parameter 1 is not of type "Element".');var A=this.observations_;A.has(E)||(A.set(E,new ee(E)),this.controller_.addObserver(this),this.controller_.refresh())}},N.prototype.unobserve=function(E){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(E instanceof M(E).Element))throw new TypeError('parameter 1 is not of type "Element".');var A=this.observations_;A.has(E)&&(A.delete(E),A.size||this.controller_.removeObserver(this))}},N.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},N.prototype.gatherActive=function(){var E=this;this.clearActive(),this.observations_.forEach(function(A){A.isActive()&&E.activeObservations_.push(A)})},N.prototype.broadcastActive=function(){if(this.hasActive()){var E=this.callbackCtx_,A=this.activeObservations_.map(function(J){return new Et(J.target,J.broadcastRect())});this.callback_.call(E,A,E),this.clearActive()}},N.prototype.clearActive=function(){this.activeObservations_.splice(0)},N.prototype.hasActive=function(){return this.activeObservations_.length>0},N}(),j=typeof WeakMap!="undefined"?new WeakMap:new H,ft=function(){function N(E){if(!(this instanceof N))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var A=h.getInstance(),J=new _e(E,A,this);j.set(this,J)}return N}();["observe","unobserve","disconnect"].forEach(function(N){ft.prototype[N]=function(){var E;return(E=j.get(this))[N].apply(E,arguments)}});var Nt=function(){return typeof K.ResizeObserver!="undefined"?K.ResizeObserver:ft}();vt.Z=Nt},16722:function(yn,vt,b){"use strict";b.d(vt,{Z:function(){return Je}});const H=$=>typeof $=="object"&&$!=null&&$.nodeType===1,Q=($,h)=>(!h||$!=="hidden")&&$!=="visible"&&$!=="clip",K=($,h)=>{if($.clientHeight<$.scrollHeight||$.clientWidth<$.scrollWidth){const We=getComputedStyle($,null);return Q(We.overflowY,h)||Q(We.overflowX,h)||(M=>{const De=(D=>{if(!D.ownerDocument||!D.ownerDocument.defaultView)return null;try{return D.ownerDocument.defaultView.frameElement}catch(St){return null}})(M);return!!De&&(De.clientHeight<M.scrollHeight||De.clientWidth<M.scrollWidth)})($)}return!1},we=($,h,We,M,De,D,St,Dt)=>D<$&&St>h||D>$&&St<h?0:D<=$&&Dt<=We||St>=h&&Dt>=We?D-$-M:St>h&&Dt<We||D<$&&Dt>We?St-h+De:0,T=$=>{const h=$.parentElement;return h==null?$.getRootNode().host||null:h},re=($,h)=>{var We,M,De,D;if(typeof document=="undefined")return[];const{scrollMode:St,block:Dt,inline:ht,boundary:Pt,skipOverflowHiddenElements:gt}=h,he=typeof Pt=="function"?Pt:Ge=>Ge!==Pt;if(!H($))throw new TypeError("Invalid target");const F=document.scrollingElement||document.documentElement,xt=[];let ze=$;for(;H(ze)&&he(ze);){if(ze=T(ze),ze===F){xt.push(ze);break}ze!=null&&ze===document.body&&K(ze)&&!K(document.documentElement)||ze!=null&&K(ze,gt)&&xt.push(ze)}const ee=(M=(We=window.visualViewport)==null?void 0:We.width)!=null?M:innerWidth,Et=(D=(De=window.visualViewport)==null?void 0:De.height)!=null?D:innerHeight,{scrollX:_e,scrollY:j}=window,{height:ft,width:Nt,top:N,right:E,bottom:A,left:J}=$.getBoundingClientRect(),{top:W,right:Oe,bottom:L,left:se}=(Ge=>{const xe=window.getComputedStyle(Ge);return{top:parseFloat(xe.scrollMarginTop)||0,right:parseFloat(xe.scrollMarginRight)||0,bottom:parseFloat(xe.scrollMarginBottom)||0,left:parseFloat(xe.scrollMarginLeft)||0}})($);let Pe=Dt==="start"||Dt==="nearest"?N-W:Dt==="end"?A+L:N+ft/2-W+L,fe=ht==="center"?J+Nt/2-se+Oe:ht==="end"?E+Oe:J-se;const Ye=[];for(let Ge=0;Ge<xt.length;Ge++){const xe=xt[Ge],{height:Ve,width:Fe,top:Wt,right:Rt,bottom:Lt,left:Ne}=xe.getBoundingClientRect();if(St==="if-needed"&&N>=0&&J>=0&&A<=Et&&E<=ee&&(xe===F&&!K(xe)||N>=Wt&&A<=Lt&&J>=Ne&&E<=Rt))return Ye;const vr=getComputedStyle(xe),lr=parseInt(vr.borderLeftWidth,10),P=parseInt(vr.borderTopWidth,10),g=parseInt(vr.borderRightWidth,10),C=parseInt(vr.borderBottomWidth,10);let p=0,x=0;const O="offsetWidth"in xe?xe.offsetWidth-xe.clientWidth-lr-g:0,I="offsetHeight"in xe?xe.offsetHeight-xe.clientHeight-P-C:0,z="offsetWidth"in xe?xe.offsetWidth===0?0:Fe/xe.offsetWidth:0,le="offsetHeight"in xe?xe.offsetHeight===0?0:Ve/xe.offsetHeight:0;if(F===xe)p=Dt==="start"?Pe:Dt==="end"?Pe-Et:Dt==="nearest"?we(j,j+Et,Et,P,C,j+Pe,j+Pe+ft,ft):Pe-Et/2,x=ht==="start"?fe:ht==="center"?fe-ee/2:ht==="end"?fe-ee:we(_e,_e+ee,ee,lr,g,_e+fe,_e+fe+Nt,Nt),p=Math.max(0,p+j),x=Math.max(0,x+_e);else{p=Dt==="start"?Pe-Wt-P:Dt==="end"?Pe-Lt+C+I:Dt==="nearest"?we(Wt,Lt,Ve,P,C+I,Pe,Pe+ft,ft):Pe-(Wt+Ve/2)+I/2,x=ht==="start"?fe-Ne-lr:ht==="center"?fe-(Ne+Fe/2)+O/2:ht==="end"?fe-Rt+g+O:we(Ne,Rt,Fe,lr,g+O,fe,fe+Nt,Nt);const{scrollLeft:q,scrollTop:de}=xe;p=le===0?0:Math.max(0,Math.min(de+p/le,xe.scrollHeight-Ve/le+I)),x=z===0?0:Math.max(0,Math.min(q+x/z,xe.scrollWidth-Fe/z+O)),Pe+=de-p,fe+=q-x}Ye.push({el:xe,top:p,left:x})}return Ye},ae=$=>$===!1?{block:"end",inline:"nearest"}:(h=>h===Object(h)&&Object.keys(h).length!==0)($)?$:{block:"start",inline:"nearest"};function Je($,h){if(!$.isConnected||!(De=>{let D=De;for(;D&&D.parentNode;){if(D.parentNode===document)return!0;D=D.parentNode instanceof ShadowRoot?D.parentNode.host:D.parentNode}return!1})($))return;const We=(De=>{const D=window.getComputedStyle(De);return{top:parseFloat(D.scrollMarginTop)||0,right:parseFloat(D.scrollMarginRight)||0,bottom:parseFloat(D.scrollMarginBottom)||0,left:parseFloat(D.scrollMarginLeft)||0}})($);if((De=>typeof De=="object"&&typeof De.behavior=="function")(h))return h.behavior(re($,h));const M=typeof h=="boolean"||h==null?void 0:h.behavior;for(const{el:De,top:D,left:St}of re($,ae(h))){const Dt=D-We.top+We.bottom,ht=St-We.left+We.right;De.scroll({top:Dt,left:ht,behavior:M})}}}}]);
|