1234 |
- import{d as I,F as E,G as k,I as L,bo as D,bI as K,N as w,J as U,M as O,aD as R,v as M,j as y,O as S,R as $,P as C,a3 as N,_ as X,Q as x,b2 as P,S as V,bJ as H,b4 as Y,b5 as B,bK as F,bL as g,b6 as j,V as T,bM as q,b7 as z,b8 as Q}from"./index-84b16e92.js";function ee(){import.meta.url,import("_").catch(()=>1);async function*o(){}}(function(){if(typeof window>"u")return;var o,d="ontouchstart"in window;document.createTouch||(document.createTouch=function(r,e,s,p,l,m,A){return new c(e,s,{pageX:p,pageY:l,screenX:m,screenY:A,clientX:p-window.pageXOffset,clientY:l-window.pageYOffset},0,0)}),document.createTouchList||(document.createTouchList=function(){for(var r=i(),e=0;e<arguments.length;e++)r[e]=arguments[e];return r.length=arguments.length,r}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(r){var e=this;do{if(e.matches(r))return e;e=e.parentElement||e.parentNode}while(e!==null&&e.nodeType===1);return null});var c=function(e,s,p,l,m){l=l||0,m=m||0,this.identifier=s,this.target=e,this.clientX=p.clientX+l,this.clientY=p.clientY+m,this.screenX=p.screenX+l,this.screenY=p.screenY+m,this.pageX=p.pageX+l,this.pageY=p.pageY+m};function i(){var r=[];return r.item=function(e){return this[e]||null},r.identifiedTouch=function(e){return this[e+1]||null},r}var a=!1;function t(r){return function(e){e.type==="mousedown"&&(a=!0),e.type==="mouseup"&&(a=!1),!(e.type==="mousemove"&&!a)&&((e.type==="mousedown"||!o||o&&!o.dispatchEvent)&&(o=e.target),o.closest("[data-no-touch-simulate]")==null&&n(r,e),e.type==="mouseup"&&(o=null))}}function n(r,e){var s=document.createEvent("Event");s.initEvent(r,!0,!0),s.altKey=e.altKey,s.ctrlKey=e.ctrlKey,s.metaKey=e.metaKey,s.shiftKey=e.shiftKey,s.touches=f(e),s.targetTouches=f(e),s.changedTouches=u(e),o.dispatchEvent(s)}function u(r){var e=i();return e.push(new c(o,1,r,0,0)),e}function f(r){return r.type==="mouseup"?i():u(r)}function h(){window.addEventListener("mousedown",t("touchstart"),!0),window.addEventListener("mousemove",t("touchmove"),!0),window.addEventListener("mouseup",t("touchend"),!0)}h.multiTouchOffset=75,d||new h})();const J=I({name:"App",setup(){const o=E(),d=async()=>await H(),c=async()=>{try{const t=o.isCbs||window.location.href.includes("simple-detail")?{code:200,data:{}}:await d();if((t==null?void 0:t.code)===5e3){const u=N();if(X(t.message),u.isApp)postMessage({api:"login"});else{if(/(192|localhost)/.test(location.origin))return;window.parent.postMessage({api:"onLogin"},"*"),setTimeout(()=>{window.location.href=`${location.origin}/classroom`},500)}return}const n=(t==null?void 0:t.data)||{};x(n),w.platformType=n.clientType==="STUDENT"?"STUDENT":""}catch(t){w.status="error",P(),console.log("🚀 ~ error:",t)}};k(async()=>{if(o.Authorization&&L(o.Authorization),!window.location.href.includes("simple-detail")){if(!D()){const t=await K();if(t!=null&&t.content){const n=t.content,u=n.tokenType+" "+n.accessToken;L(u)}}if(o.productXmlImg){w.status="login";return}}c(),U(V())});const i=t=>{t.code==="ArrowUp"?window.parent.postMessage({api:"documentBodyKeyup",code:"ArrowUp"},"*"):t.code==="ArrowDown"&&window.parent.postMessage({api:"documentBodyKeyup",code:"ArrowDown"},"*")};O(()=>{const t=document.getElementById("loading");t&&document.body.removeChild(t),(o.platform=="pc"||o.isPreView)&&(document.body.addEventListener("keyup",n=>i(n)),document.addEventListener("contextmenu",function(n){n.preventDefault()}),document.addEventListener("keydown",function(n){(n.key==="F12"||n.ctrlKey&&n.shiftKey&&n.key==="I"||n.metaKey&&n.altKey&&n.key==="I")&&n.preventDefault()}))}),R(()=>{o.platform=="pc"&&document.body.removeEventListener("keyup",i)});const a=M(()=>w.status==="login");return()=>y(C,null,[w.status==="error"?y(S,null,null):a.value?y($,null,null):null])}}),G=[{path:"/",component:F},{path:"/product-img",component:()=>g(()=>import("./index-87b172e5.js"),["./index-87b172e5.js","./index-84b16e92.js","../css/index-1ec513a0.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/evaluat-report",component:()=>g(()=>import("./index-1d1c0449.js"),["./index-1d1c0449.js","./index-84b16e92.js","../css/index-1ec513a0.css","./plyr.min-c8c2777b.js","../css/plyr-ad8ef5ae.css","./index-47d5d39a.js","../css/index-775a7918.css"],import.meta.url)},{path:"/preview",component:()=>g(()=>import("./index-361c8a9f.js"),["./index-361c8a9f.js","./index-84b16e92.js","../css/index-1ec513a0.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/view-figner",component:()=>g(()=>import("./index-84b16e92.js").then(o=>o.cb),["./index-84b16e92.js","../css/index-1ec513a0.css"],import.meta.url)},{path:"/simple-detail",component:()=>g(()=>import("./index-bae3793b.js"),["./index-bae3793b.js","./index-84b16e92.js","../css/index-1ec513a0.css","../css/index-2cf15a52.css"],import.meta.url)},{path:"/:pathMatch(.*)*",component:j,meta:{title:"404 Not Fund"}}],b=Y({history:B(),routes:G});b.beforeEach((o,d,c)=>{o.meta.title&&(document.title=o.meta.title),c()});const _=E();function W(){const o=async i=>{var t,n;const a=`Error message: ${i.target.tagName||""};${i.target.src||i.target.href||""};lineno: ${i.lineno||""};message: ${i.message||""};filename: ${i.filename||""};fileUrl: ${window.location.href};reason: ${((t=i.reason)==null?void 0:t.message)||""};
- stack: ${((n=i.reason)==null?void 0:n.stack)||""};
- bizId: ${T.examSongId||_.id||""};
- partIndex: ${_["part-index"]||T.partIndex||0}`;q(a)};return{startListenErrorLog:()=>{console.log("mount useErrorLog"),window.addEventListener("error",o),window.addEventListener("unhandledrejection",o)},stopListenErrorLog:()=>{window.removeEventListener("error",o),window.removeEventListener("unhandledrejection",o)}}}(function(){var a,t,n,u,f,h;const o=E(),d=navigator.userAgent,c=window.DAYA||((t=(a=window.webkit)==null?void 0:a.messageHandlers)==null?void 0:t.DAYA)||window.COLEXIU||((u=(n=window.webkit)==null?void 0:n.messageHandlers)==null?void 0:u.COLEXIU)||window.ORCHESTRA||((h=(f=window.webkit)==null?void 0:f.messageHandlers)==null?void 0:h.ORCHESTRA),i=o.isCbs?"/cbs-app":(d.includes("COLEXIUSTUDENT"),"/edu-app");z({isApp:!!c,platformApi:i,platformType:(d.includes("COLEXIUSTUDENT"),""),proxy:""})})();const v=Q(J);v.use(b);const Z=W();Z.startListenErrorLog();v.mount("#app");export{ee as __vite_legacy_guard};
|