(self.webpackChunk=self.webpackChunk||[]).push([[3897,6270],{58429:function(e,n,t){var i,r,o,a,s=t(31468).default;a=function(e){"use strict";var n=function(){return(n=Object.assign||function(e){for(var n,t=1,i=arguments.length;t0&&r[r.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]=0&&e.HANDLE_LIST.splice(t,1),window.removeEventListener("message",n,!1)},e.empty=function(){for(;e.HANDLE_LIST.length;)window.removeEventListener("message",e.HANDLE_LIST.shift(),!1)},e.parse=function(e){try{return"object"==s(e)?e:e?JSON.parse(e):e}catch(n){return console.log("Message.parse Error:",n),e}},e.HANDLE_LIST=[],e}();function o(e){return"[object Function]"==={}.toString.call(e)}var a,l,c,u,d={origin:""};function f(e,n){d[e]=n}function p(e){return d[e]}function g(e){var n=p("origin");return!!function(e,n){return e!==n&&(e.replace(/www\./i,"").toLowerCase()!==n.replace(/www\./i,"").toLowerCase()||(e.match("www.")?void 0:(f("origin",n),!1)))}(n,e.origin)&&(console.warn("postMessage 域名检查不通过",{safeOrigin:n,eventOrigin:e.origin}),!0)}!function(e){e.unknown="unknown",e.spreadsheet="s",e.writer="w",e.presentation="p",e.pdf="f"}(a||(a={})),function(e){e.wps="w",e.et="s",e.presentation="p",e.pdf="f"}(l||(l={})),function(e){e.nomal="nomal",e.simple="simple"}(c||(c={})),function(e){e[e.requestFullscreen=1]="requestFullscreen",e[e.exitFullscreen=0]="exitFullscreen"}(u||(u={}));var v,h,A,m=(v=0,function(){return v+=1}),x=function(e,n,t){void 0===t&&(t=!0);var i=n;if(!h){var r=function e(n){var t=n.clientHeight,i=n.clientWidth;0!==t||0!==i||A?0===t&&0===i||!A||(A.disconnect(),A=null):window.ResizeObserver&&(A=new ResizeObserver((function(t){e(n)}))).observe(n),h.style.cssText+="height: "+t+"px; width: "+i+"px"}.bind(null,i);(h=document.createElement("iframe")).classList.add("web-office-iframe");var o={id:"office-iframe",src:e,scrolling:"no",frameborder:"0",allowfullscreen:"allowfullscreen",webkitallowfullscreen:"true",mozallowfullscreen:"true",allow:"clipboard-read; clipboard-write"};for(var a in i?(o.style="width: "+i.clientWidth+"px; height: "+i.clientHeight+"px;",t&&window.addEventListener("resize",r)):((i=document.createElement("div")).classList.add("web-office-default-container"),function(e){var n=document.createElement("style");document.head.appendChild(n);var t=n.sheet;t.insertRule(".web-office-default-container {position: absolute; padding: 0; margin: 0; width: 100%; height: 100%; left: 0; top: 0;}",t.cssRules.length)}(),document.body.appendChild(i),o.style="position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;"),o)h.setAttribute(a,o[a]);i.appendChild(h),h.destroy=function(){h.parentNode.removeChild(h),h=null,window.removeEventListener("resize",r),A&&(A.disconnect(),A=null)}}return h},I=function(e){x().contentWindow&&x().contentWindow.postMessage(JSON.stringify(e),p("origin"))};function E(e,n,t){return new Promise((function(i){var o=m();r.add((function e(n){if(!g(n)){var a=r.parse(n.data);a.eventName===t&&a.msgId===o&&(i(a.data),r.remove(e))}})),I({data:e,msgId:o,eventName:n})}))}var k=function(e){return E(e,"wps.jssdk.api","wps.api.reply")},w=function(e){return E(e,"api.basic","api.basic.reply")},y={idMap:{}};function C(e){return t(this,void 0,void 0,(function(){var n,t,o,a,s,l,c,u,d,f;return i(this,(function(i){switch(i.label){case 0:return g(e)?[2]:(n=r.parse(e.data),t=n.eventName,o=n.callbackId,a=n.data,o&&(s=y.idMap[o])?(l=s.split(":"),c=l[0],u=l[1],"api.callback"===t&&y[c]&&y[c][u]?[4,(f=y[c][u]).callback.apply(f,a.args)]:[3,2]):[3,2]);case 1:d=i.sent(),I({result:d,callbackId:o,eventName:"api.callback.reply"}),i.label=2;case 2:return[2]}}))}))}var B=function(e){return t(void 0,void 0,void 0,(function(){function n(){return Object.keys(y.idMap).find((function(e){return y.idMap[e]===o+":"+t}))}var t,o,a,s,l,c,u,d,f;return i(this,(function(i){switch(i.label){case 0:return t=e.prop,o=e.parentObjId,[4,b([a=e.value])];case 1:return s=i.sent(),l=s[0],c=s[1],e.value=l[0],u=Object.keys(c)[0],d=y[o],null===a&&d&&d[t]&&((f=n())&&delete y.idMap[f],delete d[t],Object.keys(d).length||delete y[o],Object.keys(y.idMap).length||r.remove(C)),u&&(Object.keys(y.idMap).length||r.add(C),y[o]||(y[o]={}),y[o][t]={callbackId:u,callback:c[u]},(f=n())&&delete y.idMap[f],y.idMap[u]=o+":"+t),[2]}}))}))},j=function(e,o,a,s){return t(void 0,void 0,void 0,(function(){var l,c,u,d,f,p,v,h;return i(this,(function(A){switch(A.label){case 0:return l=m(),d=new Promise((function(e,n){c=e,u=n})),f={},o.args?[4,b(o.args)]:[3,2];case 1:p=A.sent(),v=p[0],h=p[1],o.args=v,f=h,A.label=2;case 2:return"api.setter"!==e?[3,4]:[4,B(o)];case 3:A.sent(),A.label=4;case 4:return function(e){var t=e[0],i=e[1];"function"==typeof(t=n({},t)).data&&(t.data=t.data()),i(),I(t)}([{eventName:e,data:o,msgId:l},function(){var n=this;return r.add((function o(d){return t(n,void 0,void 0,(function(){var n,t,p;return i(this,(function(i){switch(i.label){case 0:return g(d)?[2]:"api.callback"===(n=r.parse(d.data)).eventName&&n.callbackId&&f[n.callbackId]?[4,f[n.callbackId].apply(f,n.data.args)]:[3,2];case 1:t=i.sent(),I({result:t,eventName:"api.callback.reply",callbackId:n.callbackId}),i.label=2;case 2:return n.eventName===e+".reply"&&n.msgId===l&&(n.error?((p=new Error("")).stack=n.error+"\n"+a,s&&s(),u(p)):c(n.result),r.remove(o)),[2]}}))}))})),d}]),[2,d]}}))}))};function b(e){return t(this,void 0,void 0,(function(){var n,t,r,o,a,s,l,c,u,d,f;return i(this,(function(i){switch(i.label){case 0:n={},t=[],r=e.slice(0),i.label=1;case 1:return r.length?(o=void 0,[4,r.shift()]):[3,13];case 2:return(a=i.sent())&&a.done?[4,a.done()]:[3,4];case 3:i.sent(),i.label=4;case 4:if(!function(e){if(!e)return!1;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(o))return[3,11];for(l in o={},s=[],a)s.push(l);c=0,i.label=5;case 5:return c=0?"&":"?")+E.join("&")),f&&(f.isParentFullscreen||f.isBrowserViewFullscreen)&&(document.addEventListener("fullscreenchange",T),document.addEventListener("webkitfullscreenchange",T),document.addEventListener("mozfullscreenchange",T)),i.wordOptions&&(i.wpsOptions=i.wordOptions),i.excelOptions&&(i.etOptions=i.excelOptions),i.pptOptions&&(i.wppOptions=i.pptOptions),"object"==s(l.print)){var k="wpsconfig_print";"function"==typeof l.print.subscribe&&(l[k]=l.print.subscribe,i.print={callback:k},void 0!==l.print.custom&&(i.print.custom=l.print.custom)),delete l.print}return"function"==typeof l.exportPdf&&(l[k="wpsconfig_export_pdf"]=l.exportPdf,i.exportPdf={callback:k},delete l.exportPdf),i.commandBars&&M(i.commandBars,!1),n(n({},i),{subscriptions:l})},Q=function(e){void 0===e&&(e="");var n="";if(!n&&e){var t=e.toLowerCase();-1!==t.indexOf("/office/s/")&&(n=a.spreadsheet),-1!==t.indexOf("/office/w/")&&(n=a.writer),-1!==t.indexOf("/office/p/")&&(n=a.presentation),-1!==t.indexOf("/office/f/")&&(n=a.pdf)}if(!n){var i=e.match(/[\?&]type=([a-z]+)/)||[];n=l[i[1]]||""}return n};function M(e,n){void 0===n&&(n=!0);var t=e.map((function(e){var n=e.attributes;if(!Array.isArray(n)){var t=[];for(var i in n)if(n.hasOwnProperty(i)){var r={name:i,value:n[i]};t.push(r)}e.attributes=t}return e}));return n&&I({data:t,eventName:"setCommandBars"}),t}var D=window.navigator.userAgent.toLowerCase(),N=/Android|webOS|iPhone|iPod|BlackBerry|iPad/i.test(D),R=function(){try{return-1!==window._parent.location.search.indexOf("from=wxminiprogram")}catch(e){return!1}}();function T(){var e={status:u.requestFullscreen},n=document,t=n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement;e.status=t?u.requestFullscreen:u.exitFullscreen,I({data:e,eventName:"fullscreenchange"})}var J=function(){y.idMap={}};function U(){console.group("JSSDK 事件机制调整说明"),console.warn("jssdk.on、jssdk.off 和 jssdk.Application.Sub 将在后续版本中被弃用,建议使用改进后的 ApiEvent"),console.warn("具体请参考:https://wwo.wps.cn/docs/front-end/basic-usage/events/intro/"),console.groupEnd()}var Z=0,O=new Set;function z(e){return Z+=1,!e&&function(e){O.forEach((function(n){return n(e)}))}(Z),Z}function F(){var e=new Error("");return(e.stack||e.message||"").split("\n").slice(2).join("\n")}function G(e,o){var s,l=this,c=o.Events,u=o.Enum,d=o.Props,f=d[0],p=d[1],v={objId:Z};switch(function e(t,i,r){for(var o=i.slice(0),a=function(){var i=o.shift();!i.alias&&~Y.indexOf(i.prop)&&o.push(n(n({},i),{alias:i.prop+"Async"})),Object.defineProperty(t,i.alias||i.prop,{get:function(){var o=this,a=1===i.cache,s=a&&this["__"+i.prop+"CacheValue"];if(!s){var l=F(),c=z(a),u=function e(){for(var o,a=[],s=0;s=0?(n.then=null,n.catch=null,s.then((function(){e(n)})).catch((function(e){return t(e)}))):s.then(e,t)},n.catch=function(e){return s.catch(e)},n.Destroy=function(){return j("api.free",{objId:n.objId},"")}}var q={},V=null,P="fileOpen",K="fileSaved",H="fileStatus",W="fullscreenChange",X="error",_="stage",$="api.getToken",ee="event.toast",ne="event.hyperLinkOpen",te="api.getClipboardData";function ie(e,o,a,s,l,c,u){var d=this;void 0===a&&(a={}),r.add((function(f){return t(d,void 0,void 0,(function(){var t,d,p,v,h,A,m,x,E,k,w,y,C,B,j,b,S,Q,M;return i(this,(function(i){switch(i.label){case 0:return g(f)?[2]:(t=r.parse(f.data),d=t.eventName,p=void 0===d?"":d,v=t.data,h=void 0===v?null:v,A=t.url,m=void 0===A?null:A,-1!==["wps.jssdk.api"].indexOf(p)?[2]:"ready"!==p?[3,1]:(l.apiReadySended&&function(e){var n=[];Object.keys(q).forEach((function(t){q[t].forEach((function(i){var r=t;e.off(r,i),n.push({handle:i,eventName:r})})),delete q[t]})),n.forEach((function(e){var n=e.eventName,t=e.handle;null==V||V.ApiEvent.AddApiEventListener(n,t)}))}(o),I({eventName:"setConfig",data:n(n({},a),{version:e.version})}),e.tokenData&&e.setToken(n(n({},e.tokenData),{hasRefreshTokenConfig:!!a.refreshToken})),e.iframeReady=!0,[3,15]));case 1:return"error"!==p?[3,2]:(o.emit(X,h),[3,15]);case 2:return"open.result"!==p?[3,3]:(void 0!==(null===(S=null==h?void 0:h.fileInfo)||void 0===S?void 0:S.officeVersion)&&(e.mainVersion=h.fileInfo.officeVersion,console.log("aliyun Main Version: V"+e.mainVersion)),o.emit(P,h),[3,15]);case 3:return"api.scroll"!==p?[3,4]:(window.scrollTo(h.x,h.y),[3,15]);case 4:if(p!==$)return[3,9];x={token:!1},i.label=5;case 5:return i.trys.push([5,7,,8]),[4,l.refreshToken()];case 6:return x=i.sent(),[3,8];case 7:return E=i.sent(),console.error("refreshToken: "+(E||"fail to get")),[3,8];case 8:return I({eventName:$+".reply",data:x}),[3,15];case 9:if(p!==te)return[3,14];k={text:"",html:""},i.label=10;case 10:return i.trys.push([10,12,,13]),[4,l.getClipboardData()];case 11:return k=i.sent(),[3,13];case 12:return w=i.sent(),console.error("getClipboardData: "+(w||"fail to get")),[3,13];case 13:return I({eventName:te+".reply",data:k}),[3,15];case 14:p===ee?l.onToast(h):p===ne?l.onHyperLinkOpen(h):"stage"===p?o.emit(_,h):"event.callback"===p?(y=h.eventName,C=h.data,B=y,"fullScreenChange"===y&&(B=W),"file.saved"===y&&(B=H),((null===(Q=a.commonOptions)||void 0===Q?void 0:Q.isBrowserViewFullscreen)||(null===(M=a.commonOptions)||void 0===M?void 0:M.isParentFullscreen))&&"fullscreenchange"===B&&(j=C.status,b=C.isDispatchEvent,a.commonOptions.isBrowserViewFullscreen?function(e,n,t,i){0===e?n.style="position: static; width: "+t.width+"; height: "+t.height:1===e&&(n.style="position: absolute; width: 100%; height: 100%"),i&&function(e){["fullscreen","fullscreenElement"].forEach((function(n){Object.defineProperty(document,n,{get:function(){return!!e.status},configurable:!0})}));var n=new CustomEvent("fullscreenchange");document.dispatchEvent(n)}({status:e})}(j,c,u,b):a.commonOptions.isParentFullscreen&&function(e,n,t){var i=document.querySelector(t),r=i&&1===i.nodeType?i:n;if(0===e){var o=document;(o.exitFullscreen||o.mozCancelFullScreen||o.msExitFullscreen||o.webkitCancelFullScreen||o.webkitExitFullscreen).call(document)}else 1===e&&(r.requestFullscreen||r.mozRequestFullScreen||r.msRequestFullscreen||r.webkitRequestFullscreen).call(r)}(j,c,a.commonOptions.isParentFullscreen)),o.emit(B,C)):"api.ready"===p&&G(e,h),i.label=15;case 15:return"function"==typeof s[p]&&s[p](e,m||h),[2]}}))}))}))}function re(e){return new Promise((function(n){r.add((function t(i){g(i)||r.parse(i.data).eventName===e&&(n(),r.remove(t))}))}))}function oe(e){var n,a=this;void 0===e&&(e={}),V&&V.destroy();try{var s=S(e),l=s.subscriptions,c=void 0===l?{}:l,u=s.mount,d=void 0===u?null:u,p=s.url,g=s.refreshToken,v=s.onToast,h=s.onHyperLinkOpen,A=s.getClipboardData;f("origin",(p.match(/https*:\/\/[^\/]+/g)||[])[0]);var m=x(p,d),E=re("ready"),y=re("open.result"),C=re("api.ready"),B=d?{width:d.clientWidth+"px",height:d.clientHeight+"px"}:{width:"100vw",height:"100vh"};delete s.mount,p&&delete s.url,delete s.subscriptions;var j=(n=n||Object.create(null),{on:function(e,t){(n[e]||(n[e]=[])).push(t)},off:function(e,t){n[e]&&n[e].splice(n[e].indexOf(t)>>>0,1)},emit:function(e,t){(n[e]||[]).slice().map((function(e){e(t)})),(n["*"]||[]).slice().map((function(n){n(e,t)}))}}),b={apiReadySended:!1},Q=function(e,n,r){return t(a,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return function(e,n,t){if(q[e]){var i=!!q[e].find((function(e){return e===n}));return i&&"off"===t?(j.off(e,n),q[e]=q[e].filter((function(e){return e!==n})),!!q[e].length||(q[e]=void 0,!1)):(i||"on"!==t||(q[e].push(n),j.on(e,n)),!0)}return"on"===t?(q[e]=[],q[e].push(n),!1):"off"===t||void 0}(e,n,r)?[3,2]:[4,E];case 1:t.sent(),function(e,n){var t=e.eventName,i=e.type,r=e.handle;"on"===n?j.on(t,r):j.off(t,r),"base.event"===i&&I({eventName:"basic.event",data:{eventName:t,action:n}}),U()}(function(e,n){var t=e,i="base.event";switch(t){case K:console.warn("fileSaved事件监听即将弃用, 推荐使用fileStatus进行文件状态的监听"),t="fileStatus";break;case W:t="fullscreenchange";break;case"error":case"fileOpen":i="callback.event"}return{eventName:t,type:i,handle:n}}(e,n),r),t.label=2;case 2:return[2]}}))}))};return V={url:p,iframe:m,version:"1.1.19",iframeReady:!1,tokenData:null,commandBars:null,tabs:{getTabs:function(){return t(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,E];case 1:return e.sent(),[2,w({api:"tab.getTabs"})]}}))}))},switchTab:function(e){return t(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,E];case 1:return n.sent(),[2,w({api:"tab.switchTab",args:{tabKey:e}})]}}))}))}},setCooperUserColor:function(e){return t(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,E];case 1:return n.sent(),[2,w({api:"setCooperUserColor",args:e})]}}))}))},setToken:function(e){return t(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,E];case 1:return n.sent(),V.tokenData=e,I({eventName:"setToken",data:e}),[2]}}))}))},ready:function(){return t(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return b.apiReadySended?[3,2]:[4,y];case 1:e.sent(),b.apiReadySended=!0,I({eventName:"api.ready"}),e.label=2;case 2:return[4,C];case 3:return e.sent(),[2,new Promise((function(e){return setTimeout((function(){return e(null==V?void 0:V.Application)}),0)}))]}}))}))},destroy:function(){q={},m.destroy(),r.empty(),V=null,O=new Set,Z=0,document.removeEventListener("fullscreenchange",T),J()},save:function(){return t(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,E];case 1:return e.sent(),[2,k({api:"save"})]}}))}))},setCommandBars:function(e){return t(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,E];case 1:return n.sent(),M(e),[2]}}))}))},updateConfig:function(e){return void 0===e&&(e={}),t(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,E];case 1:return n.sent(),e.commandBars?(console.warn("Deprecated: `updateConfig()` 方法即将废弃,请使用`setCommandBars()`代替`updateConfig()`更新`commandBars`配置。"),[4,M(e.commandBars)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},executeCommandBar:function(e){return t(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,E];case 1:return n.sent(),M([{cmbId:e,attributes:[{name:"click",value:!0}]}]),[2]}}))}))},on:function(e,n){return t(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.ApiEvent.AddApiEventListener(e,n)]}))}))},off:function(e,n){return t(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.ApiEvent.RemoveApiEventListener(e,n)]}))}))},ApiEvent:{AddApiEventListener:function(e,n){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,Q(e,n,"on")];case 1:return[2,t.sent()]}}))}))},RemoveApiEventListener:function(e,n){return t(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,Q(e,n,"off")];case 1:return[2,t.sent()]}}))}))}}},function(e,n,t,i,r,a){n&&o(n)&&(r.refreshToken=n,e.refreshToken={eventName:$}),a&&o(a)&&(r.getClipboardData=a,e.getClipboardData={eventName:te}),t&&o(t)&&(r.onToast=t,e.onToast={eventName:ee}),i&&o(i)&&(r.onHyperLinkOpen=i,e.onHyperLinkOpen={eventName:ne})}(s,g,v,h,b,A),ie(V,j,s,c,b,m,B),V}catch(e){console.error(e)}}console.log("aliyun JS-SDK V1.1.19");var ae=Object.freeze({__proto__:null,listener:ie,config:oe});window.WPS=ae;var se=oe,le={config:se};e.config=se,e.default=le,Object.defineProperty(e,"__esModule",{value:!0})},"object"==s(n)?a(n):(r=[n],void 0===(o="function"==typeof(i=a)?i.apply(n,r):i)||(e.exports=o))},67057:function(e,n,t){"use strict";var i=t(7557),r=t.n(i),o=t(82242),a=t.n(o),s=t(37205),l=t.n(s),c=t(41498),u=t.n(c),d=t(79800),f=t.n(d),p=t(59301),g=t(92930),v=t(77736),h=t(92310),A=t.n(h),m=t(70052),x=t(56321),I=t(95817),E=t(37712),k=function(e){var n=e.data,t=e.onFinish;return(0,E.jsx)(v.Z,{children:n.map((function(e,n){return(0,E.jsx)(I.op,{style:{height:28},shape:"default",size:"small",onClick:function(){return t(e)},children:e},n)}))})};n.Z=function(e){var n=e.className,t=e.style,i=e.data,o=void 0===i?{}:i,s=e.defaultChatData,c=void 0===s?[]:s,d=e.initDefaultChatDataKey,v=void 0===d?0:d,h=e.showPrevButton,w=e.showNextButton,y=e.onPrevButtonClick,C=void 0===y?function(){}:y,B=e.onNextButtonClick,j=void 0===B?function(){}:B,b=e.onStatusChange,S=e.interactionTotal,Q=void 0===S?0:S,M=e.showInterText,D=void 0!==M&&M,N="主动提问开始",R=(0,m.eh)(),T=f()(R,1)[0],J=(0,m.r5)(),U=J.chatData,Z=J.setChatData,O=J.calcHistoryList,z=(0,p.useState)(0),F=f()(z,2),G=F[0],Y=F[1],L=(0,p.useState)(""),q=f()(L,2),V=q[0],P=q[1],K=(0,p.useState)(!1),H=f()(K,2),W=H[0],X=H[1],_=(0,m.wr)({status:W}),$=_.scrollBoxRef,ee=_.bottomInspectRef,ne=_.contentRef,te=_.isAtBottom,ie=(0,m.h4)($);(0,p.useEffect)((function(){if(U.length&&$.current){var e=U[U.length-1];null!=e&&e.loading&&($.current.scrollTop=$.current.scrollHeight)}}),[U.length]),(0,p.useEffect)((function(){if(v){re();var e=[];return c.forEach((function(n){var t=Date.now(),i=[{text:n.question,key:t,sender:"user",show:n.question!==N},{text:n.answer,loading:!1,key:t,sender:"AI",show:!0}];e.push.apply(e,i)})),Z(e),function(){T.cancel()}}}),[v]);var re=function(){T.cancel(),Y(1)},oe=function(){var e=u()(r()().mark((function e(n){var t,i,s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P(""),Y(0),t=Date.now(),i=[{text:n,key:t,sender:"user",show:n!==N},{loading:!0,key:t,sender:"AI",show:!0}],Z([].concat(l()(U),i)),s=O(U),T.request({url:"/api/stream/course_qna_records/chat_messages.json",body:a()({model:"qwen-max",is_chat:!0,prompt:n,history:s},o),onData:function(e,n){X(!0),Z((function(t){return t.map((function(i,r){return r===t.length-1?a()(a()({},i),{},{text:e,loading:!1,error:"error"===(null==n?void 0:n.msg)}):i}))}))},onError:function(e){Z((function(e){return l()(e).map((function(n,t){return t===e.length-1?a()(a()({},n),{},{text:"抱歉,我刚刚遇到了一点问题,没能完成您的请求。请您稍后再试一次,或者联系技术支持帮忙解决!",loading:!1,error:!0}):n}))}))}});case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ae=(0,p.useMemo)((function(){var e=U.filter((function(e){return"AI"===e.sender})).map((function(e){return e.text})).join(""),n=0;return["【交流题】","【判断题】","【文字题】","本次互动环节已结束"].forEach((function(t){var i=e.split(t).length-1;n+=i})),Math.max(0,n-1)}),[U]);(0,p.useEffect)((function(){"number"==typeof ae&&"number"==typeof Q&&(null==b||b(ae>=Q))}),[ae,Q]);var se=ie.width?ie.width-20:"100%";return(0,E.jsxs)("div",{className:A()("flex flex-col h-full",n),style:t,children:[h&&(0,E.jsxs)("div",{className:g.Z.headTip,children:["⬆️ 可点击",(0,E.jsx)("span",{onClick:C,children:"按钮"}),"或上方的阶段名称"]}),(0,E.jsxs)("div",{ref:$,style:{flex:1,overflow:"auto"},children:[(0,E.jsxs)("div",{className:g.Z.tips,style:{width:se},children:[(0,E.jsx)("img",{className:g.Z.avatar,src:x}),(0,E.jsxs)("div",{className:g.Z.details,children:[(0,E.jsx)("div",{className:"c-grey-333 font18",children:"👋 嗨,我是您的智能助教~"}),(0,E.jsx)("div",{className:"font16 mt8",style:{color:"#434D6C"},children:"我为你准备了一些互动学习问题,帮助你巩固知识。如果有不理解的地方,我会一步步引导,直到你完全理解。 准备好了就点击下方按钮,开始互动学习!"})]})]}),(0,E.jsx)(m.xj,{className:"pl20",style:{width:se},contentRef:ne,chatData:U,requestLoading:T.loading,cancelTyping:G,sensitiveWords:["【交流题】","【判断题】","【文字题】"],extraAnswerAction:function(e,n){var t;if(ae=Q&&(0,E.jsx)(I.op,{style:{margin:"0px 0px 20px 70px"},shape:"default",onClick:j,children:"进入下一阶段"}),!te&&(0,E.jsx)("div",{className:g.Z.backBottom,onClick:function(){$.current.scrollTop=$.current.scrollHeight},children:(0,E.jsx)("i",{className:"iconfont icon-huidaodibu"})}),(0,E.jsx)("div",{ref:ee})]}),!(null==U||!U.length)&&!D&&(0,E.jsx)(m.CI,{style:{margin:"0 20px 20px 20px"},onCancel:re,headExtraNode:ae>=Q?(0,E.jsx)("div",{style:{color:"#434D6C"},children:w?"已完成互动,可进入下一阶段学习":"已完成互动,可进入下一页学习"}):(0,E.jsxs)("div",{style:{color:"#434D6C"},children:["已完成答题",(0,E.jsx)("span",{className:"ml10 c-light-primary",children:ae}),"/",Q]}),value:V,onSubmit:oe,hideUpload:!0,onChange:P,typing:W,loading:T.loading})]})}},27955:function(e,n,t){"use strict";var i=t(82242),r=t.n(i),o=t(37205),a=t.n(o),s=t(7557),l=t.n(s),c=t(41498),u=t.n(c),d=t(79800),f=t.n(d),p=t(59301),g=t(92930),v=t(92310),h=t.n(v),A=t(70052),m=t(56321),x=t(95817),I=t(18714),E=t(43170),k=t(37712);n.Z=function(e){var n=e.className,t=e.style,i=e.data,o=void 0===i?{}:i,s=e.defaultChatData,c=void 0===s?[]:s,d=e.initDefaultChatDataKey,v=void 0===d?0:d,w=e.showPrevButton,y=e.showNextButton,C=e.onPrevButtonClick,B=void 0===C?function(){}:C,j=e.onNextButtonClick,b=void 0===j?function(){}:j,S=e.onStatusChange,Q=e.readingTime,M=e.analysis,D=e.totalTime,N=e.openRecord,R=e.showInterText,T=void 0!==R&&R,J=(0,A.eh)(),U=f()(J,1)[0],Z=(0,A.r5)(),O=Z.chatData,z=Z.setChatData,F=Z.calcHistoryList,G=(0,p.useState)(0),Y=f()(G,2),L=Y[0],q=Y[1],V=(0,p.useState)(""),P=f()(V,2),K=P[0],H=P[1],W=(0,p.useState)(!1),X=f()(W,2),_=X[0],$=X[1],ee=(0,p.useState)(null),ne=f()(ee,2),te=ne[0],ie=ne[1],re=(0,p.useRef)(null),oe=(0,A.wr)({status:_}),ae=oe.scrollBoxRef,se=oe.bottomInspectRef,le=oe.contentRef,ce=oe.isAtBottom,ue=(0,A.h4)(ae);(0,p.useEffect)((function(){"number"==typeof Q&&ie(Q)}),[Q]),(0,p.useEffect)((function(){return te>0&&te<=D&&!document.hidden&&(re.current=setTimeout((function(){N&&de(),ie((function(e){return Math.min(e+1,D)}))}),1e3)),function(){clearTimeout(re.current)}}),[te]),(0,p.useEffect)((function(){if(O.length&&ae.current){var e=O[O.length-1];null!=e&&e.loading&&(ae.current.scrollTop=ae.current.scrollHeight)}}),[O.length]),(0,p.useEffect)((function(){if(v){fe();var e=[];return c.forEach((function(n){var t=Date.now(),i=[{text:n.question,key:t,sender:"user",show:!0},{text:n.answer,loading:!1,key:t,sender:"AI",show:!0}];e.push.apply(e,i)})),z(e),function(){U.cancel()}}}),[v]);var de=function(){var e=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,E.ZP)("/api/smart_plan_item_banks/".concat(null==o?void 0:o.questionable_id,"/smart_plan_user_page_studies.json"),{method:"post",body:{type:"page_info"}});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),fe=function(){U.cancel(),q(1)},pe=function(){var e=u()(l()().mark((function e(n){var t,i,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:H(""),q(0),t=Date.now(),i=[{text:n,key:t,sender:"user",show:!0},{loading:!0,key:t,sender:"AI",show:!0}],z([].concat(a()(O),i)),s=F(O),U.request({url:"/api/stream/course_qna_records/chat_messages.json",body:r()({model:"qwen-max",is_chat:!0,prompt:n,history:s},o),onData:function(e,n){$(!0),z((function(t){return t.map((function(i,o){return o===t.length-1?r()(r()({},i),{},{text:e,loading:!1,error:"error"===(null==n?void 0:n.msg)}):i}))}))},onError:function(e){z((function(e){return a()(e).map((function(n,t){return t===e.length-1?r()(r()({},n),{},{text:"抱歉,我刚刚遇到了一点问题,没能完成您的请求。请您稍后再试一次,或者联系技术支持帮忙解决!",loading:!1,error:!0}):n}))}))}});case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();(0,p.useEffect)((function(){"number"==typeof te&&"number"==typeof D&&(null==S||S(te>=D))}),[te,D]),(0,p.useEffect)((function(){var e=function(){document.hidden?clearTimeout(re.current):!document.hidden&&te>0&&te0&&(0,k.jsxs)("div",{className:g.Z.tips,style:{width:ge},children:[(0,k.jsx)("img",{className:g.Z.avatar,src:m}),(0,k.jsx)("div",{className:g.Z.details,children:(0,k.jsx)(I.Z,{value:M})})]}),(0,k.jsx)(A.xj,{className:"pl20",style:{width:ge},contentRef:le,chatData:O,requestLoading:U.loading,cancelTyping:L,onAnswerFinish:u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:setTimeout((function(){return $(!1)}),0);case 1:case"end":return e.stop()}}),e)})))}),0===te&&!T&&(0,k.jsx)("div",{className:"flex justify-center mb20",children:(0,k.jsx)(x.op,{type:"primary",onClick:function(){ie(1)},children:"开始阅读解析"})}),0===te&&T&&(0,k.jsx)("div",{className:"flex justify-center mb20",children:"当前课件已结束,无法进行操作"}),y&&te>=D&&(0,k.jsx)(x.op,{style:{margin:"0px 0px 20px 70px"},shape:"default",onClick:b,children:"进入下一阶段"}),!ce&&(0,k.jsx)("div",{className:g.Z.backBottom,onClick:function(){ae.current.scrollTop=ae.current.scrollHeight},children:(0,k.jsx)("i",{className:"iconfont icon-huidaodibu"})}),(0,k.jsx)("div",{ref:se})]}),te>0&&(0,k.jsx)(A.CI,{style:{margin:"0 20px 20px 20px"},onCancel:fe,headExtraNode:te>=D?(0,k.jsx)("div",{style:{color:"#434D6C"},children:y?"阅读完成,可进入下一阶段":"阅读完成,可进入下一页学习"}):(0,k.jsxs)("div",{style:{color:"#434D6C"},children:[y?"请完整阅读解析,完成阅读才可进入下一阶段学习":"请完成阅读解析"," 剩余",(0,k.jsx)("span",{className:"ml5 mr5 c-light-primary",children:D-te}),"秒"]}),value:K,onSubmit:pe,hideUpload:!0,onChange:H,typing:_,loading:U.loading})]})}},70052:function(e,n,t){"use strict";t.d(n,{xj:function(){return ve},CI:function(){return X},h4:function(){return p},eh:function(){return l},wr:function(){return f},r5:function(){return d}});var i=t(79800),r=t.n(i),o=t(59301),a=t(93072),s=t(62233);function l(){var e=(0,o.useState)(!1),n=r()(e,2),t=n[0],i=n[1],l=(0,o.useRef)(null),c=(0,o.useCallback)((function(){var e;null===(e=l.current)||void 0===e||e.cancelRequest(),i(!1)}),[]);return[{request:(0,o.useCallback)((function(e){var n=e.url,t=e.body,r=e.onData,o=e.onDone,c=e.onCancelled,u=e.onError;l.current&&l.current.cancelRequest();var d=new a.Z(s.Z.API_SERVER+n,t);return l.current=d,i(!0),new Promise((function(e,n){d.on("data",(function(e){var n=e.chunk,t=e.full;null==r||r(t,n)})),d.on("done",(function(n){i(!1),null==o||o(n),e({status:"done",content:n})})),d.on("cancelled",(function(n){i(!1),null==c||c(n),e({status:"cancelled",content:n})})),d.on("error",(function(e){i(!1),null==u||u(e),n(e)})),d.startStream()}))}),[]),cancel:c,get loading(){return t}}]}var c=t(91232),u=t.n(c);function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=(0,o.useState)(e),t=r()(n,2),i=t[0],a=t[1],s=(0,o.useCallback)((function(e,n){var t=n||{},i=t.limit,r=t.onlySuccess,o=void 0===r||r,a=[],s=new Map;e.forEach((function(e){"AI"===e.sender&&e.key&&s.set(e.key,e)}));var l,c=u()(e);try{for(c.s();!(l=c.n()).done;){var d=l.value;if("user"===d.sender&&d.key){var f=s.get(d.key);if((null==f?void 0:f.text)&&(!o||!(null!=f&&f.error))&&(a.push({question:d.text||"",answer:f.text}),i&&a.length>=i))break}}}catch(e){c.e(e)}finally{c.f()}return a}),[]);return{chatData:i,setChatData:a,calcHistoryList:s}}var f=function(e){var n=e.status,t=e.rootMargin,i=void 0===t?"70px":t,a=e.bottomOffset,s=void 0===a?50:a,l=(0,o.useRef)(null),c=(0,o.useRef)(null),u=(0,o.useRef)(null),d=(0,o.useState)(!0),f=r()(d,2),p=f[0],g=f[1],v=(0,o.useRef)(!1),h=(0,o.useRef)(0);return(0,o.useEffect)((function(){var e=l.current,n=c.current;if(e&&n){var t=new IntersectionObserver((function(e){var n,t,i=r()(e,1)[0];document.contains(i.target)?0!==(null===(n=i.rootBounds)||void 0===n?void 0:n.width)||0!==(null===(t=i.rootBounds)||void 0===t?void 0:t.height)?0!==i.boundingClientRect.width||0!==i.boundingClientRect.height?g(i.isIntersecting):console.warn("目标元素宽高为 0,可能已被移除或隐藏"):console.warn("滚动容器无效,可能已被移除"):console.warn("目标元素已从 DOM 移除")}),{root:e,rootMargin:i,threshold:0});return t.observe(n),function(){t.disconnect()}}}),[i,!(null==l||!l.current),!(null==c||!c.current)]),(0,o.useEffect)((function(){if(n){var e=l.current,t=u.current;if(e&&t){v.current=!1,h.current=e.scrollTop;var i=function(){var n=e.scrollTop,t=e.scrollHeight,i=e.clientHeight,r=n>h.current;r&&n+i>=t-s?(e.scrollTop=t,v.current=!1):r||(v.current=!0),h.current=n};e.addEventListener("scroll",i);var r=new ResizeObserver((function(){v.current||(e.scrollTop=e.scrollHeight)}));return r.observe(t),function(){r.disconnect(),e.removeEventListener("scroll",i)}}}}),[n,s]),{scrollBoxRef:l,bottomInspectRef:c,contentRef:u,isAtBottom:p}};function p(e){var n=(0,o.useState)({width:0,height:0}),t=r()(n,2),i=t[0],a=t[1];return(0,o.useEffect)((function(){var n=e.current;if(n){var t=new ResizeObserver((function(e){var n,t=u()(e);try{for(t.s();!(n=t.n()).done;){var i=n.value,r=i.target.offsetWidth,o=i.target.offsetHeight;a({width:r,height:o})}}catch(e){t.e(e)}finally{t.f()}}));return t.observe(n),function(){t.disconnect()}}}),[e]),i}var g=t(82242),v=t.n(g),h=t(37205),A=t.n(h),m=t(7557),x=t.n(m),I=t(41498),E=t.n(I),k=t(6767),w=t(14566),y=t(62957),C=t(25399),B=t(29787),j=t(75727),b=t(99571),S=t(37568),Q=t(92310),M=t.n(Q),D="footerContainer___JFPnb",N="togglesContainer___dRNY4",R="attachment___VYSbv",T="btn___T5UpT",J="btnActive___gq01r",U="inputContainer___Yy8gW",Z="uploadBtn___OcD8F",O="sendBtn___e2elL",z="cancelBtn___DEsSI",F="lineFour___GcA3R",G="fullIcon___fmG_6",Y="selected___m2pW_",L="full___cZUDM",q="disabledInput___ijUlM",V=t(89728),P=t(58617),K=t(32050),H=t(37712),W=(0,o.forwardRef)((function(e,n){var t=e.placeholder,i=void 0===t?"在这里输入你的问题吧,Shift+Enter换行~":t,a=e.className,l=e.style,c=e.hideUpload,u=e.disabled,d=e.disabledTooltip,f=e.value,p=void 0===f?"":f,g=e.onChange,h=e.onSubmit,m=e.onCancel,I=e.loading,Q=e.typing,W=e.toggles,X=e.onFullInputChange,_=e.onInputFocus,$=e.headExtraNode,ee=(0,o.useState)([]),ne=r()(ee,2),te=ne[0],ie=ne[1],re=(0,o.useState)([]),oe=r()(re,2),ae=oe[0],se=oe[1],le=(0,o.useState)(!1),ce=r()(le,2),ue=ce[0],de=ce[1],fe=(0,o.useState)(!1),pe=r()(fe,2),ge=pe[0],ve=pe[1],he=(0,o.useRef)(null),Ae=(0,o.useRef)(null),me=(0,o.useRef)(null),xe=(0,o.useRef)(!1);(0,o.useImperativeHandle)(n,(function(){return{onAttachmentsClear:function(){ie([]),se([])}}}));var Ie,Ee={maxCount:50,showUploadList:!1,withCredentials:!0,openFileDialogOnClick:!1,fileList:te,multiple:!0,accept:".doc,.docx,.md,.txt,.pdf,.xlsx,.xls",beforeUpload:(Ie=E()(x()().mark((function e(n){var t,i,r;return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=null==n||null===(t=n.name)||void 0===t||null===(t=t.split("."))||void 0===t||null===(t=t.slice(-1))||void 0===t||null===(t=t[0])||void 0===t?void 0:t.toLowerCase(),r=["doc","docx","md","pdf","txt","xlsx","xls"],0!==n.size){e.next=5;break}return k.ZP.warning("文件内容不能为空"),e.abrupt("return",w.Z.LIST_IGNORE);case 5:if(r.includes(i)){e.next=8;break}return k.ZP.warning("目前支持txt、md、doc、docx、pdf、xlsx、xls文件"),e.abrupt("return",w.Z.LIST_IGNORE);case 8:if(!(n.size/1024/1024>100)){e.next=11;break}return k.ZP.warning("上传的文件大小限制100MB"),e.abrupt("return",w.Z.LIST_IGNORE);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)}))),function(e){return Ie.apply(this,arguments)}),onChange:function(e){var n=e.fileList;ie(n)},action:"".concat(null===s.Z||void 0===s.Z?void 0:s.Z.API_SERVER,"/api/intelligent_imports/upload_file.json")},ke={maxCount:10,showUploadList:!1,withCredentials:!0,openFileDialogOnClick:!1,fileList:ae,multiple:!0,accept:".jpg,.png",beforeUpload:function(e){var n,t=null==e||null===(n=e.name)||void 0===n||null===(n=n.split("."))||void 0===n||null===(n=n.slice(-1))||void 0===n||null===(n=n[0])||void 0===n?void 0:n.toLowerCase();return 0===e.size?(k.ZP.warning("文件内容不能为空"),w.Z.LIST_IGNORE):["jpg","png"].includes(t)?!(e.size/1024/1024>10)||(k.ZP.warning("上传的图片大小限制10MB"),w.Z.LIST_IGNORE):(k.ZP.warning("目前支持jpg、png"),w.Z.LIST_IGNORE)},onChange:function(e){var n=e.fileList;se(n)},action:"".concat(null===s.Z||void 0===s.Z?void 0:s.Z.API_SERVER,"/api/ai/generals/update_file.json")};(0,o.useEffect)((function(){var e,n=null===(e=he.current)||void 0===e||null===(e=e.resizableTextArea)||void 0===e?void 0:e.textArea;if(n){var t=new ResizeObserver((function(){ve(n.scrollHeight>=96)}));return n&&t.observe(n),function(){n&&t.unobserve(n)}}}),[]);var we=function(){null==h||h(p,te,ae)},ye=[].concat(A()(te),A()(ae)),Ce=ye.some((function(e){return"uploading"===e.status}))||Q||I||!(null!=p&&p.trim()),Be=!!ye.length||(null==W?void 0:W.some((function(e){return e.active})))||$,je=c||te.length>=50||ae.length>=10,be=[{key:"file",disabled:te.length>=50,label:(0,H.jsx)(C.Z,{placement:"right",title:(0,H.jsxs)("div",{children:[(0,H.jsx)("b",{children:"上传附件(仅识别文字)"}),(0,H.jsx)("div",{children:"最多 50 个,每个 100 MB,支持各类型文档"})]}),children:(0,H.jsxs)("span",{children:[(0,H.jsx)("i",{className:"iconfont icon-fujian3 font14 mr5"}),"上传文档"]})})},{key:"image",disabled:ae.length>=10,label:(0,H.jsx)(C.Z,{placement:"right",title:"支持不超过10M的PNG/JPG图片,最多10个",children:(0,H.jsxs)("span",{children:[(0,H.jsx)("i",{className:"iconfont icon-tupianshangchuan font14 mr5"}),"上传图片"]})})}];return(0,H.jsxs)("div",{style:l,className:M()(D,a,ue&&L,Be&&Y),children:[(0,H.jsxs)("div",{className:N,children:[$,null==W?void 0:W.filter((function(e){return!1!==e.show})).map((function(e,n){return(0,H.jsxs)(o.Fragment,{children:[(0,H.jsx)(C.Z,{title:e.tooltip,children:(0,H.jsxs)("div",{onClick:e.onToggle,className:M()(T,e.active&&J),children:[(0,H.jsx)("i",{className:"iconfont ".concat(e.icon," mr10 font12")}),e.label]})},e.label),null==e?void 0:e.extraNode]},n)})),ye.map((function(e){return(0,H.jsxs)("div",{className:R,children:["uploading"===(null==e?void 0:e.status)&&(0,H.jsx)(B.Z,{indicator:(0,H.jsx)(P.Z,{rev:!0,spin:!0}),className:"mr10",size:"small",spinning:!0}),(0,H.jsx)("span",{title:null==e?void 0:e.name,className:"mr10",children:(0,V.Pq)(e.name,20)}),(0,H.jsx)("i",{onClick:function(){ie((function(n){return n.filter((function(n){return n.uid!==e.uid}))})),se((function(n){return n.filter((function(n){return n.uid!==e.uid}))}))},className:"iconfont current icon-shanchu15 delete-hover c-red-ee4 font12"})]},e.uid)}))]}),(0,H.jsx)(C.Z,{title:d,children:(0,H.jsxs)("div",{className:M()(U,ge&&F,u&&q),children:[(0,H.jsx)(w.Z,v()({ref:Ae},Ee)),(0,H.jsx)(w.Z,v()({ref:me},ke)),(0,H.jsx)(j.Z,{className:"".concat(je?"hide":""),menu:{items:be,onClick:function(e){return function(e){if("file"===e){var n;if(ae.length)return void y.Z.confirm({centered:!0,icon:null,okText:"确认覆盖",cancelText:"取消",title:"提示",content:"已存在图片,上传文件后图片将会被覆盖?",onOk:function(){var e;se([]),null===(e=Ae.current)||void 0===e||null===(e=e.upload)||void 0===e||null===(e=e.uploader)||void 0===e||null===(e=e.fileInput)||void 0===e||e.click()}});null===(n=Ae.current)||void 0===n||null===(n=n.upload)||void 0===n||null===(n=n.uploader)||void 0===n||null===(n=n.fileInput)||void 0===n||n.click()}if("image"===e){var t;if(te.length)return void y.Z.confirm({centered:!0,icon:null,okText:"确认覆盖",cancelText:"取消",title:"提示",content:"已存在文件,上传图片后文件将会被覆盖?",onOk:function(){var e;ie([]),null===(e=me.current)||void 0===e||null===(e=e.upload)||void 0===e||null===(e=e.uploader)||void 0===e||null===(e=e.fileInput)||void 0===e||e.click()}});null===(t=me.current)||void 0===t||null===(t=t.upload)||void 0===t||null===(t=t.uploader)||void 0===t||null===(t=t.fileInput)||void 0===t||t.click()}}(e.key)}},placement:"top",children:(0,H.jsx)(b.ZP,{className:Z,icon:(0,H.jsx)(K.Z,{rev:!0,style:{fontSize:18,color:"#FFF"}})})}),(0,H.jsx)(S.Z.TextArea,{ref:he,autoSize:{minRows:1,maxRows:4},placeholder:i,value:p,variant:"borderless",style:je?{paddingLeft:0,marginLeft:0}:{},onChange:function(e){null==g||g(e.target.value)},onPressEnter:function(e){if((!e.shiftKey||"Enter"!==e.key)&&"Enter"===e.key){if(e.preventDefault(),Ce||xe.current||I)return;we()}},onCompositionStart:function(){xe.current=!0},onCompositionEnd:function(){xe.current=!1},onFocus:function(){return null==_?void 0:_()}}),Q?(0,H.jsx)(C.Z,{title:"停止生成",children:(0,H.jsx)("div",{className:"iconfont icon-tingzhihuida ".concat(z),onClick:m})}):(0,H.jsx)(b.ZP,{className:O,icon:(0,H.jsx)("i",{className:"iconfont icon-fasong2 c-white"}),disabled:Ce,onClick:we}),ge&&(0,H.jsx)("span",{className:G,onClick:function(){de(!ue),null==X||X(!ue)},children:ue?(0,H.jsx)("span",{className:"iconfont icon-shousuo"}):(0,H.jsx)("span",{className:"iconfont icon-zhankai"})})]})})]})})),X=W,_="loading___dHPeG",$="dot___wB_Xx",ee="li___pjgC0",ne="avatarIcon___SHala",te="img___DK87r",ie="content___kiz_D",re="borderBox___Txzil",oe="text___iNCQg",ae="fileWrap___wWt5C",se="file___ZeKPM",le="fileName___FzNuv",ce="source___tXQ7H",ue="action___xwJSd",de=t(30319),fe=t(83169),pe=t(56102),ge=t(56321),ve=function(e){var n=e.contentRef,i=e.className,a=e.style,s=e.aiIcon,l=void 0===s?ge:s,c=e.userIcon,u=void 0===c?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAAXNSR0IArs4c6QAAIABJREFUeF69nQm0ZHdd5z//u9/aq97W/XpNpwOZhIR9EaOyKQgqorhwHJ0onkEcZwZQZ86o4Bk548jgiDqKozLHOSoqi0hggIAoCdCEQCAJ3dk6vaXXt7/a6+535ve/Vd2vu193+gWYSirdebXce7/3t35/y1Nc4+M3D+VO+0jyUsh/SMFNSjFv2PZ8GieVPEvPf4tSihxQ1/i9/z/eluc5qBwMC8u0SJMYslyfJ9BXcBaVn83hYTA/1thvfe4/P0NF13JuT3qdv/qJfFsche/Ilf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zwsePWNqRXHAhm0jfOK271OdeBcDTtu1svoR2ApisQU5yPjEB8Yo7VCdOfzKKMK7UXbrDuQBQVClnqpKzQyVUoph01NOd9bJIp/DyhRQKHZ8FIfmgj9ddpZm1mW5Cs+VTq3uUywV4bqkYfdVFJ9sld6Y49NVMrwPY+fJtvOdLGcNAvPfEBl7sQIqMvbjh1wjgaWXz6ve85iprkCcgjp3KP4g6Xw3AwrsWa2cnC7s38+Q6Aslz9m8zGT7RpzJapVpSBEGo81ld45DxVvlDUAwi7EGPeiQ9NEOaDYtq3aFS8nBLDk7JxnUdlBSaXCnvSYGlwsJ6CXN7Hbvq8hdfDTm+KuNmYwA3rkPWJ1nI5mYd+pdKoKitZdnXtoh7AoDYxBNx9OuZrILfxDtfBJRewi3jAperiY589FbcjJt2WiycCMkfP8jstprOZaXzVC5GBFliYBnQscOQUtCjafZ1t2qtalKpOvi+i+NbOK6D6UjnlbRzSF+MQ+LPEVanCBPpnc75wumYOx+Wmb0LrP95syTne5W1dxMAxdsq8t/bu9VV8BvB2fjLCDYLtvX9FSmUqxd1uCRVKl7PqXjw9Hmb4+cU3UOPMZ0uUZ1qagBFgoX0lMzBTjP8OKCa9Wk60u6bUa5alMs2ju/guMXGS90DYypy02NU2aV7FCfmWnYOrqYJ//OArLy7XEXP/3aHzdI63TVidIH325b91H8ZwaWqeOHXYaT612GQq/kc5qX0L6WIMY6b1hTE/u2egZmaw9Fz0OuE5A8cYH7axitXdFVFqCcnN3CzlHIW0jBGNL2QaiWnUrbwRXUlnHEsTOkMF5bHrtOv7SWSNcgSJo3nD+V8ZCjzw4divnZS6U0il26q1AKot+6pb+rXYfxfOB1rs3mHTi4AAAAASUVORK5CYII=":c,d=e.chatData,f=e.requestLoading,p=e.editIndex,g=e.onEditFinish,v=e.onEditCancel,h=e.customDataNode,m=e.extraAnswerAction,I=e.cancelTyping,w=e.onAnswerFinish,y=e.onReasoningFinish,B=e.onDynamic,j=e.sensitiveWords,Q=void 0===j?[]:j,D=(0,o.useState)(""),N=r()(D,2),R=N[0],T=N[1],J=(0,o.useRef)(null);(0,o.useEffect)((function(){if(J.current&&null!==p){var e;J.current.focus();var n=null===(e=J.current.resizableTextArea)||void 0===e?void 0:e.textArea;n&&(n.selectionStart=n.selectionEnd=n.value.length)}}),[p]);var U=function(e,n){var i=n===p,r=[].concat(A()((null==e?void 0:e.fileList)||[]),A()((null==e?void 0:e.imageList)||[]));return(0,H.jsxs)("div",{className:ee,children:[(0,H.jsx)("div",{className:ne,children:(0,H.jsx)("img",{className:te,src:u})}),(0,H.jsxs)("div",{className:ie,children:[!(null==r||!r.length)&&(0,H.jsx)("div",{className:ae,children:null==r?void 0:r.map((function(e,n){var i;return(0,H.jsxs)("div",{className:se,children:[(0,H.jsx)("img",{src:t(90034)("./".concat((null==e||null===(i=e.name)||void 0===i||null===(i=i.split("."))||void 0===i?void 0:i.pop())||"txt",".png")),width:20,className:"mr10"}),(0,H.jsxs)("aside",{children:[(0,H.jsx)(C.Z,{title:null==e?void 0:e.name,children:(0,H.jsx)("div",{className:le,children:null==e?void 0:e.name})}),(0,H.jsx)("div",{className:"c-grey-999 font12",children:(0,V.RD)(null==e?void 0:e.size)})]})]},n)}))}),(0,H.jsx)("div",{className:re,children:i?(0,H.jsx)(S.Z.TextArea,{value:R,ref:J,autoSize:!0,placeholder:"请输入",variant:"borderless",onChange:function(e){return T(e.target.value)}}):(0,H.jsx)("div",{className:oe,children:null==e?void 0:e.text})}),i?(0,H.jsxs)("div",{className:ue,children:[(0,H.jsx)(b.ZP,{onClick:function(){T(""),v()},size:"small",children:"取消"}),(0,H.jsx)(b.ZP,{disabled:!R.trim(),onClick:function(){return g(R)},type:"primary",size:"small",children:"确认"})]}):(0,H.jsx)("div",{className:ue,children:(0,H.jsx)(pe.CopyToClipboard,{text:(null==e?void 0:e.text)||"",onCopy:function(){return k.ZP.success("复制成功")},children:(0,H.jsx)(C.Z,{title:"复制",children:(0,H.jsx)("i",{className:"iconfont icon-fuzhi8 font13"})})})})]})]})},Z=function(e,n){return(0,H.jsxs)("div",{className:ee,children:[(0,H.jsx)("div",{className:ne,children:(0,H.jsx)("img",{className:te,src:l})}),(0,H.jsxs)("div",{className:ie,children:[(0,H.jsxs)("div",{className:re,children:[e.loading&&(0,H.jsx)(H.Fragment,{children:null!=e&&e.imageGenerator?(0,H.jsxs)("div",{className:"flex item-center",children:["正在生成中",(0,H.jsx)("div",{className:"ai-loading"})]}):!(null!=e&&e.thinkingEnabled)&&(0,H.jsxs)("div",{children:[(0,H.jsxs)("div",{className:_,children:[(0,H.jsx)("div",{className:$}),(0,H.jsx)("div",{className:$}),(0,H.jsx)("div",{className:$})]}),(0,H.jsx)("div",{style:{marginTop:10,color:"#9096A3"},children:"请耐心等待,目前高峰期体验人数过多,我们已记录下您的需求,稍后将自动为您生成答案。"})]})}),(null==e?void 0:e.thinkingEnabled)&&(0,H.jsx)(fe.Z,{time:null==e?void 0:e.time,cancelIndex:I,loading:e.loading,streamingStatus:null==e||!e.text,onFinish:E()(x()().mark((function e(){return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==y||y();case 1:case"end":return e.stop()}}),e)}))),value:null==e?void 0:e.reasoning}),!(null==e||!e.text)&&!e.hideAnswer&&(0,H.jsx)(de.Z,{cancelIndex:I,onDynamic:B,streamingStatus:f,loadImage:!(null==e||!e.imageGenerator),onFinish:E()(x()().mark((function e(){return x()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null==w||w();case 1:case"end":return e.stop()}}),e)}))),value:(t=null==e?void 0:e.text,i=Q,r=t,i.forEach((function(e){var n=new RegExp(e,"g");r=r.replace(n,"")})),r)})]}),(null==e?void 0:e.source)&&!(null==e||!e.text)&&(0,H.jsx)("div",{className:ce,children:null==e?void 0:e.source}),(0,H.jsxs)("div",{className:ue,children:[null==m?void 0:m(e,n),(0,H.jsx)(pe.CopyToClipboard,{text:String((null==e?void 0:e.text)||""),onCopy:function(){return k.ZP.success({content:"复制成功",key:"copy"})},children:(0,H.jsx)(C.Z,{title:"复制",children:(0,H.jsx)("i",{className:"iconfot icon-fuzhi8 font13"})})})]})]})]});var t,i,r};return(0,H.jsx)("div",{ref:n,className:M()(i),style:a,children:null==d?void 0:d.map((function(e,n){return(0,H.jsx)(o.Fragment,{children:e.show&&(0,H.jsxs)(H.Fragment,{children:["user"===e.sender&&U(e,n),"AI"===e.sender&&Z(e,n),h&&!["AI","user"].includes(e.sender)&&h(e,n)]})},e.key+n)}))})}},5181:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return he}});var i=t(91232),r=t.n(i),o=t(37205),a=t.n(o),s=t(7557),l=t.n(s),c=t(41498),u=t.n(c),d=t(79800),f=t.n(d),p=t(59301),g=t(58429),v=t.n(g),h="maskSty___QKBqv",A="btn_float___MTyg8",m=t(82242),x=t.n(m),I=t(56565),E={box:"box___JDRma",page_style:"page_style___TSxPN",mainContent:"mainContent___WrnJ_",question_buuton:"question_buuton___tVuIm",selectQuestion:"selectQuestion___xdvxF",addQuestion:"addQuestion___FQqbC",submit_button:"submit_button___NUmmN",page_footer:"page_footer___xsCAT",num_style:"num_style____RKER",num_style_active:"num_style_active___Zj1Yq",button1:"button1___Qlp0H",button2:"button2___bOgXY",box_header:"box_header___uPIfT",headTip:"headTip___ghf23",box_wrap:"box_wrap___TctAB",progressbarWrap:"progressbarWrap___iIjTu",progressItem:"progressItem___n5eeJ",circle:"circle___j5pl1",activeWrap:"activeWrap___UmJBd",quit:"quit___XYuQm",progressBox:"progressBox____MSrA",time:"time___FDg0I",span1:"span1___eXY3E",span2:"span2___TADIW",span3:"span3___dcqT8",datikaWrap:"datikaWrap___fPCkE",datika:"datika___A5_TO",datikaModal:"datikaModal___Nxivs",datititleBox:"datititleBox___kObjF",datititle:"datititle___GRijH",titleBox:"titleBox___Mt6rh",square:"square___vAu_x",daticontentBox:"daticontentBox___g5MyB",activeSquare:"activeSquare___hlB9V",rightSty:"rightSty___e0dA6",errorSty:"errorSty___zRt0M",unanswer:"unanswer___Ht_gx",answered:"answered___pWlE1",confirmBtn:"confirmBtn___TcROa",datikaModalSty:"datikaModalSty___z78QJ",daojishi:"daojishi___l66Zz"},k=t(62957),w=t(6767),y=t(29787),C=t(77019),B=t(5269),j=t(89392),b="html___F0iOy",S="choiceIndex___kqVan",Q="Drawrap___EoEUV",M="c___b2vnF",D="cpp___P7I43",N="java___WVWs5",R="python___jYtaY",T="questionWrap___etqMI",J="solutionWrap___mYqhV",U="descBox___wxQO7",Z="title___kbl_N",O="desc___Fqem8",z="choiceBox___nT00I",F="activeAnswerBox___fu7T_",G="rightAnswerBox___gyayt",Y="errorAnswerBox___FlDEL",L="greenColor___Dkxsy",q="redColor___TB4es",V=t(18714),P=t(37712),K=(0,I.connect)((function(e){return{problemset:e.problemset}}))((function(e){e.problemset,e.dispatch;var n=e.question,t=e.pageCache,i=e.solutionVis,r=(e.disabled,e.questionIndex,e.pageInfo),o=e.pptInfo,a=e.SmartPlanItemBanks,s=e.questionChoiceIdsRef,l=(0,p.useState)({}),c=f()(l,2),u=c[0],d=c[1],g=(0,p.useState)([]),v=f()(g,2),h=v[0],A=v[1],m={fontSize:"16px"},I=!(null!=t&&t.is_end)&&"ended"==(null==r?void 0:r.status)||(null==n?void 0:n.is_answered)||(null==t?void 0:t.is_end)&&!(null!=a&&a.allow_answer_after_end),E=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];(0,p.useEffect)((function(){var e=(0,j.cloneDeep)(n);d(e),A(e.choices)}),[n]);var k,w,y,Q,M=function(e){var n="";return h.forEach((function(t,i){e?(null!=t&&t.me_answered||null!=t&&t.checked)&&(n+=E[i]):null!=t&&t.is_answer&&(n+=E[i])})),n};return(0,P.jsx)("div",{children:(0,P.jsxs)("div",{className:T,children:[(0,P.jsx)(V.Z,{value:'

多选题

'+(null==u?void 0:u.name),style:x()({},m)}),null==h?void 0:h.map((function(e,n){var t=e.is_answer,r=e.checked,a=e.choice_text,l=e.me_answered,c="";return i?(t&&(c=G),t||!r&&!l||(c=Y)):(r||l)&&(c=F),(0,P.jsxs)(C.Z,{className:"".concat(z," ").concat(c),align:"middle",wrap:!1,style:{cursor:I?"not-allowed":"pointer",marginTop:"10px"},onClick:function(e){!function(e){if(!I||null!=o&&o.is_simulate){var n=h.map((function(n,t){return x()(x()({},n),{},{checked:t===e?!(null!=n&&n.checked):n.checked})}));s.current=n.filter((function(e){return e.checked})).map((function(e){return null==e?void 0:e.choice_id})),A(n)}}(n)},children:[(0,P.jsx)(B.Z,{style:x()({fontWeight:500},m),className:S,children:E[n]}),(0,P.jsx)(B.Z,{flex:1,className:"ml10",children:(0,P.jsx)(V.Z,{className:b,value:a,style:x()({},m)})}),i&&t&&(0,P.jsx)(B.Z,{children:(0,P.jsx)("i",{className:"iconfont icon-duigou1 font16 c-green"})}),i&&!t&&(r||l)&&(0,P.jsx)(B.Z,{children:(0,P.jsx)("i",{className:"iconfont icon-guanbi10 font16 c-red"})})]},n)})),!i&&h.find((function(e){return(null==e?void 0:e.checked)||(null==e?void 0:e.me_answered)}))&&(0,P.jsxs)("div",{style:x()(x()({},m),{},{marginTop:"20px",fontWeight:600}),children:[(0,P.jsx)("span",{children:"已选答案  "}),(0,P.jsx)("span",{style:{color:"#3061D0"},children:M(!0)})]}),i&&(0,P.jsxs)("div",{className:J,children:[(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,P.jsxs)("div",{className:"c-grey-333 mb5 font16",children:[(0,P.jsx)("span",{style:{color:"#000",fontWeight:600,marginRight:"10px",fontSize:"16px"},children:"正确答案"}),(0,P.jsx)("span",{style:{color:"#2EC25B",fontWeight:600,fontSize:"16px"},children:M(!1)})]}),(0,P.jsxs)("div",{className:"c-grey-333 mb5 font16",children:[(0,P.jsx)("span",{style:{color:"#000",fontWeight:600,marginRight:"10px",fontSize:"16px"},children:"已选答案"}),h.find((function(e){return null==e?void 0:e.me_answered}))?(0,P.jsx)(P.Fragment,{children:(k=h.map((function(e,n){return null!=e&&e.me_answered?n:-1})).filter((function(e){return-1!==e})),w=h.map((function(e,n){return null!=e&&e.is_answer?n:-1})).filter((function(e){return-1!==e})),y=k.length===w.length&&k.every((function(e){return w.includes(e)}))?L:q,Q=k.map((function(e){return E[e]})).join(""),(0,P.jsx)("span",{className:y,style:{fontWeight:600,fontSize:"16px"},children:Q||"未作答"}))}):(0,P.jsx)("span",{style:{color:"#E30000",fontWeight:600,fontSize:"16px"},children:"未作答"})]})]}),(0,P.jsx)("div",{children:(0,P.jsx)(V.Z,{value:'题目解析'+((null==u?void 0:u.analysis)||"暂无解析"),style:{color:"#000"}})})]})]})})})),H=(0,I.connect)((function(e){return{problemset:e.problemset}}))((function(e){e.questionIndex,e.problemset,e.dispatch;var n=e.question,t=e.solutionVis,i=e.pageCache,r=e.pageInfo,o=e.pptInfo,a=e.SmartPlanItemBanks,s=e.questionChoiceIdsRef,l=(0,p.useState)({}),c=f()(l,2),u=c[0],d=c[1],g=(0,p.useState)([]),v=f()(g,2),h=v[0],A=v[1],m=(0,I.useSearchParams)(),E=(f()(m,1)[0],{fontSize:"16px"}),k=!(null!=i&&i.is_end)&&"ended"==(null==r?void 0:r.status)||(null==n?void 0:n.is_answered)||(null==i?void 0:i.is_end)&&!(null!=a&&a.allow_answer_after_end),w=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];(0,p.useEffect)((function(){var e=(0,j.cloneDeep)(n);d(e),A(e.choices)}),[n]);var y,Q,M;return(0,P.jsx)("div",{children:(0,P.jsxs)("div",{className:T,children:[(0,P.jsx)(V.Z,{value:'

单选题

'+(null==u?void 0:u.name),style:x()({},E)}),null==h?void 0:h.map((function(e,n){var i=e.is_answer,r=e.checked,a=e.choice_text,l=e.me_answered,c="";return t?(i&&(c=G),i||!r&&!l||(c=Y)):(r||l)&&(c=F),(0,P.jsxs)(C.Z,{className:"".concat(z," ").concat(c),align:"middle",wrap:!1,style:{cursor:k?"not-allowed":"pointer",marginTop:"10px"},onClick:function(e){!function(e){if(!k||null!=o&&o.is_simulate){var n=h.map((function(n,t){return x()(x()({},n),{},{checked:t===e})}));s.current=n.filter((function(e){return e.checked})).map((function(e){return null==e?void 0:e.choice_id})),A(n)}}(n)},children:[(0,P.jsx)(B.Z,{style:x()({fontWeight:500},E),className:S,children:w[n]}),(0,P.jsx)(B.Z,{flex:1,className:"ml10",children:(0,P.jsx)(V.Z,{className:b,value:a,style:x()({},E)})}),t&&i&&(0,P.jsx)(B.Z,{children:(0,P.jsx)("i",{className:"iconfont icon-duigou1 font16 c-green"})}),t&&!i&&(r||l)&&(0,P.jsx)(B.Z,{children:(0,P.jsx)("i",{className:"iconfont icon-guanbi10 font16 c-red"})})]},n)})),!t&&h.find((function(e){return(null==e?void 0:e.checked)||(null==e?void 0:e.me_answered)}))&&(0,P.jsxs)("div",{style:x()(x()({},E),{},{marginTop:"20px",fontWeight:600}),children:[(0,P.jsx)("span",{children:"已选答案  "}),(0,P.jsx)("span",{style:{color:"#3061D0"},children:w[h.findIndex((function(e){return(null==e?void 0:e.checked)||(null==e?void 0:e.me_answered)}))]})]}),t&&(0,P.jsxs)("div",{className:J,children:[(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,P.jsxs)("div",{className:"c-grey-333 mb5 font16",children:[(0,P.jsx)("span",{style:{color:"#000",fontWeight:600,marginRight:"10px",fontSize:"16px"},children:"正确答案"}),(0,P.jsx)("span",{style:{color:"#2EC25B",fontWeight:600,fontSize:"16px"},children:w[h.findIndex((function(e){return null==e?void 0:e.is_answer}))]})]}),(0,P.jsxs)("div",{className:"c-grey-333 mb5 font16",children:[(0,P.jsx)("span",{style:{color:"#000",fontWeight:600,marginRight:"10px",fontSize:"16px"},children:"已选答案"}),h.find((function(e){return null==e?void 0:e.me_answered}))?(0,P.jsx)(P.Fragment,{children:(Q=h.findIndex((function(e){return null==e?void 0:e.me_answered})),M=(null===(y=h[Q])||void 0===y?void 0:y.is_answer)?L:q,(0,P.jsx)("span",{className:M,style:{fontWeight:600,fontSize:"16px"},children:w[Q]}))}):(0,P.jsx)("span",{style:{color:"#E30000",fontWeight:600,fontSize:"16px"},children:"未作答"})]})]}),(0,P.jsx)("div",{children:(0,P.jsx)(V.Z,{value:'题目解析'+((null==u?void 0:u.analysis)||"暂无解析"),style:{color:"#000"}})})]})]})})})),W=(0,I.connect)((function(e){return{problemset:e.problemset}}))((function(e){e.problemset,e.questionIndex,e.dispatch;var n=e.question,t=e.pageCache,i=e.solutionVis,r=(e.disabled,e.pageInfo),o=e.pptInfo,a=e.SmartPlanItemBanks,s=e.questionChoiceIdsRef,l=(0,p.useState)({}),c=f()(l,2),u=c[0],d=c[1],g=(0,p.useState)([]),v=f()(g,2),h=v[0],A=v[1],m={fontSize:"16px"},I=!(null!=t&&t.is_end)&&"ended"==(null==r?void 0:r.status)||(null==n?void 0:n.is_answered)||(null==t?void 0:t.is_end)&&!(null!=a&&a.allow_answer_after_end),E=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];(0,p.useEffect)((function(){var e=(0,j.cloneDeep)(n);d(e),A(e.choices)}),[n]);var k,w,y;return(0,P.jsx)("div",{children:(0,P.jsxs)("div",{className:T,children:[(0,P.jsx)(V.Z,{value:'

判断题

'+(null==u?void 0:u.name),style:x()({},m)}),null==h?void 0:h.map((function(e,n){var t=e.is_answer,r=e.checked,a=e.choice_text,l=e.me_answered,c="";return i?(t&&(c=G),t||!r&&!l||(c=Y)):(r||l)&&(c=F),(0,P.jsxs)(C.Z,{className:"".concat(z," ").concat(c),align:"middle",wrap:!1,style:{cursor:I?"not-allowed":"pointer",marginTop:"10px"},onClick:function(e){!function(e){if(!I||null!=o&&o.is_simulate){var n=h.map((function(n,t){return x()(x()({},n),{},{checked:t==e})}));s.current=n.filter((function(e){return e.checked})).map((function(e){return null==e?void 0:e.choice_id})),A(n)}}(n)},children:[(0,P.jsx)(B.Z,{style:x()({fontWeight:500},m),className:S,children:E[n]}),(0,P.jsx)(B.Z,{flex:1,className:"ml10",children:(0,P.jsx)(V.Z,{className:b,value:a,style:x()({},m)})}),i&&t&&(0,P.jsx)(B.Z,{children:(0,P.jsx)("i",{className:"iconfont icon-duigou1 font16 c-green"})}),i&&!t&&(r||l)&&(0,P.jsx)(B.Z,{children:(0,P.jsx)("i",{className:"iconfont icon-guanbi10 font16 c-red"})})]},n)})),!i&&h.find((function(e){return(null==e?void 0:e.checked)||(null==e?void 0:e.me_answered)}))&&(0,P.jsxs)("div",{style:x()(x()({},m),{},{marginTop:"20px",fontWeight:600}),children:[(0,P.jsx)("span",{children:"已选答案  "}),(0,P.jsx)("span",{style:{color:"#3061D0"},children:E[h.findIndex((function(e){return(null==e?void 0:e.checked)||(null==e?void 0:e.me_answered)}))]})]}),i&&(0,P.jsxs)("div",{className:J,children:[(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,P.jsxs)("div",{className:"c-grey-333 mb5 font16",children:[(0,P.jsx)("span",{style:{color:"#000",fontWeight:600,marginRight:"10px",fontSize:"16px"},children:"正确答案"}),(0,P.jsx)("span",{style:{color:"#2EC25B",fontWeight:600,fontSize:"16px"},children:E[h.findIndex((function(e){return null==e?void 0:e.is_answer}))]})]}),(0,P.jsxs)("div",{className:"c-grey-333 mb5 font16",children:[(0,P.jsx)("span",{style:{color:"#000",fontWeight:600,marginRight:"10px",fontSize:"16px"},children:"已选答案"}),h.find((function(e){return null==e?void 0:e.me_answered}))?(0,P.jsx)(P.Fragment,{children:(w=h.findIndex((function(e){return null==e?void 0:e.me_answered})),y=(null===(k=h[w])||void 0===k?void 0:k.is_answer)?L:q,(0,P.jsx)("span",{className:y,style:{fontWeight:600,fontSize:"16px"},children:E[w]}))}):(0,P.jsx)("span",{style:{color:"#E30000",fontWeight:600,fontSize:"16px"},children:"未作答"})]})]}),(0,P.jsx)("div",{children:(0,P.jsx)(V.Z,{value:'题目解析'+((null==u?void 0:u.analysis)||"暂无解析"),style:{color:"#000"}})})]})]})})})),X=t(54172),_=t(30641),$=t(43170),ee=t(31005),ne=t(54501),te=t(56656),ie=t.n(te),re=t(90768),oe=t(24334),ae=t(66530),se=t(62233),le=t(89728),ce=(0,I.connect)((function(e){return{problemset:e.problemset}}))((function(e){e.problemset,e.dispatch;var n,t=e.question,i=e.pageCache,r=(e.solutionVis,e.SmartPlanItemBanks,e.disabled,e.questionIndex,e.questionChoiceIdsRef,e.handleRefresh),o=(e.childWindow,e.visible),a=e.onCancel,s=e.closeProgram,c=(e.isSimulate,(0,p.useState)("")),d=f()(c,2),g=d[0],v=d[1],h=((0,I.useParams)(),(0,p.useState)(!1)),A=f()(h,2),m=A[0],x=A[1],E=(0,p.useRef)(null),C=(0,I.useSearchParams)(),B=f()(C,1)[0],j=(0,p.useState)([]),b=f()(j,2),S=b[0],T=b[1],J=(0,p.useState)({page:1,limit:10}),z=f()(J,2),F=z[0],G=z[1],Y=(0,p.useState)(0),L=f()(Y,2),q=L[0],K=L[1],H={selectOnLineNumbers:!0,readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,enableSplitViewResizing:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1};(0,p.useEffect)((function(){if(o){var e=document.getElementById("iframeSmartPlan");if(e){var n={type:"showIntelligentTeacherStatus",aiStatus:null==t?void 0:t.enable_ai_tutor,questionStatus:"ended"===(null==t?void 0:t.status),pptStatus:null==i?void 0:i.is_end};e.contentWindow.postMessage(n,"*")}}}),[t,i,o]),(0,p.useEffect)((function(){s&&E.current&&(w.ZP.warning("答题时间倒计时结束"),localStorage.removeItem("iframeprogram_".concat(B.get("course_id"),"_").concat(B.get("id"))),E.current.style.display="none")}),[s]);var W=localStorage.getItem("iframeprogram_".concat(B.get("course_id"),"_").concat(B.get("id")));(0,p.useEffect)((function(){o&&"true"==W?te():r()}),[o,W]),(0,p.useEffect)((function(){!W&&null!=t&&t.hack_user_identifier&&pe()}),[W,null==t?void 0:t.hack_user_identifier]);var te=function(){var e=u()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(!0),null==t||!t.hack_identifier){e.next=6;break}return e.next=4,(0,ee.nF)({id:null==t?void 0:t.hack_identifier});case 4:0===(null==(n=e.sent)?void 0:n.status)&&v("".concat((null===se.Z||void 0===se.Z?void 0:se.Z.MINIPROGRAM_SERVER)||"https://data.educoder.net","/h5educoderbuild/educodermd/hack/").concat(null==n?void 0:n.identifier,"/").concat((0,le.ej)("_educoder_session"),"/").concat((0,le.ej)("_educoder_session"),"/code?catalog=smartPlane&itemId=").concat(null==t?void 0:t.smart_plan_page_item_bank_id,"&coursesId=").concat(B.get("course_id"),"&exercisesId=").concat(B.get("id")));case 6:x(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ce=function(e){var n;E.current&&(e.source===(null===(n=E.current)||void 0===n?void 0:n.contentWindow)&&(console.log("收到来自 iframe 的消息:",e.data),"back"===e.data.type&&(localStorage.removeItem("iframeprogram_".concat(B.get("course_id"),"_").concat(B.get("id"))),E.current.style.display="none")))};(0,p.useEffect)((function(){return window.addEventListener("message",ce),function(){window.removeEventListener("message",ce)}}),[]);var ue,de={C:(0,P.jsx)("span",{className:M,children:"C"}),"C++":(0,P.jsx)("span",{className:D,children:"C++"}),Java:(0,P.jsx)("span",{className:N,children:"Java"}),Python:(0,P.jsx)("span",{className:R,children:"Python"})},fe={not_started:(0,P.jsx)("span",{style:{fontSize:"16px",color:"rgb(144,150,163)"},children:"未开启"}),not_pass:(0,P.jsx)("span",{style:{fontSize:"16px",color:"rgb(227,0,0)"},children:"未通关"}),passed:(0,P.jsx)("span",{style:{fontSize:"16px",color:"rgb(0,177,135)"},children:"已通关"}),delay_passed:(0,P.jsx)("span",{style:{fontSize:"16px",color:"rgb(178, 173, 8)"},children:"结束答题后通关"})},pe=function(){var e=u()(l()().mark((function e(){var n,i,r,o=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>0&&void 0!==o[0]?o[0]:1,i=o.length>1&&void 0!==o[1]?o[1]:10,e.next=4,(0,$.ZP)("/api/myproblems/".concat(null==t?void 0:t.hack_user_identifier,"/submit_records.json"),{method:"get",params:{page:n,limit:i}});case 4:r=e.sent,T(null==r?void 0:r.records),K(null==r?void 0:r.records_count);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,P.jsxs)("div",{children:[(0,P.jsx)(V.Z,{value:'

编程题

'+(null==t?void 0:t.name)}),(0,P.jsxs)("div",{className:U,children:[(0,P.jsxs)("div",{className:Z,children:[(0,P.jsx)("span",{style:{fontSize:"14px",color:"#666",marginRight:"8px"},children:"允许编程语言:"}),null==t||null===(n=t.languages)||void 0===n?void 0:n.map((function(e,n,t){return(0,P.jsx)(p.Fragment,{children:de[null==e?void 0:e.language]},n)}))]}),(0,P.jsx)("div",{className:O,style:{height:"max-content",maxHeight:"210px",overflowY:"auto"},children:(0,P.jsx)(V.Z,{value:'问题描述'+(null==t?void 0:t.description),style:{fontSize:"16px",color:"#000"}})})]}),"not_started"!=(null==t?void 0:t.answer_status)&&(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:"20px",fontWeight:500},children:[(0,P.jsx)("span",{style:{fontSize:"16px",color:"#000",fontWeight:"500",marginRight:"10px"},children:"答题状态"}),fe[null==t?void 0:t.answer_status]]}),"not_started"!=(null==t?void 0:t.answer_status)&&(0,P.jsxs)("div",{className:U,children:[(0,P.jsxs)("div",{className:Z,children:[(0,P.jsx)("span",{style:{fontSize:"14px",color:"#000",marginRight:"5px"},children:"最后通关代码"}),(0,P.jsx)("span",{style:{fontSize:"12px",color:"#666"},children:"(未通关则展示最后编写的代码详情)"})]}),(0,P.jsx)("div",{className:O,style:{backgroundColor:"#fff"},children:(0,P.jsx)(ne.ZP,{height:300,language:null==t?void 0:t.language,value:null!=t&&t.passed_code?oe.Base64.decode(null==t?void 0:t.passed_code):"",theme:"default",options:H})})]}),"not_started"!=(null==t?void 0:t.answer_status)&&!!q&&(0,P.jsx)(X.Z,{style:{marginTop:"20px"},scroll:{x:400},columns:[{title:"评测序号",dataIndex:"query_index",width:100,render:function(e,n,t){return(0,P.jsx)("span",{style:{color:"#000"},children:(F.page-1)*F.limit+t+1})}},{title:"评测时间",dataIndex:"created_at",key:"created_at",align:"center",width:180,render:function(e,n){return(0,P.jsx)("span",{style:{color:"#000"},children:null!=n&&n.created_at?ie()(null==n?void 0:n.created_at).format("YYYY-MM-DD HH:mm"):"--"})}},{title:"评测结果",dataIndex:"status",key:"status",align:"center",width:200,render:function(e,n){var t;return(0,P.jsx)("span",{className:"".concat(0===e?"c-green":"c-red"),children:null===(t=re.Im[e])||void 0===t?void 0:t.replace("调试","评测")})}},{title:"操作",align:"center",dataIndex:"code",key:"code",width:100,fixed:"right",render:function(e,n){return(0,P.jsx)("span",{style:{cursor:"pointer",color:"#3061d0"},onClick:u()(l()().mark((function e(){var t,i,r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,ae.X6)(null==n?void 0:n.id);case 2:o=e.sent,k.Z.confirm({centered:!0,icon:null,width:350,okText:"关闭",autoFocusButton:null,cancelButtonProps:{style:{display:"none"}},title:"代码内容",content:(0,P.jsx)("div",{className:"mb10",children:(0,P.jsx)(ne.ZP,{height:200,language:null==o||null===(t=o.data)||void 0===t?void 0:t.language,theme:"vs-light",value:null!=o&&null!==(i=o.data)&&void 0!==i&&i.code?oe.Base64.decode(null==o||null===(r=o.data)||void 0===r?void 0:r.code):"",options:H})})});case 4:case"end":return e.stop()}}),e)}))),children:"查看代码"})}}].filter((function(e){return!!e})),pagination:{total:q||0,onChange:(ue=u()(l()().mark((function e(n,t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return G({page:n,limit:t}),e.next=3,pe();case 3:case"end":return e.stop()}}),e)}))),function(e,n){return ue.apply(this,arguments)}),current:null==F?void 0:F.page,pageSize:null==F?void 0:F.limit,showTotal:function(e){return(0,P.jsxs)(P.Fragment,{children:["共",(0,P.jsx)("span",{className:"ml5 mr5",style:{color:"#3061d0"},children:e}),"条数据"]})}},dataSource:S}),(0,P.jsx)(_.Z,{title:"",placement:"bottom",rootClassName:Q,width:"100vw",height:"100vh",closable:!1,onClose:function(){a()},maskClosable:!1,open:o&&"true"==W,style:{overflowX:"hidden"},children:(0,P.jsx)(y.Z,{spinning:m,children:(0,P.jsx)("div",{style:{width:"100%",height:"100%",minHeight:"100vh",overflow:"hidden"},children:o&&"true"==W&&(0,P.jsx)("iframe",{ref:E,id:"iframeSmartPlan",style:{width:"100vw",height:"100vh",display:o?"block":"none"},src:g,frameBorder:"0"})})})})]})})),ue=t(67057),de=t(27955),fe=t(14409),pe=t(50184);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var ge=(0,I.connect)((function(e){var n=e.user,t=e.classroomList,i=e.loading,r=e.globalSetting,o=e.problemset;return{user:n,classroomList:t,globalSetting:r,loading:i.effects,problemset:o}}))((function(e){e.user;var n,t,i,r,o,s,c,d,g,v,h,A,m,C,B,j,b,S,Q,M,D,N,R,T,J,U,Z,O,z,F,G,Y,L,q,V,X,_,ee,ne,te,ie,re,oe,ae,se,le,ge,ve,he,Ae,me,xe,Ie,Ee,ke,we,ye,Ce,Be,je=e.classroomList,be=e.officeToken,Se=(e.globalSetting,e.loading),Qe=(e.problemset,e.dispatch),Me=e.pageCache,De=e.pageNum,Ne=e.maxPage,Re=e.aiImg,Te=(e.changePage,e.setClassMode),Je=e.isSimulate,Ue=e.pptInfo,Ze=(0,p.useState)(!1),Oe=f()(Ze,2),ze=Oe[0],Fe=Oe[1],Ge=(0,I.useSearchParams)(),Ye=f()(Ge,1)[0],Le=(0,p.useState)(0),qe=f()(Le,2),Ve=qe[0],Pe=qe[1],Ke=(0,p.useState)(!1),He=f()(Ke,2),We=He[0],Xe=He[1],_e=(0,p.useState)(!(null!=Me&&Me.allow_answer&&(null==Me||!Me.is_end)&&"ended"!==(null==be?void 0:be.Status))),$e=f()(_e,2),en=($e[0],$e[1]),nn=(0,p.useState)(!1),tn=f()(nn,2),rn=tn[0],on=tn[1],an=(0,p.useState)({}),sn=f()(an,2),ln=sn[0],cn=(sn[1],(0,p.useRef)(null)),un=(0,p.useRef)([]),dn=(0,p.useState)(null),fn=f()(dn,2),pn=fn[0],gn=(fn[1],(0,p.useState)(!1)),vn=f()(gn,2),hn=vn[0],An=vn[1],mn=je.SmartPlanItemBanks,xn=(0,p.useState)([]),In=f()(xn,2),En=In[0],kn=In[1],wn=(0,p.useState)(0),yn=f()(wn,2),Cn=yn[0],Bn=yn[1],jn=(0,p.useState)(!1),bn=f()(jn,2),Sn=bn[0],Qn=bn[1],Mn=(0,p.useState)(!1),Dn=f()(Mn,2),Nn=Dn[0],Rn=Dn[1],Tn=(0,p.useRef)(),Jn=(0,p.useRef)(null),Un=(0,p.useState)(!1),Zn=f()(Un,2),On=Zn[0],zn=Zn[1],Fn=(0,p.useRef)(null),Gn=(0,p.useState)(!1),Yn=f()(Gn,2),Ln=Yn[0],qn=Yn[1],Vn=(0,p.useState)(!1),Pn=f()(Vn,2),Kn=Pn[0],Hn=Pn[1],Wn=(0,p.useState)(0),Xn=f()(Wn,2),_n=Xn[0],$n=Xn[1],et=(0,p.useState)(0),nt=f()(et,2),tt=nt[0],it=nt[1],rt=(0,p.useState)({defaultValue:"",open:0,language:"",placement:"right",height:"100vh"}),ot=f()(rt,2),at=ot[0],st=ot[1],lt=(0,p.useState)(""),ct=f()(lt,2),ut=ct[0],dt=ct[1],ft=(0,p.useRef)(null),pt=(0,p.useRef)(null),gt={item_bank:"试题作答",ai_qna:"智慧伴学",page_info:"阅读解析",animation_code:"动效学习"},vt={page_info:"1",ai_qna:"2",item_bank:"4"},ht=(0,p.useState)(),At=f()(ht,2),mt=At[0],xt=At[1],It=(0,p.useState)(""),Et=f()(It,2),kt=Et[0],wt=Et[1],yt=(0,p.useRef)(null),Ct=(0,p.useRef)(null);(0,p.useEffect)((function(){var e;(null==mn||null===(e=mn.page)||void 0===e?void 0:e.current_limit_time)>0?wt(mn.page.current_limit_time+1):wt("")}),[null==mn||null===(n=mn.page)||void 0===n?void 0:n.current_limit_time]);var Bt=function(){if(!yt.current)return kt;var e=Math.floor((Date.now()-yt.current)/1e3);return Math.max(0,kt-e)},jt=function e(){var n=Bt();if(wt(n),n<=0)return Ct.current&&(clearTimeout(Ct.current),Ct.current=null),void setTimeout((function(){xt(new Date),Mt()}),2e3);Ct.current&&clearTimeout(Ct.current),Ct.current=setTimeout(e,1e3)};(0,p.useEffect)((function(){if(!(kt<=0)){yt.current=Date.now(),jt();var e=function(){document.hidden?Ct.current&&(clearTimeout(Ct.current),Ct.current=null):!Ct.current&&kt>0&&(yt.current=Date.now()-1e3*(kt-Bt()),jt())};return document.addEventListener("visibilitychange",e),function(){Ct.current&&clearTimeout(Ct.current),document.removeEventListener("visibilitychange",e)}}}),[kt]);var bt=function(e){var n=Math.floor(e/60),t=e%60;return"".concat(String(n).padStart(2,"0"),":").concat(String(t).padStart(2,"0"))};(0,p.useEffect)((function(){en(!(null!=Me&&Me.allow_answer&&(null==Me||!Me.is_end)&&"ended"!==(null==be?void 0:be.Status)))}),[null==Me?void 0:Me.allow_answer,!(null!=Me&&Me.is_end),"ended"!==(null==be?void 0:be.Status)]);var St=function(){var e=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,$.ZP)("/api/courses/".concat(Ye.get("course_id"),"/smart_plans/").concat(Ye.get("id"),"/check_start.json"),{method:"post"});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,p.useEffect)((function(){var e;""!==(null==mn||null===(e=mn.page)||void 0===e?void 0:e.animation_code)&&(clearTimeout(pt.current),pt.current=setTimeout((function(){var e=document.createElement("iframe");e.style.width="100%",e.style.height="100%",e.style.overflow="auto",e.style.border="0";var n=function n(t){try{var i=t.documentElement.scrollHeight;e.style.height="".concat(Math.max(i+10,400),"px"),i||setTimeout((function(){n(t)}),1e3)}catch(e){console.error("无法访问 iframe 内容",e)}};if(ft.current){var t;ft.current.innerHTML="",ft.current.appendChild(e);var i=e.contentDocument||e.contentWindow.document;i.open(),i.write(null==mn||null===(t=mn.page)||void 0===t?void 0:t.animation_code),i.documentElement.scrollHeight,n(i),setTimeout((function(){n(i)}),1e3)}}),1e3))}),[null==mn||null===(t=mn.page)||void 0===t?void 0:t.animation_code,at.open,Cn,ut]),(0,p.useEffect)((function(){Ye.get("codeKey")&&null!=mn&&mn.open_rolling_qrcode_sign&&Qt()}),[null==mn?void 0:mn.open_rolling_qrcode_sign]);var Qt=function(){var e=u()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,$.ZP)("/api/courses/".concat(Ye.get("course_id"),"/smart_plans/").concat(Ye.get("id"),"/rolling_qrcode_attendance.json"),{method:"post",body:{qrcode_token:Ye.get("codeKey")}});case 2:0!=(null==(n=e.sent)?void 0:n.status)&&I.history.push("/");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,p.useEffect)((function(){St();var e=document.body.style.background,n=document.documentElement.style.background;return document.body.style.background="#fff",document.documentElement.style.background="#fff",document.body.style.overflow="hidden",function(){document.body.style.background=e,document.documentElement.style.background=n,document.body.style.overflow="visible"}}),[]),(0,p.useEffect)((function(){if(console.log("pageNum",De),De){var e,n="self_learning"===(null==mn||null===(e=mn.page)||void 0===e?void 0:e.lesson_mode);console.log("pageNum--",De,n),(!n||n&&cn.current!==De)&&Mt()}cn.current=De}),[De,Ve,null==Me?void 0:Me.randomData]);var Mt=function(){var e=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Xe(!0),e.next=3,Qe({type:"classroomList/getSmartPlanItemBanks",payload:{course_id:Ye.get("course_id"),id:Ye.get("id"),position:De,is_simulate:Je}});case 3:e.sent,Xe(!1);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,p.useEffect)((function(){var e,n,t,i,r;(null!=mn&&mn.alert_addendance_tips&&(ze||Ye.get("codeKey")||(Fe(!0),k.Z.confirm({centered:!0,okText:"知道了",icon:null,title:"提示",cancelButtonProps:{style:{display:"none"}},content:"当前课件已开启动态二维码签到,请联系授课教师扫码签到。",onOk:(i=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:I.history.push("/");case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})}))),De&&(null==mn||null===(e=mn.page)||void 0===e?void 0:e.position)!=_n)&&($n(null==mn||null===(r=mn.page)||void 0===r?void 0:r.position),Hn(!0),setTimeout((function(){Hn(!1)}),3e3));st(x()(x()({},at),{},{defaultValue:null==mn||null===(n=mn.page)||void 0===n?void 0:n.animation_code})),dt(new Date),Dt(null==mn||null===(t=mn.item_banks)||void 0===t?void 0:t[Ve]);var o,s,c=[];Ye.get("simulateType")?c=null==mn||null===(o=mn.page)||void 0===o||null===(o=o.module_sort)||void 0===o||null===(o=o.filter((function(e){return Ye.get("simulateType")==(null==vt?void 0:vt[e])})))||void 0===o?void 0:o.map((function(e,n){return{key:n+1,label:gt[e]}})):c=null==mn||null===(s=mn.page)||void 0===s||null===(s=s.module_sort)||void 0===s?void 0:s.map((function(e,n){return{key:n+1,label:gt[e]}}));if(kn(a()(c||[])),null!=mn&&mn.item_banks){var d=mn.item_banks.filter((function(e){return e.is_answered})).length;it(d)}}),[mn]);var Dt=function(e){var n,t;if(null!=Me&&Me.is_end&&(null==Ue||!Ue.is_simulate))return null==mn||!mn.allow_answer_after_end||null!=e&&e.is_answered?void on(!0):void on(!1);switch(null==mn||null===(n=mn.page)||void 0===n?void 0:n.solution_visibility){case"hidden":on(!1),qn(!1);break;case"show_after_edit":qn(!0),null!=e&&e.is_answered?on(!0):on(!1);break;case"show_after_submission":"ended"===(null==mn||null===(t=mn.page)||void 0===t?void 0:t.status)?(qn(!0),on(!0)):(qn(!1),on(!1));break;case"show_after_ended":null!=Me&&Me.is_end?(qn(!0),on(!0)):(qn(!1),on(!1));break;default:on(!1)}};(0,p.useEffect)((function(){Bn(0),Pe(0),Qn(!1),Rn(!1)}),[De]),(0,p.useEffect)((function(){var e;un.current=[],Dt(null==mn||null===(e=mn.item_banks)||void 0===e?void 0:e[Ve])}),[Ve]);var Nt=function(){var e=u()(l()().mark((function e(){var n,t,i,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==un.current.length){e.next=3;break}return w.ZP.warning("请您作答后再提交"),e.abrupt("return");case 3:return e.next=5,(0,$.ZP)("/api/smart_plan_item_banks/".concat(null==mn||null===(n=mn.page)||void 0===n?void 0:n.id,"/user_answers.json"),{method:"post",body:{item_bank_id:null==mn||null===(t=mn.item_banks)||void 0===t||null===(t=t[Ve])||void 0===t?void 0:t.id,item_choice_id:"MULTIPLE"==(null==mn||null===(i=mn.item_banks)||void 0===i||null===(i=i[Ve])||void 0===i?void 0:i.item_type)?un.current:un.current[0],is_simulate:null==mn?void 0:mn.is_simulate}});case 5:if(0!==(null==(r=e.sent)?void 0:r.status)){e.next=10;break}return e.next=9,Mt();case 9:w.ZP.success("提交成功");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,p.useEffect)((function(){var e;if(pn&&!pn.closed&&"PROGRAM"==(null==ln||null===(e=ln.item_banks)||void 0===e||null===(e=e[Ve])||void 0===e?void 0:e.item_type)){var n=function(){var e,n,t={type:"showIntelligentTeacherStatus",aiStatus:null==ln||null===(e=ln.page)||void 0===e?void 0:e.enable_ai_tutor,questionStatus:"ended"===(null==ln||null===(n=ln.page)||void 0===n?void 0:n.status)};pn.postMessage(t,"*")};if("complete"===pn.document.readyState)setTimeout((function(){n()}),3e3);else{pn.addEventListener("load",(function e(){n(),pn.removeEventListener("load",e)}))}var t=function(){var e=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("子窗口已关闭");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return null==pn||pn.addEventListener("unload",t),function(){null==pn||pn.removeEventListener("unload",t)}}}),[pn,ln,Ve]);var Rt=function(){var e,n,t,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch(null==En||null===(e=En[r])||void 0===e?void 0:e.label){case"试题作答":return(null==mn||null===(n=mn.item_banks)||void 0===n?void 0:n.length)&&(null==mn||null===(t=mn.item_banks)||void 0===t?void 0:t.every((function(e){return null==e?void 0:e.is_answered})));case"智慧伴学":return(null==mn||null===(i=mn.page)||void 0===i?void 0:i.finish_ai_qna)||Sn;case"阅读解析":return(null==mn?void 0:mn.page.finish_read_page_info)||Nn;case"动效学习":return!0}},Tt=function(){Rt()?Bn(1):w.ZP.info("请完成本阶段的学习任务")},Jt=function(){var e=u()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,$.ZP)("/api/smart_plan_item_banks/".concat(null==mn||null===(n=mn.page)||void 0===n?void 0:n.id,"/smart_plan_user_page_studies.json"),{method:"post"});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,p.useEffect)((function(){var e,n,t;return!mn||null==mn||null===(e=mn.page)||void 0===e||!e.id||null!=mn&&null!==(n=mn.page)&&void 0!==n&&n.has_study_record||!1!==(null==Me?void 0:Me.is_end)||(Tn.current=setTimeout((function(){null!=mn&&mn.alert_addendance_tips||Jt()}),1e4)),Te(null==mn||null===(t=mn.page)||void 0===t?void 0:t.lesson_mode),function(){Tn.current&&clearTimeout(Tn.current)}}),[Se["classroomList/getSmartPlanItemBanks"],mn]);var Ut={not_started:E.unanswer,not_pass:E.errorSty,passed:E.rightSty,delay_passed:E.rightSty},Zt=function(e){var n,t=e.choices;if(!Ln)return null!=e&&e.is_answered?E.answered:E.unanswer;var i=!0;if(null!==(n=["SINGLE","JUDGMENT"])&&void 0!==n&&n.includes(null==e?void 0:e.item_type)){var r=t.find((function(e){return null==e?void 0:e.me_answered}));i=1==(null==r?void 0:r.is_answer)}else if("MULTIPLE"===(null==e?void 0:e.item_type)){i=t.every((function(e){return(null==e?void 0:e.is_answer)&&(null==e?void 0:e.me_answered)||!(null!=e&&e.is_answer)&&!(null!=e&&e.me_answered)}))}else if("PROGRAM"===(null==e?void 0:e.item_type))return Ut[null==e?void 0:e.answer_status];return null!=e&&e.is_answered?i?E.rightSty:E.errorSty:E.unanswer},Ot=function(){Jn.current&&(Jn.current.scrollTop=0)};return(0,P.jsx)("section",{ref:Fn,className:E.safeArea,children:(0,P.jsx)(y.Z,{spinning:We,children:(0,P.jsxs)("div",{className:E.box,children:[Kn&&mn&&Ne&&(null!=mn&&mn.is_simulate?(0,P.jsxs)("div",{className:E.page_style,children:["当前页面",(0,P.jsx)("span",{style:{margin:"0 5px",color:"#3061D0"},children:De}),"/",(0,P.jsx)("span",{style:{marginLeft:"5px"},children:Ne})]}):(0,P.jsxs)("div",{className:E.page_style,children:["第",De,"页"]})),(null==mn?void 0:mn.is_simulate)&&(0,P.jsxs)("div",{style:{background:"rgba(250,100,0,0.1)",width:"100%",height:"25px",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,P.jsx)("i",{className:"iconfont icon-tishi9 font12 mr10",style:{color:"#FA6400"}}),(0,P.jsx)("span",{style:{fontSize:"12px",color:"#FA6400"},children:"提示:当前为教师体验模式,答题与互动数据将在退出时清空。"})]}),(0,P.jsx)("div",{className:E.box_header,style:{marginBottom:"20px"},children:2==En.length&&(0,P.jsx)("div",{className:E.box_wrap,children:!!En.length&&(0,P.jsxs)("div",{className:E.progressbarWrap,children:[(0,P.jsxs)("div",{className:"".concat(E.progressItem," ").concat(0==Cn?E.activeWrap:""),onClick:u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Bn(0),e.next=3,Mt();case 3:case"end":return e.stop()}}),e)}))),children:[En.length>1&&(Rt()?(0,P.jsx)("i",{className:"iconfont icon-duigou mr10 font20",style:{color:"#3061D0"}}):(0,P.jsx)("div",{className:E.circle,children:"1"})),(0,P.jsx)("div",{children:null==En||null===(i=En[0])||void 0===i?void 0:i.label})]}),En.length>1&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAAAUCAYAAAAA5FpZAAAAAXNSR0IArs4c6QAAAnFJREFUWEftmU1oE1EQx//zkkWEFlS8KXpQEQ+CXjxGrIIHQW+1mBVUtElobXrQq19nD0lok9iKCNmA7Ek82xi1F08qXorowYM9FVEjQk3yRnbTaE3ddV+f1pTuO8+8mffb2Xkz8wjhWlEC5GUtW7QOM+MkgBgxtrTkeBYknoD4XjppTq2op//RWDZfqgrCtYup01VdN5YAzxbLuyDlJAMH/TYnYJoixpmRxMBbXSe6XT+TL7HjIwGPdcH/AnysWI41Jd9n8EYQaoLoZkTQA2ww3jgGmx/kDqBxgiUuM7iHQJ85Io6NJk5Ndzs0Hf/awNt76ID/AbwV2fxsAXYlaohzw+fj737naOaWvQ3y2wSYj4LoUzQSPTA8OPBa51DdrNsJXAf8T+D5UtVNI4RKOmkeISL3N/JazCxyBavi6BDR03TKjHUzNB3fvIAvB7wL3L0gJT900kjUEHu9IrvT6dyktVU28BLMmygi+tKJ+COdg3Wr7p+Aq4B3gWcKlpMeLghBV0eS5g2Vg+eK1hUp+TqI7o6mzLMquqtFNijwIODbwGfAvNuIiv1Dg/EXKiDGJ8r76g35nIhm0ilzj4ruapFVBe4HvpVS8lbNqTqMzet6h/r7v6iAsG17/ezc/FcVnbUmu7iq0QY+bts99bn52lqDqHLeJcAzBStMKT4E/3pKCS9N/3hVBe7XGGmVhWO3y9sbdfkKjN6wLAzW+us0PpQrlKcYfChsfILPWJbV2i9E9h0w+sLWXm2KqDS8wsf6zqbk45L5kptGwuGV8rg2HM8GqO/+2Xh2se3OBwgGEwHvwweIAF/IR8TzxUdv21Dbi8B35rKDJPX+yxEAAAAASUVORK5CYII=",width:46,height:10,style:{marginLeft:"10px",marginRight:"10px"}}),(0,P.jsxs)("div",{className:"".concat(E.progressItem," ").concat(1==Cn?E.activeWrap:""),onClick:u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Tt(),Rt()){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,Mt();case 5:case"end":return e.stop()}}),e)}))),children:[Rt(0)&&Rt(1)?(0,P.jsx)("i",{className:"iconfont icon-duigou mr10 font20",style:{color:"#3061D0"}}):(0,P.jsx)("div",{className:E.circle,children:"2"}),(0,P.jsx)("div",{children:null==En||null===(r=En[1])||void 0===r?void 0:r.label})]})]})]})})}),"试题作答"==(null==En||null===(o=En[Cn])||void 0===o?void 0:o.label)&&(null==mn?void 0:mn.count)>1&&(0,P.jsx)("div",{style:{padding:"0 20px"},children:(0,P.jsxs)("div",{className:E.progressBox,children:[(0,P.jsx)("div",{className:E.time,children:(0,P.jsx)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbC1ydWxlPSJub256ZXJvIiBmaWxsPSJub25lIj48cGF0aCBkPSJNNDIgMEgxOEM4LjA2IDAgMCA4LjA2IDAgMTh2MjRjMCA5Ljk0IDguMDYgMTggMTggMThoMjRjOS45NCAwIDE4LTguMDYgMTgtMThWMThjMC05Ljk0LTguMDYtMTgtMTgtMThaIiBmaWxsPSIjRDhGNEVFIi8+PHBhdGggZD0iTTIwLjQ1MyAyMS44NzMgMjcuMDE4IDMwbC02LjU2NiA4LjEyN0MxOC4yOCA0MC44MTggMjAuMDYzIDQ1IDIzLjM4MyA0NWgxMy4yMzZjMy4zMiAwIDUuMTAxLTQuMTgyIDIuOTMtNi44NzNMMzIuOTgxIDMwbDYuNTY2LTguMTI3YzIuMTcxLTI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",width:30})}),(0,P.jsxs)("div",{children:[(0,P.jsx)("span",{className:E.span1,children:"进度 "}),(0,P.jsx)("span",{className:E.span2,children:tt||"0"}),(0,P.jsxs)("span",{className:E.span3,children:["/",(null==mn?void 0:mn.count)||"--"," 题"]})]}),kt&&"in_progress"==(null==mn||null===(s=mn.page)||void 0===s?void 0:s.status)?(0,P.jsxs)("span",{className:E.daojishi,style:{marginLeft:"10px"},children:[(0,P.jsx)("i",{className:"iconfont icon-dingbu-shiyanhuanjingdaojishi"}),(0,P.jsx)("span",{style:{width:"43px",marginLeft:"5px"},children:bt(kt)})]}):(0,P.jsx)("span",{}),(0,P.jsxs)("div",{className:E.datikaWrap,onClick:function(){zn(!0)},children:[(0,P.jsx)("i",{className:"iconfont icon-datika"}),(0,P.jsx)("span",{className:E.datika,children:"答题卡"})]})]})}),(0,P.jsx)("div",{className:E.mainContent,style:{marginBottom:"试题作答"==(null==En||null===(c=En[Cn])||void 0===c?void 0:c.label)?"60px":"0"},ref:Jn,children:"not_started"!=(null==Ue?void 0:Ue.status)||null!=Ue&&Ue.is_simulate?(0,P.jsxs)(P.Fragment,{children:["智慧伴学"==(null==En||null===(d=En[Cn])||void 0===d?void 0:d.label)&&(0,P.jsx)(ue.Z,{onNextButtonClick:function(){Tt(),Mt()},style:{height:"100%"},onStatusChange:function(e){Qn(e)},showNextButton:!(Cn+1==(null==En?void 0:En.length)),interactionTotal:null==mn||null===(g=mn.page)||void 0===g?void 0:g.knowledge_size,showInterText:!(null!=Ue&&Ue.is_simulate)&&("ended"==(null==be?void 0:be.Status)||(null==Me?void 0:Me.is_end)),initDefaultChatDataKey:(null==mn||null===(v=mn.page)||void 0===v?void 0:v.id)+(null==mn||null===(h=mn.page)||void 0===h?void 0:h.update_size),defaultChatData:null==mn||null===(A=mn.student_qna_records)||void 0===A?void 0:A.knowledge,data:{ppt_url:null==Re?void 0:Re.map((function(e){return null==e?void 0:e.url})),questionable_type:"SmartPlanItemBank",questionable_id:null==mn||null===(m=mn.page)||void 0===m?void 0:m.id,position:De,type:11,scene_type:Je?13:null}}),"阅读解析"==(null==En||null===(C=En[Cn])||void 0===C?void 0:C.label)&&(0,P.jsx)(de.Z,{onNextButtonClick:function(){Tt(),Mt()},style:{height:"100%"},openRecord:!1===(null==mn||null===(B=mn.page)||void 0===B?void 0:B.finish_read_page_info),showNextButton:!(Cn+1==(null==En?void 0:En.length)),showInterText:!(null!=Ue&&Ue.is_simulate)&&("ended"==(null==be?void 0:be.Status)||(null==Me?void 0:Me.is_end)),onStatusChange:function(e){Rn(e)},readingTime:null==mn||null===(j=mn.page)||void 0===j?void 0:j.info_read_time,analysis:null==mn||null===(b=mn.page)||void 0===b?void 0:b.page_info,totalTime:null==mn||null===(S=mn.page)||void 0===S?void 0:S.info_read_min_time,initDefaultChatDataKey:null==mn||null===(Q=mn.page)||void 0===Q?void 0:Q.id,defaultChatData:null==mn||null===(M=mn.student_qna_records)||void 0===M?void 0:M.page_info,data:{ppt_url:null==Re?void 0:Re.map((function(e){return null==e?void 0:e.url})),questionable_type:"SmartPlanItemBank",questionable_id:null==mn||null===(D=mn.page)||void 0===D?void 0:D.id,position:De,type:10,scene_type:null}}),(0,P.jsxs)("div",{style:{padding:"0px 20px"},children:[(0,P.jsx)(fe.Z,{defaultValue:at.defaultValue,open:at.open,onOpenChange:function(e){st(x()(x()({},at),{},{open:0}))},language:at.language,height:at.height,showExtra:!1},ut),"动效学习"==(null==En||null===(N=En[Cn])||void 0===N?void 0:N.label)&&(null==mn||null===(R=mn.page)||void 0===R?void 0:R.animation_code)&&(0,P.jsxs)("div",{className:E.code_style,children:[(0,P.jsx)("div",{style:{display:"flex",alignItems:"center"}}),(0,P.jsx)("div",{style:{minWidth:"420px"},ref:ft})]}),"试题作答"==(null==En||null===(T=En[Cn])||void 0===T?void 0:T.label)&&(null!=mn&&null!==(J=mn.item_banks)&&void 0!==J&&J[Ve]&&null!==(U=["in_progress","ended"])&&void 0!==U&&U.includes(null==mn||null===(Z=mn.page)||void 0===Z?void 0:Z.status)?(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",marginBottom:"20px"},children:[kt&&"试题作答"==(null==En||null===(O=En[Cn])||void 0===O?void 0:O.label)&&1==(null==mn?void 0:mn.count)&&"in_progress"==(null==mn||null===(z=mn.page)||void 0===z?void 0:z.status)?(0,P.jsxs)("span",{className:E.daojishi,style:{marginBottom:"10px"},children:[(0,P.jsx)("i",{className:"iconfont icon-dingbu-shiyanhuanjingdaojishi"}),(0,P.jsx)("span",{style:{margin:"0 5px"},children:"倒计时"}),(0,P.jsx)("span",{style:{width:"45px"},children:bt(kt)})]}):(0,P.jsx)("span",{}),"SINGLE"===(null==mn||null===(F=mn.item_banks)||void 0===F||null===(F=F[Ve])||void 0===F?void 0:F.item_type)&&(0,P.jsx)(H,{questionIndex:(null==mn||null===(G=mn.item_banks)||void 0===G?void 0:G.length)>1?Ve+1:0,question:null==mn||null===(Y=mn.item_banks)||void 0===Y?void 0:Y[Ve],questionChoiceIdsRef:un,pageCache:Me,solutionVis:rn,pageInfo:null==mn?void 0:mn.page,pptInfo:Ue,SmartPlanItemBanks:mn}),"MULTIPLE"===(null==mn||null===(L=mn.item_banks)||void 0===L||null===(L=L[Ve])||void 0===L?void 0:L.item_type)&&(0,P.jsx)(K,{questionIndex:(null==mn||null===(q=mn.item_banks)||void 0===q?void 0:q.length)>1?Ve+1:0,question:null==mn||null===(V=mn.item_banks)||void 0===V?void 0:V[Ve],questionChoiceIdsRef:un,pageCache:Me,solutionVis:rn,pageInfo:null==mn?void 0:mn.page,pptInfo:Ue,SmartPlanItemBanks:mn}),"JUDGMENT"===(null==mn||null===(X=mn.item_banks)||void 0===X||null===(X=X[Ve])||void 0===X?void 0:X.item_type)&&(0,P.jsx)(W,{questionIndex:(null==mn||null===(_=mn.item_banks)||void 0===_?void 0:_.length)>1?Ve+1:0,question:null==mn||null===(ee=mn.item_banks)||void 0===ee?void 0:ee[Ve],questionChoiceIdsRef:un,pageCache:Me,solutionVis:rn,pageInfo:null==mn?void 0:mn.page,pptInfo:Ue,SmartPlanItemBanks:mn}),"PROGRAM"===(null==mn||null===(ne=mn.item_banks)||void 0===ne||null===(ne=ne[Ve])||void 0===ne?void 0:ne.item_type)&&(0,P.jsx)(ce,{questionIndex:(null==mn||null===(te=mn.item_banks)||void 0===te?void 0:te.length)>1?Ve+1:0,question:null==mn||null===(ie=mn.item_banks)||void 0===ie?void 0:ie[Ve],questionChoiceIdsRef:un,pageCache:Me,SmartPlanItemBanks:mn,solutionVis:rn,handleRefresh:Mt,childWindow:pn,visible:hn,isSimulate:Je,onCancel:function(){An(!1)},closeProgram:mt}),"试题作答"==(null==En||null===(re=En[Cn])||void 0===re?void 0:re.label)&&("ended"==(null==be?void 0:be.Status)||(null==Me?void 0:Me.is_end))&&!(null!=mn&&mn.allow_answer_after_end)&&!(null!=mn&&null!==(oe=mn.item_banks)&&void 0!==oe&&null!==(oe=oe[Ve])&&void 0!==oe&&oe.is_answered)&&!(null!=Ue&&Ue.is_simulate)&&(0,P.jsx)("div",{className:"flex justify-center mb20 mt20",children:"当前课件已结束,无法进行操作"})]})}):null!=mn&&mn.is_extra?null!=Me&&Me.enable_extra?"温馨提示:当前页面暂无拓展习题,可以向授课教师建议补充。":"温馨提示:完成当前课件的所有基础题后,你才可以解锁拓展练习哦。":(0,P.jsx)(pe.Z,{styles:{margin:"20px auto"},customText:"当前学习内容包含试题作答环节,在老师启动答题后即可作答。"}))]})]}):(0,P.jsx)(pe.Z,{styles:{margin:"20px auto"},customText:"暂未开课"})}),"试题作答"==(null==En||null===(ae=En[Cn])||void 0===ae?void 0:ae.label)&&(null===(se=["in_progress","ended"])||void 0===se?void 0:se.includes(null==mn||null===(le=mn.page)||void 0===le?void 0:le.status))&&(0,P.jsx)("div",{className:E.page_footer,children:(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%"},children:[Ve>0&&(0,P.jsx)("div",{className:E.button1,style:{marginRight:null!=mn&&null!==(ge=mn.item_banks)&&void 0!==ge&&null!==(ge=ge[Ve])&&void 0!==ge&&ge.is_answered?"PROGRAM"==(null==mn||null===(ve=mn.item_banks)||void 0===ve||null===(ve=ve[Ve])||void 0===ve?void 0:ve.item_type)?"20px":"0px":Ve+1==(null==mn?void 0:mn.count)?"40px":"20px"},onClick:function(){Ve>0&&(Pe(Ve-1),Ot())},children:"上一题"}),0==Ve&&(null==mn?void 0:mn.count)>1&&(0,P.jsx)("div",{className:E.button1,style:{marginRight:null!=mn&&null!==(he=mn.item_banks)&&void 0!==he&&null!==(he=he[Ve])&&void 0!==he&&he.is_answered?"PROGRAM"==(null==mn||null===(Ae=mn.item_banks)||void 0===Ae||null===(Ae=Ae[Ve])||void 0===Ae?void 0:Ae.item_type)?"20px":"0px":"40px"},onClick:function(){Ve<(null==mn?void 0:mn.count)&&(Pe(Ve+1),Ot())},children:"下一题"}),"PROGRAM"!=(null==mn||null===(me=mn.item_banks)||void 0===me||null===(me=me[Ve])||void 0===me?void 0:me.item_type)&&!(null!=mn&&null!==(xe=mn.item_banks)&&void 0!==xe&&null!==(xe=xe[Ve])&&void 0!==xe&&xe.is_answered)&&("ended"!=(null==mn||null===(Ie=mn.page)||void 0===Ie?void 0:Ie.status)||(null==mn?void 0:mn.is_simulate)||(null==Me?void 0:Me.is_end)&&(null==mn?void 0:mn.allow_answer_after_end)&&"ended"==(null==mn||null===(Ee=mn.page)||void 0===Ee?void 0:Ee.status))&&(0,P.jsx)("div",{className:E.button2,style:{padding:0==Ve||Ve==(null==mn?void 0:mn.count)-1?"12px 80px":"12px 40px"},onClick:function(){Nt()},children:"提交"}),"PROGRAM"==(null==mn||null===(ke=mn.item_banks)||void 0===ke||null===(ke=ke[Ve])||void 0===ke?void 0:ke.item_type)&&!(null!=mn&&null!==(we=mn.item_banks)&&void 0!==we&&null!==(we=we[Ve])&&void 0!==we&&we.is_answered)&&("ended"!=(null==mn||null===(ye=mn.page)||void 0===ye?void 0:ye.status)||(null==mn?void 0:mn.is_simulate)||(null==Me?void 0:Me.is_end)&&(null==mn?void 0:mn.allow_answer_after_end)&&"ended"==(null==mn||null===(Ce=mn.page)||void 0===Ce?void 0:Ce.status))&&(0,P.jsx)("div",{className:E.button2,style:{padding:0==Ve||Ve==(null==mn?void 0:mn.count)-1?"12px 70px":"12px 25px"},onClick:function(){localStorage.setItem("iframeprogram_".concat(Ye.get("course_id"),"_").concat(Ye.get("id")),"true"),An(!0)},children:"进入答题"}),0!=Ve&&Ve+1<(null==mn?void 0:mn.count)&&(null==mn?void 0:mn.count)>1&&(0,P.jsx)("div",{className:E.button1,style:{marginLeft:"20px"},onClick:function(){Ve<(null==mn?void 0:mn.count)&&(Pe(Ve+1),Ot())},children:"下一题"})]})}),(0,P.jsx)(k.Z,{centered:!0,open:On,title:"答题卡",width:360,closable:!0,onCancel:function(){zn(!1)},footer:null,className:E.datikaModalSty,children:(0,P.jsxs)("div",{className:E.datikaModal,children:[(0,P.jsxs)("div",{className:E.datititleBox,children:[(0,P.jsxs)("div",{className:E.datititle,children:[(0,P.jsx)("div",{className:"".concat(E.square," ").concat(E.unanswer)}),(0,P.jsx)("div",{className:"".concat(E.titleBox),style:{color:"#9096A3"},children:"未答"})]}),!Ln&&(0,P.jsxs)("div",{className:E.datititle,children:[(0,P.jsx)("div",{className:"".concat(E.square," ").concat(E.answered)}),(0,P.jsx)("div",{className:"".concat(E.titleBox),style:{color:"#3061D0"},children:"已答"})]}),Ln&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("div",{className:E.datititle,children:[(0,P.jsx)("div",{className:"".concat(E.square," ").concat(E.rightSty)}),(0,P.jsx)("div",{className:"".concat(E.titleBox),style:{color:"#2EC25B"},children:"答对"})]}),(0,P.jsxs)("div",{className:E.datititle,children:[(0,P.jsx)("div",{className:"".concat(E.square," ").concat(E.errorSty)}),(0,P.jsx)("div",{className:"".concat(E.titleBox),style:{color:"#E30000"},children:"答错"})]})]})]}),(0,P.jsx)("div",{className:E.daticontentBox,children:null===(Be=Array.from({length:null==mn?void 0:mn.count},(function(e,n){return n+1})))||void 0===Be?void 0:Be.map((function(e,n){var t;return(0,P.jsx)("div",{onClick:function(){Pe(n),Ot()},className:"".concat(E.square," ").concat(Zt(null==mn||null===(t=mn.item_banks)||void 0===t?void 0:t[n])," ").concat(n==Ve?E.activeSquare:""),children:e},n)}))})]})})]})})})})),ve=t(95817),he=(0,I.connect)((function(e){var n=e.user,t=e.classroomList,i=e.loading;return{user:n,classroomList:t,globalSetting:e.globalSetting,loading:i.effects}}))((function(e){e.user,e.classroomList,e.globalSetting,e.loading,e.dispatch;var n=(0,p.useRef)(),t=((0,I.useParams)(),(0,I.useSearchParams)()),i=f()(t,1)[0],o=(0,p.useState)(),s=f()(o,2),c=s[0],d=s[1],g=(0,p.useState)(),m=f()(g,2),x=m[0],E=m[1],y=(0,p.useState)(1),C=f()(y,2),B=(C[0],C[1],(0,p.useState)(1)),j=f()(B,2),b=j[0],S=j[1],Q=(0,p.useState)(1),M=f()(Q,2),D=M[0],N=M[1],R=(0,p.useState)(1),T=f()(R,2),J=T[0],U=T[1],Z=(0,p.useState)(""),O=f()(Z,2),z=O[0],F=O[1],G=(0,p.useState)("40vh"),Y=f()(G,2),L=Y[0],q=Y[1],V=(0,p.useRef)(x),K=(0,p.useRef)(),H=(0,p.useState)([]),W=f()(H,2),X=W[0],_=W[1],ee=(0,p.useRef)(),ne=(0,p.useRef)([1]),te=(0,p.useState)(""),ie=f()(te,2),re=ie[0],oe=ie[1],ae=(0,p.useState)({}),se=f()(ae,2),ce=se[0],ue=se[1];i.get("educoder_session")&&(0,le.d8)("_educoder_session",i.get("educoder_session"),30);var de=function(){K.current=document.createElement("meta"),K.current.name="viewport",K.current.content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no",document.head.appendChild(K.current)};(0,p.useEffect)((function(){if(function(){Ae.apply(this,arguments)}(),localStorage.userInfo)try{var e=JSON.parse(localStorage.userInfo);"游客"===e.real_name&&(0,le.IS)()?((0,le.Or)(),de()):"游客"!==e.real_name&&de()}catch(e){}else(0,le.IS)()&&(0,le.Or)();var n=sessionStorage.getItem("".concat(i.get("course_id"),"_").concat(i.get("id"),"_pptInfo"));return n?ue(JSON.parse(n)):je(),function(){document.head.removeChild(K.current)}}),[]),(0,p.useEffect)((function(){null!=c&&c.WebofficeURL&&setTimeout((function(){!function(){Ie.apply(this,arguments)}()}),300)}),[c]),(0,p.useEffect)((function(){if(null!=x&&x.is_end&&(null==c||!c.IsCreator)){var e,n,t=JSON.parse(sessionStorage.getItem("endPPTIds"))||[];if(t&&null!==(e=t)&&void 0!==e&&e.includes(i.get("id")));else w.ZP.info("本次授课已结束,感谢您的参与!"),0===(null===(n=t)||void 0===n?void 0:n.length)?t=[i.get("id")]:t.push(i.get("id")),sessionStorage.setItem("endPPTIds",JSON.stringify(t))}}),[null==x?void 0:x.is_end,c]),(0,p.useEffect)((function(){if(null!=x&&x.enable_extra&&(null==x||!x.is_end)){var e,n=JSON.parse(localStorage.getItem("extraPPTIds"))||[];!n||null!==(e=n)&&void 0!==e&&e.includes(i.get("id"))||k.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",icon:null,maskClosable:!1,keyboard:!1,closable:!1,cancelButtonProps:{style:{display:"none"}},title:"提示",content:"恭喜你已完成所有基础习题!老师还准备了拓展习题,可以开始挑战了哦!",onOk:(t=u()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0===(null===(t=n)||void 0===t?void 0:t.length)?n=[i.get("id")]:n.push(i.get("id")),localStorage.setItem("extraPPTIds",JSON.stringify(n));case 2:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})})}var t}),[null==x?void 0:x.enable_extra]),(0,p.useEffect)((function(){!1===(null==x?void 0:x.is_end)&&"in_progress"==(null==c?void 0:c.Status)&&fe()}),[null==x?void 0:x.is_end,c]),(0,p.useEffect)((function(){V.current=x}),[x]),(0,p.useEffect)((function(){J&&pe(J)}),[J]);var fe=function(){var e=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,$.ZP)("/api/courses/".concat(i.get("course_id"),"/smart_plans/").concat(i.get("id"),"/start_class.json"),{method:"post"});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function pe(e){return he.apply(this,arguments)}function he(){return he=u()(l()().mark((function e(t){var i,r,o,a,s,c;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==n||null===(i=n.current)||void 0===i?void 0:i.ready();case 2:return null==(s=null==n||null===(r=n.current)||void 0===r?void 0:r.Application)||null===(o=s.ActivePresentation)||void 0===o||null===(o=o.SlideShowWindow)||void 0===o||null===(o=o.View)||void 0===o||o.GotoSlide(t),e.next=6,null==s||null===(a=s.ActivePresentation)||void 0===a?void 0:a.SlideShowSettings;case 6:return c=e.sent,e.next=9,null==c?void 0:c.Run();case 9:case"end":return e.stop()}}),e)}))),he.apply(this,arguments)}function Ae(){return(Ae=u()(l()().mark((function e(){var n,t,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,$.ZP)("/api/courses/".concat(i.get("course_id"),"/smart_plans/").concat(i.get("id"),"/get_office_token.json"),{method:"get",params:{is_student:!0,hidePopLogin:(0,le.IS)()}});case 2:t=e.sent,r=(null==t||null===(n=t.data)||void 0===n?void 0:n.FileName)||"",document.title=r,d(null==t?void 0:t.data);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function me(){return xe.apply(this,arguments)}function xe(){return(xe=u()(l()().mark((function e(){var t,r,o,a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,$.ZP)("/api/courses/".concat(i.get("course_id"),"/smart_plans/").concat(i.get("id"),"/set_page_cache.json"),{method:"post",body:{type:1}});case 3:if(null==(r=e.sent)||null===(t=r.data)||void 0===t||!t.page){e.next=9;break}return e.next=7,null==n||null===(o=n.current)||void 0===o?void 0:o.ready();case 7:N(null==r||null===(a=r.data)||void 0===a?void 0:a.class_max_position),U(null==r||null===(s=r.data)||void 0===s?void 0:s.page);case 9:E(null==r?void 0:r.data),e.next=14;break;case 12:e.prev=12,e.t0=e.catch(0);case 14:setTimeout((function(){var e;(!1===(null===(e=V.current)||void 0===e?void 0:e.is_end)||null!=ce&&ce.is_simulate)&&me()}),1e3);case 15:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}function Ie(){return(Ie=u()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=document.getElementById("weboffice-zone"),n.current=v().config({mount:t,url:c.WebofficeURL.includes("?")?c.WebofficeURL+"&disableForceRotate=true":c.WebofficeURL+"?disableForceRotate=true",refreshToken:Ee}),n.current.setToken({token:c.AccessToken,timeout:15e5}),ke(),me();case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(){return new Promise(function(){var e=u()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,$.ZP)("/api/courses/".concat(i.get("course_id"),"/smart_plans/").concat(i.get("id"),"/refresh_office_token.json"),{method:"get",access_token:null==c?void 0:c.AccessToken,refresh_token:null==c?void 0:c.RefreshToken});case 2:t=e.sent,n(null==t?void 0:t.data);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}())}function ke(){return we.apply(this,arguments)}function we(){return we=u()(l()().mark((function e(){var t,i,r,o,a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.current.ready();case 2:return t=n.current.Application,console.log("app:",t),e.next=6,t.ActivePresentation;case 6:return i=e.sent,e.next=9,i.Slides;case 9:return r=e.sent,e.next=12,r.Count;case 12:return o=e.sent,F(o),console.log("count:",o),e.next=17,t.ActivePresentation.SlideShowSettings;case 17:return a=e.sent,e.next=20,a.Run();case 20:return e.prev=20,e.next=23,t.ActivePresentation.SlideShowWindow.View.Slide.SlideIndex;case 23:s=e.sent,console.log("curryPage:",s),S(s),e.next=31;break;case 28:e.prev=28,e.t0=e.catch(20),console.error("获取当前页码时出错:",e.t0);case 31:t.Sub.ActiveSlideChange=function(){var e=u()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:S((null==n||null===(t=n.Data)||void 0===t?void 0:t.slideIndex)+1);case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),t.Sub.SlideShowEnd=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:q("40vh");case 1:case"end":return e.stop()}}),e)}))),Ce(),setTimeout(u()(l()().mark((function e(){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.ActivePresentation.SlideShowSettings;case 2:return n=e.sent,e.next=5,n.Run();case 5:case"end":return e.stop()}}),e)}))),500);case 35:case"end":return e.stop()}}),e,null,[[20,28]])}))),we.apply(this,arguments)}function ye(){return(ye=u()(l()().mark((function e(n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:ne.current=n,Ce();case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ce(){return Be.apply(this,arguments)}function Be(){return(Be=u()(l()().mark((function e(){var t,i,o,s,c,u,d;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.current){e.next=2;break}return e.abrupt("return");case 2:return clearTimeout(ee.current),e.next=5,n.current.ready();case 5:t=n.current.Application,i=function(e){if(!e||0===e.length)return[];for(var n=a()(e).sort((function(e,n){return e-n})),t=[],i={From:n[0],To:n[0]},r=1;r