/*! * ==================================================== * kityminder-editor - v1.0.67 - 2022-05-25 * https://github.com/fex-team/kityminder-editor * GitHub: https://github.com/fex-team/kityminder-editor * Copyright (c) 2022 ; Licensed * ==================================================== */ !function(){var d={r:function(e){if(d[e].inited)return d[e].value;if("function"!=typeof d[e].value)return d[e].inited=!0,d[e].value;var t={exports:{}},n=d[e].value(null,t.exports,t);if(d[e].inited=!0,void 0!==(d[e].value=n))return n;for(var i in t.exports)if(t.exports.hasOwnProperty(i))return d[e].inited=!0,d[e].value=t.exports,t.exports}};d[0]={value:function(e,t,n){var i=[];function r(e){i.push(e)}function o(e){this.selector=e;for(var t=0;t drag",function(){}),t.when("drag -> *",function(e,t,n){});var a,l,s,c,d,u,m=1,p=!1,g=!1;function f(e,t){if(!e)return p=g=!1,u&&kity.releaseFrame(u),void(u=null);var n,i,r;u||(u=kity.requestFrame((n=e,i=t,r=o,function(e){switch(n){case"left":r._viewDragger.move({x:-i,y:0},0);break;case"top":r._viewDragger.move({x:0,y:-i},0);break;case"right":r._viewDragger.move({x:i,y:0},0);break;case"bottom":r._viewDragger.move({x:0,y:i},0);break;default:return}e.next()})))}o.on("mousedown",function(e){m=0;var t=o.getPaper().container.getBoundingClientRect();n=e.originEvent.clientX,i=e.originEvent.clientY,d=t.top,a=t.width,l=t.height}),o.on("mousemove",function(e){if("drag"===t.state()&&0==m&&o.getSelectedNode()&&(20 {2}",t,r,e),n=0;n *"),2==(i=e.split(" - ")).length?n="before":2==(i=e.split(" -> ")).length&&(n="after"),!n)throw new Error("Illegal fsm condition: "+e);r=i[0],o=i[1],t.condition={when:n,exit:r,enter:o},l.push(t)}}return n.exports=function(){this.fsm=new i("normal")}}},d[10]={value:function(e,t,n){var g=d.r(22);return window.diff=g,n.exports=function(){var n,i,r,o,a=this.minder,e=this.hotbox,l=100;function t(){r=[],o=[],n=a.exportJson()}function s(){var e=a.exportJson(),t=g(e,n);if(t.length){for(r.push(t);r.length>l;)r.shift();return n=e,!0}}function c(){i=!0;var e,t=r.pop();t&&(a.applyPatches(t),e=a.exportJson(),o.push(g(e,n)),n=e),i=!1}function d(){i=!0;var e=o.pop();e&&(a.applyPatches(e),s()),i=!1}function u(){return!!r.length}function m(){return!!o.length}this.history={reset:t,undo:c,redo:d,hasUndo:u,hasRedo:m},t(),a.on("contentchange",function(){i||s()&&(o=[])}),a.on("import",t),a.on("patch",function(e){if(i){var t=e.patch;switch(t.express){case"node.add":a.select(t.node.getChild(t.index),!0);break;case"node.remove":case"data.replace":case"data.remove":case"data.add":a.select(t.node,!0)}}});var p=e.state("main");p.button({position:"top",label:"撤销",key:"Ctrl + Z",enable:u,action:c,next:"idle"}),p.button({position:"top",label:"重做",key:"Ctrl + Y",enable:m,action:d,next:"idle"})}}},d[11]={value:function(e,t,n){var i=d.r(2);return n.exports=function(){var e=this.fsm,a=this.minder,r=this.receiver,t=this.container,l=new i(t);l.setParentFSM(e),e.when("normal -> hotbox",function(e,t,n){var i,r=a.getSelectedNode();if(r){var o=r.getRenderBox();i={x:o.cx,y:o.cy}}l.active("main",i)}),e.when("normal -> normal",function(e,t,n,i){"shortcut-handle"==n&&(l.dispatch(i)?i.preventDefault():a.dispatchKeyEvent(i))}),e.when("modal -> normal",function(e,t,n,i){"import-text-finish"==n&&r.element.focus()}),this.hotbox=l}}},d[12]={value:function(e,t,n){d.r(21);var s=new(d.r(19))("input");return n.exports=function(){var r=this.fsm,p=this.minder,e=this.hotbox,o=this.receiver,a=o.element,l=window.kity.Browser.gecko;function t(){var e=p.getSelectedNode();if(e){var t=a;if(a.innerText="","bold"===e.getData("font-weight")){var n=document.createElement("b");t.appendChild(n),t=n}if("italic"===e.getData("font-style")){var i=document.createElement("i");t.appendChild(i),t=i}t.innerText=p.queryCommandValue("text"),l&&o.fixFFCaretDisappeared(),r.jump("input","input-request"),o.selectAll()}}function n(){var e=p.getSelectedNode();if(e){var t=e.getData("font-size")||e.getStyle("font-size");a.style.fontSize=t+"px",a.style.minWidth=0,a.style.minWidth=a.clientWidth+"px",a.style.fontWeight=e.getData("font-weight")||"",a.style.fontStyle=e.getData("font-style")||"",a.classList.add("input"),a.focus()}}function g(){a.classList.remove("input"),o.selectAll()}function i(){var t=i,n=p.getSelectedNode();n&&(t.timer||(t.timer=setTimeout(function(){var e=n.getRenderBox("TextRenderer");a.style.left=Math.round(e.x)+"px",a.style.top=(s.flaged?Math.round(e.bottom+30):Math.round(e.y))+"px",t.timer=0})))}s.flaged&&a.classList.add("debug"),a.onmousedown=function(e){e.stopPropagation()},p.on("layoutallfinish viewchange viewchanged selectionchange",function(e){"viewchange"==e.type&&"input"!=r.state()||i()}),i(),r.when("* -> input",n),r.when("input -> *",function(e,t,n){switch(n){case"input-cancel":return g();case"input-commit":default:return function(){var e=[].slice.call(a.childNodes);setTimeout(function(){a.innerHTML=""},0);var t=p.getSelectedNode();if(e=function(e){for(var t,n,i,r="",o=/\S/,a=new RegExp("( |"+String.fromCharCode(160)+")"),l=document.createElement("br"),s=!1,c=!1,d=0,u=e.length;d/g,">").replace(/\n/g,"
")}))}},d[22]={value:function(e,t,n){var m=Object.keys?Object.keys:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t};function p(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function g(e){return"object"==typeof e?JSON.parse(JSON.stringify(e)):e}return n.exports=function(e,t){var n=[];return function e(t,n,i,r){for(var o=m(n),a=m(t),l=!1,s=a.length-1;0<=s;s--){var c=t[u=a[s]];if(n.hasOwnProperty(u)){var d=n[u];"object"==typeof c&&null!=c&&"object"==typeof d&&null!=d?e(c,d,i,r+"/"+p(u)):c!=d&&i.push({op:"replace",path:r+"/"+p(u),value:g(d)})}else i.push({op:"remove",path:r+"/"+p(u)}),l=!0}if(l||o.length!=a.length)for(s=0;s
{{ 'appendchildnode' | lang:'ui/command' }}
{{ 'appendparentnode' | lang:'ui/command' }}
{{ 'appendsiblingnode' | lang:'ui/command' }}
"),e.put("ui/directive/arrange/arrange.html","
{{ 'arrangeup' | lang:'ui/command' }}
{{ 'arrangedown' | lang:'ui/command' }}
"),e.put("ui/directive/colorPanel/colorPanel.html",'
'),e.put("ui/directive/expandLevel/expandLevel.html",'
'),e.put("ui/directive/fontOperator/fontOperator.html",''),e.put("ui/directive/hyperLink/hyperLink.html",'
'),e.put("ui/directive/imageBtn/imageBtn.html",'
'),e.put("ui/directive/kityminderEditor/kityminderEditor.html",'
'),e.put("ui/directive/kityminderViewer/kityminderViewer.html",'
'),e.put("ui/directive/layout/layout.html",''),e.put("ui/directive/navigator/navigator.html",''),e.put("ui/directive/noteBtn/noteBtn.html",'
'),e.put("ui/directive/noteEditor/noteEditor.html",'

请选择节点编辑备注

'),e.put("ui/directive/notePreviewer/notePreviewer.html",'
'),e.put("ui/directive/operation/operation.html","
{{ 'editnode' | lang:'ui/command' }}
{{ 'removenode' | lang:'ui/command' }}
"),e.put("ui/directive/priorityEditor/priorityEditor.html",'
'),e.put("ui/directive/progressEditor/progressEditor.html",'
'),e.put("ui/directive/resourceEditor/resourceEditor.html",'
'),e.put("ui/directive/searchBox/searchBox.html",''),e.put("ui/directive/searchBtn/searchBtn.html",'
'),e.put("ui/directive/selectAll/selectAll.html",'
'),e.put("ui/directive/styleOperator/styleOperator.html",''),e.put("ui/directive/templateList/templateList.html",''),e.put("ui/directive/themeList/themeList.html",''),e.put("ui/directive/topTab/topTab.html",''),e.put("ui/directive/undoRedo/undoRedo.html",'
'),e.put("ui/dialog/hyperlink/hyperlink.tpl.html",''),e.put("ui/dialog/imExportNode/imExportNode.tpl.html",''),e.put("ui/dialog/image/image.tpl.html",'')}]),angular.module("kityminderEditor").service("commandBinder",function(){return{bind:function(e,t,n){e.on("interactchange",function(){n.commandDisabled=-1===e.queryCommandState(t),n.commandValue=e.queryCommandValue(t),n.$apply()})}}}),angular.module("kityminderEditor").provider("config",function(){this.config={ctrlPanelMin:250,ctrlPanelWidth:parseInt(window.localStorage.__dev_minder_ctrlPanelWidth)||250,dividerWidth:3,defaultLang:"zh-cn",zoom:[10,20,30,50,80,100,120,150,200],imageUpload:"server/imageUpload.php"},this.set=function(e,t){var n=Object.keys(this.config),i={};for(var r in"object"==typeof e?i=e:i[e]=t,i){if(!i.hasOwnProperty(r)||-1===n.indexOf(r))return console.error("Unsupported config key: ",e,", please choose in :",n.join(", ")),!1;this.config[r]=i[r]}return!0},this.$get=function(){var t=this;return{get:function(e){return 0===arguments.length?t.config:t.config.hasOwnProperty(e)?t.config[e]:(console.warn("Missing config key pair for : ",e),"")}}}}),angular.module("kityminderEditor").service("lang.zh-cn",function(){return{"zh-cn":{template:{default:"思维导图",tianpan:"天盘图",structure:"组织结构图",filetree:"目录组织图",right:"逻辑结构图","fish-bone":"鱼骨头图"},theme:{classic:"脑图经典","classic-compact":"紧凑经典",snow:"温柔冷光","snow-compact":"紧凑冷光",fish:"鱼骨图",wire:"线框","fresh-red":"清新红","fresh-soil":"泥土黄","fresh-green":"文艺绿","fresh-blue":"天空蓝","fresh-purple":"浪漫紫","fresh-pink":"脑残粉","fresh-red-compat":"紧凑红","fresh-soil-compat":"紧凑黄","fresh-green-compat":"紧凑绿","fresh-blue-compat":"紧凑蓝","fresh-purple-compat":"紧凑紫","fresh-pink-compat":"紧凑粉",tianpan:"经典天盘","tianpan-compact":"紧凑天盘"},maintopic:"中心主题",topic:"分支主题",panels:{history:"历史",template:"模板",theme:"皮肤",layout:"布局",style:"样式",font:"文字",color:"颜色",background:"背景",insert:"插入",arrange:"调整",nodeop:"当前",priority:"优先级",progress:"进度",resource:"资源",note:"备注",attachment:"附件",word:"文字"},error_message:{title:"哎呀,脑图出错了",err_load:"加载脑图失败",err_save:"保存脑图失败",err_network:"网络错误",err_doc_resolve:"文档解析失败",err_unknown:"发生了奇怪的错误",err_localfile_read:"文件读取错误",err_download:"文件下载失败",err_remove_share:"取消分享失败",err_create_share:"分享失败",err_mkdir:"目录创建失败",err_ls:"读取目录失败",err_share_data:"加载分享内容出错",err_share_sync_fail:"分享内容同步失败",err_move_file:"文件移动失败",err_rename:"重命名失败",unknownreason:"可能是外星人篡改了代码...",pcs_code:{3:"不支持此接口",4:"没有权限执行此操作",5:"IP未授权",110:"用户会话已过期,请重新登录",31001:"数据库查询错误",31002:"数据库连接错误",31003:"数据库返回空结果",31021:"网络错误",31022:"暂时无法连接服务器",31023:"输入参数错误",31024:"app id为空",31025:"后端存储错误",31041:"用户的cookie不是合法的百度cookie",31042:"用户未登陆",31043:"用户未激活",31044:"用户未授权",31045:"用户不存在",31046:"用户已经存在",31061:"文件已经存在",31062:"文件名非法",31063:"文件父目录不存在",31064:"无权访问此文件",31065:"目录已满",31066:"文件不存在",31067:"文件处理出错",31068:"文件创建失败",31069:"文件拷贝失败",31070:"文件删除失败",31071:"不能读取文件元信息",31072:"文件移动失败",31073:"文件重命名失败",31079:"未找到文件MD5,请使用上传API上传整个文件。",31081:"superfile创建失败",31082:"superfile 块列表为空",31083:"superfile 更新失败",31101:"tag系统内部错误",31102:"tag参数错误",31103:"tag系统错误",31110:"未授权设置此目录配额",31111:"配额管理只支持两级目录",31112:"超出配额",31113:"配额不能超出目录祖先的配额",31114:"配额不能比子目录配额小",31141:"请求缩略图服务失败",31201:"签名错误",31202:"文件不存在",31203:"设置acl失败",31204:"请求acl验证失败",31205:"获取acl失败",31206:"acl不存在",31207:"bucket已存在",31208:"用户请求错误",31209:"服务器错误",31210:"服务器不支持",31211:"禁止访问",31212:"服务不可用",31213:"重试出错",31214:"上传文件data失败",31215:"上传文件meta失败",31216:"下载文件data失败",31217:"下载文件meta失败",31218:"容量超出限额",31219:"请求数超出限额",31220:"流量超出限额",31298:"服务器返回值KEY非法",31299:"服务器返回值KEY不存在"}},ui:{shared_file_title:"[分享的] {0} (只读)",load_share_for_edit:"正在加载分享的文件...",share_sync_success:"分享内容已同步",recycle_clear_confirm:"确认清空回收站么?清空后的文件无法恢复。",fullscreen_exit_hint:"按 Esc 或 F11 退出全屏",error_detail:"详细信息",copy_and_feedback:"复制并反馈",move_file_confirm:'确定把 "{0}" 移动到 "{1}" 吗?',rename:"重命名",rename_success:"{0} 重命名成功",move_success:"{0} 移动成功到 {1}",command:{appendsiblingnode:"插入同级主题",appendparentnode:"插入上级主题",appendchildnode:"插入下级主题",removenode:"删除",editnode:"编辑",arrangeup:"上移",arrangedown:"下移",resetlayout:"整理布局",expandtoleaf:"展开全部节点",expandtolevel1:"展开到一级节点",expandtolevel2:"展开到二级节点",expandtolevel3:"展开到三级节点",expandtolevel4:"展开到四级节点",expandtolevel5:"展开到五级节点",expandtolevel6:"展开到六级节点",fullscreen:"全屏",outline:"大纲"},search:"搜索",expandtoleaf:"展开",back:"返回",undo:"撤销 (Ctrl + Z)",redo:"重做 (Ctrl + Y)",tabs:{idea:"思路",appearence:"外观",view:"视图"},quickvisit:{new:"新建 (Ctrl + Alt + N)",save:"保存 (Ctrl + S)",share:"分享 (Ctrl + Alt + S)",feedback:"反馈问题(F1)",editshare:"编辑"},menu:{mainmenutext:"百度脑图",newtab:"新建",opentab:"打开",savetab:"保存",sharetab:"分享",preferencetab:"设置",helptab:"帮助",feedbacktab:"反馈",recenttab:"最近使用",netdisktab:"百度云存储",localtab:"本地文件",drafttab:"草稿箱",downloadtab:"导出到本地",createsharetab:"当前脑图",managesharetab:"已分享",newheader:"新建脑图",openheader:"打开",saveheader:"保存到",draftheader:"草稿箱",shareheader:"分享我的脑图",downloadheader:"导出到指定格式",preferenceheader:"偏好设置",helpheader:"帮助",feedbackheader:"反馈"},mydocument:"我的文档",emptydir:"目录为空!",pickfile:"选择文件...",acceptfile:"支持的格式:{0}",dropfile:"或将文件拖至此处",unsupportedfile:"不支持的文件格式",untitleddoc:"未命名文档",overrideconfirm:"{0} 已存在,确认覆盖吗?",checklogin:"检查登录状态中...",loggingin:"正在登录...",recent:"最近打开",clearrecent:"清空",clearrecentconfirm:"确认清空最近文档列表?",cleardraft:"清空",cleardraftconfirm:"确认清空草稿箱?",none_share:"不分享",public_share:"公开分享",password_share:"私密分享",email_share:"邮件邀请",url_share:"脑图 URL 地址:",sns_share:"社交网络分享:",sns_share_text:"“{0}” - 我用百度脑图制作的思维导图,快看看吧!(地址:{1})",none_share_description:"不分享当前脑图",public_share_description:"创建任何人可见的分享",share_button_text:"创建",password_share_description:"创建需要密码才可见的分享",email_share_description:"创建指定人可见的分享,您还可以允许他们编辑",ondev:"敬请期待!",create_share_failed:"分享失败:{0}",remove_share_failed:"删除失败:{1}",copy:"复制",copied:"已复制",shared_tip:"当前脑图被 {0} 分享,你可以修改之后保存到自己的网盘上或再次分享",current_share:"当前脑图",manage_share:"我的分享",share_remove_action:"不分享该脑图",share_view_action:"打开分享地址",share_edit_action:"编辑分享的文件",login:"登录",logout:"注销",switchuser:"切换账户",userinfo:"个人信息",gotonetdisk:"我的网盘",requirelogin:'请 后使用',saveas:"保存为",filename:"文件名",fileformat:"保存格式",save:"保存",mkdir:"新建目录",recycle:"回收站",newdir:"未命名目录",bold:"加粗",italic:"斜体",forecolor:"字体颜色",fontfamily:"字体",fontsize:"字号",layoutstyle:"主题",node:"节点操作",saveto:"另存为",hand:"允许拖拽",camera:"定位根节点","zoom-in":"放大(Ctrl+)","zoom-out":"缩小(Ctrl-)",markers:"标签",resource:"资源",help:"帮助",preference:"偏好设置",expandnode:"展开到叶子",collapsenode:"收起到一级节点",template:"模板",theme:"皮肤",clearstyle:"清除样式",copystyle:"复制样式",pastestyle:"粘贴样式",appendsiblingnode:"同级主题",appendchildnode:"下级主题",arrangeup:"前调",arrangedown:"后调",editnode:"编辑",removenode:"移除",priority:"优先级",progress:{p1:"未开始",p2:"完成 1/8",p3:"完成 1/4",p4:"完成 3/8",p5:"完成一半",p6:"完成 5/8",p7:"完成 3/4",p8:"完成 7/8",p9:"已完成",p0:"清除进度"},link:"链接",image:"图片",note:"备注",insertlink:"插入链接",insertimage:"插入图片",insertnote:"插入备注",removelink:"移除已有链接",removeimage:"移除已有图片",removenote:"移除已有备注",resetlayout:"整理",justnow:"刚刚",minutesago:"{0} 分钟前",hoursago:"{0} 小时前",yesterday:"昨天",daysago:"{0} 天前",longago:"很久之前",redirect:"您正在打开连接 {0},百度脑图不能保证连接的安全性,是否要继续?",navigator:"导航器",unsavedcontent:"当前文件还没有保存到网盘:\n\n{0}\n\n虽然未保存的数据会缓存在草稿箱,但是清除浏览器缓存会导致草稿箱清除。",shortcuts:"快捷键",contact:"联系与反馈",email:"邮件组",qq_group:"QQ 群",github_issue:"Github",baidu_tieba:"贴吧",clipboardunsupported:"您的浏览器不支持剪贴板,请使用快捷键复制",load_success:"{0} 加载成功",save_success:"{0} 已保存于 {1}",autosave_success:"{0} 已自动保存于 {1}",selectall:"全选",selectrevert:"反选",selectsiblings:"选择兄弟节点",selectlevel:"选择同级节点",selectpath:"选择路径",selecttree:"选择子树"},popupcolor:{clearColor:"清空颜色",standardColor:"标准颜色",themeColor:"主题颜色"},dialogs:{markers:{static:{lang_input_text:"文本内容:",lang_input_url:"链接地址:",lang_input_title:"标题:",lang_input_target:"是否在新窗口:"},priority:"优先级",none:"无",progress:{title:"进度",notdone:"未完成",done1:"完成 1/8",done2:"完成 1/4",done3:"完成 3/8",done4:"完成 1/2",done5:"完成 5/8",done6:"完成 3/4",done7:"完成 7/8",done:"已完成"}},help:{},hyperlink:{},image:{},resource:{}},hyperlink:{hyperlink:"链接...",unhyperlink:"移除链接"},image:{image:"图片...",removeimage:"移除图片"},marker:{marker:"进度/优先级..."},resource:{resource:"资源..."}}}}),angular.module("kityminderEditor").service("memory",function(){return{get:function(e){var t=window.localStorage.getItem(e);return JSON.parse(t)},set:function(e,t){try{return window.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){if(function(e){var t=!1;if(e)if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t}(e))return!1}},remove:function(e){var t=window.localStorage.getItem(e);return window.localStorage.removeItem(e),t},clear:function(){window.localStorage.clear()}}}),angular.module("kityminderEditor").service("minder.service",function(){var t=[];return{registerEvent:function(e){t.push(e)},executeCallback:function(){t.forEach(function(e){e.apply(this,arguments)})}}}),angular.module("kityminderEditor").service("resourceService",["$document",function(t){var n=null;this.open=function(e){n||(t.bind("click",i),t.bind("keydown",r)),n&&n!==e&&(n.resourceListOpen=!1),n=e},this.close=function(e){n===e&&(n=null,t.unbind("click",i),t.unbind("keydown",r))};var i=function(e){if(n){var t=n.getToggleElement();e&&t&&t[0].contains(e.target)||n.$apply(function(){console.log("to close the resourcelist"),n.resourceListOpen=!1})}},r=function(e){27===e.which&&(n.focusToggleElement(),i())}}]),angular.module("kityminderEditor").service("revokeDialog",["$modal","minder.service",function(e,t){return t.registerEvent(function(){var t=window.minder,n=window.editor,i=n.hotbox.getParentFSM();t.on("importNodeData",function(){i.jump("modal","import-text-modal"),e.open({animation:!0,templateUrl:"ui/dialog/imExportNode/imExportNode.tpl.html",controller:"imExportNode.ctrl",size:"md",resolve:{title:function(){return"导入节点"},defaultValue:function(){return""},type:function(){return"import"}}}).result.then(function(e){try{t.Text2Children(t.getSelectedNode(),e)}catch(e){alert(e)}i.jump("normal","import-text-finish"),n.receiver.selectAll()},function(){i.jump("normal","import-text-finish"),n.receiver.selectAll()})}),t.on("exportNodeData",function(){i.jump("modal","export-text-modal"),e.open({animation:!0,templateUrl:"ui/dialog/imExportNode/imExportNode.tpl.html",controller:"imExportNode.ctrl",size:"md",resolve:{title:function(){return"导出节点"},defaultValue:function(){var e=t.getSelectedNode();return(0,window.kityminder.data.getRegisterProtocol("text").Node2Text)(e)},type:function(){return"export"}}}).result.then(function(e){i.jump("normal","export-text-finish"),n.receiver.selectAll()},function(){i.jump("normal","export-text-finish"),n.receiver.selectAll()})})}),{}}]),angular.module("kityminderEditor").service("server",["config","$http",function(i,r){return{uploadImage:function(e){var t=i.get("imageUpload"),n=new FormData;return n.append("upload_file",e),r.post(t,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}})}}}]),angular.module("kityminderEditor").service("valueTransfer",function(){return{}}),angular.module("kityminderEditor").filter("commandState",function(){return function(e,t){return e.queryCommandState(t)}}).filter("commandValue",function(){return function(e,t){return e.queryCommandValue(t)}}),angular.module("kityminderEditor").filter("lang",["config","lang.zh-cn",function(r,o){return function(e,t){var n=r.get("defaultLang");if(null==o[n])return"未发现对应语言包,请检查 lang.xxx.service.js!";var i=o[n];return t.split("/").forEach(function(e,t){i=i[e]}),i[e]||null}}]),angular.module("kityminderEditor").controller("hyperlink.ctrl",["$scope","$modalInstance","link",function(t,n,e){t.R_URL=new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),t.url=e.url||"",t.title=e.title||"",setTimeout(function(){var e=$("#link-url");e.focus(),e[0].setSelectionRange(0,t.url.length)},30),t.shortCut=function(e){e.stopPropagation(),13==e.keyCode?t.ok():27==e.keyCode&&t.cancel()},t.ok=function(){if(t.R_URL.test(t.url))n.close({url:t.url,title:t.title});else{t.urlPassed=!1;var e=$("#link-url");e.focus(),e[0].setSelectionRange(0,t.url.length)}editor.receiver.selectAll()},t.cancel=function(){n.dismiss("cancel"),editor.receiver.selectAll()}}]),angular.module("kityminderEditor").controller("imExportNode.ctrl",["$scope","$modalInstance","title","defaultValue","type",function(r,e,t,n,o){r.title=t,r.value=n,r.type=o,r.ok=function(){""!=r.value&&(e.close(r.value),editor.receiver.selectAll())},r.cancel=function(){e.dismiss("cancel"),editor.receiver.selectAll()},setTimeout(function(){$(".single-input").focus(),$(".single-input")[0].setSelectionRange(0,n.length)},30),r.shortCut=function(e){if(e.stopPropagation(),27==e.keyCode&&r.cancel(),8==e.keyCode&&"export"==o&&e.preventDefault(),9==e.keyCode){e.preventDefault();var t=e.target,n=function(e){var t=0;if(document.selection){e.focus();var n=document.selection.createRange();n.moveStart("character",-e.value.length),t=n.text.length}else(e.selectionStart||"0"==e.selectionStart)&&(t=e.selectionStart);return t}(t),i=t.value;t.value=i.substr(0,n)+"\t"+i.substr(n),function(e,t){if(e.setSelectionRange)e.focus(),e.setSelectionRange(t,t);else if(e.createTextRange){var n=e.createTextRange();n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",t),n.select()}}(t,n+1)}}}]),angular.module("kityminderEditor").controller("image.ctrl",["$http","$scope","$modalInstance","image","server",function(i,r,t,e,n){r.data={list:[],url:e.url||"",title:e.title||"",R_URL:/^https?\:\/\/\w+/},setTimeout(function(){var e=$("#image-url");e.focus(),e[0].setSelectionRange(0,r.data.url.length)},300),r.searchImage=function(){var e,t,n;r.list=[],(e=r.data.searchKeyword2,t=new Date,n="http://image.baidu.com/search/acjson?tn=resultjson_com&ipn=rj&ct=201326592&fp=result&queryWord="+e+"&cl=2&lm=-1&ie=utf-8&oe=utf-8&st=-1&ic=0&word="+e+"&face=0&istype=2&nc=1&pn=60&rn=60&gsm=3c&"+t.getTime()+"=&callback=JSON_CALLBACK",i.jsonp(n)).success(function(e){if(e&&e.data)for(var t=0;t>1;e.push("M",t,n+o,"a",o,o,0,1,1,0,.01,"z")};default:return function(e,t,n,i,r){e.push("M",t,n,"h",i,"v",r,"h",-i,"z")}}}function m(){var e=minder.getRenderContainer().getBoundaryBox();s=e;r.setViewBox(e.x-30-.5,e.y-30-.5,e.width+60+1,e.height+60+1);var n=[],i=[];minder.getRoot().traverse(function(e){var t=e.getLayoutBox();d(n,t.x,t.y,t.width,t.height),e.getConnection()&&e.parent&&e.parent.isExpanded()&&i.push(e.getConnection().getPathData())}),r.setStyle("background",minder.getStyle("background")),n.length?o.fill(minder.getStyle("root-background")).setPathData(n):o.setPathData(null),i.length?a.stroke(minder.getStyle("connect-color"),"0.5%").setPathData(i):a.setPathData(null),p()}function p(){c=minder.getViewDragger().getView(),l.setBox(c.intersect(s))}minder.on("themechange",function(e){d=u(e.theme)}),function(){function t(e,t){var n=c;e.x=-e.x,e.y=-e.y;var i=minder.getPaper().getViewPortMatrix();n=i.transformBox(n);var r=e.offset(n.width/2,n.height/2);minder.getViewDragger().moveTo(r,t)}var n=!1;r.on("mousedown",function(e){n=!0,t(e.getPosition("top"),200),i.addClass("grab")}),r.on("mousemove",function(e){n&&t(e.getPosition("top"))}),$(window).on("mouseup",function(){n=!1,i.removeClass("grab")})}()}}}]),angular.module("kityminderEditor").directive("noteBtn",["valueTransfer",function(t){return{restrict:"E",templateUrl:"ui/directive/noteBtn/noteBtn.html",scope:{minder:"="},replace:!0,link:function(e){e.minder;e.addNote=function(){t.noteEditorOpen=!0}}}}]),angular.module("kityminderEditor").directive("noteEditor",["valueTransfer",function(a){return{restrict:"A",templateUrl:"ui/directive/noteEditor/noteEditor.html",scope:{minder:"="},replace:!0,controller:["$scope",function(n){var i,r=n.minder,o=!1;n.codemirrorLoaded=function(e){i=n.cmEditor=e,e.setSize("100%","100%")},n.$watch("noteContent",function(e){var t=-1!=r.queryCommandState("note");e&&t&&!o&&r.execCommand("note",e),setTimeout(function(){i.refresh()})});n.$watch(function(){return a.noteEditorOpen},function(e,t){e&&setTimeout(function(){i.refresh(),i.focus()}),n.noteEditorOpen=a.noteEditorOpen},!0),n.closeNoteEditor=function(){a.noteEditorOpen=!1,editor.receiver.selectAll()},r.on("interactchange",function(){var e=n.noteEnabled=-1!=r.queryCommandState("note"),t=r.queryCommandValue("note")||"";e&&(n.noteContent=t),o=!0,n.$apply(),o=!1})}]}}]),angular.module("kityminderEditor").directive("notePreviewer",["$sce","valueTransfer",function(v,e){return{restrict:"A",templateUrl:"ui/directive/notePreviewer/notePreviewer.html",link:function(m,e){var t,n=m.minder,p=e.parent(),g=e.children();m.showNotePreviewer=!1,marked.setOptions({gfm:!0,tables:!0,breaks:!0,pedantic:!1,sanitize:!0,smartLists:!0,smartypants:!1}),n.on("shownoterequest",function(e){t=setTimeout(function(){!function(e,t){var n=e.getRenderer("NoteIconRenderer").getRenderShape().getRenderBox("screen"),i=e.getData("note");g[0].scrollTop=0;var r=marked(i);t&&(r=r.replace(new RegExp("("+t+")","ig"),'$1'));m.noteContent=v.trustAsHtml(r),m.$apply();var o=$(p[0]).width(),a=$(p[0]).height(),l=$(g).outerWidth(),s=$(g).outerHeight(),c=n.cx-l/2-p[0].offsetLeft,d=n.bottom+10-p[0].offsetTop;c<0&&(c=10);o