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

5 lines
16 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[132,4],{"5oB3":function(Ee,oe,l){Ee.exports={flex_box_center:"flex_box_center___2WENa",flex_space_between:"flex_space_between___32o_C",flex_box_vertical_center:"flex_box_vertical_center___VReNJ",flex_box_center_end:"flex_box_center_end___VidHP",flex_box_column:"flex_box_column___7bh0_",guidance:"guidance___1zlCK",title:"title___TLK56",u:"u___1YcNG",active:"active___2cPfY",content:"content___3PW9_",btn:"btn___26Rnl",table:"table___eu48a",modal:"modal___CSRxE"}},"9Bee":function(Ee,oe,l){"use strict";var de=l("k1fw"),q=l("q1tI"),_e=l.n(q),Te=l("vg9a"),De=l("tJVT"),ye=l("DlQD"),ie=l.n(ye),fe=l("rUJ1");function he(a,s){var u=a.match(/^(\s+)(?:```)/);if(u===null)return s;var c=u[1];return s.split(`
`).map(function(d){var m=d.match(/^\s+/);if(m===null)return d;var M=Object(De.a)(m,1),j=M[0];return j.length>=c.length?d.slice(c.length):d}).join(`
`)}var me=[],ee=["<ul>"],p=new ie.a.Renderer,ge=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Oe(){me.length=0,ee=["<ul>"]}var ve={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function P(a,s,u,c){if(s>=a.length||a[s].level<=u)return s;var d=a[s];c.push("<li><a href='#"+d.anchor+"'>"+d.text+"</a>"),s++;var m=[];return s=P(a,s,d.level,m),m.length>0&&(c.push("<ul>"),m.forEach(function(M){c.push(M)}),c.push("</ul>")),c.push("</li>"),s=P(a,s,u,c),s}function h(){return P(me,0,0,ee),ee.push("</ul>"),ee.join("")}var be={heading:function(s){var u=ge.exec(s);if(u)return{type:"heading",raw:u[0],depth:u[1].length,text:u[2]}},fences:function(s){var u=this.rules.block.fences.exec(s);if(u){var c=u[0],d=he(c,u[3]||""),m=u[2]?u[2].trim():u[2];if(["latex","katex","math"].indexOf(m)>=0){var M=pe(),j=d;d=M,L[M]={type:"block",expression:j}}return{type:"code",raw:c,lang:m,text:d}}}},Pe=/(?:\${2})([^\n`]+?)(?:\${2})/gi,le=0,pe=function(){return"__special_katext_id_".concat(le++,"__")},L={};function xe(){return L}function se(){le=0,L={}}function te(a){return a=a.replace(Pe,function(s,u){var c=pe();return L[c]={type:"inline",expression:u},c}),a}var Y=p.listitem;p.listitem=function(a){return Y(te(a))};var Me=p.paragraph;p.paragraph=function(a){return Me(te(a))};var Le=p.tablecell;p.tablecell=function(a,s){return Le(te(a),s)},p.code=function(a,s,u){var c=(s||"").match(/\S*/)[0];return c?["latex","katex","math"].indexOf(c)>=0?"<p class='editormd-tex'>".concat(a,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(s,'">').concat(u?a:Object(fe.escape)(a,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(u?a:Object(fe.escape)(a,!0))+"</code></pre>"},p.heading=function(a,s,u){var c=this.options.headerPrefix+u.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return me.push({anchor:c,level:s,text:a}),"<h"+s+' id="'+c+'">'+a+"</h"+s+">"},ie.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),ie.a.use({tokenizer:be,renderer:p});var R=ie.a,y=l("SJMd"),W=l("m3rI"),D=l("Oy/b"),k=/<pre[^>]*>/g;function G(a){var s=document.createElement("div");return s.innerHTML=a,s.childNodes.length===0?"":s.childNodes[0].nodeValue}var H=oe.a=function(a){var s=a.value,u=s===void 0?"":s,c=a.className,d=a.showTextOnly,m=a.showLines,M=a.style,j=M===void 0?{}:M,w=String(u),g=Object(q.useMemo)(function(){try{var N=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,K=/\"\/api\/attachments\/|\"\/attachments\/download\//g,C=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;w=w.replace(N,"("+W.a.API_SERVER+"/api/attachments/").replace(K,'"'+W.a.API_SERVER+"/api/attachments/").replace(C,'"'+W.a.API_SERVER+"/files/uploads/")}catch(ne){}var v=R(w);setTimeout(function(){return S()},300);var z=xe();if(w.match(/\[TOC\]/)&&(v=v.replace("<p>[TOC]</p>",h()),Oe()),v=v.replace(/(__special_katext_id_\d+__)/g,function(ne,re){var ae=z[re],Z=ae.type,J=ae.expression;return Object(D.renderToString)(G(J)||"",{displayMode:Z==="block",throwOnError:!1,output:"html"})}),v=v.replace(/▁/g,"\u2581\u2581\u2581"),se(),d){var $=document.createElement("div");return $.innerHTML=v,$.innerText}return v},[w]),I=Object(q.useRef)();ve.WebkitLineClamp=m,m&&(j=Object(de.a)(Object(de.a)({},j),ve));function A(N){var K=N.target;if(K.tagName.toUpperCase()==="A"){var C=K.getAttribute("href");if(C.startsWith("#")){N.preventDefault();var v=document.getElementById(C.replace("#",""));v&&v.scrollIntoView(!0)}}}var S=function(){};return Object(q.useEffect)(function(){if(I.current&&g&&(g.match(k)&&window.PR.prettyPrint()),I.current)return I.current.addEventListener("click",A),function(){I.current.removeEventListener("click",A),se(),Oe()}},[g,I.current,A]),_e.a.createElement(_e.a.Fragment,null,_e.a.createElement("div",{ref:I,style:Object(de.a)({},j),className:"".concat(c||""," markdown-body "),dangerouslySetInnerHTML:{__html:g}}))}},ObO0:function(Ee,oe,l){"use strict";l.r(oe);var de=l("2qtc"),q=l("kLXV"),_e=l("g9YV"),Te=l("wCAj"),De=l("cWXX"),ye=l("/ezw"),ie=l("+L6B"),fe=l("2/Rp"),he=l("9og8"),me=l("5Dmo"),ee=l("3S7+"),p=l("tJVT"),ge=l("PpiC"),Oe=l("Znn+"),ve=l("ZTPi"),P=l("q1tI"),h=l.n(P),be=l("Ty5D"),Pe=l("9kvl"),le=l("1vsH"),pe=l("5oB3"),L=l.n(pe),xe=l("ErOA"),se=l("m3rI"),te=l("9Bee");function Y(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Y=function(){return y};var R,y={},W=Object.prototype,D=W.hasOwnProperty,k=Object.defineProperty||function(n,e,t){n[e]=t.value},G=typeof Symbol=="function"?Symbol:{},H=G.iterator||"@@iterator",a=G.asyncIterator||"@@asyncIterator",s=G.toStringTag||"@@toStringTag";function u(n,e,t){return Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),n[e]}try{u({},"")}catch(n){u=function(t,r,i){return t[r]=i}}function c(n,e,t,r){var i=e&&e.prototype instanceof I?e:I,o=Object.create(i.prototype),_=new J(r||[]);return k(o,"_invoke",{value:ne(n,t,_)}),o}function d(n,e,t){try{return{type:"normal",arg:n.call(e,t)}}catch(r){return{type:"throw",arg:r}}}y.wrap=c;var m="suspendedStart",M="suspendedYield",j="executing",w="completed",g={};function I(){}function A(){}function S(){}var N={};u(N,H,function(){return this});var K=Object.getPrototypeOf,C=K&&K(K(F([])));C&&C!==W&&D.call(C,H)&&(N=C);var v=S.prototype=I.prototype=Object.create(N);function z(n){["next","throw","return"].forEach(function(e){u(n,e,function(t){return this._invoke(e,t)})})}function $(n,e){function t(i,o,_,O){var b=d(n[i],n,o);if(b.type!=="throw"){var B=b.arg,U=B.value;return U&&typeof U=="object"&&D.call(U,"__await")?e.resolve(U.__await).then(function(X){t("next",X,_,O)},function(X){t("throw",X,_,O)}):e.resolve(U).then(function(X){B.value=X,_(B)},function(X){return t("throw",X,_,O)})}O(b.arg)}var r;k(this,"_invoke",{value:function(o,_){function O(){return new e(function(b,B){t(o,_,b,B)})}return r=r?r.then(O,O):O()}})}function ne(n,e,t){var r=m;return function(i,o){if(r===j)throw new Error("Generator is already running");if(r===w){if(i==="throw")throw o;return{value:R,done:!0}}for(t.method=i,t.arg=o;;){var _=t.delegate;if(_){var O=re(_,t);if(O){if(O===g)continue;return O}}if(t.method==="next")t.sent=t._sent=t.arg;else if(t.method==="throw"){if(r===m)throw r=w,t.arg;t.dispatchException(t.arg)}else t.method==="return"&&t.abrupt("return",t.arg);r=j;var b=d(n,e,t);if(b.type==="normal"){if(r=t.done?w:M,b.arg===g)continue;return{value:b.arg,done:t.done}}b.type==="throw"&&(r=w,t.method="throw",t.arg=b.arg)}}}function re(n,e){var t=e.method,r=n.iterator[t];if(r===R)return e.delegate=null,t==="throw"&&n.iterator.return&&(e.method="return",e.arg=R,re(n,e),e.method==="throw")||t!=="return"&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+t+"' method")),g;var i=d(r,n.iterator,e.arg);if(i.type==="throw")return e.method="throw",e.arg=i.arg,e.delegate=null,g;var o=i.arg;return o?o.done?(e[n.resultName]=o.value,e.next=n.nextLoc,e.method!=="return"&&(e.method="next",e.arg=R),e.delegate=null,g):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function ae(n){var e={tryLoc:n[0]};1 in n&&(e.catchLoc=n[1]),2 in n&&(e.finallyLoc=n[2],e.afterLoc=n[3]),this.tryEntries.push(e)}function Z(n){var e=n.completion||{};e.type="normal",delete e.arg,n.completion=e}function J(n){this.tryEntries=[{tryLoc:"root"}],n.forEach(ae,this),this.reset(!0)}function F(n){if(n||n===""){var e=n[H];if(e)return e.call(n);if(typeof n.next=="function")return n;if(!isNaN(n.length)){var t=-1,r=function i(){for(;++t<n.length;)if(D.call(n,t))return i.value=n[t],i.done=!1,i;return i.value=R,i.done=!0,i};return r.next=r}}throw new TypeError(typeof n+" is not iterable")}return A.prototype=S,k(v,"constructor",{value:S,configurable:!0}),k(S,"constructor",{value:A,configurable:!0}),A.displayName=u(S,s,"GeneratorFunction"),y.isGeneratorFunction=function(n){var e=typeof n=="function"&&n.constructor;return!!e&&(e===A||(e.displayName||e.name)==="GeneratorFunction")},y.mark=function(n){return Object.setPrototypeOf?Object.setPrototypeOf(n,S):(n.__proto__=S,u(n,s,"GeneratorFunction")),n.prototype=Object.create(v),n},y.awrap=function(n){return{__await:n}},z($.prototype),u($.prototype,a,function(){return this}),y.AsyncIterator=$,y.async=function(n,e,t,r,i){i===void 0&&(i=Promise);var o=new $(c(n,e,t,r),i);return y.isGeneratorFunction(e)?o:o.next().then(function(_){return _.done?_.value:o.next()})},z(v),u(v,s,"Generator"),u(v,H,function(){return this}),u(v,"toString",function(){return"[object Generator]"}),y.keys=function(n){var e=Object(n),t=[];for(var r in e)t.push(r);return t.reverse(),function i(){for(;t.length;){var o=t.pop();if(o in e)return i.value=o,i.done=!1,i}return i.done=!0,i}},y.values=F,J.prototype={constructor:J,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=R,this.done=!1,this.delegate=null,this.method="next",this.arg=R,this.tryEntries.forEach(Z),!e)for(var t in this)t.charAt(0)==="t"&&D.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=R)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(B,U){return _.type="throw",_.arg=e,t.next=B,U&&(t.method="next",t.arg=R),!!U}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],_=o.completion;if(o.tryLoc==="root")return r("end");if(o.tryLoc<=this.prev){var O=D.call(o,"catchLoc"),b=D.call(o,"finallyLoc");if(O&&b){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(O){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!b)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&D.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&(e==="break"||e==="continue")&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var _=o?o.completion:{};return _.type=e,_.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(_)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),Z(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var i=r.completion;if(i.type==="throw"){var o=i.arg;Z(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:F(e),resultName:t,nextLoc:r},this.method==="next"&&(this.arg=R),g}},y}var Me=ve.a.TabPane,Le=function(y){var W,D,k,G,H,a=y.user,s=Object(ge.a)(y,["user"]),u=Object(P.useState)(1),c=Object(p.a)(u,2),d=c[0],m=c[1],M=Object(P.useState)(!1),j=Object(p.a)(M,2),w=j[0],g=j[1],I=Object(P.useState)(!1),A=Object(p.a)(I,2),S=A[0],N=A[1],K=Object(P.useState)(""),C=Object(p.a)(K,2),v=C[0],z=C[1],$=Object(P.useState)(!0),ne=Object(p.a)($,2),re=ne[0],ae=ne[1],Z=Object(P.useState)([{},{}]),J=Object(p.a)(Z,2),F=J[0],n=J[1],e=Object(be.l)(),t=e.pathname,r=Object(P.useState)(!1),i=Object(p.a)(r,2),o=i[0],_=i[1],O=Object(P.useState)([]),b=Object(p.a)(O,2),B=b[0],U=b[1],X=Object(P.useState)(!1),je=Object(p.a)(X,2),Ue=je[0],we=je[1];Object(P.useEffect)(function(){var E;(a==null||((E=a.userInfo)===null||E===void 0)?void 0:E.identity)&&Se()},[a==null||((W=a.userInfo)===null||W===void 0)?void 0:W.identity]),Object(P.useEffect)(function(){Ne()},[]);var Ae=[{title:"\u6587\u4EF6\u540D\u79F0",dataIndex:"filename",width:300,ellipsis:!0,key:"filename",render:function(f,T){return h.a.createElement("span",{className:["c-black"].join(" ")},h.a.createElement(ee.a,{title:T.filename,placement:"topLeft"},T.filename))}},{title:"\u5927\u5C0F",dataIndex:"filesize",key:"filesize",ellipsis:!0},{title:"\u64CD\u4F5C",dataIndex:"operate",key:"id",width:100,render:function(f,T){return h.a.createElement("a",{className:"c-blue",onClick:function(){return Ie(T.id)}},"\u4E0B\u8F7D")}}],Se=function(){if(t.includes("paths")||t.includes("shixuns")||t.includes("classrooms")){var f;(a==null||((f=a.userInfo)===null||f===void 0)?void 0:f.identity)==="student"?(g(!0),m(1)):(N(!0),m(0));return}},Ne=function(){var E=Object(he.a)(Y().mark(function f(T){var x,V,Q,Ce;return Y().wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,Object(xe.a)("/api/introductions.json",{method:"get"});case 2:x=ue.sent,(x==null?void 0:x.introductions)&&(V=null,t.includes("classrooms")&&(V="course",z("\u6559\u5B66\u8BFE\u5802")),t.includes("paths")&&(V="subject",z("\u5B9E\u8DF5\u8BFE\u7A0B")),t.includes("shixuns")&&(V="shixun",z("\u5B9E\u8DF5\u9879\u76EE")),Q=x.introductions,Ce=[Q==null?void 0:Q.find(function(ce){return ce.clazz==="teacher"&&ce.page_type===V}),Q==null?void 0:Q.find(function(ce){return ce.clazz==="student"&&ce.page_type===V})],n(Ce)),ae(!1);case 5:case"end":return ue.stop()}},f)}));return function(T){return E.apply(this,arguments)}}(),Ie=function(f){var T=se.a.API_SERVER+"/api/attachments/"+f;Object(le.r)("",T)},Be=function(){var f,T;if(((f=F[d])===null||f===void 0||((T=f.attachments)===null||T===void 0)?void 0:T.length)===1){var x;Ie((x=F[d])===null||x===void 0?void 0:x.attachments[0].id)}else _(!0)};function We(){return Re.apply(this,arguments)}function Re(){return Re=Object(he.a)(Y().mark(function E(){var f;return Y().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(!(B.length===0)){x.next=3;break}return we(!0),x.abrupt("return");case 3:f=[],B.forEach(function(V){f.push(se.a.API_SERVER+"/api/attachments/"+V)}),f.forEach(function(V){Object(le.q)("",V)}),U([]),_(!1);case 8:case"end":return x.stop()}},E)})),Re.apply(this,arguments)}return h.a.createElement("section",{className:L.a.guidance},h.a.createElement(ye.a,{loading:re,active:!0,paragraph:{rows:5}},h.a.createElement("div",{className:L.a.title},v,"\u65B0\u624B\u6307\u5F15"),h.a.createElement("ul",{className:L.a.u},!w&&h.a.createElement("li",{onClick:function(){return m(0)},className:d===0?L.a.active:""},"\u6559\u5E08\u7248"),!S&&h.a.createElement("li",{onClick:function(){return m(1)},className:d===1?L.a.active:""},"\u5B66\u751F\u7248")),d===0&&h.a.createElement("div",{className:L.a.content},h.a.createElement(te.a,{value:((D=F[0])===null||D===void 0?void 0:D.content)||""})),d===1&&h.a.createElement("div",{className:L.a.content},h.a.createElement(te.a,{value:((k=F[1])===null||k===void 0?void 0:k.content)||""})),!w&&((G=F[d])===null||G===void 0?void 0:G.attachments)&&h.a.createElement("div",{className:L.a.btn},h.a.createElement(fe.a,{type:"primary",onClick:function(){return Be()}},"\u4E0B\u8F7D\u6587\u4EF6"))),h.a.createElement(q.a,{centered:!0,title:"\u4E0B\u8F7D\u6587\u4EF6",visible:o,okText:"\u6279\u91CF\u4E0B\u8F7D",cancelText:"\u53D6\u6D88",destroyOnClose:!0,className:L.a.modal,width:600,maskClosable:!1,bodyStyle:{minHeight:200},onOk:function(){We()},onCancel:function(){U([]),_(!1)}},h.a.createElement(Te.a,{pagination:!1,columns:Ae,className:L.a.table,dataSource:((H=F[d])===null||H===void 0?void 0:H.attachments)||[],scroll:{y:260},rowKey:function(f){return f.id},rowSelection:{onChange:function(f,T){we(!1),U(f)},selectedRowKeys:B}}),Ue&&h.a.createElement("div",{style:{color:"#ff4d4f"}},"\u8BF7\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6")))};oe.default=Object(Pe.a)(function(R){var y=R.user;return{user:y}})(Le)}}]);