"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[50869],{87691:function(n,e,t){t.r(e),t.d(e,{default:function(){return C}});var s=t(7557),i=t.n(s),u=t(41498),c=t.n(u),l=t(79800),a=t.n(l),r=t(39647),o=t.n(r),d=t(59301),v=t(49389),f=t(83287),h=t(61621),_=t(3113),p="guidance___BnanP",m="title___b2ocd",j="u___QIqxh",x="active___VXClY",N="content___NNbRj",y="btn___Q2wyi",k=t(94171),g=t(91689),S=t(71212),b=t(37712),w=["user"],C=(0,v.connect)((function(n){return{user:n.user}}))((function(n){var e,t,s,u=n.user,l=(o()(n,w),(0,d.useState)(1)),r=a()(l,2),C=r[0],Z=r[1],I=(0,d.useState)(!1),z=a()(I,2),E=z[0],P=z[1],R=(0,d.useState)(!1),Q=a()(R,2),V=Q[0],q=Q[1],A=(0,d.useState)(""),B=a()(A,2),L=B[0],X=B[1],Y=(0,d.useState)(!0),D=a()(Y,2),F=D[0],G=D[1],H=(0,d.useState)([{},{}]),J=a()(H,2),K=J[0],M=J[1],O=(0,v.useLocation)(),T=O.pathname;console.log(O,"location"),(0,d.useEffect)((function(){var n;null!=u&&null!==(n=u.userInfo)&&void 0!==n&&n.identity&&U()}),[null==u||null===(e=u.userInfo)||void 0===e?void 0:e.identity]),(0,d.useEffect)((function(){W()}),[]);var U=function(){var n;T.includes("classrooms")?"student"===(null==u||null===(n=u.userInfo)||void 0===n?void 0:n.identity)&&(P(!0),Z(2)):T.includes("paths")&&q(!0)},W=function(){var n=c()(i()().mark((function n(e){var t,s,u,c;return i()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,k.ZP)("/api/introductions.json",{method:"get"});case 2:null!=(t=n.sent)&&t.introductions&&(s=null,T.includes("classrooms")&&(s="course",X("教学课堂")),T.includes("paths")&&(s="subject",X("实践课程")),u=t.introductions,c=[null==u?void 0:u.find((function(n){return"teacher"===n.clazz&&n.page_type===s})),null==u?void 0:u.find((function(n){return"student"===n.clazz&&n.page_type===s}))],M(c)),G(!1);case 5:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}();return(0,b.jsx)("section",{className:p,children:(0,b.jsxs)(h.Z,{loading:F,active:!0,paragraph:{rows:5},children:[(0,b.jsxs)("div",{className:m,children:[L,"新手指引"]}),(0,b.jsxs)("ul",{className:j,children:[!E&&(0,b.jsx)("li",{onClick:function(){return Z(1)},className:1===C?x:"",children:"教师版"}),!V&&(0,b.jsx)("li",{onClick:function(){return Z(2)},className:2===C?x:"",children:"学生版"})]}),1===C&&(0,b.jsx)("div",{className:N,children:(0,b.jsx)(S.Z,{value:(null===(t=K[0])||void 0===t?void 0:t.content)||""})}),2===C&&(0,b.jsx)("div",{className:N,children:(0,b.jsx)(S.Z,{value:(null===(s=K[1])||void 0===s?void 0:s.content)||""})}),(0,b.jsx)("div",{className:y,children:(0,b.jsx)(_.ZP,{type:"primary",onClick:function(){var n,e,t=g.Z.API_SERVER+(1===C?null===(n=K[0])||void 0===n?void 0:n.attachment_url:null===(e=K[1])||void 0===e?void 0:e.attachment_url);(0,f.Nd)("",t)},children:"下载用户手册"})})]})})}))}}]);