instrument-5ba0b8c2.js 6.4 KB

12345
  1. import{d as I,F as L,G as k,I as T,bo as D,bI as K,N as w,J as U,M as O,aD as R,v as $,j as y,O as M,R as C,P as N,a3 as S,_ 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 _,bM as q,b7 as z,b8 as Q}from"./index-6f82b769.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=L(),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=S();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&&T(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;T(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=$(()=>w.status==="login");return()=>y(N,null,[w.status==="error"?y(M,null,null):a.value?y(C,null,null):null])}}),G=[{path:"/",component:F},{path:"/product-img",component:()=>g(()=>import("./index-59f3b70d.js"),["./index-59f3b70d.js","./index-6f82b769.js","../css/index-1ec513a0.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/evaluat-report",component:()=>g(()=>import("./index-2d47a45b.js"),["./index-2d47a45b.js","./index-6f82b769.js","../css/index-1ec513a0.css","./plyr.min-c8c2777b.js","../css/plyr-ad8ef5ae.css","./index-c8a62d72.js","../css/index-775a7918.css"],import.meta.url)},{path:"/preview",component:()=>g(()=>import("./index-3d8a0f43.js"),["./index-3d8a0f43.js","./index-6f82b769.js","../css/index-1ec513a0.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/view-figner",component:()=>g(()=>import("./index-6f82b769.js").then(o=>o.cb),["./index-6f82b769.js","../css/index-1ec513a0.css"],import.meta.url)},{path:"/simple-detail",component:()=>g(()=>import("./index-7b920124.js"),["./index-7b920124.js","./index-6f82b769.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=L();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||""};colno: ${i.colno||""};message: ${i.message||""};filename: ${i.filename||""};fileUrl: ${window.location.href};reason: ${((t=i.reason)==null?void 0:t.message)||""};
  2. stack: ${((n=i.reason)==null?void 0:n.stack)||""};
  3. bizId: ${_.examSongId||E.id||""};
  4. partIndex: ${E["part-index"]||_.partIndex||0}
  5. partName: ${decodeURIComponent(E["part-name"]||"")||""};`;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=L(),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};