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

1 line
11 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[36569],{48783:function(e,t,n){var o=n(74902),i=n(96523);t.Z=function(e){let t;const n=n=>()=>{t=null,e.apply(void 0,(0,o.Z)(n))},r=function(){if(null==t){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];t=(0,i.Z)(n(o))}};return r.cancel=()=>{i.Z.cancel(t),t=null},r}},30291:function(e,t,n){n.d(t,{Z:function(){return E}});var o=n(15671),i=n(43144),r=n(60136),l=n(51630),a=n(67294),s=n(94184),c=n.n(s),f=n(48555),u=n(10366),d=n(48783),p=n(53124),h=n(67968),g=n(45503);const v=e=>{const{componentCls:t}=e;return{[t]:{position:"fixed",zIndex:e.zIndexPopup}}};var m=(0,h.Z)("Affix",(e=>{const t=(0,g.TS)(e,{zIndexPopup:e.zIndexBase+10});return[v(t)]}));function k(e){return e!==window?e.getBoundingClientRect():{top:0,bottom:window.innerHeight}}function x(e,t,n){if(void 0!==n&&t.top>e.top-n)return n+t.top}function y(e,t,n){if(void 0!==n&&t.bottom<e.bottom+n){return n+(window.innerHeight-t.bottom)}}const C=["resize","scroll","touchstart","touchmove","touchend","pageshow","load"];function w(){return"undefined"!=typeof window?window:null}var b;!function(e){e[e.None=0]="None",e[e.Prepare=1]="Prepare"}(b||(b={}));let S=function(e){(0,r.Z)(n,e);var t=(0,l.Z)(n);function n(){var e;return(0,o.Z)(this,n),(e=t.apply(this,arguments)).state={status:b.None,lastAffix:!1,prevTarget:null},e.placeholderNodeRef=(0,a.createRef)(),e.fixedNodeRef=(0,a.createRef)(),e.addListeners=()=>{const t=e.getTargetFunc(),n=null==t?void 0:t(),{prevTarget:o}=e.state;o!==n&&(C.forEach((t=>{null==o||o.removeEventListener(t,e.lazyUpdatePosition),null==n||n.addEventListener(t,e.lazyUpdatePosition)})),e.updatePosition(),e.setState({prevTarget:n}))},e.removeListeners=()=>{e.timer&&(clearTimeout(e.timer),e.timer=null);const{prevTarget:t}=e.state,n=e.getTargetFunc(),o=null==n?void 0:n();C.forEach((n=>{null==o||o.removeEventListener(n,e.lazyUpdatePosition),null==t||t.removeEventListener(n,e.lazyUpdatePosition)})),e.updatePosition.cancel(),e.lazyUpdatePosition.cancel()},e.getOffsetTop=()=>{const{offsetBottom:t,offsetTop:n}=e.props;return void 0===t&&void 0===n?0:n},e.getOffsetBottom=()=>e.props.offsetBottom,e.measure=()=>{const{status:t,lastAffix:n}=e.state,{onChange:o}=e.props,i=e.getTargetFunc();if(t!==b.Prepare||!e.fixedNodeRef.current||!e.placeholderNodeRef.current||!i)return;const r=e.getOffsetTop(),l=e.getOffsetBottom(),a=i();if(a){const t={status:b.None},i=k(e.placeholderNodeRef.current);if(0===i.top&&0===i.left&&0===i.width&&0===i.height)return;const s=k(a),c=x(i,s,r),f=y(i,s,l);void 0!==c?(t.affixStyle={position:"fixed",top:c,width:i.width,height:i.height},t.placeholderStyle={width:i.width,height:i.height}):void 0!==f&&(t.affixStyle={position:"fixed",bottom:f,width:i.width,height:i.height},t.placeholderStyle={width:i.width,height:i.height}),t.lastAffix=!!t.affixStyle,o&&n!==t.lastAffix&&o(t.lastAffix),e.setState(t)}},e.prepareMeasure=()=>{e.setState({status:b.Prepare,affixStyle:void 0,placeholderStyle:void 0})},e.updatePosition=(0,d.Z)((()=>{e.prepareMeasure()})),e.lazyUpdatePosition=(0,d.Z)((()=>{const t=e.getTargetFunc(),{affixStyle:n}=e.state;if(t&&n){const o=e.getOffsetTop(),i=e.getOffsetBottom(),r=t();if(r&&e.placeholderNodeRef.current){const t=k(r),l=k(e.placeholderNodeRef.current),a=x(l,t,o),s=y(l,t,i);if(void 0!==a&&n.top===a||void 0!==s&&n.bottom===s)return}}e.prepareMeasure()})),e}return(0,i.Z)(n,[{key:"getTargetFunc",value:function(){const{getTargetContainer:e}=this.context,{target:t}=this.props;return void 0!==t?t:null!=e?e:w}},{key:"componentDidMount",value:function(){this.timer=setTimeout(this.addListeners)}},{key:"componentDidUpdate",value:function(e){this.addListeners(),e.offsetTop===this.props.offsetTop&&e.offsetBottom===this.props.offsetBottom||this.updatePosition(),this.measure()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"render",value:function(){const{affixStyle:e,placeholderStyle:t}=this.state,{affixPrefixCls:n,rootClassName:o,children:i}=this.props,r=c()(e&&o,{[n]:!!e});let l=(0,u.Z)(this.props,["prefixCls","offsetTop","offsetBottom","target","onChange","affixPrefixCls","rootClassName"]);return a.createElement(f.Z,{onResize:this.updatePosition},a.createElement("div",Object.assign({},l,{ref:this.placeholderNodeRef}),e&&a.createElement("div",{style:t,"aria-hidden":"true"}),a.createElement("div",{className:r,ref:this.fixedNodeRef,style:e},a.createElement(f.Z,{onResize:this.updatePosition},i))))}}]),n}(a.Component);S.contextType=p.E_;var E=(0,a.forwardRef)(((e,t)=>{const{prefixCls:n,rootClassName:o}=e,{getPrefixCls:i}=(0,a.useContext)(p.E_),r=i("affix",n),[l,s]=m(r),f=Object.assign(Object.assign({},e),{affixPrefixCls:r,rootClassName:c()(o,s)});return l(a.createElement(S,Object.assign({},f,{ref:t})))}))},36569:function(e,t,n){n.d(t,{Z:function(){return $}});var o=n(74902),i=n(94184),r=n.n(i),l=n(60276),a=n(67294),s=n(37494),c=n(66367),f=n(58375),u=n(30291),d=n(53124);var p=a.createContext(void 0);var h=e=>{const{href:t,title:n,prefixCls:o,children:i,className:l,target:s,replace:c}=e,f=a.useContext(p),{registerLink:u,unregisterLink:h,scrollTo:g,onClick:v,activeLink:m,direction:k}=f||{};a.useEffect((()=>(null==u||u(t),()=>{null==h||h(t)})),[t]);const{getPrefixCls:x}=a.useContext(d.E_),y=x("anchor",o),C=m===t,w=r()(`${y}-link`,l,{[`${y}-link-active`]:C}),b=r()(`${y}-link-title`,{[`${y}-link-title-active`]:C});return a.createElement("div",{className:w},a.createElement("a",{className:b,href:t,title:"string"==typeof n?n:"",target:s,onClick:e=>{c&&(e.preventDefault(),window.location.replace(t)),null==v||v(e,{title:n,href:t}),null==g||g(t)}},n),"horizontal"!==k?i:null)},g=n(14747),v=n(67968),m=n(45503);const k=e=>{const{componentCls:t,holderOffsetBlock:n,motionDurationSlow:o,lineWidthBold:i,colorPrimary:r,lineType:l,colorSplit:a}=e;return{[`${t}-wrapper`]:{marginBlockStart:-n,paddingBlockStart:n,[t]:Object.assign(Object.assign({},(0,g.Wf)(e)),{position:"relative",paddingInlineStart:i,[`${t}-link`]:{paddingBlock:e.linkPaddingBlock,paddingInline:`${e.linkPaddingInlineStart}px 0`,"&-title":Object.assign(Object.assign({},g.vS),{position:"relative",display:"block",marginBlockEnd:e.anchorTitleBlock,color:e.colorText,transition:`all ${e.motionDurationSlow}`,"&:only-child":{marginBlockEnd:0}}),[`&-active > ${t}-link-title`]:{color:e.colorPrimary},[`${t}-link`]:{paddingBlock:e.anchorPaddingBlockSecondary}}}),[`&:not(${t}-wrapper-horizontal)`]:{[t]:{"&::before":{position:"absolute",insetInlineStart:0,top:0,height:"100%",borderInlineStart:`${i}px ${l} ${a}`,content:'" "'},[`${t}-ink`]:{position:"absolute",insetInlineStart:0,display:"none",transform:"translateY(-50%)",transition:`top ${o} ease-in-out`,width:i,backgroundColor:r,[`&${t}-ink-visible`]:{display:"inline-block"}}}},[`${t}-fixed ${t}-ink ${t}-ink`]:{display:"none"}}}},x=e=>{const{componentCls:t,motionDurationSlow:n,lineWidthBold:o,colorPrimary:i}=e;return{[`${t}-wrapper-horizontal`]:{position:"relative","&::before":{position:"absolute",left:{_skip_check_:!0,value:0},right:{_skip_check_:!0,value:0},bottom:0,borderBottom:`1px ${e.lineType} ${e.colorSplit}`,content:'" "'},[t]:{overflowX:"scroll",position:"relative",display:"flex",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},[`${t}-link:first-of-type`]:{paddingInline:0},[`${t}-ink`]:{position:"absolute",bottom:0,transition:`left ${n} ease-in-out, width ${n} ease-in-out`,height:o,backgroundColor:i}}}}};var y=(0,v.Z)("Anchor",(e=>{const{fontSize:t,fontSizeLG:n,paddingXXS:o}=e,i=(0,m.TS)(e,{holderOffsetBlock:o,anchorPaddingBlockSecondary:o/2,anchorTitleBlock:t/14*3,anchorBallSize:n/2});return[k(i),x(i)]}),(e=>({linkPaddingBlock:e.paddingXXS,linkPaddingInlineStart:e.padding})));function C(){return window}function w(e,t){if(!e.getClientRects().length)return 0;const n=e.getBoundingClientRect();return n.width||n.height?t===window?(t=e.ownerDocument.documentElement,n.top-t.clientTop):n.top-t.getBoundingClientRect().top:n.top}const b=/#([\S ]+)$/,S=e=>{var t;const{rootClassName:n,anchorPrefixCls:i,className:g,style:v,offsetTop:m,affix:k=!0,showInkInFixed:x=!1,children:y,items:S,direction:E="vertical",bounds:$,targetOffset:P,onClick:T,onChange:B,getContainer:N,getCurrentAnchor:z,replace:O}=e;const[R,Z]=a.useState([]),[L,I]=a.useState(null),j=a.useRef(L),A=a.useRef(null),_=a.useRef(null),U=a.useRef(!1),{direction:D,getTargetContainer:F,anchor:M}=a.useContext(d.E_),W=null!==(t=null!=N?N:F)&&void 0!==t?t:C,H=JSON.stringify(R),X=(0,l.useEvent)((e=>{R.includes(e)||Z((t=>[].concat((0,o.Z)(t),[e])))})),q=(0,l.useEvent)((e=>{R.includes(e)&&Z((t=>t.filter((t=>t!==e))))})),G=(0,l.useEvent)((e=>{if(j.current===e)return;const t="function"==typeof z?z(e):e;I(t),j.current=t,null==B||B(e)})),J=a.useCallback((()=>{if(U.current)return;const e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const o=[],i=W();if(e.forEach((e=>{const r=b.exec(null==e?void 0:e.toString());if(!r)return;const l=document.getElementById(r[1]);if(l){const r=w(l,i);r<t+n&&o.push({link:e,top:r})}})),o.length)return o.reduce(((e,t)=>t.top>e.top?t:e)).link;return""}(R,void 0!==P?P:m||0,$);G(e)}),[H,P,m]),Y=a.useCallback((e=>{G(e);const t=b.exec(e);if(!t)return;const n=document.getElementById(t[1]);if(!n)return;const o=W();let i=(0,c.Z)(o,!0)+w(n,o);i-=void 0!==P?P:m||0,U.current=!0,(0,f.Z)(i,{getContainer:W,callback(){U.current=!1}})}),[P,m]),K=r()(n,`${i}-wrapper`,{[`${i}-wrapper-horizontal`]:"horizontal"===E,[`${i}-rtl`]:"rtl"===D},g,null==M?void 0:M.className),Q=r()(i,{[`${i}-fixed`]:!k&&!x}),V=r()(`${i}-ink`,{[`${i}-ink-visible`]:L}),ee=Object.assign(Object.assign({maxHeight:m?`calc(100vh - ${m}px)`:"100vh"},null==M?void 0:M.style),v),te=e=>Array.isArray(e)?e.map((e=>a.createElement(h,Object.assign({replace:O},e,{key:e.key}),"vertical"===E&&te(e.children)))):null,ne=a.createElement("div",{ref:A,className:K,style:ee},a.createElement("div",{className:Q},a.createElement("span",{className:V,ref:_}),"items"in e?te(S):y));a.useEffect((()=>{const e=W();return J(),null==e||e.addEventListener("scroll",J),()=>{null==e||e.removeEventListener("scroll",J)}}),[H]),a.useEffect((()=>{"function"==typeof z&&G(z(j.current||""))}),[z]),a.useEffect((()=>{(()=>{var e;const t=null===(e=A.current)||void 0===e?void 0:e.querySelector(`.${i}-link-title-active`);if(t&&_.current){const{style:e}=_.current,n="horizontal"===E;e.top=n?"":`${t.offsetTop+t.clientHeight/2}px`,e.height=n?"":`${t.clientHeight}px`,e.left=n?`${t.offsetLeft}px`:"",e.width=n?`${t.clientWidth}px`:"",n&&(0,s.Z)(t,{scrollMode:"if-needed",block:"nearest"})}})()}),[E,z,H,L]);const oe=a.useMemo((()=>({registerLink:X,unregisterLink:q,scrollTo:Y,activeLink:L,onClick:T,direction:E})),[L,T,Y,E]);return a.createElement(p.Provider,{value:oe},k?a.createElement(u.Z,{offsetTop:m,target:W},ne):ne)};const E=e=>{const{prefixCls:t,rootClassName:n}=e,{getPrefixCls:o}=a.useContext(d.E_),i=o("anchor",t),[l,s]=y(i);return l(a.createElement(S,Object.assign({},e,{rootClassName:r()(s,n),anchorPrefixCls:i})))};E.Link=h;var $=E}}]);