var B=Object.defineProperty,k=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var y=(l,o,e)=>o in l?B(l,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[o]=e,c=(l,o)=>{for(var e in o||(o={}))L.call(o,e)&&y(l,e,o[e]);if(p)for(var e of p(o))E.call(o,e)&&y(l,e,o[e]);return l},v=(l,o)=>k(l,A(o));import{d as w,E as s,c as b,w as D,r as I,o as M,a as T,b as S,e as q,f as Z,m as P,g as H,h as O,i as $,s as R,j as U,k as N}from"./vendor.2b18510b.js";function i1(){import("data:text/javascript,")}const j=function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))t(a);new MutationObserver(a=>{for(const n of a)if(n.type==="childList")for(const i of n.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&t(i)}).observe(document,{childList:!0,subtree:!0});function e(a){const n={};return a.integrity&&(n.integrity=a.integrity),a.referrerpolicy&&(n.referrerPolicy=a.referrerpolicy),a.crossorigin==="use-credentials"?n.credentials="include":a.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function t(a){if(a.ep)return;a.ep=!0;const n=e(a);fetch(a.href,n)}};j();if(typeof window!="undefined"){let l=function(){var o=document.body,e=document.getElementById("__svg__icons__dom__");e||(e=document.createElementNS("http://www.w3.org/2000/svg","svg"),e.style.position="absolute",e.style.width="0",e.style.height="0",e.id="__svg__icons__dom__",e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:link","http://www.w3.org/1999/xlink")),e.innerHTML='',o.insertBefore(e,o.lastChild)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",l):l()}const K=w({setup(l){const e=(t=>{if(window.location.hash.indexOf("?")<0)return null;let n=window.location.hash.split("?")[1].split("&");for(let i=0;i{const n=I("router-view");return M(),b(n,null,{default:D(({Component:i})=>[(M(),b(T(i)))]),_:1})}}}),G="modulepreload",F={},Q="./",f=function(o,e){return!e||e.length===0?o():Promise.all(e.map(t=>{if(t=`${Q}${t}`,t in F)return;F[t]=!0;const a=t.endsWith(".css"),n=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${n}`))return;const i=document.createElement("link");if(i.rel=a?"stylesheet":G,a||(i.as="script",i.crossOrigin=""),i.href=t,document.head.appendChild(i),a)return new Promise((r,x)=>{i.addEventListener("load",r),i.addEventListener("error",x)})})).then(()=>o())};function W(l){switch(l){case"../src/pages/404/index.tsx":return f(()=>import("./index.dd65b2b0.js"),["assets/index.dd65b2b0.js","assets/index.49150f4c.css","assets/vendor.2b18510b.js"]);case"../src/pages/home/index.tsx":return f(()=>import("./index.76543d1a.js"),["assets/index.76543d1a.js","assets/index.8074ef92.css","assets/vendor.2b18510b.js"]);case"../src/pages/login/index.tsx":return f(()=>import("./index.bdaa7270.js"),["assets/index.bdaa7270.js","assets/index.526ec19c.css","assets/vendor.2b18510b.js"]);default:return new Promise(function(o,e){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(e.bind(null,new Error("Unknown variable dynamic import: "+l)))})}}const m=l=>async()=>{let o=Promise.resolve(null);try{o=await W(`../src/pages/${l}/index.tsx`)}catch{o=Promise.reject()}return o};var J=[{path:"/",component:m("home")},{path:"/home",component:m("home")},{path:"/login",component:m("login")},{path:"/:pathMatch(.*)*",component:m("404"),meta:{title:"404 Not Fund"}}],h=S({history:q(),routes:J}),X=w({name:"SvgIcon",props:{prefix:{type:String,default:"icon"},name:{type:String,required:!0},color:{type:String,default:"#333"}},render(){const{name:l,prefix:o,color:e}=this,t=`#${o}-${l}`;return Z("svg",P(this.$attrs,{"aria-hidden":"true",style:{color:e}}),[Z("use",{href:t,fill:e},null)])}}),Y={install(l){l.component("SvgIcon",X)}};const C="dy_admin_token",u="live_admin_token",V=()=>{const l=H.get(C),o=localStorage.getItem(u);let e=null;return o?e=o:l&&(localStorage.setItem(u,l),e=l),e};function r1(l){return localStorage.setItem(u,l)}function e1(){return H.remove(C),localStorage.removeItem(u)}let d=0,_;const l1=l=>{if(d===0){const o=Object.assign({lock:!0,text:"\u52A0\u8F7D\u4E2D...",background:"rgba(0, 0, 0, 0.7)"},l);_=O.service(c({},o))}d++},o1=()=>{d<=0||(d--,d===0&&_.close())},g=$({requestType:"form",timeout:1e4});g.interceptors.request.use((l,o)=>{o.hideLoading||!1||l1();const t=V(),a=localStorage.getItem("tenantId")||"",n=localStorage.getItem("organId")||"",i={};return t&&!["/api-auth/usernameLogin","/api-auth/smsLogin","/api-auth/code/sendSms"].includes(l)&&(i.Authorization=t),a&&(i.tenantId=a),n&&(i.organId=n),{url:l,options:v(c({},o),{params:R(o.params),headers:c(c({},o.headers),i)})}});g.interceptors.response.use(async(l,o)=>{setTimeout(()=>{o1()},200);let e=o.hideMessage||!1;if(new URL(l.url),l.status>299||l.status<200){const a="\u670D\u52A1\u5668\u9519\u8BEF\uFF0C\u72B6\u6001\u7801"+l.status;throw e||s.error(a),new Error(a)}const t=await l.clone().json();if(t.code!==200&&t.errCode!==0){const a=t.msg||"\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5";if(t.code===401||t.code===403){e||s.error("\u767B\u5F55\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\uFF01");const n=window.location.href.split("#")[0];h.push(`/login?redirect=${n}`)}throw t.code===404&&(e||s.error("\u8BF7\u6C42\u8D44\u6E90\u4E0D\u5B58\u5728\uFF01"),h.push("/404")),t.code===403||t.code===401||e||s.error(a),new Error(a)}return l});const z=U({user:null});const a1=["/login"];h.beforeEach(async(l,o,e)=>{var a;if(V())if(l.path==="/login")e({path:"/"});else if((a=z.user)==null?void 0:a.speakerId)e();else try{const i=sessionStorage.getItem("roomUid"),r=await g.get("/api-web/imLiveBroadcastRoom/queryRoom",{params:{roomUid:i}});z.user=r.data,e(v(c({},l),{replace:!0}))}catch(i){i.msg&&s.error(i.msg),e1(),e("/login")}else a1.indexOf(l.path)!==-1?e():e(`/login?redirect=${l.fullPath}`)});h.afterEach(()=>{});N(K).use(Y).use(h).mount("#app");export{i1 as __vite_legacy_guard,e1 as a,r1 as b,g as r,z as s};