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.
5 lines
14 KiB
5 lines
14 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[132],{"5oB3":function(ue,Y,l){ue.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"}},"9Bee":function(ue,Y,l){"use strict";var re=l("k1fw"),X=l("q1tI"),ne=l.n(X),de=l("vg9a"),se=l("tJVT"),B=l("DlQD"),V=l.n(B),R=l("rUJ1");function T(i,u){var s=i.match(/^(\s+)(?:```)/);if(s===null)return u;var c=s[1];return u.split(`
|
|
`).map(function(_){var O=_.match(/^\s+/);if(O===null)return _;var P=Object(se.a)(O,1),U=P[0];return U.length>=c.length?_.slice(c.length):_}).join(`
|
|
`)}var F=[],z=["<ul>"],M=new V.a.Renderer,le=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function x(){F.length=0,z=["<ul>"]}var ae={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Q(i,u,s,c){if(u>=i.length||i[u].level<=s)return u;var _=i[u];c.push("<li><a href='#"+_.anchor+"'>"+_.text+"</a>"),u++;var O=[];return u=Q(i,u,_.level,O),O.length>0&&(c.push("<ul>"),O.forEach(function(P){c.push(P)}),c.push("</ul>")),c.push("</li>"),u=Q(i,u,s,c),u}function oe(){return Q(F,0,0,z),z.push("</ul>"),z.join("")}var Z={heading:function(u){var s=le.exec(u);if(s)return{type:"heading",raw:s[0],depth:s[1].length,text:s[2]}},fences:function(u){var s=this.rules.block.fences.exec(u);if(s){var c=s[0],_=T(c,s[3]||""),O=s[2]?s[2].trim():s[2];if(["latex","katex","math"].indexOf(O)>=0){var P=A(),U=_;_=P,y[P]={type:"block",expression:U}}return{type:"code",raw:c,lang:O,text:_}}}},ce=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,A=function(){return"__special_katext_id_".concat(v++,"__")},y={};function I(){return y}function S(){v=0,y={}}function m(i){return i=i.replace(ce,function(u,s){var c=A();return y[c]={type:"inline",expression:s},c}),i}var ie=M.listitem;M.listitem=function(i){return ie(m(i))};var $=M.paragraph;M.paragraph=function(i){return $(m(i))};var L=M.tablecell;M.tablecell=function(i,u){return L(m(i),u)},M.code=function(i,u,s){var c=(u||"").match(/\S*/)[0];return c?["latex","katex","math"].indexOf(c)>=0?"<p class='editormd-tex'>".concat(i,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(u,'">').concat(s?i:Object(R.escape)(i,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(s?i:Object(R.escape)(i,!0))+"</code></pre>"},M.heading=function(i,u,s){var c=this.options.headerPrefix+s.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return F.push({anchor:c,level:u,text:i}),"<h"+u+' id="'+c+'">'+i+"</h"+u+">"},V.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),V.a.use({tokenizer:Z,renderer:M});var C=V.a,W=l("SJMd"),g=l("m3rI"),k=l("Oy/b"),K=/<pre[^>]*>/g;function w(i){var u=document.createElement("div");return u.innerHTML=i,u.childNodes.length===0?"":u.childNodes[0].nodeValue}var J=Y.a=function(i){var u=i.value,s=u===void 0?"":u,c=i.className,_=i.showTextOnly,O=i.showLines,P=i.style,U=P===void 0?{}:P,j=String(s),N=Object(X.useMemo)(function(){try{var e=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,t=/\"\/api\/attachments\/|\"\/attachments\/download\//g,a=/\(\s+\/files\/uploads\/|\(\/files\/uploads\//g;j=j.replace(e,"("+g.a.API_SERVER+"/api/attachments/").replace(t,'"'+g.a.API_SERVER+"/api/attachments/").replace(a,'"'+g.a.API_SERVER+"/files/uploads/")}catch(p){}var n=C(j);setTimeout(function(){return r()},300);var o=I();if(j.match(/\[TOC\]/)&&(n=n.replace("<p>[TOC]</p>",oe()),x()),n=n.replace(/(__special_katext_id_\d+__)/g,function(p,f){var h=o[f],b=h.type,E=h.expression;return Object(k.renderToString)(w(E)||"",{displayMode:b==="block",throwOnError:!1,output:"html"})}),n=n.replace(/▁/g,"\u2581\u2581\u2581"),S(),_){var d=document.createElement("div");return d.innerHTML=n,d.innerText}return n},[j]),D=Object(X.useRef)();ae.WebkitLineClamp=O,O&&(U=Object(re.a)(Object(re.a)({},U),ae));function G(e){var t=e.target;if(t.tagName.toUpperCase()==="A"){var a=t.getAttribute("href");if(a.startsWith("#")){e.preventDefault();var n=document.getElementById(a.replace("#",""));n&&n.scrollIntoView(!0)}}}var r=function(){};return Object(X.useEffect)(function(){if(D.current&&N&&(N.match(K)&&window.PR.prettyPrint()),D.current)return D.current.addEventListener("click",G),function(){D.current.removeEventListener("click",G),S(),x()}},[N,D.current,G]),ne.a.createElement(ne.a.Fragment,null,ne.a.createElement("div",{ref:D,style:Object(re.a)({},U),className:"".concat(c||""," markdown-body "),dangerouslySetInnerHTML:{__html:N}}))}},ObO0:function(ue,Y,l){"use strict";l.r(Y);var re=l("cWXX"),X=l("/ezw"),ne=l("+L6B"),de=l("2/Rp"),se=l("9og8"),B=l("tJVT"),V=l("PpiC"),R=l("q1tI"),T=l.n(R),F=l("Ty5D"),z=l("9kvl"),M=l("1vsH"),le=l("5oB3"),x=l.n(le),ae=l("ErOA"),Q=l("m3rI"),oe=l("9Bee");function Z(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Z=function(){return v};var v={},A=Object.prototype,y=A.hasOwnProperty,I=Object.defineProperty||function(r,e,t){r[e]=t.value},S=typeof Symbol=="function"?Symbol:{},m=S.iterator||"@@iterator",ie=S.asyncIterator||"@@asyncIterator",$=S.toStringTag||"@@toStringTag";function L(r,e,t){return Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{L({},"")}catch(r){L=function(t,a,n){return t[a]=n}}function C(r,e,t,a){var n=e&&e.prototype instanceof k?e:k,o=Object.create(n.prototype),d=new N(a||[]);return I(o,"_invoke",{value:O(r,t,d)}),o}function W(r,e,t){try{return{type:"normal",arg:r.call(e,t)}}catch(a){return{type:"throw",arg:a}}}v.wrap=C;var g={};function k(){}function K(){}function w(){}var J={};L(J,m,function(){return this});var i=Object.getPrototypeOf,u=i&&i(i(D([])));u&&u!==A&&y.call(u,m)&&(J=u);var s=w.prototype=k.prototype=Object.create(J);function c(r){["next","throw","return"].forEach(function(e){L(r,e,function(t){return this._invoke(e,t)})})}function _(r,e){function t(n,o,d,p){var f=W(r[n],r,o);if(f.type!=="throw"){var h=f.arg,b=h.value;return b&&typeof b=="object"&&y.call(b,"__await")?e.resolve(b.__await).then(function(E){t("next",E,d,p)},function(E){t("throw",E,d,p)}):e.resolve(b).then(function(E){h.value=E,d(h)},function(E){return t("throw",E,d,p)})}p(f.arg)}var a;I(this,"_invoke",{value:function(o,d){function p(){return new e(function(f,h){t(o,d,f,h)})}return a=a?a.then(p,p):p()}})}function O(r,e,t){var a="suspendedStart";return function(n,o){if(a==="executing")throw new Error("Generator is already running");if(a==="completed"){if(n==="throw")throw o;return G()}for(t.method=n,t.arg=o;;){var d=t.delegate;if(d){var p=P(d,t);if(p){if(p===g)continue;return p}}if(t.method==="next")t.sent=t._sent=t.arg;else if(t.method==="throw"){if(a==="suspendedStart")throw a="completed",t.arg;t.dispatchException(t.arg)}else t.method==="return"&&t.abrupt("return",t.arg);a="executing";var f=W(r,e,t);if(f.type==="normal"){if(a=t.done?"completed":"suspendedYield",f.arg===g)continue;return{value:f.arg,done:t.done}}f.type==="throw"&&(a="completed",t.method="throw",t.arg=f.arg)}}}function P(r,e){var t=e.method,a=r.iterator[t];if(a===void 0)return e.delegate=null,t==="throw"&&r.iterator.return&&(e.method="return",e.arg=void 0,P(r,e),e.method==="throw")||t!=="return"&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+t+"' method")),g;var n=W(a,r.iterator,e.arg);if(n.type==="throw")return e.method="throw",e.arg=n.arg,e.delegate=null,g;var o=n.arg;return o?o.done?(e[r.resultName]=o.value,e.next=r.nextLoc,e.method!=="return"&&(e.method="next",e.arg=void 0),e.delegate=null,g):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function U(r){var e={tryLoc:r[0]};1 in r&&(e.catchLoc=r[1]),2 in r&&(e.finallyLoc=r[2],e.afterLoc=r[3]),this.tryEntries.push(e)}function j(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function N(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(U,this),this.reset(!0)}function D(r){if(r){var e=r[m];if(e)return e.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var t=-1,a=function n(){for(;++t<r.length;)if(y.call(r,t))return n.value=r[t],n.done=!1,n;return n.value=void 0,n.done=!0,n};return a.next=a}}return{next:G}}function G(){return{value:void 0,done:!0}}return K.prototype=w,I(s,"constructor",{value:w,configurable:!0}),I(w,"constructor",{value:K,configurable:!0}),K.displayName=L(w,$,"GeneratorFunction"),v.isGeneratorFunction=function(r){var e=typeof r=="function"&&r.constructor;return!!e&&(e===K||(e.displayName||e.name)==="GeneratorFunction")},v.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,w):(r.__proto__=w,L(r,$,"GeneratorFunction")),r.prototype=Object.create(s),r},v.awrap=function(r){return{__await:r}},c(_.prototype),L(_.prototype,ie,function(){return this}),v.AsyncIterator=_,v.async=function(r,e,t,a,n){n===void 0&&(n=Promise);var o=new _(C(r,e,t,a),n);return v.isGeneratorFunction(e)?o:o.next().then(function(d){return d.done?d.value:o.next()})},c(s),L(s,$,"Generator"),L(s,m,function(){return this}),L(s,"toString",function(){return"[object Generator]"}),v.keys=function(r){var e=Object(r),t=[];for(var a in e)t.push(a);return t.reverse(),function n(){for(;t.length;){var o=t.pop();if(o in e)return n.value=o,n.done=!1,n}return n.done=!0,n}},v.values=D,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(j),!e)for(var t in this)t.charAt(0)==="t"&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 a(h,b){return d.type="throw",d.arg=e,t.next=h,b&&(t.method="next",t.arg=void 0),!!b}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],d=o.completion;if(o.tryLoc==="root")return a("end");if(o.tryLoc<=this.prev){var p=y.call(o,"catchLoc"),f=y.call(o,"finallyLoc");if(p&&f){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(p){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&y.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&(e==="break"||e==="continue")&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var d=o?o.completion:{};return d.type=e,d.arg=t,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(d)},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 a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),j(a),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var n=a.completion;if(n.type==="throw"){var o=n.arg;j(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:D(e),resultName:t,nextLoc:a},this.method==="next"&&(this.arg=void 0),g}},v}var ce=function(A){var y,I,S,m=A.user,ie=Object(V.a)(A,["user"]),$=Object(R.useState)(1),L=Object(B.a)($,2),C=L[0],W=L[1],g=Object(R.useState)(!1),k=Object(B.a)(g,2),K=k[0],w=k[1],J=Object(R.useState)(!1),i=Object(B.a)(J,2),u=i[0],s=i[1],c=Object(R.useState)(""),_=Object(B.a)(c,2),O=_[0],P=_[1],U=Object(R.useState)(!0),j=Object(B.a)(U,2),N=j[0],D=j[1],G=Object(R.useState)([{},{}]),r=Object(B.a)(G,2),e=r[0],t=r[1],a=Object(F.l)(),n=a.pathname;console.log(a,"location"),Object(R.useEffect)(function(){var f;(m==null||((f=m.userInfo)===null||f===void 0)?void 0:f.identity)&&o()},[m==null||((y=m.userInfo)===null||y===void 0)?void 0:y.identity]),Object(R.useEffect)(function(){d()},[]);var o=function(){if(n.includes("classrooms")){var h;(m==null||((h=m.userInfo)===null||h===void 0)?void 0:h.identity)==="student"&&(w(!0),W(2));return}if(n.includes("paths")){s(!0);return}},d=function(){var f=Object(se.a)(Z().mark(function h(b){var E,q,H,fe;return Z().wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(ae.a)("/api/introductions.json",{method:"get"});case 2:E=ee.sent,(E==null?void 0:E.introductions)&&(q=null,n.includes("classrooms")&&(q="course",P("\u6559\u5B66\u8BFE\u5802")),n.includes("paths")&&(q="subject",P("\u5B9E\u8DF5\u8BFE\u7A0B")),H=E.introductions,fe=[H==null?void 0:H.find(function(te){return te.clazz==="teacher"&&te.page_type===q}),H==null?void 0:H.find(function(te){return te.clazz==="student"&&te.page_type===q})],t(fe)),D(!1);case 5:case"end":return ee.stop()}},h)}));return function(b){return f.apply(this,arguments)}}(),p=function(){var h,b,E=Q.a.API_SERVER+"/api/attachments/"+(C===1?(h=e[0])===null||h===void 0?void 0:h.attachment_id:(b=e[1])===null||b===void 0?void 0:b.attachment_id);Object(M.r)("",E)};return T.a.createElement("section",{className:x.a.guidance},T.a.createElement(X.a,{loading:N,active:!0,paragraph:{rows:5}},T.a.createElement("div",{className:x.a.title},O,"\u65B0\u624B\u6307\u5F15"),T.a.createElement("ul",{className:x.a.u},!K&&T.a.createElement("li",{onClick:function(){return W(1)},className:C===1?x.a.active:""},"\u6559\u5E08\u7248"),!u&&T.a.createElement("li",{onClick:function(){return W(2)},className:C===2?x.a.active:""},"\u5B66\u751F\u7248")),C===1&&T.a.createElement("div",{className:x.a.content},T.a.createElement(oe.a,{value:((I=e[0])===null||I===void 0?void 0:I.content)||""})),C===2&&T.a.createElement("div",{className:x.a.content},T.a.createElement(oe.a,{value:((S=e[1])===null||S===void 0?void 0:S.content)||""})),T.a.createElement("div",{className:x.a.btn},T.a.createElement(de.a,{type:"primary",onClick:p},"\u4E0B\u8F7D\u7528\u6237\u624B\u518C"))))};Y.default=Object(z.a)(function(v){var A=v.user;return{user:A}})(ce)}}]);
|