const{createApp}=Vue const{createVuetify,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,tab:'account',discussions:{targetPage:1,}},search:{width:80,text:null,loading:false,},usersMap:new Map([[642,{uid:642,url:'/u/6f26512f6a045c77666e546f3e3c6a71',avatar:'/a/6f26512f6a045c77666e546f3e3c6a71',username:'5261🤖',}],[6605,{uid:6605,url:'/u/3b0047256a045c71666a536f2f1b310e',avatar:'/a/3b0047256a045c71666a536f2f1b310e',username:'drymonfidelia🤖',}],[8348,{uid:8348,url:'/u/2010072a6a045c7f636e5e6f423e3677',avatar:'/a/2010072a6a045c7f636e5e6f423e3677',username:'glcolof🤖',}],]),} const App={setup(){const{smAndUp,mdAndUp}=useDisplay() return{smAndUp,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)}},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?$/,this.nav.discussions.targetPage>1?`/${this.nav.discussions.targetPage}`:'') window.location.href=url},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diff