import{u as C,r as d,p as N,o as r,h as m,w as U,d as $,F as R,i as p,k as h,al as f,P as t,ac as T}from"./index-CcuUJlEo.js";import{u as j}from"./Header.vue_vue_type_style_index_0_scoped_52329e45_lang-D_ieGuUB.js";import{u as q}from"./use-current-user-BRt8eA5O.js";/* empty css */import O from"./ContentContainer-CWGg6POV.js";import"./login-xyzQ2n37.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const K={__name:"Xiaoshu",props:{},setup(_){const g=C(),b=j(),{bus:u}=f,x=_,s=d(!1),c=d([]),v=t("XIAOSHU_URL"),k=t("WEBSOCKET_BASE_URL"),y=t("API_BASE_URL"),S=t("ASSETS_BASE_URL"),w={padding:0};function E(){const e={"system:menu:conversation":"/chat/qa","system:conversation:qa":"/chat/qa","system:conversation:hisroty":"/chat/history","system:conversation:board":"/chat/board","system:menu:intelligent":"/intelligent","system:menu:knowledge":"/knowledge"};let o="";for(let n in e)if(T(n)){o=e[n];break}return o}return N(()=>{const e=q(),o=e.token,l={userName:e.username,token:o},L=JSON.stringify(l),i=E(),A=` window.WEBSOCKET_BASE_URL = '${k}'; window.API_BASE_URL = '${y}'; window.ASSETS_BASE_URL = '${S}'; localStorage.setItem('xintongxiaoshu', '${L}'); const observer = new MutationObserver((mutationsList) => { mutationsList.forEach((mutation) => { if (mutation.type === "childList") { // console.log("A child node has been added or removed."); // console.log(mutation); if(mutation.addedNodes.length > 0){ // console.log('新节点被添加', mutation.addedNodes); // console.log(mutation); const addedNodes = mutation.addedNodes; addedNodes.forEach((item, index) => { const klass_name = item.className; if(klass_name === 'arco-trigger-popup arco-trigger-position-rt arco-popover'){ // popover // 可能是用户名,账号 const box = item.querySelector('.xiaoshu-aside-left-menus-pop-container'); const div = document.createElement('div'); div.setAttribute('class', 'xiaoshu-aside-left-menus-logout-btn'); const span = document.createElement('span'); span.innerText = '退出登录' div.appendChild(span); box.appendChild(div); div.addEventListener('click', () => { window.$wujie?.bus.$emit("xiaoshuAsideLogout"); }); } }); } if(mutation.removedNodes.length > 0){ // console.log('节点被移除', mutation.removedNodes); // console.log(mutation); } } else if (mutation.type === "attributes") { // console.log('属性被修改了'); }else{ // console.log('其他'); } }); }); observer.observe(document.body, {childList: true, subtree: true}) `;let a="";i?a=` const box = document.querySelector('.xiaoshu-aside-left-menus-container'); if(box){ const btn = document.createElement('div'); box.appendChild(btn); btn.innerHTML = '返回'; btn.addEventListener('click', () => { window.$wujie?.bus.$emit("xiaoshuAsideBack"); }); } `:a="console.log('cant back');";const B=` .xiaoshu-aside-left-back-btn{ width: 100%; height: 40px; line-height: 40px; text-align: center; background-color: #165dff; color: #fff; display: inline-block; cursor: pointer; } .xiaoshu-aside-left-menus-pop-container {} .xiaoshu-aside-left-menus-actions-container{ display: none; } .user-popover.xiaoshu-aside-left-menus-pop-container>div.item{ display: none; } .user-popover.xiaoshu-aside-left-menus-pop-container>header{ padding-bottom: 0; border-bottom: none; } .xiaoshu-aside-left-menus-logout-btn{ cursor: pointer; text-align: center; margin-top: 10px; } `;u.$on("xiaoshuAsideBack",function(){i&&g.push(i)}),u.$on("xiaoshuAsideLogout",function(){b()}),c.value=[{jsBeforeLoaders:[{content:A}]},{jsAfterLoaders:[{content:a}]},{cssAfterLoaders:[{content:B}]}],s.value=!0}),(e,o)=>(r(),m(O,{containerStyle:w},{default:U(()=>[s.value?p("",!0):(r(),$(R,{key:0},[],64)),s.value?(r(),m(h(f),{key:1,width:"100%",height:"100%",name:"xiaoshu",url:h(v),sync:!1,props:x,plugins:c.value},null,8,["url","props","plugins"])):p("",!0)]),_:1}))}};export{K as default};