(function(t){function e(e){for(var c,n,r=e[0],l=e[1],a=e[2],h=0,d=[];h-1&&(e.children[i]=c,ct["a"].success("编辑成功"))}else if(o.type!==c.type){if(o.type===e.type){var n=e.children.findIndex((function(t){return t.title===o.title}));e.children.splice(n,1)}c.type===e.type&&(e.children.push(c),ct["a"].success("编辑成功"))}}else console.log("---?"),e.type===c.type&&(e.children.push(c),ct["a"].success("新增成功"));return e}));localStorage.setItem("BOOKMARK",JSON.stringify(i)),e.emit("fresh"),l()}}))};function l(){n.value.resetFields(),e.emit("closeViews",!1)}return Object(X["eb"])((function(){return t.detail}),(function(e){e&&Object(X["A"])((function(){s.ruleForm=Object(H["a"])({},t.detail)}))}),{deep:!0}),Object(H["a"])(Object(H["a"])({},Object(Z["r"])(s)),{},{closeViews:l,submitForm:r,refruleForm:n,rules:i,BOOKMARK:c})},methods:{}};o("d215");st.render=ot,st.__scopeId="data-v-bca4dc88";var it=st,nt=Object(c["hb"])("data-v-4549f6a1");Object(c["I"])("data-v-4549f6a1");var rt={class:"dialog-footer"},lt=Object(c["n"])("取 消"),at=Object(c["n"])("确 定");Object(c["G"])();var ut=nt((function(t,e,o,s,i,n){var r=Object(c["O"])("el-input"),l=Object(c["O"])("el-form-item"),a=Object(c["O"])("el-col"),u=Object(c["O"])("el-row"),h=Object(c["O"])("el-form"),d=Object(c["O"])("el-button"),g=Object(c["O"])("el-dialog");return Object(c["F"])(),Object(c["k"])(g,{"custom-class":"my-dialog",title:"用户登录",visible:o.isLoginVisible,width:"400px"},{footer:nt((function(){return[Object(c["o"])("span",rt,[Object(c["o"])(d,{onClick:s.closeViews,size:"small"},{default:nt((function(){return[lt]})),_:1},8,["onClick"]),Object(c["o"])(d,{type:"primary",onClick:s.submitForm,size:"small"},{default:nt((function(){return[at]})),_:1},8,["onClick"])])]})),default:nt((function(){return[Object(c["o"])(h,{"status-icon":"",ref:"refruleForm",rules:s.rules,model:t.ruleForm,"label-width":"80px",size:"small"},{default:nt((function(){return[Object(c["o"])(u,null,{default:nt((function(){return[Object(c["o"])(a,{span:24},{default:nt((function(){return[Object(c["o"])(l,{label:"邮箱",prop:"email"},{default:nt((function(){return[Object(c["o"])(r,{modelValue:t.ruleForm.email,"onUpdate:modelValue":e[1]||(e[1]=function(e){return t.ruleForm.email=e}),placeholder:"请输入邮箱"},null,8,["modelValue"])]})),_:1})]})),_:1}),Object(c["o"])(a,{span:24},{default:nt((function(){return[Object(c["o"])(l,{label:"密码",prop:"password"},{default:nt((function(){return[Object(c["o"])(r,{modelValue:t.ruleForm.password,"onUpdate:modelValue":e[2]||(e[2]=function(e){return t.ruleForm.password=e}),"show-password":"",placeholder:"请输入密码"},null,8,["modelValue"])]})),_:1})]})),_:1})]})),_:1})]})),_:1},8,["rules","model"])]})),_:1},8,["visible"])})),ht=o("852e"),dt=o.n(ht),gt=(o("d3b7"),o("c72e")),pt=o.n(gt),mt=function(t,e){return new Promise((function(o,c){pt.a.User.logIn(t,e).then((function(t){o(t)})).catch((function(t){c(t)}))}))},bt=function(t,e){return new Promise((function(o,c){pt.a.User.loginWithEmail(e,t).then((function(t){o(t)})).catch((function(t){c(t)}))}))},ft=function(t,e){return new Promise((function(o,c){pt.a.User.logOut(t,e).then((function(t){o(t)}))}))},vt=function(t,e){return new Promise((function(o,c){var s=new pt.a.User;s.setUsername(t),s.setPassword(e),s.signUp().then((function(t){o(t)}),(function(t){c(t)}))}))},jt=function(t){return new Promise((function(e,o){var c=new pt.a.User;c.loginWithAuthData({openid:t.openid,access_token:t.access_token,expires_in:t.expires_in},"weixin").then((function(t){e(t)})).catch((function(t){o(t)}))}))},yt={login:mt,logout:ft,register:vt,loginEmail:bt,getInfo:jt},Ot={model:{value:"isLoginVisible",events:"closeViews"},props:{isLoginVisible:{type:Boolean,default:!1}},setup:function(t,e){var o=Object(Z["j"])({ruleForm:{username:"",password:""}}),c={password:[{required:!0,message:"请输入密码",trigger:"blur"}],email:[{type:"email",required:!0,message:"请输入邮箱",trigger:"blur"}]},s=Object(Z["k"])(null),i=function(){s.value.validate((function(t){if(t){var c=Object(H["a"])({},o.ruleForm);yt.login(c.email,c.password).then((function(t){dt.a.set("userInfo",JSON.stringify(t)),ct["a"].success("登录成功"),n()})).catch((function(){yt.register(c.email,c.password).then((function(t){dt.a.set("userInfo",JSON.stringify(t)),e.emit("setUser"),ct["a"].success("注册成功"),n()}))}))}}))};function n(){s.value.resetFields(),e.emit("closeViews",!1)}return Object(H["a"])(Object(H["a"])({},Object(Z["r"])(o)),{},{closeViews:n,submitForm:i,refruleForm:s,rules:c})},methods:{}};o("aa1e");Ot.render=ut,Ot.__scopeId="data-v-4549f6a1";var kt=Ot,wt=o("cffa");o("3ca3"),o("ddb0"),o("2b3d");function xt(t){var e=[],o=function t(e,o){var c=e.children;if(c&&c.length>0)for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:function(){};localStorage.getItem("BOOKMARK")?(console.log("持久化数据"),_t=JSON.parse(localStorage.getItem("BOOKMARK"))):(localStorage.setItem("BOOKMARK",JSON.stringify(Q)),_t=Q),t()}Rt();var Jt={components:{Dialog:it,Login:kt},name:"kestrel-bookmark",setup:function(){var t=function t(e){var o,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=Object(W["a"])(e);try{for(s.s();!(o=s.n()).done;){var i=o.value;Array.isArray(i.children)?t(i.children,c):c.push(i)}}catch(n){s.e(n)}finally{s.f()}return c},e=Object(Z["j"])({activeIndex:0,data:_t,bookMark:_t[0].children,searchVal:"",allData:t(_t),isDetailVisible:!1,isLoginVisible:!1,detail:{},userInfo:{username:"未登录"}}),o=function(){dt.a.get("userInfo")?e.userInfo=JSON.parse(dt.a.get("userInfo")):e.userInfo={username:"未登录"}};o(),Object(X["eb"])((function(){return e.searchVal}),(function(){e.bookMark=e.allData.filter((function(t){return t.title.toLowerCase().indexOf(e.searchVal.toLowerCase())>-1}))}));var c=function(t,o){e.bookMark=t.children,e.activeIndex=o},s=function(t){return window.open(t.url,"_target")};function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"add",c=Object(H["a"])({},t);e.detail="modify"===o?Object.assign(c,{type:_t[e.activeIndex].type,flag:"modify"}):Object.assign({},{type:_t[e.activeIndex].type,flag:"add"}),e.isDetailVisible=!0}var n=function(){e.isLoginVisible=!0},r=function(t){return e.isDetailVisible=t},l=function(t){return e.isLoginVisible=t},a=function(){var t=Object(G["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Rt((function(){e.data=_t,e.bookMark=_t[e.activeIndex].children}));case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),u=function(t){for(var o=JSON.parse(localStorage.getItem("BOOKMARK")),c=Object.assign(t,{type:_t[e.activeIndex].type}),s=0;s-1&&(o[s].children.splice(i,1),localStorage.setItem("BOOKMARK",JSON.stringify(o)),ct["a"].success("删除成功"),a())}},h=function(){ct["b"].confirm("确认要退出登录?","温馨提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var t={username:"",password:""};yt.logout(t.username,t.password).then((function(t){console.log(t),dt.a.remove("userInfo"),o()})),Object(ct["a"])({type:"success",message:"删除成功!"})}))},d=function(){e.userInfo.objectId?h():n()};return Object(H["a"])(Object(H["a"])({deleteClick:u},Object(Z["r"])(e)),{},{selectType:c,navigate:s,add:i,closeViews:r,closeLoginViews:l,search:a,importBookmark:St,exportBookmark:Vt,loginClick:d,setUsername:o})},methods:{beforeEnter:function(t){t.style.opacity=0,t.style.height=0},enter:function(t,e){wt["a"].to(t,{opacity:1,height:"1.6em",delay:.15*t.dataset.index,onComplete:e})},leave:function(t,e){wt["a"].to(t,{opacity:0,height:0,delay:.15*t.dataset.index,onComplete:e})}}};o("64e8");Jt.render=q,Jt.__scopeId="data-v-f77714da";var It=Jt;o("7dd6");pt.a.init({appId:"BwLrCgdVyLs52mJO1HcrXakI-gzGzoHsz",appKey:"25gNwzw4dV7IAh7i0IzDnYvV",serverURL:"https://bwlrcgdv.lc-cn-n1-shared.com"});var Ct=Object(c["j"])(It);Ct.use(ct["c"]),Ct.mount("#app")},"64e8":function(t,e,o){"use strict";o("2950")},"8f1f":function(t,e,o){},a5f7:function(t,e,o){t.exports=o.p+"img/logo.f38dc2e8.svg"},aa1e:function(t,e,o){"use strict";o("aded")},aded:function(t,e,o){},b3c0:function(t,e,o){t.exports=o.p+"img/add.ca18f050.svg"},d215:function(t,e,o){"use strict";o("8f1f")},e8ed:function(t,e,o){t.exports=o.p+"img/blog.f57ba53d.svg"},fe3c:function(t,e,o){t.exports=o.p+"img/file.807fb7b5.svg"}}); //# sourceMappingURL=app.d2ab1700.js.map