"use strict";var t=require("obsidian");function e(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))}function i(t,e){const i=Object.keys(e).map((i=>function(t,e,i){const n=t[e],s=t.hasOwnProperty(e);let r=i(n);n&&Object.setPrototypeOf(r,n);return Object.setPrototypeOf(o,r),t[e]=o,a;function o(...i){return r===n&&t[e]===o&&a(),r.apply(this,i)}function a(){t[e]===o&&(s?t[e]=n:delete t[e]),r!==n&&(r=n,Object.setPrototypeOf(o,n||Function))}}(t,i,e[i])));return 1===i.length?i[0]:function(){i.forEach((t=>t()))}}"function"==typeof SuppressedError&&SuppressedError;var n={"Open as mindmap board":"Open as mindmap","Create new mindmap":"Create new mindmap","New mindmap board":"New mindmap board","Untitled mindmap":"Untitled mindmap","Open as markdown":"Open as markdown","Sub title":"Sub title","Export to opml":"Export to opml","Export to image":"Export to image","Canvas size":"Canvas size","Canvas size desc":"Width and height of the canvas","Canvas background":"Canvas background","Canvas background desc":"Background color of canvas","Max level of node to markdown head":"Max level of node to create a Heading","Max level of node to markdown head desc":"Specify which Node Level creates a seperate Heading instead of a List-Item","Font size":"Font Size","Font size desc":"Specify the Font Size","Mind map layout direct":"Mindmap Layout","Mind map layout direct desc":"Specify the direction the nodes are placed in your Mindmap",Right:"Right",Left:"Left",Centered:"Centered","Open PDF File":"Open PDF file...","Save Image error,Please try again":"Save image error,please try again","Creating Rect Annotate":"Creating rect annotate...","Cancel Create Rect Annotate":"Cancel create rect annotate","File Is Not Exist":"File is not exist","Open File Error":"Open file error","PDF Cannot Open More Instances":"PDF reader cannot open more instances","Create Rect Annotate":"Created rect annotate","Stroke Array":"Stroke Color","Stroke Array Desc":"Node link color base on this value or random color","PDFJs Plugin Path":"PDF reader path","PDFJs Plugin Path Desc":"If you want to use PDF annotation,You need download pdf js plugin and set up this value","Andriod pdfjs Plugin Path":"Andriod pdf reader path","Ios pdfjs Plugin Path":"Ios pdf reader path","Mac pdfjs Plugin Path":"Mac pdfjs Plugin Path","PDF Path":"PDF store path","PDF Annotate Path":"PDF annotate store path","PDF Image Path":"Image store path of PDF rect annotate","Miss PDF Reader Path":"Miss PDF plugin path,you need download Pdf js plugin,and set up value of PDF reader path","Please Use Rich Mode":"Please change yaml mindmap-plugin basic to rich","The probation period has ended":"The probation period has ended or active code has expired",Rect:"Rect",Circle:"Circle",Pointer:"Pointer","Show MindMap":"Show mind map","Hide MindMap":"Hide mind map","Open Protocol":"Support protocol","Open Protocol Desc":"Support protocol like 'obsidian://{protocol name}' for function of jump to pdf annotate",Protocol:"Protocol","Protocol Desc":"Protocol name",Open:"Open",Close:"Close","Open as outline":"Open as outline","Show Annotate":"Show annotate","Annotation save type":"PDF annotation save type","Annotation save type desc":"The type of save pdf annotation,there are two file types:`annos` and `md`,`annos` as default,`annos` is `json` file in fact ","Export annotate pdf":"Export annotate pdf","Export annotate pdf tip":"This is a time-consuming operation. Please wait patiently","Export annotate pdf success":"Export pdf success","Export annotate pdf error":"Export pdf error","Active Code":"Active code","Active Code Desc":"You can active markmind by use this value. Web site:","Active error":"Active code error","Active success":"Active success","Annotate PDF":"Annotate PDF","Annotate EPUB":"Annotate EPUB","PDF Viewer Theme":"PDF viewer theme","PDF Viewer Theme desc":"Theme of pdf viewer","Copy as markdown":"Copy as markdown","Copy node text":"Copy node text only","Copy node link":"Copy node link","Export as opml":"Export as opml","Mobile app not support":"File not support mobile app","Not support file type":"The file type is not support,please open pdf file","Not find md file":"This pdf has not annotations in valut","Please select another node":"Please select another node","Change layout to mindmap":"Change layout to mindmap","Change layout to right":"Change layout to right","Change layout to left":"Change layout to left","Change layout to tree":"Change layout to tree","Copy mindmap node":"Copy selected node","Paste to node":"Paste to node","Toggle mardkown/mindmap":"Toggle markdown/mindmap mode","Copy node id":"Copy node ID","Mobile Active Code":"Mobile active code","Mobile Active Code Desc":"You can active mobile markmind by use value , it will create if you input active code","Mindmap mode":"Mindmap mode","Mindmap mode desc":"When create mindmap , it will create mode of this value , `basic` mode as default","Pdf screen short":"Folder to save image","Pdf screen short desc":"Save image to this folder when use pdf rect annotate","Set mindmap to center":"Set mindmap to center",save:"Save",cancel:"Cancel","Remove annotate space":"Remove space of pdf annotate","Remove annotate space desc":"In environment of chinese , open this and it will remove spaces between text automatic","Get path of vault":"Get base path of vault","Smooth movement":"Support smooth movement of mindmap nodes","Smooth movement desc":"Smooth movement of mindmap nodes","Support code block":"Support parse code block of mindmap","Support code block desc":"Support parse code block of mindmap in markdown file",toPng:"Export to PNG","Set pdf js path":"Set up pdf js plugin path","Please open a mind map":"Please open a mind map and try this command again","Set up pdf js path success":"Success,please restart obsidian","Create new outline":"Create new outline","Copy node":"Copy","Paste node":"Paste","Fill color":"Fill color","Stroke color":"Stroke color","Text color":"Text color","Text align":"Text align","Stroke width":"Stroke width","Stroke style":"Stroke style",nodeColor:"Setup board color",nodeColorDesc:"Use this to setup node background/stroke/font color","Export to html":"Export to html","Change layout to fishLeft":"Change layout to left fish","Change layout to fishRight":"Change layout to right fish","Open as table":"Open as table","get table html":"Get html code of table","get table markdown":"Get markdown of table","Get pdf annotations":"Import pdf highlight annotations","extract highlight success":"Import pdf highlight success","Change basic mode to rich mode":"Change basic mode to rich mode","Change rich mode to basic mode":"Change rich mode to basic mode","Export pdf annotations":"Export pdf annotations","Format of pdf highlight":"Format of pdf highlight","Format of pdf highlight desc":"When export pdf highights , it will generate file in this format","Use new version of pdfjs":"Toggle to new version of pdfjs","Use old version of pdfjs":"Toggle to old version of pdfjs",searchResult:"Find {{nodeNumber}} nodes contains this word","Toggle search box":"Toggle search box","Fine tune height of annotate":"Fine tune height of annotate","Fine tune height of annotate desc":"Fine tune height of annotate , adjust upward (px)","Fine tune height of annotate desc one":"Fine tune height of annotate , adjust downward (px)","Create hand drawn mindmap":"Create hand drawn mindmap from basic mode","Decode URI pdf link":"Open decode PDF link","Decode URI pdf link desc":"If your `annotate-target` is encode by `encodeURI` , you can open this","Expand to first node level":"Expand to first node level","Expand to second node level":"Expand to second node level","Expand to third node level":"Expand to third node level","Expand to all node level":"Expand to all node level","Expand to fourth node level":"Expand to fourth node level","Expand to fifth node level":"Expand to fifth node level","Auto create node when annotate":"Auto create node when annotate","Auto create node when annotate desc":"Auto create node when create pdf annotate","Add child node":"Add child node","Add brother node":"Add brother node","Edit node":"Edit node","Cancel edit node":"Cancel edit node","Delete node":"Delete node",Undo:"Undo",Redo:"Redo","Use custom short cut":"Use custom short cut","Use custom short cut desc":"You can set up custom short cut of mindmap for add node/delete node/undo/redo/edit node/quit edit node commands in `ctrl + p` board","PDF cache folder":"PDF cache folder","PDF cache folder desc":"When you open pdf in web by use pdf annotator, the pdf will store to this folder","Folder of paste image":"Folder of paste image","Folder of paste image desc":"When paste image , image will store to this folder","Change basic to table mode":"Change basic mindmap to table mode","Change basic to outline mode":"Change basic to outline mode","Saving data":"Saving data ...",Saved:"Saved","Only copy annotate link":"Only copy annotate link","Only copy annotate link desc":"Only copy annotate link when click an pdf annotate","Saving image":"Saving image ...","Auto set node to center when tab node of mindmap":"Auto set node to center when tab node of mindmap","Auto set node to center when tab node of mindmap desc":"Auto set node to center when use up/down/left/right key to tab node of mindmap","Auto open search box":"Auto open mindmap search box","Auto open search box desc":"If obsidian has search text, auto open mindmap search box","Export to pdf":"Export mindmap as a pdf file","Please do this in a separate window":"Please export mindmap to pdf in a independ window","PDF save success":"Save pdf success","Add collapse node mark":"Auto add collapse node ID of basic mode","Add collapse node mark desc":"When save mindmap of basic mode , auto add collapsed node ID in the end of node text","Change theme":"Open change theme box","Close change theme":"Close change theme box","Can not change layout":" Can not change node layout to table because the child of this node have summary, boundary , callout or layout","Only use obsidian folder for pdfjs plugin":"Put pdfjs plugin to .obsidian folder of vault","Only use obsidian folder for pdfjs plugin desc":"Put pdfjs plugin to .obsidian folder of vault in android or ios system","Generate mind maps by chatGTP":"Generate mind maps by chatGTP (outline)","Get inspiration":"Get inspiration by chatGTP",ChatGTPError:"Get text error from chatGTP,please try again",ChatGTPLoading:"AI is getting data , please wait a minute...","ChatGTP appkey":"Please input apikey of chatGPT","ChatGTP appkey desc":"Please input apikey of chatGPT","ChatGTP model":"ChatGPT model","ChatGTP model desc":"Please select chatGPT model",ProxyServer:"Please input proxy server","ProxyServer desc":"If you can not access website of openai api, you can use a proxy server","Generate mind maps by Q&A of chatGTP":"Generate mind maps by chatGPT (Q&A)","Annotate template":"Annotate template","Annotate template desc":"When click annotate, it will generate text according to this template to copy to clipboard","Support translate":"Support for word translation of pdf annotate","Support translate desc":"When make annotate of pdf, support word translation","Google translate":"Google tranlate","Google translate desc":"Google tranlate","Baidu translate":"Baidu translate","Baidu translate desc":"Baidu translate","Youdao translate":"Youdao translate","Youdao translate desc":"Youdao translate","Translate appid":"Translate appId or token","Translate appid desc":"AppId or token of translate","Translate secret":"Translate secret","Translate secret desc":"Secret of translate, if you use token, the value may be empty","Not have translations of pdf full text":"No full-text translation files available","Translate spend time":"Translating, please be patient and wait...","Translate success":"Translation successful","Parsing PDF structure":"Parsing PDF structuring...","Parsing PDF structure error":"Parsing PDF structure error","Full text translate":"Full text translation","Pdf in vault":"Currently only support PDF in vault","Completed translation":"Completed translation: ","Translation engine":"Translation engine",baidu:"baidu","Copy full text translations":"Copy full text translations to clipboard","Mindmap is in read":"Mind map in read-only mode","Export to pdf (old version)":"Export mindmap to pdf (v0.15.9)","Scale speed of mobile version":"Scale speed of mobile version","Scale speed of mobile version desc":"Scale speed of mobile version","Cover node":"Cover node text","Cancel cover node":"Cancel cover node text","Export to xmind zen":"Export mindmap to xmind zen file","Export xmind success":"Export to xmind zen file success","Auto adapt screen":"Adapt screen","Start marker":"Start marker","End marker":"End marker",None:"none","Support PDF annotation":"Support pdf annotation","Support PDF annotation desc":"The PDF annotation function can only be supported up to Obsidian version 1.4, and cannot be supported after version 1.5"};const s={ar:{},cs:{},da:{},de:{"Open as mindmap board":"Öffne als Mindmap","Create new mindmap":"Erstelle neue Mindmap","New mindmap board":"Neue Mindmap","Untitled mindmap":"Unbenannte Mindmap","Open as markdown":"Öffne als Markdown","Sub title":"Untertitel","Export to opml":"Exportiere als opml","Export to image":"Exportiere als Bild","Canvas size":"Leinwandgröße","Canvas size desc":"Breite und Höhe der Leinwand","Canvas background":"Leinwand Hintergrund","Canvas background desc":"Hintergrundfarbe der Leinwand","Max level of node to markdown head":"Maximale Knotenebene welche eine Überschrift erstellt","Max level of node to markdown head desc":"Angeben, welche Knotenebene eine separate Überschrift anstelle eines Listenelements erstellt.","Font size":"Schriftgröße","Font size desc":"Gebe die Schriftgröße ans","Mind map layout direct":"Mindmap Layout","Mind map layout direct desc":"Geben Sie die Richtung an, in der die Knoten in Ihrer Mindmap platziert werden.",Right:"Rechts",Left:"Links",Centered:"Zentriert"},en:n,"en-gb":{},es:{},fr:{},hi:{},id:{},it:{},ja:{},ko:{},nl:{},nn:{},pl:{},pt:{},"pt-br":{},ro:{},ru:{},tr:{},"zh-cn":{"Open as mindmap board":"打开为思维导图","Create new mindmap":"创建新思维导图","New mindmap board":"新建思维导图","Untitled mindmap":"未命名思维导图","Open as markdown":"打开为 Markdown 文件","Sub title":"新节点","Export to opml":"导出至OPML","Export to image":"导出至图片","Canvas size":"画布尺寸","Canvas size desc":"绘制思维导图画布的宽度和高度","Canvas background":"背景颜色","Canvas background desc":"画布的背景颜色","Max level of node to markdown head":"节点文字转为markdown标题的最大层级","Max level of node to markdown head desc":"将小于该层级的节点文字转为markdown标题,最大层级为6,因为HTML标题支持最大为6级","Font size":"文字大小","Font size desc":"思维导图文字默认大小,单位px","Mind map layout direct":"思维导图布局方向","Mind map layout direct desc":"思维导图的布局方向,分为向两侧发散、仅右侧、仅左侧三个方向","Expand node":"展开节点","Collapse node":"收缩节点","Only show this node":"仅显示该节点","Expand all node":"展开所有节点","Collapse all node":"收缩所有节点","Add relate link":"添加联系线","Remove relate link":"删除联系线","Add summary node":"添加归纳","Remove summary node":"删除归纳","Remove node":"删除节点","Only remove this node":"仅删除该节点","Open PDF File":"正在打开PDF文件...","Save Image error,Please try again":"保存图片失败,请重试","Creating Rect Annotate":"正在创建矩形标注","Cancel Create Rect Annotate":"取消创建矩形标注","File Is Not Exist":"文件不存在","Open File Error":"打开文件失败","PDF Cannot Open More Instances":"不支持多开PDF阅读器","Create Rect Annotate":"创建矩形标注成功","Stroke Array":"颜色组","Stroke Array Desc":"节点连线颜色将按照颜色组生成,否则生成随机颜色","PDFJs Plugin Path":"PDFJs 插件路径","Andriod pdfjs Plugin Path":"安卓 PDFJs 插件路径","Ios pdfjs Plugin Path":"IOS PDFJs 插件路径","Mac pdfjs Plugin Path":"Mac PDFJs 插件路径","PDFJs Plugin Path Desc":"如果您要使用PDF标注功能,您需要下载PDFJS插件,并设置插件路径","PDF Path":"PDF 存储路径","PDF Annotate Path":"PDF 标注存储路径","PDF Image Path":"PDF 矩形标注生成的图片存储路径","Miss PDF Reader Path":"缺少PDF插件,您需要下载PDFJS插件,并在设置中设置PDF插件路径(绝对路径)","Please Use Rich Mode":"目前处于Basic模式或者未激活,无法使用PDF标注功能,请使用Rich模式或者激活软件","The probation period has ended":"免费版本或者激活码已过期,请至markmind.net购买激活码以激活应用",Rect:"矩形",Circle:"圆",Pointer:"点","Show MindMap":"显示思维导图","Hide MindMap":"隐藏思维导图","Open Protocol":"开启协议支持","Open Protocol Desc":"支持类似 obsidian://{Protocol name} 的协议,用于跳转至PDF标注",Protocol:"协议名","Protocol Desc":"协议名称",Open:"开启",Close:"关闭","Open as outline":"打开为大纲","Show Annotate":"展示标注","Annotation save type":"标注保存类型","Annotation save type desc":"当保存PDF标注时保存的文件类型,目前分为保存为annos和markdown两种,默认扩展名为annos(本质是json文件)","Export annotate pdf":"导出标注后的PDF文件","Export annotate pdf tip":"这是一个费时的操作,请耐心等待...","Export annotate pdf success":"导出PDF文件成功","Export annotate pdf error":"导出PDF文件失败","Active Code":"激活码","Active Code Desc":"可以使用该值激活markmind,网站:","Active error":"激活失败,请检查激活码","Active success":"已激活","Annotate PDF":"打开注释PDF","Annotate EPUB":"打开注释EPUB","PDF Viewer Theme":"PDF阅读器主题","PDF Viewer Theme desc":"切换PDF阅读器主题皮肤","Copy as markdown":"复制为markdown","Copy node text":"仅复制该节点文本","Copy node link":"复制节点引用链接","Export as opml":"导出为OPML","Mobile app not support":"移动端不支持打开本地PDF文件","Not support file type":"不支持注释该文件类型,只支持pdf文件","Not find md file":"这是一个外部pdf文件,在文件夹中尚不存在批注信息","Please select another node":"请选择另一个节点","Change layout to mindmap":"切换思维导图布局为默认","Change layout to right":"切换思维导图布局为右侧","Change layout to left":"切换思维导图布局为左侧","Change layout to tree":"切换思维导图布局为树向下布局","Copy mindmap node":"复制节点","Paste to node":"粘贴节点","Toggle mardkown/mindmap":"切换为Markdown或思维导图模式","Copy node id":"获取节点ID","Mobile Active Code":"移动端激活码","Mobile Active Code Desc":"用于激活移动端,当你填入激活码时,该值将自动生成","Mindmap mode":"思维导图模式","Mindmap mode desc":"当创建思维导图时,将按照该值创建思维导图的模式,默认是basic模式","Pdf screen short":"PDF 截图文件夹","Pdf screen short desc":"用于保存PDF矩形标注所截的图片","Set mindmap to center":"居中思维导图",save:"保存",cancel:"取消","Remove annotate space":"自动移除标注文字中的空格","Remove annotate space desc":"在中文环境下,某些pdf文字标注时,文字之间存在空格,可以开启该选项,将自动移除文字之间的空格","Get path of vault":"获取库的基础路径","Smooth movement":"开启支持思维导图节点支持平滑过渡效果","Smooth movement desc":"当点击引用节点时,节点跳转到同一思维导图的其他节点时的过渡效果","Support code block":"开启支持图文混排","Support code block desc":"支持在markdown文档中图文混排效果",toPng:"导出为PNG图片","Set pdf js path":"设置 pdfjs 插件路径","Please open a mind map":"请打开一个思维导图并重新执行此命令","Set up pdf js path success":"设置 pdfjs 插件路径成功,请重新启动 obsidian","Create new outline":"创建大纲","Copy node":"复制","Paste node":"粘贴","Fill color":"背景颜色","Stroke color":"外框颜色","Text color":"文字颜色","Text align":"对齐方式","Stroke width":"外框粗细","Stroke style":"外框样式",nodeColor:"节点设置面板颜色组",nodeColorDesc:"用于改变节点设置面板颜色组","Export to html":"导出思维导图为html文件","Change layout to fishLeft":"切换思维导图布局为左侧鱼骨图","Change layout to fishRight":"切换思维导图布局为右侧鱼骨图","Open as table":"打开为表格","get table html":"获取表格的HTML源码","get table markdown":"获取表格的 markdown 文本","Get pdf annotations":"导入PDF高亮标注","extract highlight success":"导入PDF高亮成功","Change basic mode to rich mode":"将 basic 模式转为 rich 模式","Change rich mode to basic mode":"将 rich 模式转为 basic 模式","Export pdf annotations":"导出 PDF 注释","Format of pdf highlight":"PDF 注释格式设置","Format of pdf highlight desc":"当导出 PDF 注释时,将按照该格式生成文件","Use new version of pdfjs":"切换至新版 pdfjs 插件","Use old version of pdfjs":"切换至旧版 pdfjs 插件",searchResult:"发现到 {{nodeNumber}} 个节点包含该关键字","Toggle search box":"打开或关闭搜索框","Fine tune height of annotate":"微调 PDF 标注高度","Fine tune height of annotate desc":"向上调整的距离 (px)","Fine tune height of annotate desc one":"向下调整的距离 (px)","Create hand drawn mindmap":"生成手绘模式的思维导图","Decode URI pdf link":"是否打开解码PDF链接","Decode URI pdf link desc":"如果你的 `annotate-target`被 `encodeURI`编码 , 可以打开该选项","Expand to first node level":"展开至第一级节点","Expand to second node level":"展开至第二级节点","Expand to third node level":"展开至第三级节点","Expand to all node level":"展开所有节点","Expand to fourth node level":"展开至第四级节点","Expand to fifth node level":"展开至第五级节点","Auto create node when annotate":"标注时自动生成思维导图节点","Auto create node when annotate desc":"当创建 pdf 标注时自动是否自动创建思维导图节点","Add child node":"添加子节点","Add brother node":"添加兄弟节点","Edit node":"编辑节点","Cancel edit node":"退出编辑节点","Delete node":"删除节点",Undo:"撤销",Redo:"恢复","Use custom short cut":"开启自定义快捷键","Use custom short cut desc":"支持思维导图设置自定义快捷键,目前支持如下命令(在 Ctrl + P 面板里):添加节点、删除节点、编辑节点、取消编辑节点、撤销、恢复","PDF cache folder":"PDF 缓存目录","PDF cache folder desc":"当使用 PDF 标注工具打开在线 PDF 时,该 PDF 将自动缓存至该文件夹中,下次打开时将优先从该目录中读取数据","Folder of paste image":"粘贴图片文件夹","Folder of paste image desc":"设置文件夹路径,指向库中的某一文件夹,粘贴的图片将存入该文件夹中","Change basic to table mode":"打开 Basic 模式的思维导图为表格","Change basic to outline mode":"打开 Basic 模式为大纲","Saving data":"正在保存 ...",Saved:"已保存","Only copy annotate link":"开启支持只复制标注链接","Only copy annotate link desc":"当点击一个 PDF 标注时,只会复制链接","Saving image":"正在保存图片...","Auto set node to center when tab node of mindmap":"切换思维导图时自动居中节点","Auto set node to center when tab node of mindmap desc":"当使用上、下、左、右键切换节点时,自动居中节点","Auto open search box":"自动打开思维导图搜索框","Auto open search box desc":"当 obsidian 搜索中存在搜索条件,打开思维导图时自动打开搜索框,并触发思维导图搜索","Export to pdf":"导出思维导图为 PDF 文件","Please do this in a separate window":"请在独立窗口进行此操作,无法在主窗口执行","PDF save success":"PDF 保存成功","Add collapse node mark":"Basic 模式下自动添加折叠节点标记","Add collapse node mark desc":"Basic 模式下,保存思维导图时,自动在折叠的节点最后加入ID,用于下次打开可以恢复折叠原状","Change theme":"打开主题切换框","Close change theme":"关闭主题切换框","Can not change layout":"由于该节点的子节点存在归纳、外框、标注或者布局,所以无法转换为表格布局,防止数据丢失","Only use obsidian folder for pdfjs plugin":"支持 pdfjs 插件放在.obsidian 文件夹","Only use obsidian folder for pdfjs plugin desc":"在安卓或者ios系统支持将 pdfjs 插件放在库内的 .obsidian 文件夹","Generate mind maps by chatGTP":"智能生成思维导图(AI 大纲)","Get inspiration":"获取灵感(AI)",ChatGTPError:"AI 获取文本失败,请检查网络,重新尝试!",ChatGTPLoading:"AI 正在获取数据,请稍等...","ChatGTP appkey":"请输入 ChatGPT 的 apikey","ChatGTP appkey desc":"如果您没有这个Apikey 请至 ChatGPT 官网申请","ChatGTP model":"ChatGPT 模型","ChatGTP model desc":"请选择 chatGPT 模型",ProxyServer:"网络代理","ProxyServer desc":"如果无法直接访问 OpenAI 的 api,可以使用网络代理","Generate mind maps by Q&A of chatGTP":"智能生成思维导图(AI 问答)","Annotate template":"标注格式","Annotate template desc":"当标注自动生成节点或者点击标注时,将以此格式生成标注,并复制到粘贴板","Support translate":"支持标注划词翻译","Support translate desc":"当做 pdf 标注时,划词时自动翻译","Google translate":"谷歌翻译","Google translate desc":"谷歌翻译设置","Baidu translate":"百度翻译","Baidu translate desc":"百度翻译设置","Youdao translate":"有道翻译","Youdao translate desc":"有道翻译设置","Translate appid":"翻译 Appid 或者 token","Translate appid desc":"请输入翻译的 AppId 或者 token","Translate secret":"翻译秘钥 secret","Translate secret desc":"请输入翻译秘钥 secret, 如果您是使用 token 之类的请求api,则该值可能不需要填写","Not have translations of pdf full text":"没有全文翻译文件,请重新翻译 PDF","Translate spend time":"正在翻译中,请等待,总共 (条数): ","Translate success":"翻译完成","Parsing PDF structure":"正在解析 PDF 结构...","Parsing PDF structure error":"解析 PDF 出错","Full text translate":"全文翻译","Pdf in vault":"全文翻译暂时只支持库内的 pdf","Completed translation":"翻译已完成: ","Translation engine":"翻译引擎",baidu:"百度","Copy full text translations":"复制全文翻译到剪贴板","Mindmap is in read":"导图处于只读模式","Export to pdf (old version)":"导出导图为 PDF (v0.15.9)","Scale speed of mobile version":"移动端缩放速率","Scale speed of mobile version desc":"可以调整该值,使得移动端双指放大或者缩小变换流畅","Cover node":"遮挡节点文字","Cancel cover node":"取消遮挡节点文字","Export to xmind zen":"导出导图为 xmind zen 文件","Export xmind success":"导出 xmind zen 文件成功","Auto adapt screen":"自适应屏幕","Start marker":"开始标志","End marker":"结束标志",None:"无","Support PDF annotation":"是否支持 PDF 标注功能","Support PDF annotation desc":"PDF 标注功能只能支持到 obsidian 1.4 版本,1.5 版本后无法支持"},"zh-tw":{}}[t.moment.locale()];function r(e){return s||console.error("Error: mindmap locale not found",t.moment.locale()),s&&s[e]||n[e]}const o=/^(---)$.+?^(---)$.+?/ims,a="mindmap-plugin",h=["---","",`${a}: basic`,"","---","",""].join("\n"),l=["---","",`${a}: rich`,"","---","",""].join("\n"),d=["---","",`${a}: basic`,"display-mode: outline","","---","",""].join("\n");function c(t,i,n,s,r,a,h,l,d,c){var u,p;return e(this,void 0,void 0,(function*(){var e=yield i.vault.adapter.read(n.path),d=s.querySelector(".markdown-embed");if(d){if(e=e.trim().replace(o,"")){const{root:t}=Bs.transform(e);(m=Is(t)).isRoot=!0}else var m={id:Cs(),text:"Basic root",isRoot:!0,main:!0};var f=document.createElement("div");f.classList.add("mm-mindmap-container"),f.style.visibility="hidden",null===(u=s.querySelector(".markdown-embed-content"))||void 0===u||(u.style.display="none"),null===(p=s.querySelector(".markdown-embed-link"))||void 0===p||(p.style.zIndex="20"),d.appendChild(f),m.useScale=!1;var g=new _i(m,f,h,!1);if(g.path=n.path,g._mode="basic",g.colors=a,g.parent=r,g._plugin=t,c?g.initTable(m):(g.init(),g.refresh()),!r)s.findAll(".internal-embed").forEach((t=>{const e=t.getAttribute("src"),s="string"==typeof e&&i.metadataCache.getFirstLinkpathDest(e,n.path);if(s&&"md"!==s.extension&&g){t.innerText="";var r=i.vault.getResourcePath(s);t.createEl("img",{attr:{src:r}},(e=>{t.hasAttribute("width")&&e.setAttribute("width",t.getAttribute("width")),t.hasAttribute("alt")&&e.setAttribute("alt",t.getAttribute("alt"))})),t.addClasses(["image-embed","is-loaded"])}})),s.querySelectorAll("img").forEach((t=>{t.onload=()=>{var e,i=null===(e=t.closest(".mm-node"))||void 0===e?void 0:e.getAttribute("data-id");if(i){var n=g.getNodeById(i);null==n||n.clearCacheData(),null==n||n.refreshBox(),g.timeOut&&clearTimeout(g.timeOut),g.timeOut=setTimeout((()=>{g.refresh()}),300)}},t.setAttribute("draggble","false")}));setTimeout((()=>{r||(g.refresh(),g.toDiv(!0),f.style.visibility="visible",g.center(),g.root.unSelect()),l&&l(g)}),900)}}))}function u(t,i,n,s,r,o,a,h,l){var d,c;return e(this,void 0,void 0,(function*(){var e=yield i.vault.adapter.read(n.path);if(p=s.querySelector(".markdown-embed")){var l=e.match(/^(\`\`\` json)$.+?^(\`\`\`)$.+?/ims);if(l&&l.length>0)var u=l[0].substring(8,l[0].length-4).trim();else u=JSON.stringify({mindData:[[{id:Cs(),text:"Root",isRoot:!0,main:!0,x:4e3,y:4e3,isExpand:!0,layout:{layoutName:"mindmap2",direct:"mindmap"}}]]});var p,m=document.createElement("div");if(m.classList.add("mm-mindmap-container"),m.style.visibility="hidden",null===(d=s.querySelector(".markdown-embed-content"))||void 0===d||(d.style.display="none"),null===(c=s.querySelector(".markdown-embed-link"))||void 0===c||(c.style.zIndex="20"),p=s.querySelector(".markdown-embed")){p.appendChild(m);var f=JSON.parse(u);f.useScale=!1;var g=new _i(f,m,a,!1);if(g.path=n.path,g.colors=o,g.parent=r,g._mode="rich",g._plugin=t,g.initRich(f,{}),!r)s.findAll(".internal-embed").forEach((t=>{const e=t.getAttribute("src"),s="string"==typeof e&&i.metadataCache.getFirstLinkpathDest(e,n.path);if(s&&"md"!==s.extension&&g){t.innerText="";var r=i.vault.getResourcePath(s);t.createEl("img",{attr:{src:r}},(e=>{t.hasAttribute("width")&&e.setAttribute("width",t.getAttribute("width")),t.hasAttribute("alt")&&e.setAttribute("alt",t.getAttribute("alt"))})),t.addClasses(["image-embed","is-loaded"])}})),s.querySelectorAll("img").forEach((t=>{t.onload=()=>{var e,i=null===(e=t.closest(".mm-node"))||void 0===e?void 0:e.getAttribute("data-id");if(i){var n=g.getNodeById(i);n&&(n.clearCacheData(),n.refreshBox()),g.timeOut&&clearTimeout(g.timeOut),g.timeOut=setTimeout((()=>{g.refresh()}),300)}},t.setAttribute("draggble","false")}));setTimeout((()=>{r||(g.refresh(),g.toDiv(!0),m.style.visibility="visible",g.center(),g.root.unSelect()),h&&h(g)}),900)}}}))}function p(t,e,i){if(t&&t.length){const[n,s]=e,r=Math.PI/180*i,o=Math.cos(r),a=Math.sin(r);for(const e of t){const[t,i]=e;e[0]=(t-n)*o-(i-s)*a+n,e[1]=(t-n)*a+(i-s)*o+s}}}function m(t,e){return t[0]===e[0]&&t[1]===e[1]}function f(t,e,i,n=1){const s=i,r=Math.max(e,.1),o=t[0]&&t[0][0]&&"number"==typeof t[0][0]?[t]:t,a=[0,0];if(s)for(const t of o)p(t,a,s);const h=function(t,e,i){const n=[];for(const e of t){const t=[...e];m(t[0],t[t.length-1])||t.push([t[0][0],t[0][1]]),t.length>2&&n.push(t)}const s=[];e=Math.max(e,.1);const r=[];for(const t of n)for(let e=0;et.ymine.ymin?1:t.xe.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!r.length)return s;let o=[],a=r[0].ymin,h=0;for(;o.length||r.length;){if(r.length){let t=-1;for(let e=0;ea);e++)t=e;r.splice(0,t+1).forEach((t=>{o.push({s:a,edge:t})}))}if(o=o.filter((t=>!(t.edge.ymax<=a))),o.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),(1!==i||h%e==0)&&o.length>1)for(let t=0;t=o.length)break;const i=o[t].edge,n=o[e].edge;s.push([[Math.round(i.x),a],[Math.round(n.x),a]])}a+=i,o.forEach((t=>{t.edge.x=t.edge.x+i*t.edge.islope})),h++}return s}(o,r,n);if(s){for(const t of o)p(t,a,-s);!function(t,e,i){const n=[];t.forEach((t=>n.push(...t))),p(n,e,i)}(h,a,-s)}return h}function g(t,e){var i;const n=e.hachureAngle+90;let s=e.hachureGap;s<0&&(s=4*e.strokeWidth),s=Math.round(Math.max(s,.1));let r=1;return e.roughness>=1&&((null===(i=e.randomizer)||void 0===i?void 0:i.next())||Math.random())>.7&&(r=s),f(t,s,n,r||1)}class A{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const i=g(t,e);return{type:"fillSketch",ops:this.renderLines(i,e)}}renderLines(t,e){const i=[];for(const n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return i}}function v(t){const e=t[0],i=t[1];return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}class y extends A{fillPolygons(t,e){let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);const n=g(t,Object.assign({},e,{hachureGap:i})),s=Math.PI/180*e.hachureAngle,r=[],o=.5*i*Math.cos(s),a=.5*i*Math.sin(s);for(const[t,e]of n)v([t,e])&&r.push([[t[0]-o,t[1]+a],[...e]],[[t[0]+o,t[1]-a],[...e]]);return{type:"fillSketch",ops:this.renderLines(r,e)}}}class x extends A{fillPolygons(t,e){const i=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),s=this._fillPolygons(t,n);return i.ops=i.ops.concat(s.ops),i}}class b{constructor(t){this.helper=t}fillPolygons(t,e){const i=g(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(i,e)}dotsOnLines(t,e){const i=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let s=e.fillWeight;s<0&&(s=e.strokeWidth/2);const r=n/4;for(const o of t){const t=v(o),a=t/n,h=Math.ceil(a)-1,l=t-h*n,d=(o[0][0]+o[1][0])/2-n/4,c=Math.min(o[0][1],o[1][1]);for(let t=0;t{const r=v(t),o=Math.floor(r/(i+n)),a=(r+n-o*(i+n))/2;let h=t[0],l=t[1];h[0]>l[0]&&(h=t[1],l=t[0]);const d=Math.atan((l[1]-h[1])/(l[0]-h[0]));for(let t=0;t{const s=v(t),r=Math.round(s/(2*e));let o=t[0],a=t[1];o[0]>a[0]&&(o=t[1],a=t[0]);const h=Math.atan((a[1]-o[1])/(a[0]-o[0]));for(let t=0;tn%2?t+i:t+e));r.push({key:"C",data:t}),e=t[4],i=t[5];break}case"Q":r.push({key:"Q",data:[...a]}),e=a[2],i=a[3];break;case"q":{const t=a.map(((t,n)=>n%2?t+i:t+e));r.push({key:"Q",data:t}),e=t[2],i=t[3];break}case"A":r.push({key:"A",data:[...a]}),e=a[5],i=a[6];break;case"a":e+=a[5],i+=a[6],r.push({key:"A",data:[a[0],a[1],a[2],a[3],a[4],e,i]});break;case"H":r.push({key:"H",data:[...a]}),e=a[0];break;case"h":e+=a[0],r.push({key:"H",data:[e]});break;case"V":r.push({key:"V",data:[...a]}),i=a[0];break;case"v":i+=a[0],r.push({key:"V",data:[i]});break;case"S":r.push({key:"S",data:[...a]}),e=a[2],i=a[3];break;case"s":{const t=a.map(((t,n)=>n%2?t+i:t+e));r.push({key:"S",data:t}),e=t[2],i=t[3];break}case"T":r.push({key:"T",data:[...a]}),e=a[0],i=a[1];break;case"t":e+=a[0],i+=a[1],r.push({key:"T",data:[e,i]});break;case"Z":case"z":r.push({key:"Z",data:[]}),e=n,i=s}return r}function Q(t){const e=[];let i="",n=0,s=0,r=0,o=0,a=0,h=0;for(const{key:l,data:d}of t){switch(l){case"M":e.push({key:"M",data:[...d]}),[n,s]=d,[r,o]=d;break;case"C":e.push({key:"C",data:[...d]}),n=d[4],s=d[5],a=d[2],h=d[3];break;case"L":e.push({key:"L",data:[...d]}),[n,s]=d;break;case"H":n=d[0],e.push({key:"L",data:[n,s]});break;case"V":s=d[0],e.push({key:"L",data:[n,s]});break;case"S":{let t=0,r=0;"C"===i||"S"===i?(t=n+(n-a),r=s+(s-h)):(t=n,r=s),e.push({key:"C",data:[t,r,...d]}),a=d[0],h=d[1],n=d[2],s=d[3];break}case"T":{const[t,r]=d;let o=0,l=0;"Q"===i||"T"===i?(o=n+(n-a),l=s+(s-h)):(o=n,l=s);const c=n+2*(o-n)/3,u=s+2*(l-s)/3,p=t+2*(o-t)/3,m=r+2*(l-r)/3;e.push({key:"C",data:[c,u,p,m,t,r]}),a=o,h=l,n=t,s=r;break}case"Q":{const[t,i,r,o]=d,l=n+2*(t-n)/3,c=s+2*(i-s)/3,u=r+2*(t-r)/3,p=o+2*(i-o)/3;e.push({key:"C",data:[l,c,u,p,r,o]}),a=t,h=i,n=r,s=o;break}case"A":{const t=Math.abs(d[0]),i=Math.abs(d[1]),r=d[2],o=d[3],a=d[4],h=d[5],l=d[6];if(0===t||0===i)e.push({key:"C",data:[n,s,h,l,h,l]}),n=h,s=l;else if(n!==h||s!==l){P(n,s,h,l,t,i,r,o,a).forEach((function(t){e.push({key:"C",data:t})})),n=h,s=l}break}case"Z":e.push({key:"Z",data:[]}),n=r,s=o}i=l}return e}function M(t,e,i){return[t*Math.cos(i)-e*Math.sin(i),t*Math.sin(i)+e*Math.cos(i)]}function P(t,e,i,n,s,r,o,a,h,l){const d=(c=o,Math.PI*c/180);var c;let u=[],p=0,m=0,f=0,g=0;if(l)[p,m,f,g]=l;else{[t,e]=M(t,e,-d),[i,n]=M(i,n,-d);const o=(t-i)/2,l=(e-n)/2;let c=o*o/(s*s)+l*l/(r*r);c>1&&(c=Math.sqrt(c),s*=c,r*=c);const u=s*s,A=r*r,v=u*A-u*l*l-A*o*o,y=u*l*l+A*o*o,x=(a===h?-1:1)*Math.sqrt(Math.abs(v/y));f=x*s*l/r+(t+i)/2,g=x*-r*o/s+(e+n)/2,p=Math.asin(parseFloat(((e-g)/r).toFixed(9))),m=Math.asin(parseFloat(((n-g)/r).toFixed(9))),tm&&(p-=2*Math.PI),!h&&m>p&&(m-=2*Math.PI)}let A=m-p;if(Math.abs(A)>120*Math.PI/180){const t=m,e=i,a=n;m=h&&m>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,u=P(i=f+s*Math.cos(m),n=g+r*Math.sin(m),e,a,s,r,o,0,h,[m,t,f,g])}A=m-p;const v=Math.cos(p),y=Math.sin(p),x=Math.cos(m),b=Math.sin(m),w=Math.tan(A/4),C=4/3*s*w,E=4/3*r*w,k=[t,e],I=[t+C*y,e-E*v],B=[i+C*b,n-E*x],D=[i,n];if(I[0]=2*k[0]-I[0],I[1]=2*k[1]-I[1],l)return[I,B,D].concat(u);{u=[I,B,D].concat(u);const t=[];for(let e=0;e2){const s=[];for(let e=0;e2*Math.PI&&(p=0,m=2*Math.PI);const f=2*Math.PI/h.curveStepCount,g=Math.min(f/2,(m-p)/2),A=it(g,l,d,c,u,p,m,1,h);if(!h.disableMultiStroke){const t=it(g,l,d,c,u,p,m,1.5,h);A.push(...t)}return o&&(a?A.push(...Y(l,d,l+c*Math.cos(p),d+u*Math.sin(p),h),...Y(l,d,l+c*Math.cos(m),d+u*Math.sin(m),h)):A.push({op:"lineTo",data:[l,d]},{op:"lineTo",data:[l+c*Math.cos(p),d+u*Math.sin(p)]})),{type:"path",ops:A}}function W(t,e){const i=Q(L(T(t))),n=[];let s=[0,0],r=[0,0];for(const{key:t,data:o}of i)switch(t){case"M":r=[o[0],o[1]],s=[o[0],o[1]];break;case"L":n.push(...Y(r[0],r[1],o[0],o[1],e)),r=[o[0],o[1]];break;case"C":{const[t,i,s,a,h,l]=o;n.push(...nt(t,i,s,a,h,l,r,e)),r=[h,l];break}case"Z":n.push(...Y(r[0],r[1],s[0],s[1],e)),r=[s[0],s[1]]}return{type:"path",ops:n}}function V(t,e){const i=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,s=n.length;if(s>2){i.push({op:"move",data:[n[0][0]+K(t,e),n[0][1]+K(t,e)]});for(let r=1;r500?.4:-.0016668*h+1.233334;let d=s.maxRandomnessOffset||0;d*d*100>a&&(d=h/10);const c=d/2,u=.2+.2*J(s);let p=s.bowing*s.maxRandomnessOffset*(n-e)/200,m=s.bowing*s.maxRandomnessOffset*(t-i)/200;p=K(p,s,l),m=K(m,s,l);const f=[],g=()=>K(c,s,l),A=()=>K(d,s,l),v=s.preserveVertices;return r&&(o?f.push({op:"move",data:[t+(v?0:g()),e+(v?0:g())]}):f.push({op:"move",data:[t+(v?0:K(d,s,l)),e+(v?0:K(d,s,l))]})),o?f.push({op:"bcurveTo",data:[p+t+(i-t)*u+g(),m+e+(n-e)*u+g(),p+t+2*(i-t)*u+g(),m+e+2*(n-e)*u+g(),i+(v?0:g()),n+(v?0:g())]}):f.push({op:"bcurveTo",data:[p+t+(i-t)*u+A(),m+e+(n-e)*u+A(),p+t+2*(i-t)*u+A(),m+e+2*(n-e)*u+A(),i+(v?0:A()),n+(v?0:A())]}),f}function $(t,e,i){if(!t.length)return[];const n=[];n.push([t[0][0]+K(e,i),t[0][1]+K(e,i)]),n.push([t[0][0]+K(e,i),t[0][1]+K(e,i)]);for(let s=1;s3){const r=[],o=1-i.curveTightness;s.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+21&&s.push(i)}else s.push(i);s.push(t[e+3])}else{const n=.5,r=t[e+0],o=t[e+1],a=t[e+2],h=t[e+3],l=ht(r,o,n),d=ht(o,a,n),c=ht(a,h,n),u=ht(l,d,n),p=ht(d,c,n),m=ht(u,p,n);lt([r,l,u,m],0,i,s),lt([m,p,c,h],0,i,s)}var r,o;return s}function dt(t,e){return ct(t,0,t.length,e)}function ct(t,e,i,n,s){const r=s||[],o=t[e],a=t[i-1];let h=0,l=1;for(let n=e+1;nh&&(h=e,l=n)}return Math.sqrt(h)>n?(ct(t,e,l+1,n,r),ct(t,l,i,n,r)):(r.length||r.push(o),r.push(a)),r}function ut(t,e=.15,i){const n=[],s=(t.length-1)/3;for(let i=0;i0?ct(n,0,n.length,i):n}const pt="none";class mt{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,i){return{shape:t,sets:e||[],options:i||this.defaultOptions}}line(t,e,i,n,s){const r=this._o(s);return this._d("line",[R(t,e,i,n,r)],r)}rectangle(t,e,i,n,s){const r=this._o(s),o=[],a=z(t,e,i,n,r);if(r.fill){const s=[[t,e],[t+i,e],[t+i,e+n],[t,e+n]];"solid"===r.fillStyle?o.push(V([s],r)):o.push(X([s],r))}return r.stroke!==pt&&o.push(a),this._d("rectangle",o,r)}ellipse(t,e,i,n,s){const r=this._o(s),o=[],a=j(i,n,r),h=q(t,e,r,a);if(r.fill)if("solid"===r.fillStyle){const i=q(t,e,r,a).opset;i.type="fillPath",o.push(i)}else o.push(X([h.estimatedPoints],r));return r.stroke!==pt&&o.push(h.opset),this._d("ellipse",o,r)}circle(t,e,i,n){const s=this.ellipse(t,e,i,i,n);return s.shape="circle",s}linearPath(t,e){const i=this._o(e);return this._d("linearPath",[F(t,!1,i)],i)}arc(t,e,i,n,s,r,o=!1,a){const h=this._o(a),l=[],d=U(t,e,i,n,s,r,o,!0,h);if(o&&h.fill)if("solid"===h.fillStyle){const o=Object.assign({},h);o.disableMultiStroke=!0;const a=U(t,e,i,n,s,r,!0,!1,o);a.type="fillPath",l.push(a)}else l.push(function(t,e,i,n,s,r,o){const a=t,h=e;let l=Math.abs(i/2),d=Math.abs(n/2);l+=K(.01*l,o),d+=K(.01*d,o);let c=s,u=r;for(;c<0;)c+=2*Math.PI,u+=2*Math.PI;u-c>2*Math.PI&&(c=0,u=2*Math.PI);const p=(u-c)/o.curveStepCount,m=[];for(let t=c;t<=u;t+=p)m.push([a+l*Math.cos(t),h+d*Math.sin(t)]);return m.push([a+l*Math.cos(u),h+d*Math.sin(u)]),m.push([a,h]),X([m],o)}(t,e,i,n,s,r,h));return h.stroke!==pt&&l.push(d),this._d("arc",l,h)}curve(t,e){const i=this._o(e),n=[],s=H(t,i);if(i.fill&&i.fill!==pt)if("solid"===i.fillStyle){const e=H(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else{const e=[],s=t;if(s.length){const t="number"==typeof s[0][0]?[s]:s;for(const n of t)n.length<3?e.push(...n):3===n.length?e.push(...ut(rt([n[0],n[0],n[1],n[2]]),10,(1+i.roughness)/2)):e.push(...ut(rt(n),10,(1+i.roughness)/2))}e.length&&n.push(X([e],i))}return i.stroke!==pt&&n.push(s),this._d("curve",n,i)}polygon(t,e){const i=this._o(e),n=[],s=F(t,!0,i);return i.fill&&("solid"===i.fillStyle?n.push(V([t],i)):n.push(X([t],i))),i.stroke!==pt&&n.push(s),this._d("polygon",n,i)}path(t,e){const i=this._o(e),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const s=i.fill&&"transparent"!==i.fill&&i.fill!==pt,r=i.stroke!==pt,o=!!(i.simplification&&i.simplification<1),a=function(t,e,i){const n=Q(L(T(t))),s=[];let r=[],o=[0,0],a=[];const h=()=>{a.length>=4&&r.push(...ut(a,e)),a=[]},l=()=>{h(),r.length&&(s.push(r),r=[])};for(const{key:t,data:e}of n)switch(t){case"M":l(),o=[e[0],e[1]],r.push(o);break;case"L":h(),r.push([e[0],e[1]]);break;case"C":if(!a.length){const t=r.length?r[r.length-1]:o;a.push([t[0],t[1]])}a.push([e[0],e[1]]),a.push([e[2],e[3]]),a.push([e[4],e[5]]);break;case"Z":h(),r.push([o[0],o[1]])}if(l(),!i)return s;const d=[];for(const t of s){const e=dt(t,i);e.length&&d.push(e)}return d}(t,1,o?4-4*(i.simplification||1):(1+i.roughness)/2),h=W(t,i);if(s)if("solid"===i.fillStyle)if(1===a.length){const e=W(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));n.push({type:"fillPath",ops:this._mergedShape(e.ops)})}else n.push(V(a,i));else n.push(X(a,i));return r&&(o?a.forEach((t=>{n.push(F(t,!1,i))})):n.push(h)),this._d("path",n,i)}opsToPath(t,e){let i="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":i+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":i+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":i+=`L${t[0]} ${t[1]} `}}return i.trim()}toPaths(t){const e=t.sets||[],i=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:pt};break;case"fillPath":e={d:this.opsToPath(t),stroke:pt,strokeWidth:0,fill:i.fill||pt};break;case"fillSketch":e=this.fillSketch(t,i)}e&&n.push(e)}return n}fillSketch(t,e){let i=e.fillWeight;return i<0&&(i=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||pt,strokeWidth:i,fill:pt}}_mergedShape(t){return t.filter(((t,e)=>0===e||"move"!==t.op))}}class ft{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new mt(e)}draw(t){const e=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,s=t.options.fixedDecimalPlaceDigits;for(const r of e)switch(r.type){case"path":n.save(),n.strokeStyle="none"===i.stroke?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,r,s),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,r,s,e),n.restore();break}case"fillSketch":this.fillSketch(n,r,i)}}fillSketch(t,e,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,e,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,i,n="nonzero"){t.beginPath();for(const n of e.ops){const e="number"==typeof i&&i>=0?n.data.map((t=>+t.toFixed(i))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,i,n,s){const r=this.gen.line(t,e,i,n,s);return this.draw(r),r}rectangle(t,e,i,n,s){const r=this.gen.rectangle(t,e,i,n,s);return this.draw(r),r}ellipse(t,e,i,n,s){const r=this.gen.ellipse(t,e,i,n,s);return this.draw(r),r}circle(t,e,i,n){const s=this.gen.circle(t,e,i,n);return this.draw(s),s}linearPath(t,e){const i=this.gen.linearPath(t,e);return this.draw(i),i}polygon(t,e){const i=this.gen.polygon(t,e);return this.draw(i),i}arc(t,e,i,n,s,r,o=!1,a){const h=this.gen.arc(t,e,i,n,s,r,o,a);return this.draw(h),h}curve(t,e){const i=this.gen.curve(t,e);return this.draw(i),i}path(t,e){const i=this.gen.path(t,e);return this.draw(i),i}}const gt="http://www.w3.org/2000/svg";class At{constructor(t,e){this.svg=t,this.gen=new mt(e)}draw(t){const e=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.svg.ownerDocument||window.document,s=n.createElementNS(gt,"g"),r=t.options.fixedDecimalPlaceDigits;for(const o of e){let e=null;switch(o.type){case"path":e=n.createElementNS(gt,"path"),e.setAttribute("d",this.opsToPath(o,r)),e.setAttribute("stroke",i.stroke),e.setAttribute("stroke-width",i.strokeWidth+""),e.setAttribute("fill","none"),i.strokeLineDash&&e.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&e.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":e=n.createElementNS(gt,"path"),e.setAttribute("d",this.opsToPath(o,r)),e.setAttribute("stroke","none"),e.setAttribute("stroke-width","0"),e.setAttribute("fill",i.fill||""),"curve"!==t.shape&&"polygon"!==t.shape||e.setAttribute("fill-rule","evenodd");break;case"fillSketch":e=this.fillSketch(n,o,i)}e&&s.appendChild(e)}return s}fillSketch(t,e,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2);const s=t.createElementNS(gt,"path");return s.setAttribute("d",this.opsToPath(e,i.fixedDecimalPlaceDigits)),s.setAttribute("stroke",i.fill||""),s.setAttribute("stroke-width",n+""),s.setAttribute("fill","none"),i.fillLineDash&&s.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&s.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),s}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,e){return this.gen.opsToPath(t,e)}line(t,e,i,n,s){const r=this.gen.line(t,e,i,n,s);return this.draw(r)}rectangle(t,e,i,n,s){const r=this.gen.rectangle(t,e,i,n,s);return this.draw(r)}ellipse(t,e,i,n,s){const r=this.gen.ellipse(t,e,i,n,s);return this.draw(r)}circle(t,e,i,n){const s=this.gen.circle(t,e,i,n);return this.draw(s)}linearPath(t,e){const i=this.gen.linearPath(t,e);return this.draw(i)}polygon(t,e){const i=this.gen.polygon(t,e);return this.draw(i)}arc(t,e,i,n,s,r,o=!1,a){const h=this.gen.arc(t,e,i,n,s,r,o,a);return this.draw(h)}curve(t,e){const i=this.gen.curve(t,e);return this.draw(i)}path(t,e){const i=this.gen.path(t,e);return this.draw(i)}}var vt={canvas:(t,e)=>new ft(t,e),svg:(t,e)=>new At(t,e),generator:t=>new mt(t),newSeed:()=>mt.newSeed()};function yt(t){if(window.getSelection){t.focus();var e=t.win.getSelection();try{e.selectAllChildren(t),e.collapseToEnd()}catch(t){}}}class xt{constructor(t,e){this.box={x:0,y:0,width:0,height:0},this.name="node",this.isExpand=!0,this.isSelect=!1,this.children=[],this.isHide=!1,this.isEdit=!1,this._barDom=null,this.callout=null,this.wireFrames=[],this.summaries=[],this.induce=null,this.wireFrame=null,this.layout=null,this.wfs=[],this.induces=[],this.belongInduce=null,this._wireFrames=[],this._summaries=[],this._removeLink=null,this.shouldRender=!0,this.containBar=!1,this.tNode=null,this._shapeDom=null,this._mathTime=null,this._noteTab=null,this.coverDom=null,this._hasImage=null,this._hasLink="",this.data=t,this.mindmap=e,this.data.stroke&&(this.stroke=this.data.stroke),this.data.style&&(this.style=Object.assign({},this.style,this.data.style)),this.initDom()}getId(){return this.data.id}getParent(){return this.parent||null}initDom(){this.containEl=document.createElement("div"),this.containEl.classList.add("mm-node"),this.containEl.setAttribute("contentEditable","false"),this.containEl.setAttribute("tabIndex","-1"),this.containEl.setAttribute("data-id",this.data.id),this.containEl.setAttribute("draggable","false"),this.assistDom=document.createElement("div"),this.assistDom.classList.add("mm-node-assist"),this.contentEl=document.createElement("div"),this.contentEl.classList.add("mm-node-content"),this.containEl.appendChild(this.contentEl),this.contentEl.appendChild(this.assistDom),this.editDom=document.createElement("div"),this.editDom.classList.add("mm-node-edit"),this.contentEl.appendChild(this.editDom),this.plgDom=document.createElement("div"),this.plgDom.classList.add("mm-note-dom"),this.contentEl.appendChild(this.plgDom),this.initNodeBar(),this.updateAnnotate(),this.data.note&&this.updateNote(),this.data.isRoot&&(this.containEl.classList.add("mm-root"),this.isRoot=!0),this.setStyle(),this.parseText(),this.data.cover&&this.createCoverDom()}createCoverDom(){var t=document.createElement("div");this.containEl.appendChild(t),t.classList.add("mm-node-cover"),this.coverDom=t}setCoverText(t){t?(this.data.cover=!0,this.coverDom||this.createCoverDom()):(this.data.cover=!1,this.containEl.contains(this.coverDom)&&(this.containEl.removeChild(this.coverDom),this.coverDom=null))}initNodeBar(){this._barDom=document.createElement("div"),this._barDom.classList.add("mm-node-bar"),this.containEl.appendChild(this._barDom)}parseText(){var e;t.MarkdownRenderer.renderMarkdown(this.data.text,this.editDom,this.mindmap.path||"",this.mindmap._plugin||(null===(e=this.mindmap.view)||void 0===e?void 0:e.plugin)).then((()=>{this.data.mdText=this.editDom.innerHTML,this.refreshBox(),this.mindmap&&this.mindmap.emit("initNode",{}),this._delay()}))}isMindmap(t){if(t&&t.frontmatter){var e=t.frontmatter["mindmap-plugin"];return"rich"==e||"basic"==e}return!1}isMindmapRichMode(t){return!!(t&&t.frontmatter&&t.frontmatter["mindmap-plugin"]&&"rich"==t.frontmatter["mindmap-plugin"])}_deleyRefreshLayout(t,e){if(t&&e){var i=(t=t.tNode?t.tNode:t).getRootLayout()||e.mmLayout,n=e._delayRefresh.filter((t=>t.layout==i));if(n&&n.length)n[0].timeOut&&clearTimeout(n[0].timeOut),n[0].timeOut=setTimeout((()=>{e.emit("renderEditNode",{node:t})}),800);else{if(!i)return;e._delayRefresh.push({node:t,layout:i,timeOut:setTimeout((()=>{e.emit("renderEditNode",{node:t})}),800)})}e._delayRefresh.length>20&&(e._delayRefresh=[])}}_refreshImage(t,e){var i=this;t.findAll(".internal-embed").forEach((t=>{const n=t.getAttribute("src");if(n.startsWith("http")){var s=n.toLowerCase(),r={extension:s.substring(s.lastIndexOf(".")+1)},o=n;"mp4"==r.extension||"webm"==r.extension||"ogv"==r.extension?(t.innerText="",t.createEl("video",{attr:{controls:!0}},(e=>{t.hasAttribute("width")&&e.setAttribute("width",t.getAttribute("width")),t.hasAttribute("alt")&&e.setAttribute("alt",t.getAttribute("alt")),e.createEl("source",{attr:{src:o}})}))):"mp3"==r.extension||"wav"==r.extension||"m4a"==r.extension||"ogg"==r.extension?(t.innerText="",t.createEl("audio",{attr:{controls:!0}},(e=>{t.hasAttribute("width")?e.setAttribute("width",t.getAttribute("width")):e.setAttribute("width","200px"),t.hasAttribute("alt")&&e.setAttribute("alt",t.getAttribute("alt")),e.createEl("source",{attr:{src:o}})}))):"png"!=r.extension&&"gif"!=r.extension&&"svg"!=r.extension&&"jpg"!=r.extension&&"jpeg"!=r.extension||(t.innerText="",t.createEl("img",{attr:{src:o}},(e=>{i._hasImage=e,t.hasAttribute("width")&&e.setAttribute("width",t.getAttribute("width")),t.hasAttribute("alt")&&e.setAttribute("alt",t.getAttribute("alt"))})),t.addClasses(["image-embed","is-loaded"]))}else{if((r="string"==typeof n&&this.mindmap.view&&this.mindmap.view.app&&this.mindmap.view.app.metadataCache.getFirstLinkpathDest(n,this.mindmap.path))&&"md"!==r.extension&&e){t.innerText="";o=this.mindmap.view.app.vault.getResourcePath(r);"mp4"==r.extension||"webm"==r.extension||"ogv"==r.extension?t.createEl("video",{attr:{controls:!0}},(e=>{t.hasAttribute("width")&&e.setAttribute("width",t.getAttribute("width")),t.hasAttribute("alt")&&e.setAttribute("alt",t.getAttribute("alt")),e.createEl("source",{attr:{src:o}})})):"mp3"==r.extension||"wav"==r.extension||"m4a"==r.extension||"ogg"==r.extension?t.createEl("audio",{attr:{controls:!0}},(e=>{t.hasAttribute("width")?e.setAttribute("width",t.getAttribute("width")):e.setAttribute("width","200px"),t.hasAttribute("alt")&&e.setAttribute("alt",t.getAttribute("alt")),e.createEl("source",{attr:{src:o}})})):(t.createEl("img",{attr:{src:o}},(e=>{i._hasImage=e,t.hasAttribute("width")&&e.setAttribute("width",t.getAttribute("width")),t.hasAttribute("alt")&&e.setAttribute("alt",t.getAttribute("alt"))})),t.addClasses(["image-embed","is-loaded"]))}}})),t.querySelectorAll("img").forEach((t=>{var i;t.onload||(t.onload=()=>{var i,n=null===(i=t.closest(".mm-node"))||void 0===i?void 0:i.getAttribute("data-id");if(n){var s=e.getNodeById(n);s&&(s.clearCacheData(),s.refreshBox(),this._deleyRefreshLayout(s,e))}}),t.setAttribute("draggble","false");var n=null===(i=t.closest(".mm-node"))||void 0===i?void 0:i.getAttribute("data-id");if(n){var s=e.getNodeById(n);s&&(s.clearCacheData(),s.refreshBox(),this._deleyRefreshLayout(s,e))}}));var n=t.querySelectorAll("video"),s=t.querySelectorAll("audio");(n.length||s.length)&&setTimeout((()=>{this.clearCacheData(),this.refreshBox(),this._deleyRefreshLayout(this,this.mindmap)}),500)}_createHandDrawFill(){var t=this.getLevel();if(this.mindmap&&this.mindmap.useHandMode&&t<=1){var e=this.mindmap._rc||vt.svg(this.mindmap.draw),i=!!document.querySelector(".theme-dark")||!1;this.shapeSvg&&this.mindmap.draw.node.removeChild(this.shapeSvg);var n=this.getBox(),s=0==t?"solid":"sunburst",r=0==t?"1":"2",o=i?"#fff":"rgb(0, 170, 255)",a=i?"#333":"#000";this.shapeSvg=e.rectangle(n.x,n.y,n.width,n.height,{fill:this.stroke||this.data.stroke||o,fillStyle:s,stroke:this.stroke||this.data.stroke||a,fillWeight:r}),this.mindmap.draw.node.appendChild(this.shapeSvg)}}getImage(){return this._hasImage}getLink(){var t="",i=!1;return this.editDom.findAll("a").forEach((n=>e(this,void 0,void 0,(function*(){t=n.getAttribute("href"),i=!(!n.getAttribute("class")||"internal-link"!=n.getAttribute("class"))})))),{isMd:i,link:t}}_delay(){var i=this;this.editDom.style.overflow="",this.editDom.findAll(".internal-embed").forEach((n=>e(this,void 0,void 0,(function*(){var e,s;const r=n.getAttribute("src");if("string"==typeof r){var o=t.parseLinktext(r);if(!o)return;var a="";if(this.mindmap&&this.mindmap.view){var h=this.mindmap.view.app.metadataCache.getFirstLinkpathDest(o.path,this.mindmap.path);if(h instanceof t.TFile&&"md"===h.extension){if(this.editDom.querySelector(`.markdown-embed[data-name="${h.path}"]`))return;var l=this.mindmap.view.app.metadataCache.getFileCache(h);if(this.isMindmap(l)){if((m=document.createElement("div")).classList.add("markdown-embed"),n.appendChild(m),m.setAttribute("data-name",h.path),(f=document.createElement("div")).classList.add("markdown-embed-content"),(g=document.createElement("div")).classList.add("markdown-preview-view"),f.appendChild(g),(A=document.createElement("div")).classList.add("markdown-embed-link"),A.setAttribute("aria-label","Open link"),A.innerHTML=``,this.editDom.style.overflow="auto",m.appendChild(f),m.appendChild(A),this.isMindmapRichMode(l))yield u(null===(e=this.mindmap.view)||void 0===e?void 0:e.plugin,this.mindmap.view.app,h,n,this,this.mindmap.colors,this.mindmap.setting,(t=>{this._refreshImage(n,t),setTimeout((()=>{t.toDiv(!0),t.containerEL.style.visibility="visible",t.center(),t.root.unSelect(),this.clearCacheData(),this.refreshBox(),this.mindmap&&this.mindmap.emit("renderEditNode",{node:i.tNode?i.tNode:i}),this._createHandDrawFill()}),900)}));else{var d=l&&l.frontmatter;if(d)var p=!!d["display-mode"]&&"table"==d["display-mode"];yield c(null===(s=this.mindmap.view)||void 0===s?void 0:s.plugin,this.mindmap.view.app,h,n,this,this.mindmap.colors,this.mindmap.setting,(t=>{this._refreshImage(n,t),setTimeout((()=>{t.toDiv(!0),t.containerEL.style.visibility="visible",t.center(),t.root.unSelect(),this.clearCacheData(),this.refreshBox(),this.mindmap&&this.mindmap.emit("renderEditNode",{node:i.tNode?i.tNode:i}),this._createHandDrawFill()}),900)}),0,p)}}else{if(!(a=yield this.mindmap.view.app.vault.adapter.read(h.path)).trim())return;var m,f,g,A;if((m=document.createElement("div")).classList.add("markdown-embed"),m.setAttribute("data-name",h.path),(f=document.createElement("div")).classList.add("markdown-embed-content"),(g=document.createElement("div")).classList.add("markdown-preview-view"),f.appendChild(g),(A=document.createElement("div")).classList.add("markdown-embed-link"),A.setAttribute("aria-label","Open link"),A.innerHTML=``,n.appendChild(m),m.appendChild(f),m.appendChild(A),o.subpath){var v=this.mindmap.view.app.metadataCache.getFileCache(h),y=t.resolveSubpath(v,o.subpath);if(y&&y.start&&y.end)var x=a.substring(y.start.offset,y.end.offset);else if(y&&y.start&&!y.end)x=a.substr(y.start.offset);else x=a||""}else x=a||"";x&&t.MarkdownRenderer.renderMarkdown(x,g,this.mindmap.path||"",null).then((()=>{this.refreshBox(),this.mindmap&&this.mindmap.emit("renderEditNode",{node:i.tNode?i.tNode:i}),this._createHandDrawFill()}))}}}}})))),setTimeout((()=>{this._refreshImage(this.editDom,this.mindmap),(this.editDom.querySelector("code")||this.editDom.querySelector(".MathJax")||this.editDom.querySelector(".callout"))&&setTimeout((()=>{this.clearCacheData(),this.refreshBox(),this._deleyRefreshLayout(i,this.mindmap),this._createHandDrawFill()}),200),this.editDom.findAll("a.external-link").length&&setTimeout((()=>{this.clearCacheData(),this.refreshBox(),this._createHandDrawFill(),this.mindmap&&(this.mindmap._initTime&&clearTimeout(this.mindmap._initTime),this.mindmap._initTime=setTimeout((()=>{this._deleyRefreshLayout(i,this.mindmap)}),600))}),300),setTimeout((()=>{this.refreshBox(),this._createHandDrawFill()}),1500)}),280)}_delayRefresh(){}getRootLayout(){for(var t=this,e=null;t;)e=t.layout,t=t.belongInduce?t.belongInduce.node:t.parent;return e}select(){this.isSelect=!0,"relateLink"==this.nodeType||"callout"==this.nodeType?this.containEl.setAttribute("draggable","false"):this.containEl.setAttribute("draggable","true"),Object.assign(window,{myNode:this}),this.containEl.classList.contains("mm-node-select")||this.containEl.classList.add("mm-node-select"),this.mindmap.selectNode=this,this.tNode&&this.tNode.select()}unSelect(){this.isSelect=!1,this.containEl.setAttribute("draggable","false"),this.containEl.classList.contains("mm-node-select")&&this.containEl.classList.remove("mm-node-select")}edit(){this.editDom.innerText="",this._oldText=this.data.text,this.editDom.innerText=this._oldText,this.editDom.setAttribute("contentEditable","true"),this.containEl.setAttribute("draggable","false"),this.editDom.focus(),this.mindmap.editNode=this,this.isEdit=!0,this.data.cover&&this.coverDom&&(this.coverDom.style.display="none"),yt(this.editDom),this.editDom.innerText!=r("Sub title")&&"callout"!=this.editDom.innerText||this.selectText(),this.containEl.classList.contains("mm-edit-node")||this.containEl.classList.add("mm-edit-node")}selectText(){var t=this.editDom;if(this.editDom.win.getSelection){var e=this.editDom.win.getSelection(),i=this.editDom.doc.createRange();i.selectNodeContents(t),e.removeAllRanges(),e.addRange(i)}}cancelEdit(){var e;if(this.shouldRender){var i=this.editDom.innerText.trim()||"";this.data.text=i,this.editDom.innerText="",this.data.cover&&this.coverDom&&(this.coverDom.style.display=""),t.MarkdownRenderer.renderMarkdown(i,this.editDom,this.mindmap.path||"",null===(e=this.mindmap.view)||void 0===e?void 0:e.plugin).then((()=>{this.data.mdText=this.editDom.innerHTML,this.refreshBox(),this._delay()})),i!=this._oldText&&(this.mindmap.execute("changeNodeText",{node:this.tNode?this.tNode:this,text:i,oldText:this._oldText}),this.callout&&this.callout.refresh()),this.editDom.setAttribute("contentEditable","false"),this.isEdit=!1,this.containEl.classList.contains("mm-edit-node")&&this.containEl.classList.remove("mm-edit-node"),this.mindmap.appEl.focus(),this.mindmap.editNode=null}}getLevel(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t}getChildren(){return this.children}setPosition(t,e){this.box.x=t,this.box.y=e,this.containEl.style.left=t+"px",this.containEl.style.top=e+"px",this.data.x=t,this.data.y=e}getPosition(){return{x:this.box.x,y:this.box.y}}move(t,e){var i=this.getPosition();this.setPosition(i.x+t,i.y+e)}getStyle(){return Object.assign({},this.style)}setStyle(t,e){e&&t?this.style=t:t&&(this.style=Object.assign({},this.style,t));var i=this.style,n="";for(var s in this.style)n+="font-size"==s||"border-width"==s?`${s}:${i[s]}px;`:`${s}:${i[s]};`;this.contentEl.setAttribute("style",n),this.nodeType&&"callout"==this.nodeType&&this.callout&&(this.callout.color=this.style["background-color"]||this.callout.color,this.callout.refresh())}isEmptyObject(t){for(var e in t)return!1;return!0}getData(){var t=Object.assign({},this.data);if(t.mdText&&delete t.mdText,this.layout?t.layout={layoutName:this.layout.layoutName,direct:this.layout.direct}:t.layout=null,"freeNode"==this.nodeType){t.main=!1;var e=this.getPosition();t.x=e.x,t.y=e.y}return this.isExpand&&(t.isExpand=!0),this.parent&&(t.pid=this.parent.getId()),t.children&&delete t.children,t.stroke=this.stroke||"",this.isEmptyObject(this.style)||(t.style=Object.assign({},this.style)),this.belongInduce&&(t.direct=this.direct),JSON.parse(JSON.stringify(t))}refreshBox(){this.box=this.getDomBox()}getBox(){return Object.assign({},this.box)}refreshCBox(){this.box=this.getCBox()}getContainBox(){return this.containBar?this.containBox:this.box}getCBox(t){var e=this.getBox(),i=0,n=0;if(this.callout){var s=this.callout.getBox();s.ye.y+e.height&&(n=s.y+s.height-e.y-e.height)}if(t&&this.wfs.length){var r=0;this.wfs.forEach((t=>{if(t.data&&t.data.text){var e=t.getTextBox().height;r+=e}})),i+=r+3,n+=3}return Object.assign(Object.assign({},e),{th:i,bh:n})}getContainDomBox(){var t=parseInt(this.containEl.style.top);return{x:parseInt(this.containEl.style.left),y:t,width:Math.ceil(this.containEl.offsetWidth),height:Math.ceil(this.containEl.offsetHeight),th:0,bh:0}}getDomBox(){var t=parseInt(this.containEl.style.top);return{x:parseInt(this.containEl.style.left)||0,y:t||0,width:Math.ceil(this.contentEl.offsetWidth),height:Math.ceil(this.contentEl.offsetHeight),th:0,bh:0}}getNodeList(){var t=[];return function e(i){t.push(i),i.children.forEach((t=>{e(t)}))}(this),t}getShowNodeList(){var t=[];return function e(i){i.isShow()&&t.push(i),i.children.forEach((t=>{e(t)}))}(this),t}getSiblings(){return this.parent?this.parent.children.filter((t=>t!=this)):[]}isLeaf(){return!this.children.length}isShow(){return"none"!=this.containEl.style.display}show(){this.containEl.style.display="block",this.isHide=!1}hide(){this.containEl.style.display="none",this.isHide=!0}clearCacheData(){for(var t=this;t;)t.boundingRect=null,t=t.parent||t.belongInduce&&t.belongInduce.node}addChild(t,e){-1==this.children.indexOf(t)&&(e>-1?(e>this.children.length&&(e=this.children.length),this.children.splice(e,0,t)):this.children.push(t),t.parent=this)}removeChild(t){var e=this.children.indexOf(t);return e>-1&&this.children.splice(e,1),e}setText(t){this.data.text=t,this.editDom.innerHTML="",this.parseText()}expand(){this.isExpand=!0,this.data.isExpand=!0,function t(e){e.show(),e.boundingRect=null,e.induces.length&&e.induces.forEach((e=>{t(e.root)})),e.isExpand&&(e.layout&&(e.layout.svgDom&&(e.layout.svgDom.show(),e.layout.isShow=!0),e.layout.group&&(e.layout.group.show(),e.layout.isShow=!0),e.layout.tableDom&&(e.layout.tableDom.style.display="")),e.children.forEach((e=>{t(e)})))}(this),function t(e){e.isShow()||e.show(),e.refreshBox(),e.isExpand&&e.children.forEach((e=>{t(e)})),e.wfs.length&&e.wfs.forEach((t=>{t.show(),t.refreshItems()})),e.induces.length&&e.induces.forEach((e=>{e.show(),e.refreshItems(),t(e.root)}))}(this),this.containEl.classList.contains("mm-node-collapse")&&this.containEl.classList.remove("mm-node-collapse")}collapse(){function t(e){e.hide(),e.setPosition(10,10),e.induces.length&&e.induces.forEach((e=>{t(e.root)})),e.layout&&(e.layout.tableDom&&(e.layout.tableDom.style.display="none"),e.layout.svgDom&&(e.layout.svgDom.hide(),e.layout.isShow=!1),e.layout.group&&(e.layout.group.hide(),e.layout.isShow=!1)),e.isExpand&&e.children.forEach((e=>{t(e)}))}this.children.forEach((e=>{t(e)})),this.isExpand=!1,this.data.isExpand=!1,this.containEl.classList.contains("mm-node-collapse")||this.containEl.classList.add("mm-node-collapse"),this.layout&&(this.layout.tableDom&&(this.layout.tableDom.style.display="none"),this.layout.svgDom&&(this.layout.svgDom.hide(),this.layout.isShow=!1),this.layout.group&&(this.layout.group.hide(),this.layout.isShow=!1)),this.getMind().updateAllAssist()}isFirst(){if(this.parent){var t=this.parent.getChildren();return t&&0==t.indexOf(this)}return!0}isLast(){if(this.parent){var t=this.parent.getChildren();return t.length&&t.indexOf(this)==t.length-1}return!0}getNodeLayout(){return this.layout}getLayout(){for(var t=this,e=null;t;){if(t.layout){e=t.layout;break}t=t.parent}return e}getTopLayout(){if(!this.parent)return this.layout||null;var t=this,e=null,i=this.layout;for(this.layout=null;t;){if(t.layout){e=t.layout;break}t=t.parent}return this.layout=i,this.topLayout=e,e}getMind(){return this.mindmap||null}setAnnotate(t){"highlight"==t.type?(this.editDom.innerHTML=t.selectText,this.editDom.focus(),yt(this.editDom)):(this.editDom.innerHTML=`![[${t.path}]]`,this.editDom.focus(),yt(this.editDom)),this.data.annotate=t,this.updateAnnotate()}updateAnnotate(){!this.annotateDom&&this.data.annotate&&(this.annotateDom=document.createElement("div"),this.annotateDom.innerHTML='',this.annotateDom.classList.add("mm-node-annotate"),this.assistDom.appendChild(this.annotateDom))}deleteAnnotate(){this.annotateDom&&(this.assistDom.removeChild(this.annotateDom),this.annotateDom=null,this.data.annotate=null)}getAnnotateId(){return this.data.annotate?this.data.annotate.id:null}getAnnotate(){return this.data.annotate?JSON.parse(JSON.stringify(this.data.annotate)):null}updateNote(){if(this.plgDom.innerHTML="",this.data.note){var t=document.createElement("span");this.plgDom.appendChild(t),t.innerHTML='',t.style.display="flex",t.style.alignItems="center",t.style.margin="0 4px",t.style.cursor="pointer",t.classList.add("mm-note-span")}}setNote(t){this.data.note=t,this.updateNote()}}class bt{constructor(t,e){this.children=[],this.hasInit=!1,this.isSelect=!1,this.isExpand=!0,this.isEdit=!1,this.layout=null,this.induces=[],this.wireFrames=[],this.wfs=[],this.summaries=[],this.callout=null,this._tableDom=null,this.style={},this.isHide=!1,this.nodeType="",this.data=t,e&&(this.mindmap=e),t.style&&(this.style=t.style),this.iNode=new xt(t,e),this.iNode.tNode=this}init(t){this.hasInit||(0==this.getLevel()?(this.tdDom=document.createElement("th"),this.tdDom.setAttribute("colspan",t)):this.tdDom=document.createElement("td"),this.tdDom.appendChild(this.iNode.containEl),this.tdDom.setAttribute("data-id",this.data.id),this.hasInit=!0,this.setStyle())}_initTdDom(t){this.hasInit||(0==this.getLevel()?(this.tdDom=document.createElement("th"),this.tdDom.setAttribute("colspan",t)):this.tdDom=document.createElement("td"),this.tdDom.innerText=this.data.text,this.tdDom.setAttribute("data-id",this.data.id),this.hasInit=!0)}getLevel(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t}isLeaf(){return!this.children.length}isFirst(){if(this.parent){var t=this.parent.getChildren();return t&&0==t.indexOf(this)}return!0}isLast(){if(this.parent){var t=this.parent.getChildren();return t.length&&t.indexOf(this)==t.length-1}return!0}getChildren(){return this.children}getId(){return this.data.id}unSelect(){this.isSelect=!1}select(){this.isSelect=!0,this.mindmap.selectNode=this}getOffset(t,e){for(var i=0,n=0;t&&t!=e;)i+=t.offsetLeft,n+=t.offsetTop,t=t.offsetParent||t.parentElement||t.parentNode;return{x:i,y:n}}getBox(t){if(this._tableDom)var e=parseInt(this._tableDom.style.left),i=parseInt(this._tableDom.style.top),n=this.getOffset(this.iNode.containEl,this._tableDom);else e=parseInt(this.mindmap.tableDom.style.left),i=parseInt(this.mindmap.tableDom.style.top),n=this.getOffset(this.iNode.containEl,this.mindmap.tableDom);return{x:n.x+e,y:n.y+i,width:this.iNode.containEl.clientWidth,height:this.iNode.containEl.clientHeight}}getDomBox(){return this.getBox()}clearCacheData(){for(var t=this;t;)t.boundingRect=null,t=t.parent||t.belongInduce&&t.belongInduce.node}expand(){this.isExpand=!0,this.data.isExpand=!0,this.layout&&this.layout.tableDom&&(this.layout.tableDom.style.display="")}hide(){this.isHide=!0,this.layout&&this.layout.tableDom&&(this.layout.tableDom.style.display="none")}show(){this.isHide=!1,this.layout&&this.layout.tableDom&&(this.layout.tableDom.style.display="")}isShow(){return!this.isHide}collapse(){this.isExpand=!1,this.data.isExpand=!1,this.layout&&this.layout.tableDom&&(this.layout.tableDom.style.display="none")}refreshBox(){}getAnnotateId(){}addChild(t,e){-1==this.children.indexOf(t)&&(e>-1?(e>this.children.length&&(e=this.children.length),this.children.splice(e,0,t)):this.children.push(t),t.parent=this)}removeChild(t){var e=this.children.indexOf(t);return e>-1&&this.children.splice(e,1),e}getData(){var t=Object.assign({},this.data);return t.mdText&&delete t.mdText,t.isExpand=this.isExpand,this.parent&&(t.pid=this.parent.getId()),t.children&&delete t.children,this.style&&(t.style=Object.assign({},this.style)),this.layout&&(t.layout={layoutName:"table",direct:""}),JSON.parse(JSON.stringify(t))}setStyle(t,e){e&&t?this.style=t:t&&(this.style=Object.assign(Object.assign({},this.style),t));var i=this.style,n="";for(var s in this.style)n+="font-size"==s||"border-width"==s?`${s}:${i[s]}px;`:`${s}:${i[s]};`;this.tdDom.setAttribute("style",n),this.iNode.setStyle(this.style),this.nodeType&&"callout"==this.nodeType&&this.callout&&(this.callout.color=this.style["background-color"]||this.callout.color,this.callout.refresh())}getStyle(){return this.style}setNote(t){this.data.note=t,this.iNode.setNote(t)}edit(){this.isEdit=!0,this.iNode.edit()}cancelEdit(){this.isEdit=!1,this.iNode.cancelEdit()}setText(t){this.data.text=t}selectText(){this.iNode.selectText()}getMind(){return this.mindmap}getShowNodeList(){var t=[];return this.layout&&"table"==this.layout.layoutName&&t.push(this),t}setPosition(t,e){this.data.x=t,this.data.y=e,this.layout&&this.layout.setPosition(t,e)}getPosition(){return this.getBox()}move(t,e){var i=this.getPosition();this.setPosition(i.x+t,i.y+e)}getLayout(){for(var t=this,e=null;t;){if(t.layout){e=t.layout;break}t=t.parent}return e}getNodeLayout(){return this.layout}getRootLayout(){for(var t=this,e=null;t;)e=t.layout,t=t.belongInduce?t.belongInduce.node:t.parent;return e}getTopLayout(){if(!this.parent)return this.layout||null;var t=this,e=null,i=this.layout;for(this.layout=null;t;){if(t.layout){e=t.layout;break}t=t.parent}return this.layout=i,this.topLayout=e,e}refreshCBox(){this.box=this.getCBox()}getContainBox(){return this.containBar?this.containBox:this.box}getCBox(t){var e=this.getBox(),i=0,n=0;if(this.callout){var s=this.callout.getBox();s.ye.y+e.height&&(n=s.y+s.height-e.y-e.height)}if(t&&this.wfs.length){var r=0;this.wfs.forEach((t=>{if(t.data&&t.data.text){var e=t.getTextBox().height;rt!=this)):[]}getLink(){return this.iNode?this.iNode.getLink():""}getImage(){return this.iNode?this.iNode.getImage():""}}var wt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ct(t){var e={exports:{}};return t(e,e.exports),e.exports}function Et(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var kt=Ct((function(t,e){!function(i,n){var s=function(){var t=null,e={};f();var i=[],n=function(e){if(void 0!==(e=e||{}).seed&&null!==e.seed&&e.seed===parseInt(e.seed,10))t=e.seed;else if("string"==typeof e.seed)t=y(e.seed);else{if(void 0!==e.seed&&null!==e.seed)throw new TypeError("The seed value must be an integer or string");t=null}var h,l;if(null!==e.count&&void 0!==e.count){for(var d=e.count,c=[],u=0;uc.length;){var p=n(e);null!==t&&(e.seed=t),c.push(p)}return e.count=d,c}return a([h=s(e),l=r(h,e),o(h,l,e)],e)};function s(t){if(i.length>0){var e=u(r=x(t.hue)),n=(r[1]-r[0])/i.length,s=parseInt((e-r[0])/n);return!0===i[s]?s=(s+2)%i.length:i[s]=!0,(e=u(r=[(r[0]+s*n)%359,(r[0]+(s+1)*n)%359]))<0&&(e=360+e),e}var r;return(e=u(r=l(t.hue)))<0&&(e=360+e),e}function r(t,e){if("monochrome"===e.hue)return 0;if("random"===e.luminosity)return u([0,100]);var i=d(t),n=i[0],s=i[1];switch(e.luminosity){case"bright":n=55;break;case"dark":n=s-10;break;case"light":s=55}return u([n,s])}function o(t,e,i){var n=h(t,e),s=100;switch(i.luminosity){case"dark":s=n+20;break;case"light":n=(s+n)/2;break;case"random":n=0,s=100}return u([n,s])}function a(t,e){switch(e.format){case"hsvArray":return t;case"hslArray":return v(t);case"hsl":var i=v(t);return"hsl("+i[0]+", "+i[1]+"%, "+i[2]+"%)";case"hsla":var n=v(t),s=e.alpha||Math.random();return"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+s+")";case"rgbArray":return g(t);case"rgb":return"rgb("+g(t).join(", ")+")";case"rgba":var r=g(t);s=e.alpha||Math.random();return"rgba("+r.join(", ")+", "+s+")";default:return p(t)}}function h(t,e){for(var i=c(t).lowerBounds,n=0;n=s&&e<=o){var h=(a-r)/(o-s);return h*e+(r-h*s)}}return 0}function l(t){if("number"==typeof parseInt(t)){var i=parseInt(t);if(i<360&&i>0)return[i,i]}if("string"==typeof t)if(e[t]){var n=e[t];if(n.hueRange)return n.hueRange}else if(t.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var s=A(t)[0];return[s,s]}return[0,360]}function d(t){return c(t).saturationRange}function c(t){for(var i in t>=334&&t<=360&&(t-=360),e){var n=e[i];if(n.hueRange&&t>=n.hueRange[0]&&t<=n.hueRange[1])return e[i]}return"Color not found"}function u(e){if(null===t){var i=.618033988749895,n=Math.random();return n+=i,n%=1,Math.floor(e[0]+n*(e[1]+1-e[0]))}var s=e[1]||1,r=e[0]||0,o=(t=(9301*t+49297)%233280)/233280;return Math.floor(r+o*(s-r))}function p(t){var e=g(t);function i(t){var e=t.toString(16);return 1==e.length?"0"+e:e}return"#"+i(e[0])+i(e[1])+i(e[2])}function m(t,i,n){var s=n[0][0],r=n[n.length-1][0],o=n[n.length-1][1],a=n[0][1];e[t]={hueRange:i,lowerBounds:n,saturationRange:[s,r],brightnessRange:[o,a]}}function f(){m("monochrome",null,[[0,0],[100,0]]),m("red",[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),m("orange",[18,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),m("yellow",[46,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),m("green",[62,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),m("blue",[178,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),m("purple",[257,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),m("pink",[282,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]])}function g(t){var e=t[0];0===e&&(e=1),360===e&&(e=359),e/=360;var i=t[1]/100,n=t[2]/100,s=Math.floor(6*e),r=6*e-s,o=n*(1-i),a=n*(1-r*i),h=n*(1-(1-r)*i),l=256,d=256,c=256;switch(s){case 0:l=n,d=h,c=o;break;case 1:l=a,d=n,c=o;break;case 2:l=o,d=n,c=h;break;case 3:l=o,d=a,c=n;break;case 4:l=h,d=o,c=n;break;case 5:l=n,d=o,c=a}return[Math.floor(255*l),Math.floor(255*d),Math.floor(255*c)]}function A(t){t=3===(t=t.replace(/^#/,"")).length?t.replace(/(.)/g,"$1$1"):t;var e=parseInt(t.substr(0,2),16)/255,i=parseInt(t.substr(2,2),16)/255,n=parseInt(t.substr(4,2),16)/255,s=Math.max(e,i,n),r=s-Math.min(e,i,n),o=s?r/s:0;switch(s){case e:return[(i-n)/r%6*60||0,o,s];case i:return[60*((n-e)/r+2)||0,o,s];case n:return[60*((e-i)/r+4)||0,o,s]}}function v(t){var e=t[0],i=t[1]/100,n=t[2]/100,s=(2-i)*n;return[e,Math.round(i*n/(s<1?s:2-s)*1e4)/100,s/2*100]}function y(t){for(var e=0,i=0;i!==t.length&&!(e>=Number.MAX_SAFE_INTEGER);i++)e+=t.charCodeAt(i);return e}function x(t){if(isNaN(t)){if("string"==typeof t)if(e[t]){var i=e[t];if(i.hueRange)return i.hueRange}else if(t.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){return c(A(t)[0]).hueRange}}else{var n=parseInt(t);if(n<360&&n>0)return c(t).hueRange}return[0,360]}return n}();t&&t.exports&&(e=t.exports=s),e.randomColor=s}()}));class It{constructor(t){this.edges=[],this.isShow=!0,this.lineWeight=!0,this.svgDom=null,this.name=t}layout(t,e){}refresh(){}addEdge(t){this.edges.push(t)}removeEdge(t){var e=this.edges.indexOf(t);e>-1&&this.edges.splice(e,e)}moveNode(t,e,i){t&&t.move(e,i),t.callout&&t.callout.refresh(),t.wfs&&t.wfs.forEach((t=>{t.move(e,i)})),t.induces&&t.induces.forEach((t=>{t.move(e,i),this.moveNode(t.root,e,i)})),t&&t.children.forEach((t=>{this.moveNode(t,e,i)}))}linePoint(t,e){let i=0;var n=Math.ceil;return e%2==1&&(i=.5,n=parseInt),t.map((t=>[n(t[0])+i,n(t[1])+i]))}_updateNodeAssist(t,e){for(var i=t;i;){i.callout&&i.callout.refresh();var n=i.wireFrames,s=i.summaries;if(n.length&&n.forEach((e=>{e.items.indexOf(t)>-1&&(e.refreshNode(),e.refresh())})),s.length&&s.forEach((e=>{e.items.indexOf(t)>-1&&(e.refreshNode(),e.refresh())})),e){if(i==e)break;i=i.parent}else i=i.parent}}_updateRootAssist(){this.root.induce&&(this.root.induce.refreshItems(),this.root.induce.refresh()),this.root.wireFrame&&(this.root.wireFrame.refreshItems(),this.root.wireFrame.refresh())}}class Bt extends It{constructor(t,e,i){super("minder"),this.layoutName="mindmap",this.direct="",this.levelDis=40,this.nodeDis=8,this.firstLevelDis=80,this.firstNodeDis=20,this.isCache=!0,this.lefts=[],this.rights=[],this.colors=[],this.lineWidth=2,this.root=t,this.mind=this.root.mindmap,this.direct=e||"mindmap",this.colors=i||[],this.svgDom=this.mind.edgeGroup.group()}layout(t,e){t&&(this.root=t),this.root.isExpand&&(this.svgDom||(this.svgDom=this.root.mindmap.edgeGroup.group()),this.root.layout=this,e&&(this.direct=e),this.root.nodeType&&"induce"==this.root.nodeType&&(this.firstLevelDis=20,this.firstNodeDis=10),this.root.nodeType&&"freeNode"==this.root.nodeType&&(this.root.containEl.classList.contains("mm-root")||this.root.containEl.classList.add("mm-root")),this.lefts=[],this.rights=[],this.root.isShow()&&(this.setDirect(),this._layoutSecondLevelNode(this.root)),this.createLink())}setDirect(){var t=this,e=this.root.children.length,i=this.root;"right"==this.direct?(this.rights=i.children,this.rights.forEach((t=>{this._setDirect(t,"right")}))):"left"==this.direct?(this.lefts=i.children,this.lefts.forEach((t=>{this._setDirect(t,"left")}))):i.children.forEach((function(i,n){n{this._setDirect(t,e)}))}_layoutSecondLevelNode(t){this._layoutMinder(),"induce"!=this.root.nodeType&&this._doRefresh(),this._updateRootAssist()}_doRefresh(){var t=this.root,e=t.getPosition(),i=t.getBox(),n=e.y+i.height/2,s=t.getChildren(),r=s.filter((t=>"right"==t.direct)),o=s.filter((t=>"left"==t.direct));if(r.length>=2){var a=r[0],h=r[r.length-1],l=a.getPosition(),d=h.getPosition(),c=h.getBox(),u=d.y+c.height-n,p=n-l.y;if(Math.abs(u)!=Math.abs(p)){var m=Math.abs(Math.abs(u)-Math.abs(p))/2;Math.abs(u)>Math.abs(p)?r.forEach((t=>{this.moveNode(t,0,-parseInt(m+""))})):r.forEach((t=>{this.moveNode(t,0,parseInt(m+""))}))}}if(o.length>=2){a=o[0],h=o[o.length-1],l=a.getPosition(),d=h.getPosition(),c=h.getBox(),u=d.y+c.height-n,p=n-l.y;if(Math.abs(u)!=Math.abs(p)){m=Math.abs(Math.abs(u)-Math.abs(p))/2;Math.abs(u)>Math.abs(p)?o.forEach((t=>{this.moveNode(t,0,-parseInt(m+""))})):o.forEach((t=>{this.moveNode(t,0,parseInt(m+""))}))}}}updateRight(){var t=this.root.getPosition(),e=this.root.getBox(),i=this.rights,n=this._getNodesHeight(i),s=[parseInt(t.x+e.width+this.firstLevelDis+""),parseInt(t.y+e.height/2-n/2+"")];i.forEach((t=>{t.setPosition(s[0],s[1]);var e=t.getBox();s[1]+=parseInt(e.height+this.firstNodeDis+"")})),i.forEach((t=>{this._layoutRight(t)}))}updateLeft(){var t=this.root.getPosition(),e=this.root.getBox(),i=this.lefts,n=this._getNodesHeight(i),s=[parseInt(t.x-this.firstLevelDis+""),parseInt(t.y+e.height/2-n/2+"")];i.forEach((t=>{var e=t.getBox();t.setPosition(parseInt(s[0]-e.width+""),parseInt(s[1]+"")),s[1]+=e.height+this.firstNodeDis})),i.forEach((t=>{this._layoutLeft(t)}))}_layoutMinder(){this.updateRight(),this.updateLeft(),this._doLayout(this.root)}_getNodesHeight(t){if(t[0]&&1==t[0].getLevel())var e=this.firstNodeDis;else e=this.nodeDis;var i=0;return t.forEach(((n,s)=>{i+=n.getBox().height,s!=t.length-1&&(i+=e)})),i}_layoutRight(t){if(t.isExpand){var e=t.getPosition(),i=t.getBox(),n=this._getNodesHeight(t.children);t.callout&&t.callout.refresh();var s=[e.x+i.width+this.levelDis,i.y+i.height/2-n/2];if(t.children.forEach((t=>{t.setPosition(s[0],s[1]);var e=t.getBox();s[1]+=e.height+this.nodeDis})),t.layout)if("table"!=t.layout.layoutName){t.layout.layout(t,t.layout.direct||"");e=t.getPosition();i=t.mindmap.getBBox(t);var r=parseInt(Math.abs(e.x-i.x)+"");this.moveNode(t,r,0),t.boundingRect=null,t.direct="right"}else t.boundingRect=null,t.direct="right";else t.children.forEach((t=>{this._layoutRight(t)}))}}_updateNodeAssist(t){t.callout&&t.callout.refresh();var e=t.parent,i={};if(e){var n=e.wireFrames,s=e.summaries;n.length&&n.forEach((e=>{if(e.node==t&&(e.refresh(),e.data&&e.data.text))if(i[t.getId()])i[t.getId()].rangeNode=i[t.getId()].rangeNode.concat(e.rangeNode.slice()),i[t.getId()].rangeNode.unique();else{var n=e.getTextBox().height,s=e.rangeNode.slice();i[t.getId()]={node:t,wf:e,topDy:n+4,rangeNode:s}}})),s.length&&s.forEach((e=>{e.node==t&&e.refresh()}))}this.topInfo=i}_doLayout(t){var e=this,i=t.mindmap;i.traverseDF((t=>{if(t!=e.root&&t.isShow()){if(t.layout){if(t.layout!=e&&t.getTopLayout()!=e)return}else if(t.getLayout()!=e)return;e._updateNodeAssist(t);var n=t.getCBox();if(e.isCache&&t.boundingRect)var s=t.boundingRect;else{var r=t.getShowNodeList(),o=[],a=[],h=[],l=[];if(r.forEach((t=>{t.callout&&t.callout.isShow&&h.push(t.callout);var e=t.wireFrames;t.summaries.forEach((t=>{t.isShow()&&-1==a.indexOf(t)&&a.push(t)})),e.forEach((t=>{t.isHide||-1==o.indexOf(t)&&o.push(t)}))})),r=r.concat(o),a.forEach((t=>{r=r.concat(t.getAllItem()),l=l.concat(t.groups)})),(r=r.concat(h)).length)s=i.getBoundingRect(r)}var d=t.parent;if(d)var c=d.wireFrames,u=d.summaries;if(t.boundingRect)var p=t.boundingRect.topDy,m=t.boundingRect.downDy;else p=Math.abs(s.y-n.y),m=Math.abs(s.y+s.height-n.y-n.height),c&&c.length&&c.forEach((i=>{var n=i.topNode.getCBox();if(i.node==t&&(p+=Math.abs(6+n.th),e.topInfo[t.getId()]&&(p+=e.topInfo[t.getId()].topDy)),i.endNode&&i.endNode==t){var s=i.bottomNode.getCBox();m+=Math.abs(6+s.bh)}})),s.topDy=p,s.downDy=m,t.boundingRect=s;e._adjustNode(t,0,p,m),c&&c.length&&c.forEach((e=>{e.endNode==t&&e.refresh()})),u&&u.length&&u.forEach((e=>{e.endNode==t&&e.refresh()}))}}),t)}_layoutLeft(t){if(t.isExpand){var e=t.getPosition(),i=t.getBox(),n=this._getNodesHeight(t.children);t.callout&&t.callout.refresh();var s=[e.x-this.levelDis,e.y+i.height/2-n/2];if(t.children.forEach((t=>{var e=t.getBox();t.setPosition(s[0]-e.width,s[1]),s[1]+=e.height+this.nodeDis})),t.layout)if("table"!=t.layout.layoutName){t.layout.layout(t,t.layout.direct||"");e=t.getPosition();var r=t.mindmap.getBBox(t),o=Math.abs(e.x+i.width-r.x-r.width);this.moveNode(t,-o,0),t.direct="left",t.boundingRect=null}else t.direct="left",t.boundingRect=null;else t.children.forEach((t=>{this._layoutLeft(t)}))}}_adjustDoNode(t,e,i){if(t)for(var n=t.direct;t&&t!=this.root;){var s=t.getSiblings(),r=t.getPosition();s.forEach((t=>{t.direct==n&&(t.getPosition().y>r.y?this.moveNode(t,0,i):this.moveNode(t,0,-e))})),t=t.parent}}_adjustNode(t,e,i,n){if(t){var s=t.direct;if(t&&t!=this.root){var r=t.getSiblings(),o=t.getPosition();r.forEach((t=>{t.direct==s&&(t.getPosition().y>o.y?this.moveNode(t,e,n):this.moveNode(t,e,-i))}))}}}refresh(t){this.layout(this.root,t||this.direct),this.createLink()}createLink(){var t=this,e=this.root.mindmap;if(this.svgDom&&this.svgDom.clear(),0!=this.root.getChildren().length&&this.svgDom&&this.root.isShow()){var i=this.lineWidth;e.traverseBF((e=>{if(e.isExpand){var n=e.getChildren(),s=e.getBox(),r=e.getPosition(),o=e.getLevel(),a=n.length,h=2,l=1,d=2,c=1;1==a&&(h=4,l=1,d=4,c=3),n.forEach((n=>{var u=n.direct,p=n.getBox(),m=n.getPosition();let f=e.stroke?e.stroke:n.stroke?n.stroke:kt();if("right"==u){if(0==o||1==o){var g=[s.width+r.x,s.height/2+r.y];if(0==o)var A=[m.x,p.height/2+m.y];else A=[p.width+m.x,p.height+m.y]}else g=[s.width+r.x,s.height+r.y],A=[p.width+m.x,p.height+m.y];if(0==o)var v=[(y=[g[0]+this.firstLevelDis/h*l,g[1]])[0],A[1]];else{var y=[g[0]+this.levelDis/h*l,g[1]];v=[g[0]+this.levelDis/d*c,A[1]]}}else{if(0==o||1==o){g=[r.x,s.height/2+r.y];if(0==o)A=[m.x+p.width,p.height/2+m.y];else A=[m.x,p.height+m.y]}else g=[r.x,s.height+r.y],A=[m.x,p.height+m.y];if(0==o)v=[(y=[g[0]-this.firstLevelDis/h*l,g[1]])[0],A[1]];else y=[g[0]-this.levelDis/h*l,g[1]],v=[g[0]-this.levelDis/d*c,A[1]]}if(1==a)if(1==o)var x=[g,y,v,A];else if(Math.abs(g[1]-A[1])>2)x=[g,v,A];else x=[g,A];else if(0==e.getLevel()){var b=[],w=[];if(e.getChildren().forEach((t=>{"right"==t.direct?b.push(t):w.push(t)})),b.length>=2&&0==b.indexOf(n)||b.length>=2&&b.indexOf(n)==b.length-1)if("right"==u){if(A[1]>g[1])var C=[y[0],A[1]-2],E=[y[0]+2,A[1]];else C=[y[0],A[1]+2],E=[y[0]+2,A[1]];x=[g,y,C,E,A]}else{if(A[1]>g[1])C=[y[0],A[1]-2],E=[y[0]-2,A[1]];else C=[y[0],A[1]+2],E=[y[0]-2,A[1]];x=[g,y,C,E,A]}else if(w.length>=2&&0==w.indexOf(n)||w.length>=2&&w.indexOf(n)==w.length-1)if("right"==u){if(A[1]>g[1])C=[y[0],A[1]-2],E=[y[0]+2,A[1]];else C=[y[0],A[1]+2],E=[y[0]+2,A[1]];x=[g,y,C,E,A]}else{if(A[1]>g[1])C=[y[0],A[1]-2],E=[y[0]-2,A[1]];else C=[y[0],A[1]+2],E=[y[0]-2,A[1]];x=[g,y,C,E,A]}else if(b.length>=2&&0!=b.indexOf(n)||b.length>=2&&b.indexOf(n)!=b.length-1||w.length>=2&&0!=w.indexOf(n)||w.length>=2&&w.indexOf(n)!=w.length-1)x=[v,A];if(1==b.length&&1==w.length)x=[g,A];if(b.length>1&&1==w.length)if("right"==u)x=[g,v,A];else x=[g,A]}else if("right"==u)if(n.isFirst()||n.isLast()){if(A[1]>g[1])C=[y[0],A[1]-2],E=[y[0]+2,A[1]];else C=[y[0],A[1]+2],E=[y[0]+2,A[1]];x=[g,y,C,E,A]}else x=[v,A];else if(n.isFirst()||n.isLast()){if(A[1]>g[1])C=[y[0],A[1]-2],E=[y[0]-2,A[1]];else C=[y[0],A[1]+2],E=[y[0]-2,A[1]];x=[g,y,C,E,A]}else x=[v,A];var k=t.svgDom.polyline(t.linePoint(x,i));k.fill("none"),k.stroke({color:f,width:i,linecap:"round",linejoin:"round"}),k.source=e,k.target=n}))}}),this.root)}}}class Dt extends Bt{constructor(t,e,i){super(t,e,i),this.firstLevelDis=50,this.levelDis=30,this.nodeDis=10,this.layoutName="mindmap1"}createLink(){var t=this,e=this.levelDis,i=this.direct;this.svgDom&&this.svgDom.clear();var n=this.root;if(this.svgDom&&this.root.isShow()){var s=this.root.getLevel();n.children.forEach(((t,e)=>{t.stroke||(t.stroke=this.colors[e]||kt())})),function n(r){if(r==t.root);else if(r.layout)return;if(r.isExpand){var o=r.getChildren(),a=o.length,h=r.getPosition(),l=r.getBox(),d=r.getLevel();o.length&&o.forEach((function(o){var c=o.direct,u=o.getPosition(),p=o.getBox();let m=r.stroke?r.stroke:o.stroke?o.stroke:kt();if(o.stroke||(o.stroke=m),o._barDom&&(o._barDom.style.backgroundColor=m,o._barDom.style.borderColor=m),d==s)if("minder"==i)if("right"==c)var f={x:h.x+l.width/2,y:h.y+l.height/2},g={x:u.x,y:p.height/2+u.y};else f={x:h.x+l.width/2,y:h.y+l.height/2},g={x:Number.parseInt(u.x+p.width+""),y:Number.parseInt(p.height/2+u.y+"")};else{f={x:h.x+l.width/2,y:h.y+l.height/2};if("right"==c)g={x:u.x,y:p.height/2+u.y};else g={x:u.x+p.width,y:p.height/2+u.y}}else if("right"==c)f={x:h.x+l.width,y:h.y+l.height/2},g={x:u.x,y:p.height/2+u.y};else f={x:h.x,y:h.y+l.height/2},g={x:u.x+p.width,y:p.height/2+u.y};if(d==s)var A=t.svgDom.path();else A=t.svgDom.polyline();if(A.fill("none"),A.stroke({color:m,width:t.lineWidth,linecap:"round",linejoin:"round"}),d==s)if("right"==c){var v=parseInt((f.x+g.x)/2-30+""),y=parseInt(f.y+(g.y-f.y)/1.1+""),x=`M ${f.x} ${f.y} Q ${v} ${y},${g.x} ${g.y} `;A.plot(x)}else{v=parseInt((f.x+g.x)/2+30+""),y=parseInt(f.y+(g.y-f.y)/1.1+""),x=`M ${f.x} ${f.y} Q ${v} ${y},${g.x} ${g.y} `;A.plot(x)}else{var b=g.y{r(t)}))}function r(t){if(t.isExpand){if(t.layout)return void t.layout.createLink();t.children.forEach((t=>{r(t)}))}}}}var Nt={mindmap1:Dt,mindmap2:class extends Bt{constructor(t,e,i){super(t,e,i),this.firstLevelDis=40,this.levelDis=30,this.nodeDis=10,this.type="minder",this.layoutName="mindmap2"}createLink(){var t=this,e=this.levelDis,i=this.root;if(this.svgDom&&this.svgDom.clear(),this.svgDom&&this.root.isExpand&&this.root.isShow()){var n=this.lineWidth,s=this.rights,r=this.lefts,o=i.getBox(),a=i.getPosition();s.length,r.length,i.children.forEach(((t,e)=>{t.stroke||(t.stroke=this.colors[e]||kt())})),function(){var e=[],h=[];s.forEach((t=>{t.getPosition().y+t.getBox().height/2>o.height/2+a.y?h.push(t):e.push(t)}));var l=e.length,d=h.length,c=parseInt((o.width/2-6)/l+""),u=parseInt((o.width/2-6)/d+"");e.forEach(((e,s)=>{var r=e.getBox(),h=e.getPosition(),l=r.height/2+h.y,d=l-(o.height/2+a.y),u=[a.x+o.width/2+6+c*s,a.y+o.height/2];if(Math.abs(d)>2)var p=[u[0],l-5*d/Math.abs(d)],m=[u[0]+5,l];else p=[u[0],l-d/2],m=[u[0]+Math.abs(d)/2,l];var f=[h.x,l];let g=i.stroke?i.stroke:e.stroke||kt();e.stroke||(e.stroke=g),e._barDom&&(e._barDom.style.backgroundColor=g,e._barDom.style.borderColor=g);var A=t.linePoint([p],n)[0],v=t.linePoint([m],n)[0],y=`M${A[0]} ${A[1]},Q${A[0]} ${v[1]},${v[0]} ${v[1]}`,x=t.svgDom.path().stroke({color:g,width:n+2,linecap:"round",linejoin:"round"});x.plot(y),x.fill("none"),t.svgDom.line(t.linePoint([u,p],n+2)).stroke({color:g,width:n+2,linecap:"round",linejoin:"round"}).fill("none"),t.svgDom.line(t.linePoint([m,f],n+2)).stroke({color:g,width:n+2,linecap:"round",linejoin:"round"}).fill("none")})),h.reverse().forEach(((e,s)=>{var r=e.getBox(),h=e.getPosition(),l=r.height/2+h.y,d=l-(o.height/2+a.y),c=[a.x+o.width/2+6+u*s,a.y+o.height/2];if(Math.abs(d)>2)var p=[c[0],l-5*d/Math.abs(d)],m=[c[0]+5,l];else p=[c[0],l-d/2],m=[c[0]+Math.abs(d)/2,l];var f=[h.x,l];let g=i.stroke?i.stroke:e.stroke||kt();e.stroke||(e.stroke=g),e._barDom&&(e._barDom.style.backgroundColor=g,e._barDom.style.borderColor=g);var A=t.linePoint([p],n)[0],v=t.linePoint([m],n)[0],y=`M${A[0]} ${A[1]},Q${A[0]} ${v[1]},${v[0]} ${v[1]}`,x=t.svgDom.path().stroke({color:g,width:n+2,linecap:"round",linejoin:"round"});x.plot(y),x.fill("none"),t.svgDom.line(t.linePoint([c,p],n+2)).stroke({color:g,width:n+2,linecap:"round",linejoin:"round"}).fill("none"),t.svgDom.line(t.linePoint([m,f],n+2)).stroke({color:g,width:n+2,linecap:"round",linejoin:"round"}).fill("none")}));var p=[],m=[];r.forEach((t=>{t.getPosition().y+t.getBox().height/2>o.height/2+a.y?m.push(t):p.push(t)}));var f=p.length,g=m.length,A=parseInt((o.width/2-12)/f+""),v=parseInt((o.width/2-12)/g+"");p.forEach(((e,s)=>{var r=e.getBox(),h=e.getPosition(),l=r.height/2+h.y,d=l-(o.height/2+a.y),c=[a.x+o.width/2-6-A*s,a.y+o.height/2];if(Math.abs(d)>2)var u=[c[0],l-5*d/Math.abs(d)],p=[c[0]-5,l];else u=[c[0],l-d/2],p=[c[0]-Math.abs(d)/2,l];var m=[h.x+r.width,l];let f=i.stroke?i.stroke:e.stroke||kt();e.stroke||(e.stroke=f),e._barDom&&(e._barDom.style.backgroundColor=f,e._barDom.style.borderColor=f);var g=t.linePoint([u],n)[0],v=t.linePoint([p],n)[0],y=`M${g[0]} ${g[1]},Q${g[0]} ${v[1]},${v[0]} ${v[1]}`,x=t.svgDom.path().stroke({color:f,width:n+2,linecap:"round",linejoin:"round"});x.plot(y),x.fill("none"),t.svgDom.line(t.linePoint([c,u],n+2)).stroke({color:f,width:n+2,linecap:"round",linejoin:"round"}).fill("none"),t.svgDom.line(t.linePoint([p,m],n+2)).stroke({color:f,width:n+2,linecap:"round",linejoin:"round"}).fill("none")})),m.reverse().forEach(((e,s)=>{var r=e.getBox(),h=e.getPosition(),l=r.height/2+h.y,d=l-(o.height/2+a.y),c=[a.x+o.width/2-6-v*s,a.y+o.height/2];if(Math.abs(d)>2)var u=[c[0],l-5*d/Math.abs(d)],p=[c[0]-5,l];else u=[c[0],l-d/2],p=[c[0]-Math.abs(d)/2,l];var m=[h.x+r.width,l];let f=i.stroke?i.stroke:e.stroke||kt();e.stroke||(e.stroke=f),e._barDom&&(e._barDom.style.backgroundColor=f,e._barDom.style.borderColor=f);var g=t.linePoint([u],n)[0],A=t.linePoint([p],n)[0],y=`M${g[0]} ${g[1]},Q${g[0]} ${A[1]},${A[0]} ${A[1]}`,x=t.svgDom.path().stroke({color:f,width:n+2,linecap:"round",linejoin:"round"});x.plot(y),x.fill("none"),t.svgDom.line(t.linePoint([c,u],n+2)).stroke({color:f,width:n+2,linecap:"round",linejoin:"round"}).fill("none"),t.svgDom.line(t.linePoint([p,m],n+2)).stroke({color:f,width:n+2,linecap:"round",linejoin:"round"}).fill("none")}))}(),i.children.forEach(((t,e)=>{h(t),l(t)}))}function h(i){if(!i.layout&&i.isExpand){var s=i.getChildren(),r=s.length,o=i.getPosition(),a=i.getBox();s.length&&s.forEach((function(s){var l=s.direct,d=s.getPosition(),c=s.getBox();let u=i.stroke?i.stroke:s.stroke?s.stroke:kt();if(s.stroke||(s.stroke=u),s._barDom&&(s._barDom.style.backgroundColor=u,s._barDom.style.borderColor=u),"right"==l)var p={x:o.x+a.width,y:o.y+a.height/2},m={x:d.x,y:c.height/2+d.y};else p={x:o.x,y:o.y+a.height/2},m={x:d.x+c.width,y:c.height/2+d.y};if(1==r)var f=[[p.x,p.y],[m.x,m.y]];else{var g=m.y{l(t)}))}}}},mindmap:class extends It{constructor(t,e,i){super("mindmap"),this.layoutName="mindmap",this.direct="",this.levelDis=50,this.nodeDis=6,this.firstLevelDis=80,this.firstNodeDis=20,this.isCache=!0,this.lefts=[],this.rights=[],this.colors=[],this.lineWidth=2,this.root=t||null,this.mind=(null==t?void 0:t.mindmap)||null,this.direct=e||"mindmap",this.colors=i||[],this.svgDom||(this.svgDom=this.mind.edgeGroup.group()),this.layout()}setDirect(){var t=this,e=this.root.children.length,i=this.root;this.rights=[],this.lefts=[],"right"==this.direct?(this.rights=i.children,this.rights.forEach((t=>{this._setDirect(t,"right")}))):"left"==this.direct?(this.lefts=i.children,this.lefts.forEach((t=>{this._setDirect(t,"left")}))):i.children.forEach((function(i,n){n{this._setDirect(t,e)}))}layout(t,e){t&&(this.root=t),e&&(this.direct=e),this.setDirect(),"right"==this.direct?this.layoutRight():"left"==this.direct?this.layoutLeft():this.layoutMindMap(),this._dolayout(),this._doRefresh(),this.root&&this.root.mindmap.useHandMode?this.createHandDrawLink():this.createLink()}layoutMindMap(){this.layoutRight(),this.layoutLeft()}layoutRight(t,e){var i=t||this.rights,n=e||this.root,s=n.getPosition(),r=n.getBox(),o=n.getLevel();if(0==o)var a=this.firstLevelDis,h=this.firstNodeDis;else a=this.levelDis,h=this.nodeDis;var{disHeight:l,height:d}=this._getNodesHeight(i),c=d/i.length;if(0==o)var u=[parseInt(s.x+r.width+a+""),parseInt(s.y+r.height/2-l/2+"")];else if(1==o)u=[parseInt(s.x+r.width+a+""),parseInt(s.y+r.height/2-l/2-c/2-this.lineWidth/2+"")];else u=[parseInt(s.x+r.width+a+""),parseInt(s.y+r.height-l/2-c/2+"")];i.forEach((t=>{t.setPosition(u[0],u[1]);var e=t.getBox();u[1]+=parseInt(e.height+h+"")})),i.forEach((t=>{t.isExpand&&this.layoutRight(t.children,t)}))}layoutLeft(t,e){var i=t||this.lefts,n=e||this.root,s=n.getPosition(),r=n.getBox(),o=n.getLevel();if(0==o)var a=this.firstLevelDis,h=this.firstNodeDis;else a=this.levelDis,h=this.nodeDis;var{disHeight:l,height:d}=this._getNodesHeight(i),c=d/i.length;if(0==o)var u=[parseInt(s.x-a+""),parseInt(s.y+r.height/2-l/2+"")];else if(1==o)u=[parseInt(s.x-a+""),parseInt(s.y+r.height/2-l/2-c/2-this.lineWidth/2+"")];else u=[parseInt(s.x-a+""),parseInt(s.y+r.height-l/2-c/2+"")];i.forEach((t=>{var e=t.getBox();t.setPosition(parseInt(u[0]-e.width+""),parseInt(u[1]+"")),u[1]+=e.height+h})),i.forEach((t=>{t.isExpand&&this.layoutLeft(t.children,t)}))}_getNodesHeight(t){if(t[0]&&1==t[0].getLevel())var e=this.firstNodeDis;else e=this.nodeDis;var i=0,n=0;return 1==t.length?{disHeight:i=t[0].getBox().height,height:i}:(t.forEach(((s,r)=>{var o=s.getBox().height;i+=o,n+=o,r!=t.length-1&&(i+=e)})),{disHeight:i,height:n})}_doRefresh(){var t=this.root,e=t.getPosition(),i=t.getBox(),n=e.y+i.height/2,s=this.rights,r=this.lefts;if(s.length>=2){var o=s[0],a=s[s.length-1],h=o.getPosition(),l=a.getPosition(),d=a.getBox(),c=l.y+d.height-n,u=n-h.y;if(Math.abs(c)!=Math.abs(u)){var p=Math.abs(Math.abs(c)-Math.abs(u))/2+"";Math.abs(c)>Math.abs(u)?s.forEach((t=>{this.moveNode(t,0,-parseInt(p))})):s.forEach((t=>{this.moveNode(t,0,parseInt(p))}))}}if(r.length>=2){o=r[0],a=r[r.length-1],h=o.getPosition(),l=a.getPosition(),d=a.getBox(),c=l.y+d.height-n,u=n-h.y;if(Math.abs(c)!=Math.abs(u)){p=Math.abs(Math.abs(c)-Math.abs(u))/2+"";Math.abs(c)>Math.abs(u)?r.forEach((t=>{this.moveNode(t,0,-parseInt(p))})):r.forEach((t=>{this.moveNode(t,0,parseInt(p))}))}}}moveNode(t,e,i){t.move(e,i),t&&t.children&&t.children.forEach((t=>{this.moveNode(t,e,i)}))}linePoint(t,e){let i=0;var n;return e%2==1?(i=.5,n=parseInt):n=Math.ceil,t.map((t=>[n(t[0])+i,n(t[1])+i]))}_dolayout(){var t=this,e=this.mind;e.traverseDF((i=>{if(i!=t.root&&i.isExpand){var n=i.getCBox();if(t.isCache&&i.boundingRect)var s=i.boundingRect;else{var r=i.getShowNodeList();r.length&&(s=e.getBoundingRect(r))}if(s){if(i.boundingRect&&t.isCache)var o=s.topDy,a=s.downDy;else o=Math.abs(s.y-n.y),a=Math.abs(s.y+s.height-n.y-n.height),s.topDy=o,s.downDy=a,i.boundingRect=s;t._adjustNode(i,0,o,a)}}}))}_adjustNode(t,e,i,n){if(t){var s=t.direct;if(t&&t!=this.root){var r=t.getSiblings(),o=t.getPosition();r.forEach((t=>{t.direct==s&&(t.getPosition().y>o.y?this.moveNode(t,e,n):this.moveNode(t,e,-i))}))}}}refresh(t,e){this.layout(t,e)}createHandDrawLink(){var t=this;this.svgDom&&this.svgDom.clear();var e=vt.svg(this.root.mindmap.draw);if(0!=this.root.getChildren().length){var i=this.levelDis,n=this.root,s=this.lineWidth,r=this.root.getLevel();this.root.children.forEach(((t,e)=>{t.stroke=this.colors[e]||kt()})),function n(o){if(o.isExpand){var a=o.getChildren(),h=o.getPosition(),l=o.getBox();l.height=l.height+s;var d=o.getLevel();a.length&&a.forEach((function(a){var c=a.direct,u=a.getPosition(),p=Object.assign({},a.getBox());p.height=p.height+s;let m=o.stroke?o.stroke:a.stroke?a.stroke:kt();if(a.stroke||(a.stroke=m),a._barDom&&(a._barDom.style.backgroundColor=m,a._barDom.style.borderColor=m),d==r)var f={x:h.x+l.width/2,y:h.y+l.height/2};else f=d==1+r?"right"==c?{x:h.x+l.width,y:h.y+l.height/2}:{x:h.x,y:h.y+l.height/2}:"right"==c?{x:h.x+l.width,y:h.y+l.height}:{x:h.x,y:h.y+l.height};if(d==r)if("right"==c)var g={x:u.x,y:p.height/2+u.y};else g={x:u.x+p.width,y:p.height/2+u.y};else g="right"==c?{x:u.x,y:p.height+u.y}:{x:u.x+p.width,y:p.height+u.y};if(s%2==1)var A=parseInt(f.x+"")-.5,v=parseInt(g.x+"")-.5,y=parseInt(f.y+"")-.5,x=parseInt(g.y+"")-.5;else A=parseInt(f.x+""),y=parseInt(f.y+""),v=parseInt(g.x+""),x=parseInt(g.y+"");if(s%2==1)var b=parseInt(u.x+"")-.5,w=parseInt(u.x+p.width+"")-.5,C=x,E=x;else b=parseInt(u.x+""),C=parseInt(p.height+u.y+""),w=parseInt(u.x+p.width+""),E=parseInt(p.height+u.y+"");if(d==r){var k=`M${A} ${y} C ${parseInt(f.x+"")+(g.x-f.x)/9} ${parseInt(f.y+"")+(g.y-f.y)/9*8}, ${parseInt(f.x+(g.x-f.x)/9*8+"")} ${parseInt(g.y+"")}, ${v} ${x}`,I=e.path(k,{stroke:m,strokeWidth:s+1,fill:"none"});t.svgDom.node.appendChild(I)}else{var B={x:f.x+i/2,y:f.y},D={x:f.x+i/2,y:g.y};"left"==c&&(B.x=f.x-i/2,D.x=f.x-i/2),B.x=parseInt(B.x+""),B.y=parseInt(B.y+""),D.x=parseInt(D.x+""),D.y=parseInt(D.y+"");var N=`M${A} ${y} C${B.x} ${B.y}, ${D.x} ${D.y}, ${v} ${x}`,S=e.path(N,{stroke:m,strokeWidth:d==r?s+1:s,fill:"none",roughness:.4});I=e.line(b-1,C,w+1,E,{stroke:m,strokeWidth:d==r?s+1:s,fill:"none",roughness:.8});t.svgDom.node.appendChild(I),t.svgDom.node.appendChild(S)}n(a)}))}}(n)}}createLink(){var t=this;if(this.svgDom&&this.svgDom.clear(),0!=this.root.getChildren().length){var e=this.levelDis,i=this.root,n=this.lineWidth,s=this.root.getLevel();this.root.children.forEach(((t,e)=>{t.stroke=this.colors[e]||kt()})),function i(r){if(r.isExpand){var o=r.getChildren(),a=r.getPosition(),h=r.getBox();h.height=h.height+n;var l=r.getLevel();o.length&&o.forEach((function(o){var d=o.direct,c=o.getPosition(),u=Object.assign({},o.getBox());u.height=u.height+n;let p=r.stroke?r.stroke:o.stroke?o.stroke:kt();if(o.stroke||(o.stroke=p),o._barDom&&(o._barDom.style.backgroundColor=p,o._barDom.style.borderColor=p),l==s)var m={x:a.x+h.width/2,y:a.y+h.height/2};else m=l==1+s?"right"==d?{x:a.x+h.width,y:a.y+h.height/2}:{x:a.x,y:a.y+h.height/2}:"right"==d?{x:a.x+h.width,y:a.y+h.height}:{x:a.x,y:a.y+h.height};if(l==s)if("right"==d)var f={x:c.x,y:u.height/2+c.y};else f={x:c.x+u.width,y:u.height/2+c.y};else f="right"==d?{x:c.x,y:u.height+c.y}:{x:c.x+u.width,y:u.height+c.y};if(n%2==1)var g=parseInt(m.x+"")-.5,A=parseInt(f.x+"")-.5,v=parseInt(m.y+"")-.5,y=parseInt(f.y+"")-.5;else g=parseInt(m.x+""),v=parseInt(m.y+""),A=parseInt(f.x+""),y=parseInt(f.y+"");if(l==s)var x=t.svgDom.path().stroke({color:p,width:n+1,linecap:"round",linejoin:"round"}).fill("none");else x=t.svgDom.path().stroke({color:p,width:n,linecap:"round",linejoin:"round"}).fill("none");if(n%2==1)var b=parseInt(c.x+"")-.5,w=parseInt(c.x+u.width+"")-.5,C=y,E=y;else b=parseInt(c.x+""),C=parseInt(u.height+c.y+""),w=parseInt(c.x+u.width+""),E=parseInt(u.height+c.y+"");if(l==s){var k=`M${g} ${v} C ${parseInt(m.x+"")+(f.x-m.x)/9} ${parseInt(m.y+"")+(f.y-m.y)/9*8}, ${parseInt(m.x+(f.x-m.x)/9*8+"")} ${parseInt(f.y+"")}, ${A} ${y}`;x.plot(k)}else{t.svgDom.line(b,C,w,E).stroke({color:p,width:n,linecap:"miter",linejoin:"miter"}).fill("none");var I={x:m.x+e/2,y:m.y},B={x:m.x+e/2,y:f.y};"left"==d&&(I.x=m.x-e/2,B.x=m.x-e/2),I.x=parseInt(I.x+""),I.y=parseInt(I.y+""),B.x=parseInt(B.x+""),B.y=parseInt(B.y+"");var D=`M${g} ${v} C ${I.x} ${I.y}, ${B.x} ${B.y}, ${A} ${y}`;x.plot(D)}i(o)}))}}(i)}}},mindmap6:class extends It{constructor(t,e,i){super("minder"),this.layoutName="mindmap6",this.direct="",this.levelDis=40,this.nodeDis=8,this.firstLevelDis=80,this.firstNodeDis=20,this.isCache=!0,this.lefts=[],this.rights=[],this.colors=[],this.lineWidth=2,this.root=t,this.mind=this.root.mindmap,this.direct=e||"mindmap",this.colors=i||[],this.svgDom=this.mind.edgeGroup.group()}layout(t,e){t&&(this.root=t),this.root.isExpand&&(this.svgDom||(this.svgDom=this.root.mindmap.edgeGroup.group()),this.root.layout=this,e&&(this.direct=e),this.root.nodeType&&"induce"==this.root.nodeType&&(this.firstLevelDis=20,this.firstNodeDis=10),this.root.nodeType&&"freeNode"==this.root.nodeType&&(this.root.containEl.classList.contains("mm-root")||this.root.containEl.classList.add("mm-root")),this.lefts=[],this.rights=[],this.root.isShow()&&(this.setDirect(),this._layoutSecondLevelNode(this.root)),this.createLink())}setDirect(){var t=this,e=this.root.children.length,i=this.root;"right"==this.direct?(this.rights=i.children,this.rights.forEach((t=>{this._setDirect(t,"right")}))):"left"==this.direct?(this.lefts=i.children,this.lefts.forEach((t=>{this._setDirect(t,"left")}))):i.children.forEach((function(i,n){n{this._setDirect(t,e)}))}_layoutSecondLevelNode(t){this._layoutMinder(),"induce"!=this.root.nodeType&&this._doRefresh(),this._updateRootAssist()}_doRefresh(){var t=this.root,e=t.getPosition(),i=t.getBox(),n=e.y+i.height/2,s=t.getChildren(),r=s.filter((t=>"right"==t.direct)),o=s.filter((t=>"left"==t.direct));if(r.length>=2){var a=r[0],h=r[r.length-1],l=a.getPosition(),d=h.getPosition(),c=h.getBox(),u=d.y+c.height-n,p=n-l.y;if(Math.abs(u)!=Math.abs(p)){var m=Math.abs(Math.abs(u)-Math.abs(p))/2;Math.abs(u)>Math.abs(p)?r.forEach((t=>{this.moveNode(t,0,-parseInt(m+""))})):r.forEach((t=>{this.moveNode(t,0,parseInt(m+""))}))}}if(o.length>=2){a=o[0],h=o[o.length-1],l=a.getPosition(),d=h.getPosition(),c=h.getBox(),u=d.y+c.height-n,p=n-l.y;if(Math.abs(u)!=Math.abs(p)){m=Math.abs(Math.abs(u)-Math.abs(p))/2;Math.abs(u)>Math.abs(p)?o.forEach((t=>{this.moveNode(t,0,-parseInt(m+""))})):o.forEach((t=>{this.moveNode(t,0,parseInt(m+""))}))}}}updateRight(){var t=this.root.getPosition(),e=this.root.getBox(),i=this.rights,{height:n}=this._getNodesHeight(i),s=[parseInt(t.x+e.width+this.firstLevelDis+""),parseInt(t.y+e.height/2-n/2+"")];i.forEach((t=>{t.setPosition(s[0],s[1]);var e=t.getBox();s[1]+=parseInt(e.height+this.firstNodeDis+"")})),i.forEach((t=>{this._layoutRight(t)}))}updateLeft(){var t=this.root.getPosition(),e=this.root.getBox(),i=this.lefts,{height:n}=this._getNodesHeight(i),s=[parseInt(t.x-this.firstLevelDis+""),parseInt(t.y+e.height/2-n/2+"")];i.forEach((t=>{var e=t.getBox();t.setPosition(parseInt(s[0]-e.width+""),parseInt(s[1]+"")),s[1]+=e.height+this.firstNodeDis})),i.forEach((t=>{this._layoutLeft(t)}))}_layoutMinder(){this.updateRight(),this.updateLeft(),this._doLayout(this.root)}_getNodesHeight(t){if(t[0]&&1==t[0].getLevel())var e=this.firstNodeDis;else e=this.nodeDis;var i=0,n=0;return 1==t.length?{disHeight:i=t[0].getBox().height,height:i}:(t.forEach(((s,r)=>{var o=s.getBox().height;i+=o,n+=o,r!=t.length-1&&(i+=e)})),{disHeight:i,height:n})}_layoutRight(t){if(t.isExpand){var e=t.getPosition(),i=t.getBox(),{disHeight:n,height:s}=this._getNodesHeight(t.children);t.callout&&t.callout.refresh();var r=s/t.children.length;if(i.height>r+6)var o=parseInt(e.y+i.height/2-n/2-r/2+"");else o=parseInt(e.y+i.height-n/2-r/2+"");var a=[parseInt(e.x+i.width+this.levelDis+""),o];if(t.children.forEach((t=>{t.setPosition(a[0],a[1]);var e=t.getBox();a[1]+=e.height+this.nodeDis})),t.layout)if("table"!=t.layout.layoutName){t.layout.layout(t,t.layout.direct||"");e=t.getPosition();i=t.mindmap.getBBox(t);var h=parseInt(Math.abs(e.x-i.x)+"");this.moveNode(t,h,0),t.boundingRect=null,t.direct="right"}else t.boundingRect=null,t.direct="right";else t.children.forEach((t=>{this._layoutRight(t)}))}}_updateNodeAssist(t){t.callout&&t.callout.refresh();var e=t.parent,i={};if(e){var n=e.wireFrames,s=e.summaries;n.length&&n.forEach((e=>{if(e.node==t&&(e.refresh(),e.data&&e.data.text))if(i[t.getId()])i[t.getId()].rangeNode=i[t.getId()].rangeNode.concat(e.rangeNode.slice()),i[t.getId()].rangeNode.unique();else{var n=e.getTextBox().height,s=e.rangeNode.slice();i[t.getId()]={node:t,wf:e,topDy:n+4,rangeNode:s}}})),s.length&&s.forEach((e=>{e.node==t&&e.refresh()}))}this.topInfo=i}_doLayout(t){var e=this,i=t.mindmap;i.traverseDF((t=>{if(t!=e.root&&t.isShow()){if(t.layout){if(t.layout!=e&&t.getTopLayout()!=e)return}else if(t.getLayout()!=e)return;e._updateNodeAssist(t);var n=t.getCBox();if(e.isCache&&t.boundingRect)var s=t.boundingRect;else{var r=t.getShowNodeList(),o=[],a=[],h=[],l=[];if(r.forEach((t=>{t.callout&&t.callout.isShow&&h.push(t.callout);var e=t.wireFrames;t.summaries.forEach((t=>{t.isShow()&&-1==a.indexOf(t)&&a.push(t)})),e.forEach((t=>{t.isHide||-1==o.indexOf(t)&&o.push(t)}))})),r=r.concat(o),a.forEach((t=>{r=r.concat(t.getAllItem()),l=l.concat(t.groups)})),(r=r.concat(h)).length)s=i.getBoundingRect(r)}var d=t.parent;if(d)var c=d.wireFrames,u=d.summaries;if(t.boundingRect)var p=t.boundingRect.topDy,m=t.boundingRect.downDy;else p=Math.abs(s.y-n.y),m=Math.abs(s.y+s.height-n.y-n.height),c&&c.length&&c.forEach((i=>{var n=i.topNode.getCBox();if(i.node==t&&(p+=Math.abs(6+n.th),e.topInfo[t.getId()]&&(p+=e.topInfo[t.getId()].topDy)),i.endNode&&i.endNode==t){var s=i.bottomNode.getCBox();m+=Math.abs(6+s.bh)}})),s.topDy=p,s.downDy=m,t.boundingRect=s;e._adjustNode(t,0,p,m),c&&c.length&&c.forEach((e=>{e.endNode==t&&e.refresh()})),u&&u.length&&u.forEach((e=>{e.endNode==t&&e.refresh()}))}}),t)}_layoutLeft(t){if(t.isExpand){var e=t.getPosition(),i=t.getBox(),{disHeight:n,height:s}=this._getNodesHeight(t.children),r=s/t.children.length;if(t.callout&&t.callout.refresh(),i.height>r+6)var o=parseInt(e.y+i.height/2-n/2-r/2+"");else o=parseInt(e.y+i.height-n/2-r/2+"");var a=[parseInt(e.x-this.levelDis+""),o];if(t.children.forEach((t=>{var e=t.getBox();t.setPosition(a[0]-e.width,a[1]),a[1]+=e.height+this.nodeDis})),t.layout)if("table"!=t.layout.layoutName){t.layout.layout(t,t.layout.direct||"");e=t.getPosition();var h=t.mindmap.getBBox(t),l=Math.abs(e.x+i.width-h.x-h.width);this.moveNode(t,-l,0),t.direct="left",t.boundingRect=null}else t.direct="left",t.boundingRect=null;else t.children.forEach((t=>{this._layoutLeft(t)}))}}_adjustDoNode(t,e,i){if(t)for(var n=t.direct;t&&t!=this.root;){var s=t.getSiblings(),r=t.getPosition();s.forEach((t=>{t.direct==n&&(t.getPosition().y>r.y?this.moveNode(t,0,i):this.moveNode(t,0,-e))})),t=t.parent}}_adjustNode(t,e,i,n){if(t){var s=t.direct;if(t&&t!=this.root){var r=t.getSiblings(),o=t.getPosition();r.forEach((t=>{t.direct==s&&(t.getPosition().y>o.y?this.moveNode(t,e,n):this.moveNode(t,e,-i))}))}}}refresh(t){this.layout(this.root,t||this.direct),this.createLink()}createLink(){var t=this;if(this.svgDom&&this.svgDom.clear(),this.root.isExpand&&this.root.isShow()&&0!=this.root.getChildren().length){var e=this.levelDis,i=this.root,n=this.lineWidth,s=this.root.getLevel();!function i(r){if(r==t.root);else if(r.layout)return;if(r.isExpand){var o=r.getChildren(),a=r.getPosition(),h=r.getBox();h.height=h.height+n;var l=r.getLevel();o.length&&o.forEach((function(o){var d=o.direct,c=o.getPosition(),u=Object.assign({},o.getBox());u.height=u.height+n;let p=r.stroke?r.stroke:o.stroke?o.stroke:kt();if(o.stroke||(o.stroke=p),o._barDom&&(o._barDom.style.backgroundColor=p,o._barDom.style.borderColor=p),l==s)var m={x:a.x+h.width/2,y:a.y+h.height/2};else m=l==1+s?"right"==d?{x:a.x+h.width,y:a.y+h.height/2}:{x:a.x,y:a.y+h.height/2}:"right"==d?{x:a.x+h.width,y:a.y+h.height}:{x:a.x,y:a.y+h.height};if(l==s)if("right"==d)var f={x:c.x,y:u.height/2+c.y};else f={x:c.x+u.width,y:u.height/2+c.y};else f="right"==d?{x:c.x,y:u.height+c.y}:{x:c.x+u.width,y:u.height+c.y};if(n%2==1)var g=parseInt(m.x+"")-.5,A=parseInt(f.x+"")-.5,v=parseInt(m.y+"")-.5,y=parseInt(f.y+"")-.5;else g=parseInt(m.x+""),v=parseInt(m.y+""),A=parseInt(f.x+""),y=parseInt(f.y+"");if(l==s)var x=t.svgDom.path().stroke({color:p,width:n+1,linecap:"round",linejoin:"round"}).fill("none");else x=t.svgDom.path().stroke({color:p,width:n,linecap:"round",linejoin:"round"}).fill("none");if(n%2==1)var b=parseInt(c.x+"")-.5,w=parseInt(c.x+u.width+"")-.5,C=y,E=y;else b=parseInt(c.x+""),C=parseInt(u.height+c.y+""),w=parseInt(c.x+u.width+""),E=parseInt(u.height+c.y+"");if(l==s){var k=`M${g} ${v} C ${parseInt(m.x+"")+(f.x-m.x)/9} ${parseInt(m.y+"")+(f.y-m.y)/9*8}, ${parseInt(m.x+(f.x-m.x)/9*8+"")} ${parseInt(f.y+"")}, ${A} ${y}`;x.plot(k)}else{t.svgDom.line(b,C,w,E).stroke({color:p,width:n,linecap:"miter",linejoin:"miter"}).fill("none");var I={x:m.x+e/2,y:m.y},B={x:m.x+e/2,y:f.y};"left"==d&&(I.x=m.x-e/2,B.x=m.x-e/2),I.x=parseInt(I.x+""),I.y=parseInt(I.y+""),B.x=parseInt(B.x+""),B.y=parseInt(B.y+"");var D=`M${g} ${v} C ${I.x} ${I.y}, ${B.x} ${B.y}, ${A} ${y}`;x.plot(D)}i(o)}))}}(i),i.children.forEach(((t,e)=>{r(t)}))}function r(t){if(t.isExpand){if(t.layout)return void t.layout.createLink();t.children.forEach((t=>{r(t)}))}}}},fish:class extends It{constructor(t,e,i){super("fish"),this.root=null,this.tops=[],this.bottoms=[],this.dis=10,this.levelDis=20,this.firstLevelDis=20,this.layoutName="fish",this.type="fish",this.angle=7*Math.PI/18,this.isCache=!1,this.colors=[],this.fishTail=null,this.stroke="",this.root=t,this.direct=e||"right",this.colors=i||[],this.stroke=kt(),this.svgDom||(this.svgDom=this.root.getMind().edgeGroup.group())}layout(t,e){if(this.direct=e||"right",this.tops=[],this.bottoms=[],this.root=t||this.root,this.root.isExpand){this.svgDom||(this.svgDom=this.root.getMind().edgeGroup.group()),this.root.layout=this,this.root.parent||"induce"==this.root.nodeType||this.root.containEl.classList.add("mm-root");var i=this.root.children.length;this.root.getChildren().forEach(((t,e)=>{e{t.mark="up",t.containEl.classList=[],t.containEl.classList.add("mm-node"),t.containEl.classList.add("mm-node-"+this.direct),t.containEl.classList.add(`mm-${this.layoutName}-node`),t.direct=this.direct,t.isExpand||t.containEl.classList.add("mm-node-collapse"),t.isLeaf()&&!t.containEl.classList.contains("mm-node-leaf")?t.containEl.classList.add("mm-node-leaf"):t.containEl.classList.contains("mm-node-leaf")&&t.containEl.classList.remove("mm-node-leaf")}))):(this.bottoms.push(t),t.getNodeList().forEach((t=>{t.mark="down",t.containEl.classList=[],t.containEl.classList.add("mm-node"),t.containEl.classList.add("mm-node-"+this.direct),t.containEl.classList.add(`mm-${this.layoutName}-node`),t.direct=this.direct,t.isExpand||t.containEl.classList.add("mm-node-collapse"),t.isLeaf()&&!t.containEl.classList.contains("mm-node-leaf")?t.containEl.classList.add("mm-node-leaf"):t.containEl.classList.contains("mm-node-leaf")&&t.containEl.classList.remove("mm-node-leaf")}))),t.containEl.classList.add("mm-node-second"),t.refreshBox()})),"left"==this.direct?this._layoutRight():"right"==this.direct&&this._layoutLeft(),this.root.mindmap.useHandMode?this.createHandDrawLink():this.createLink()}}_layoutLeft(){var t=this,e=this.root,i=e.getMind(),n=e.getBox(),s=e.getPosition(),r=s.y+n.height/2,o=[];this.tops.forEach(((e,i)=>{e.direct="up";var a=e.getCBox();0==i?(e.setPosition(n.width+s.x+40+t.dis/Math.tan(t.angle),r-t.dis-a.height),o=[n.width+s.x+40+t.dis/Math.tan(t.angle)+a.width+t.dis,0]):(e.setPosition(o[0]+t.dis/Math.tan(t.angle),r-t.dis-a.height),o=[o[0]+a.width+t.dis+40,0]),t._layout(e,"top")})),this.bottoms.forEach(((e,i)=>{e.direct="down";var a=e.getBox();if(0==i){var h=n.width+50+(t.dis+a.height)/Math.tan(t.angle)+t.dis;e.setPosition(h+s.x,r+t.dis),o=[h+a.width+t.dis+40,0]}else e.setPosition(o[0]+(t.dis+a.height)/Math.tan(t.angle)+t.dis,r+t.dis),o=[o[0]+a.width+t.dis,0];t._layout(e,"bottom")})),this.tops.forEach(((t,e)=>{if(e>0){var n=i.getBBox(this.tops[e-1]),s=t.getPosition(),r=n.right-s.x+this.dis+40;this.moveNode(t,r,0)}})),this.bottoms.forEach(((t,e)=>{if(e>0){var n=i.getBBox(this.bottoms[e-1]),s=t.getPosition(),r=n.right-s.x+this.dis+40;this.moveNode(t,r,0)}})),this.tops.forEach((t=>{this._updateNodeAssist(t,this.root)})),this.bottoms.forEach((t=>{this._updateNodeAssist(t,this.root)})),this._updateRootAssist()}_layoutRight(){var t=this,e=this.root,i=e.getMind(),n=e.getBox(),s=e.getPosition(),r=s.y+n.height/2,o=[];this.tops.forEach(((e,i)=>{e.direct="up";var n=e.getBox();0==i?(e.setPosition(s.x-n.width-t.dis-t.dis/Math.tan(t.angle)-40,r-t.dis-n.height),o=[s.x-n.width-t.dis-t.dis/Math.tan(t.angle)-40,0]):(e.setPosition(o[0]-n.width-t.dis-t.dis/Math.tan(t.angle)-40,r-t.dis-n.height),o=[o[0]-n.width-t.dis-t.dis/Math.tan(t.angle)-40,0]),t._layout1(e,"top")})),this.bottoms.forEach(((e,i)=>{e.direct="down";var n=e.getBox();if(0==i){var a=s.x-n.width-t.dis-(t.dis+n.height)/Math.tan(t.angle)-40;e.setPosition(a,r+t.dis),o=[a,0]}else e.setPosition(o[0]-n.width-(t.dis+n.height)/Math.tan(t.angle)-t.dis-40,r+t.dis),o=[o[0]-(t.dis+n.height)/Math.tan(t.angle)-t.dis-40,0];t._layout1(e,"bottom")})),this.tops.forEach(((t,e)=>{if(e>0){var n=i.getBBox(this.tops[e-1]),s=t.getPosition(),r=t.getBox(),o=s.x-n.x+this.dis+r.width+40;this.moveNode(t,-o,0)}})),this.bottoms.forEach(((t,e)=>{if(e>0){var n=i.getBBox(this.bottoms[e-1]),s=t.getPosition(),r=t.getBox(),o=s.x-n.x+this.dis+r.width+40;this.moveNode(t,-o,0)}})),this.tops.forEach((t=>{this._updateNodeAssist(t)})),this.bottoms.forEach((t=>{this._updateNodeAssist(t)})),this._updateRootAssist()}_layout(t,e){if(t.isExpand){t.layout&&(t.layout.group&&(t.layout.group.clear(),t.layout.group.remove(),t.layout.group=null),t.layout.svgDom&&(t.layout.svgDom.clear(),t.layout.svgDom.remove(),t.layout.svgDom=null));var i=this,n=t.getMind();if("top"==e){var s=t.getBox(),r=t.getPosition(),o=s.width+r.x+i.dis,a=t.getChildren(),h=0,l=0;a.forEach(((t,d)=>{if(t.isShow()){t.callout&&t.callout.refresh();var c=t.getCBox();if(0==d)l=o+(i.dis+s.height+c.bh)/Math.tan(i.angle),h=r.y-c.height-c.bh-i.dis,t.setPosition(l,h);else{var u=n.getBBox(a[d-1]),p=a[d-1].getCBox(),m=(p.y-u.y+i.dis+c.bh+p.height)/Math.tan(i.angle),f=p.x+m,g=u.y-i.dis-c.height-c.bh;t.setPosition(f,g)}i._updateNodeAssist(t,i.root),i._layout(t,e)}}))}else{s=t.getBox(),r=t.getPosition(),o=s.width+r.x+i.dis,h=0,l=0,a=t.getChildren();t.getChildren().forEach(((t,d)=>{if(t.isShow()){t.callout&&t.callout.refresh();var c=t.getCBox();if(0==d){var u=(i.dis+c.th+c.height)/Math.tan(i.angle);l=o+u,h=r.y+s.height+i.dis+c.th+0,t.setPosition(l,h)}else{var p=n.getBBox(a[d-1]),m=a[d-1].getCBox(),f=(u=(i.dis+c.th+c.height+p.y+p.height-m.y-m.height)/Math.tan(i.angle),m.x+u),g=p.y+p.height+i.dis+c.th;t.setPosition(f,g)}i._updateNodeAssist(t,i.root),i._layout(t,e)}}))}}}_layout1(t,e){if(t.isExpand){t.layout&&(t.layout.group&&(t.layout.group.clear(),t.layout.group.remove(),t.layout.group=null),t.layout.svgDom&&(t.layout.svgDom.clear(),t.layout.svgDom.remove(),t.layout.svgDom=null));var i=this,n=t.getMind(),s=t.getChildren();if("top"==e){var r=t.getBox(),o=(a=t.getPosition()).x-i.dis;s.forEach(((t,h)=>{if(t.isShow()){t.callout&&t.callout.refresh();var l=t.getCBox();if(0==h){var d=o-l.width-(r.height+i.dis+l.bh)/Math.tan(i.angle),c=a.y-l.height-l.bh-i.dis;t.setPosition(d,c)}else{var u=n.getBBox(s[h-1]),p=s[h-1].getBox(),m=(p.y-u.y+i.dis+p.height+l.bh+0)/Math.tan(i.angle),f=p.x+p.width-l.width-m,g=u.y-i.dis-l.height-l.bh-0;t.setPosition(f,g)}i._updateNodeAssist(t,i.root),i._layout1(t,e)}}))}else{var a;r=t.getBox(),o=(a=t.getPosition()).x-i.dis;t.getChildren().forEach(((t,h)=>{if(t.isShow()){t.callout&&t.callout.refresh();var l=t.getCBox();if(0==h){var d=o-l.width-(l.height+i.dis+l.th+0)/Math.tan(i.angle),c=a.y+r.height+i.dis+l.th+0;t.setPosition(d,c)}else{var u=n.getBBox(s[h-1]),p=s[h-1].getBox(),m=u.y+u.height-p.y-p.height,f=(m+i.dis+l.th+0+l.height)/Math.tan(i.angle),g=p.x+p.width-l.width-f,A=p.y+i.dis+m+l.th+0+p.height;t.setPosition(g,A)}i._updateNodeAssist(t,i.root),i._layout1(t,e)}}))}}}adjustNode(t,e){var i=t.getPosition(),n=t.getBBox(),s=t.getParent(),r=s.getPosition(),o=s.getBBox();if("top"==e)var a=r.y-i.y;else a=i.y-r.y-o.height+n.height;for(var h=a/Math.tan(this.angle);s.getLevel()>1;){r=s.getPosition(),s.getSiblings().forEach((t=>{var i=t.getPosition();"top"==e?i.yr.y&&this.moveNode(t,h,a)})),s=s.getParent()}}adjustNode1(t,e){var i=t.getPosition(),n=t.getBBox(),s=t.getParent(),r=s.getPosition(),o=s.getBBox();if("top"==e)var a=r.y-i.y;else a=i.y-r.y-o.height+n.height;for(var h=a/Math.tan(this.angle);s.getLevel()>1;){r=s.getPosition(),s.getSiblings().forEach((t=>{var i=t.getPosition();"top"==e?i.yr.y&&this.moveNode(t,-h,a)})),s=s.getParent()}}createHandDrawLink(){if(this.svgDom&&this.svgDom.clear(),!this.svgDom)return;if(0==this.root.getChildren().length)return;if("left"==this.direct)return void this.createHandDrawLink1();var t=vt.svg(this.root.mindmap.draw),e=this;this.dis;var i=this.root.getLevel();function n(s,r){var o=s.getBox(),a=s.getPosition();let h=s.parent.stroke?s.parent.stroke:s.stroke?s.stroke:kt();if(s.stroke||(s.stroke=h),s._barDom&&(s._barDom.style.backgroundColor=h,s._barDom.style.borderColor=h),s.getLevel()==i+1){if("top"==r){var l=[a.x-e.dis/Math.tan(e.angle),parseInt(a.y+o.height+e.dis)],d=[(c=[a.x,a.y+o.height+1])[0]+o.width+1,c[1]];e.svgDom.node.appendChild(t.linearPath(e.linePoint([l,c,d],1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}else if("bottom"==r){var c;l=[a.x-(e.dis+o.height)/Math.tan(e.angle),parseInt(a.y-e.dis)],d=[(c=[a.x,a.y+o.height+1])[0]+o.width+1,c[1]];e.svgDom.node.appendChild(t.linearPath(e.linePoint([l,c,d],1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}}else{var u=s.getParent(),p=u.getPosition(),m=u.getBox();if(s.isLast())var f=[l=[p.x+m.width-1,p.y+m.height+1],[l[0]+e.dis,l[1]],g=[a.x,a.y+o.height+1],d=[g[0]+o.width,g[1]]];else{var g;f=[g=[a.x,a.y+o.height+1],d=[g[0]+o.width,g[1]]]}e.svgDom.node.appendChild(t.linearPath(e.linePoint(f,1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}s.isExpand&&s.getChildren().forEach((t=>{n(t,r)}))}this.root.children.forEach(((t,e)=>{t.stroke||(t.stroke=this.colors[e]||kt())})),this.tops.forEach((t=>{n(t,"top")})),this.bottoms.forEach((t=>{n(t,"bottom")})),this.createHandDrawBone()}createLink(){if(this.svgDom&&this.svgDom.clear(),!this.svgDom)return;if(0==this.root.getChildren().length)return;if("left"==this.direct)return void this.createLink1();var t=this;this.dis;var e=this.root.getLevel();function i(n,s){var r=n.getBox(),o=n.getPosition();let a=n.parent.stroke?n.parent.stroke:n.stroke?n.stroke:kt();if(n.stroke||(n.stroke=a),n._barDom&&(n._barDom.style.backgroundColor=a,n._barDom.style.borderColor=a),n.getLevel()==e+1){if("top"==s){var h=[o.x-t.dis/Math.tan(t.angle),parseInt(o.y+r.height+t.dis)],l=[(d=[o.x,o.y+r.height+1])[0]+r.width+1,d[1]];(c=t.svgDom.polyline(t.linePoint([h,d,l],2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}else if("bottom"==s){var d;h=[o.x-(t.dis+r.height)/Math.tan(t.angle),parseInt(o.y-t.dis)],l=[(d=[o.x,o.y+r.height+1])[0]+r.width+1,d[1]];(c=t.svgDom.polyline(t.linePoint([h,d,l],2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}}else{var c,u=n.getParent(),p=u.getPosition(),m=u.getBox();if(n.isLast())var f=[h=[p.x+m.width-1,p.y+m.height+1],[h[0]+t.dis,h[1]],g=[o.x,o.y+r.height+1],l=[g[0]+r.width,g[1]]];else{var g;f=[g=[o.x,o.y+r.height+1],l=[g[0]+r.width,g[1]]]}(c=t.svgDom.polyline(t.linePoint(f,2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}n.isExpand&&n.getChildren().forEach((t=>{i(t,s)}))}this.root.children.forEach(((t,e)=>{t.stroke||(t.stroke=this.colors[e]||kt())})),this.tops.forEach((t=>{i(t,"top")})),this.bottoms.forEach((t=>{i(t,"bottom")})),this.creatBone()}createHandDrawLink1(){var t=this;if(this.dis,!this.svgDom)return;if(this.svgDom&&this.svgDom.clear(),0==this.root.getChildren().length)return;var e=vt.svg(this.root.mindmap.draw);var i=this.root.getLevel();function n(s,r){var o=s.getBox(),a=s.getPosition();let h=s.parent.stroke?s.parent.stroke:s.stroke?s.stroke:kt();if(s.stroke||(s.stroke=h),s._barDom&&(s._barDom.style.backgroundColor=h,s._barDom.style.borderColor=h),s.getChildren().length,s.getLevel()==i+1){if("top"==r){var l=[a.x+o.width+t.dis/Math.tan(t.angle),parseInt(a.y+o.height+t.dis)],d=[a.x+o.width,a.y+o.height+1],c=[a.x-1,d[1]];t.svgDom.node.appendChild(e.linearPath(t.linePoint([l,d,c],1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}else if("bottom"==r){l=[a.x+o.width+(t.dis+o.height)/Math.tan(t.angle),parseInt(a.y-t.dis)],d=[a.x+o.width,a.y+o.height+1],c=[a.x-1,d[1]];t.svgDom.node.appendChild(e.linearPath(t.linePoint([l,d,c],1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}}else{var u=s.getParent(),p=u.getPosition(),m=u.getBox();if(s.isLast())var f=[l=[p.x+1,p.y+m.height+1],[l[0]-t.dis,l[1]],g=[a.x+o.width,a.y+o.height+1],c=[a.x,g[1]]];else{var g;f=[g=[a.x+o.width,a.y+o.height+1],c=[a.x,g[1]]]}t.svgDom.node.appendChild(e.linearPath(t.linePoint(f,1),{stroke:h,strokeWidth:1,fill:"none",roughness:.6}))}s.isExpand&&s.getChildren().forEach((t=>{n(t,r)}))}this.root.children.forEach(((t,e)=>{t.stroke||(t.stroke=this.colors[e]||kt())})),this.tops.forEach((t=>{n(t,"top")})),this.bottoms.forEach((t=>{n(t,"bottom")})),this.createHandDrawBone1()}createLink1(){var t=this;if(this.dis,!this.svgDom)return;if(this.svgDom&&this.svgDom.clear(),0==this.root.getChildren().length)return;var e=this.root.getLevel();function i(n,s){var r=n.getBox(),o=n.getPosition();let a=n.parent.stroke?n.parent.stroke:n.stroke?n.stroke:kt();if(n.stroke||(n.stroke=a),n._barDom&&(n._barDom.style.backgroundColor=a,n._barDom.style.borderColor=a),n.getChildren().length,n.getLevel()==e+1){if("top"==s){var h=[o.x+r.width+t.dis/Math.tan(t.angle),parseInt(o.y+r.height+t.dis)],l=[o.x+r.width,o.y+r.height+1],d=[o.x-1,l[1]];(c=t.svgDom.polyline(t.linePoint([h,l,d],2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}else if("bottom"==s){h=[o.x+r.width+(t.dis+r.height)/Math.tan(t.angle),parseInt(o.y-t.dis)],l=[o.x+r.width,o.y+r.height+1],d=[o.x-1,l[1]];(c=t.svgDom.polyline(t.linePoint([h,l,d],2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}}else{var c,u=n.getParent(),p=u.getPosition(),m=u.getBox();if(n.isLast())var f=[h=[p.x+1,p.y+m.height+1],[h[0]-t.dis,h[1]],g=[o.x+r.width,o.y+r.height+1],d=[o.x,g[1]]];else{var g;f=[g=[o.x+r.width,o.y+r.height+1],d=[o.x,g[1]]]}(c=t.svgDom.polyline(t.linePoint(f,2))).fill("none"),c.stroke({color:a,width:2,linecap:"round",linejoin:"round"})}n.isExpand&&n.getChildren().forEach((t=>{i(t,s)}))}this.root.children.forEach(((t,e)=>{t.stroke||(t.stroke=this.colors[e]||kt())})),this.tops.forEach((t=>{i(t,"top")})),this.bottoms.forEach((t=>{i(t,"bottom")})),this.creatBone1()}createHandDrawBone(){var t=this;if(!this.isShow)return;if(!this.svgDom)return;var e=vt.svg(this.root.mindmap.draw),i=this.root.getMind(),n=this.root,s=n.getBox(),r=n.getPosition(),o=i.getBoundingRect(n.getShowNodeList());let a=this.stroke;var h=parseInt(r.x+s.width)+.5,l=parseInt(r.y+s.height/2)+.5,d=parseInt(r.x+o.width+30)+.5,c=l;t.svgDom.node.appendChild(e.polygon([[h,l-3],[d,c],[h,l+3]],{stroke:a,strokeWidth:1,fill:a,roughness:.4}));var u=[r.x+o.width+30,l],p=[u[0]+60,u[1]-30],m=[u[0]+60,u[1]+30];t.fishTail=e.polygon([u,p,m],{stroke:a,strokeWidth:1,fill:a,roughness:.6}),t.svgDom.node.appendChild(t.fishTail)}creatBone(){var t=this;if(!this.isShow)return;if(!this.svgDom)return;var e=this.root.getMind(),i=this.root,n=i.getBox(),s=i.getPosition(),r=e.getBoundingRect(i.getShowNodeList());let o=this.root.stroke||this.stroke;this.stroke;var a=parseInt(s.x+n.width),h=parseInt(s.y+n.height/2),l=parseInt(s.x+r.width+30),d=h;t.svgDom.line(a,h,l,d).stroke({color:o,width:2,linecap:"round",linejoin:"round"});var c=[s.x+r.width+30,h],u=[c[0]+60,c[1]-30],p=[c[0]+60,c[1]+30];t.fishTail=t.svgDom.polygon([c,u,p]).fill("lightskyblue").stroke({color:o,width:2,linecap:"round",linejoin:"round"})}createHandDrawBone1(){var t=this;if(!this.svgDom)return;var e=vt.svg(this.root.mindmap.draw),i=this.root,n=i.getMind(),s=i.getBox(),r=i.getPosition(),o=n.getBoundingRect(i.getShowNodeList());let a=this.stroke;var h=parseInt(r.x)+.5,l=parseInt(r.y+s.height/2)+.5,d=parseInt(o.x-40)+.5,c=l;t.svgDom.node.appendChild(e.polygon([[h,l-3],[d,c],[h,l+3]],{stroke:a,strokeWidth:1,fill:a,roughness:.4}));var u=[o.x-40,l],p=[u[0]-60,u[1]-30],m=[u[0]-60,u[1]+30];t.fishTail=e.polygon([u,p,m],{stroke:a,strokeWidth:1,fill:a,roughness:.6}),t.svgDom.node.appendChild(t.fishTail)}creatBone1(){var t=this;if(!this.svgDom)return;var e=this.root,i=e.getMind(),n=e.getBox(),s=e.getPosition(),r=i.getBoundingRect(e.getShowNodeList());let o=this.root.stroke||this.stroke;var a=parseInt(s.x),h=parseInt(s.y+n.height/2),l=parseInt(r.x-40),d=h;t.svgDom.line(a,h,l,d).stroke({color:o,width:2,linecap:"round",linejoin:"round"});var c=[r.x-40,h],u=[c[0]-60,c[1]-30],p=[c[0]-60,c[1]+30];t.fishTail=t.svgDom.polygon([c,u,p]).fill("lightskyblue").stroke({color:o,width:2,linecap:"round",linejoin:"round"})}refresh(){this.tops=[],this.bottoms=[],this.layout(this.root,this.direct)}},tree:class extends It{constructor(t,e,i){super("tree"),this.layoutName="tree",this.direct="down",this.levelDis=20,this.dis=10,this.firstLevel=60,this.firstNodeDis=20,this.isCache=!0,this.lefts=[],this.rights=[],this.colors=[],this.lineWidth=2,this.cache={},this.group=null,this.root=t,"down"!=e&&"up"!=e||(this.direct=e),this.colors=i||[],this.mind=this.root.mindmap,this.group||(this.group=this.mind.edgeGroup.group())}layout(t,e){t&&(this.root=t),this.direct=e&&("down"==e||"up"==e)?e:"down",t.layout=this,this.group||(this.group=this.root.getMind().edgeGroup.group()),this.svgDom=this.group,this.root.isShow()&&(t.children.forEach((t=>{this.setDirect(t)})),this._doLayout(t),this.doLayout(t),this.root.nodeType&&"induce"!=this.root.nodeType&&this.refreshLayout(),this._updateRootAssist()),this.createLink()}setDirect(t){if(t.direct=this.direct,t.containEl){var e=t.containEl.classList.contains("mm-node-second");t.containEl.setAttribute("class",""),t.containEl.classList.add("mm-node"),t.containEl.classList.add("mm-node-"+this.direct),t.belongInduce&&t.containEl.classList.add("mm-node-induce"),t.isLeaf()&&!t.containEl.classList.contains("mm-node-leaf")?t.containEl.classList.add("mm-node-leaf"):t.containEl.classList.contains("mm-node-leaf")&&t.containEl.classList.remove("mm-node-leaf"),0==t.getLevel()&&this.root.nodeType&&"induce"!=this.root.nodeType&&t.containEl.classList.add("mm-root"),1==t.getLevel()&&this.root.nodeType&&"induce"!=this.root.nodeType&&(t.containEl.classList.add("mm-node-second"),t.refreshBox()),e&&t.refreshBox(),t.isExpand||t.containEl.classList.add("mm-node-collapse"),t.isSelect&&t.containEl.classList.add("mm-node-select"),(t===this.root||!t.layout&&t.isExpand)&&t.children.forEach((t=>{this.setDirect(t)}))}}_doLayout(t){var e=this,i=this.levelDis,n=this.dis,s=t.getBox(),r=t.getPosition();0==t.getLevel()&&(i=this.firstLevel,n=this.firstNodeDis);var o=t.getChildren().length-1;let a=0;if(t.getChildren().forEach((function(t,e){let i=t.getBox();a+=i.width,e!=o&&(a+=n)})),"down"==this.direct){let e=r.y+s.height+i,o=r.x+s.width/2-a/2,h=0;t.getChildren().forEach((function(t,i){t.callout&&t.callout.refresh();let s=t.getCBox();var r=e+s.th;0==i?(t.setPosition(o,r),h=o+s.width+n):(t.setPosition(h,r),h=h+s.width+n)}))}else{let e=r.y-i,o=r.x+s.width/2-a/2,h=0;t.getChildren().forEach((function(t,i){t.callout&&t.callout.refresh(),t.wireFrame&&t.wireFrame.refresh();let s=t.getCBox();0==i?(t.setPosition(o,e-s.height-s.bh),h=o+s.width+n):(t.setPosition(h,e-s.height-s.bh),h=h+s.width+n)}))}if("down"==this.direct&&t.layout&&t!=this.root)if("table"!=t.layout.layoutName){t.layout.layout(t,t.layout.direct||""),s=t.getMind().getBBox(t);var h=t.getCBox().th,l=Math.abs(Math.abs(r.y-s.y)-h);this.moveNode(t,0,l),t.boundingRect=null,t.direct="down"}else t.direct="down",t.boundingRect=null;else t.isExpand&&t.getChildren().forEach((function(t,i){e._doLayout(t)}))}doLayout(t){if(t&&t.isExpand){var e=this,i=t.getMind();i.traverseDF((t=>{if(t!=e.root&&t.isShow()){if(t.layout){if(t.layout!=e&&t.getTopLayout()!=e)return}else if(t.getLayout()!=e&&"down"==e.direct)return;t.callout&&t.callout.isShow&&t.callout.refresh();var n={},s=t.parent;if(s){var r=s.wireFrames,o=s.summaries;r.length&&r.forEach((e=>{if(e.node==t&&(e.refreshNode(),e.refresh(),e.data&&e.data.text))if(n[t.getId()])n[t.getId()].rangeNode=n[t.getId()].rangeNode.concat(e.rangeNode.slice()),n[t.getId()].rangeNode.unique();else{var i=e.getTextBox().height,s=e.rangeNode.slice();n[t.getId()]={node:t,wf:e,topDy:i+4,rangeNode:s}}})),o.length&&o.forEach((e=>{e.node==t&&(e.refreshNode(),e.refresh())}))}var a=t.getBox();if(e.isCache&&t.boundingRect)var h=t.boundingRect;else{var l=t.getShowNodeList(),d=[],c=[],u=[],p=[];if(l.forEach((t=>{t.callout&&t.callout.isShow&&-1==u.indexOf(t)&&u.push(t.callout),t.layout&&t.layout.isShow&&-1==p.indexOf(t.layout)&&p.push(t.layout);var e=t.wireFrames;t.summaries.forEach((t=>{t.isShow()&&-1==c.indexOf(t)&&c.push(t)})),e.forEach((t=>{t.isHide||-1==d.indexOf(t)&&d.push(t)}))})),l=l.concat(d).concat(u),c.forEach((t=>{l=l.concat(t.getAllItem())})),l.length){h=i.getBoundingRect(l);p.length&&p.forEach((t=>{if("fish"==t.layoutName&&"down"==e.direct&&("right"==t.direct?t.creatBone():t.creatBone1(),t.fishTail)){var i=t.fishTail.bbox();i.xh.right&&(h.right=i.x+i.width),i.y+i.height>h.bottom&&(h.bottom=i.y+i.height),h.width=h.right-h.x,h.height=h.bottom-h.y}}))}}if(e.isCache&&t.boundingRect)var m=t.boundingRect.leftDx,f=t.boundingRect.rightDx;else{m=Math.abs(h.x-a.x),f=Math.abs(h.right-a.x-a.width);var g={},A={};r&&r.length&&r.forEach((e=>{var i=e.leftNode;if(e.node==t){if(g[i])return;g[i]=!0,m+=6}if(e.endNode&&e.endNode==t){var n=e.rightNode;if(A[n])return;A[n]=!0,f+=6}})),h.leftDx=m,h.rightDx=f,t.boundingRect=h}if(e.adjustNode(t,m,f,0),"top"!==t.direct)for(let t in n)e.adjustNode(n[t].node,0,0,n[t].topDy,n[t]);r&&r.length&&r.forEach((e=>{e.endNode==t&&e.refresh()})),o&&o.length&&o.forEach((e=>{e.endNode==t&&e.refresh()}))}}),t,!1)}}adjustNode(t,e,i,n,s){var r=this;if(s)s.rangeNode.forEach((t=>{"down"==r.direct?r.moveNode(t,0,n):r.moveNode(t,0,-n)}));else if(t&&t!=this.root){var o=t.getPosition();t.getSiblings().forEach((function(t){let n=t.getPosition();if(o.x>n.x){if(0==e)return;r.moveNode(t,-e,0)}else{if(0==i)return;r.moveNode(t,i,0)}}))}}refreshLayout(){var t=this.root,e=t.getPosition(),i=t.getBox(),n=e.x+i.width/2,s=t.getChildren();if(s.length>=2){var r=s[0],o=s[s.length-1],a=r.getPosition(),h=o.getPosition(),l=o.getBox(),d=h.x+l.width-n,c=n-a.x;if(Math.abs(d)!=Math.abs(c)){var u=Math.abs(Math.abs(d)-Math.abs(c))/2;Math.abs(d)>Math.abs(c)?s.forEach((t=>{this.moveNode(t,-u,0)})):s.forEach((t=>{this.moveNode(t,u,0)}))}}}createLink(){"down"==this.direct?this.createDownLink():this.createUpLink()}createDownLink(){var t=this,e=this.root;if(this.group&&this.group.clear(),0==this.root.getChildren().length)return;if(!this.group||!this.root.isShow())return;let i=this.lineWidth;function n(t){if(t.isExpand){if(t.layout)return void t.layout.createLink();t.children.forEach((t=>{n(t)}))}}!function e(n){if((!n.layout||n==t.root)&&n.isExpand){var s=n.getPosition(),r=n.getBox();n==t.root&&(r.height+=1),n.getChildren().forEach((function(o,a){let h=o.getBox(),l=o.getPosition(),d={x:s.x+r.width/2,y:s.y+r.height},c=l.x+h.width/2,u=l.y,p=n.stroke?n.stroke:o.stroke?o.stroke:t.colors[a]||kt();if(o.stroke||(o.stroke=p),o._barDom&&(o._barDom.style.backgroundColor=p,o._barDom.style.borderColor=p),1==n.getChildren().length){if(i%2==1)var m=parseInt(d.x+"")+.5,f=d.y,g=parseInt(c+"")+.5,A=parseInt(u+"")+.5;else m=parseInt(d.x+""),f=d.y,g=parseInt(c+""),A=parseInt(u+"");var v=t.group.line(m,f,g,A).stroke({color:p,width:i,linecap:"round",linejoin:"round"})}else{var y=[s.x+r.width/2,s.y+r.height],x=[l.x+h.width/2,l.y];if(0==n.getLevel())var b=[y[0],y[1]+t.firstLevel/2];else b=[y[0],y[1]+t.levelDis/2];if(l.x+h.width/2>s.x+r.width/2)var w=[x[0]-4,b[1]],C=[x[0],b[1]+4];else w=[x[0]+4,b[1]],C=[x[0],b[1]+4];var E=[y,b,w],k=[C,x];if(E.length>2){(v=t.group.polyline(t.linePoint(E,i))).fill("none"),v.stroke({color:p,width:i,linecap:"round",linejoin:"round"});var I=t.linePoint([C],i)[0],B=t.linePoint([w],i)[0],D=`M${I[0]} ${I[1]},Q${I[0]} ${B[1]},${B[0]} ${B[1]}`,N=t.group.path().stroke({color:p,width:i,linecap:"round",linejoin:"round"});N.plot(D),N.fill("none"),(v=t.group.polyline(t.linePoint(k,i))).fill("none"),v.stroke({color:p,width:i,linecap:"round",linejoin:"round"})}else{(v=t.group.polyline(t.linePoint(E,i))).fill("none"),v.stroke({color:p,width:i,linecap:"round",linejoin:"round"})}}e(o)}))}}(e),e.children.forEach(((t,e)=>{n(t)}))}createUpLink(){var t=this,e=this.root;if(this.group&&this.group.clear(),0==this.root.getChildren().length)return;if(!this.group||!this.root.isShow())return;let i=this.lineWidth;(e=this.root).children.forEach(((t,e)=>{t.stroke||(t.stroke=this.colors[e]||kt())})),function e(n){if(n.layout&&n!=t.root&&n.layout.group&&n.layout.group.clear(),n.isExpand){var s=n.getPosition(),r=n.getBox();n.getLevel(),n.getChildren().forEach((function(o,a){let h=o.getCBox(),l=o.getPosition(),d=parseInt(s.x+r.width/2+""),c=parseInt(s.y+""),u=parseInt(l.x+h.width/2+""),p=parseInt(l.y+h.height+""),m=n.stroke?n.stroke:o.stroke?o.stroke:kt();if(o.stroke||(o.stroke=m),o._barDom&&(o._barDom.style.backgroundColor=m,o._barDom.style.borderColor=m),1==n.getChildren().length){if(i%2==1)var f=parseInt(d+"")+.5,g=parseInt(c+"")+.5,A=parseInt(u+"")+.5,v=parseInt(p+"")+.5;else f=parseInt(d+""),g=parseInt(c+""),A=parseInt(u+""),v=parseInt(p+"");var y=t.group.line(f,g,A,v).stroke({color:m,width:i,linecap:"round",linejoin:"round"})}else{var x=[s.x+r.width/2,s.y],b=[l.x+h.width/2,l.y+h.height],w=[x[0],x[1]-t.levelDis/2];if(o.isFirst()||o.isLast()){if(l.x+h.width/2>s.x+r.width/2)var C=[b[0]-4,w[1]],E=[b[0],w[1]-4];else C=[b[0]+4,w[1]],E=[b[0],w[1]-4];var k=[x,w,C],I=[E,b]}else k=[C=[b[0],w[1]],b];if(k.length>2){(y=t.group.polyline(t.linePoint(k,i))).fill("none"),y.stroke({color:m,width:i,linecap:"round",linejoin:"round"});var B=t.linePoint([E],i)[0],D=t.linePoint([C],i)[0],N=`M${B[0]} ${B[1]},Q${B[0]} ${D[1]},${D[0]} ${D[1]}`,S=t.group.path().stroke({color:m,width:i,linecap:"round",linejoin:"round"});S.plot(N),S.fill("none"),(y=t.group.polyline(t.linePoint(I,i))).fill("none"),y.stroke({color:m,width:i,linecap:"round",linejoin:"round"})}else{(y=t.group.polyline(t.linePoint(k,i))).fill("none"),y.stroke({color:m,width:i,linecap:"round",linejoin:"round"})}}e(o)}))}}(e)}refresh(){var t=this.root;this.layout(t,this.direct),this.createLink()}},multipleTree:class extends It{constructor(t,e,i){super("multipleTree"),this.mind=null,this.colors=[],this.layoutName="multipleTree",this.type="multipleTree",this.levelDis=20,this.firstLevelDis=40,this.nodeDis=18,this.root=null,this.rootLevel=0,this.rights=[],this.lefts=[],this.isCache=!1,this.name="multipleTree",this.lineWidth=2,this.root=t,this.mind=this.root.mindmap,this.colors=i||[],this.direct=e||"multipleTree",this.svgDom||(this.svgDom=this.mind.edgeGroup.group())}layout(t,e){if(this.rights=[],this.lefts=[],this.root=t||this.root,this.rootLevel=this.root.getLevel(),this.root.layout=this,this.direct=e,this.root.containEl.classList.contains("mm-multipleTree-node")||(this.root.containEl.classList.add("mm-node-down"),this.root.containEl.classList.add("mm-multipleTree-node")),this.svgDom||(this.svgDom=this.root.mindmap.edgeGroup.group()),"right"==this.direct)this.root.children.forEach((t=>{this.rights.push(t),this.setDirect(t,"right")}));else if("left"==this.direct)this.root.children.forEach((t=>{this.lefts.push(t),this.setDirect(t,"left")}));else{var i=this.root.children.length;this.root.children.forEach(((t,e)=>{e{this.setDirect(t,e)}))}}_layoutTow(){this.root.isExpand&&this.root.isShow()&&(this._layoutRight(),this._layoutLeft())}_layoutRight(){var t=this.root.getCBox();this.rights.forEach(((e,i)=>{e.callout&&e.callout.refresh(),this._layoutRightNode(e,i,t,!0,e.getLevel()-1)}))}getParentPos(t){t.getLevel();var e=t.getDomBox();return{x:e.x+e.width/2,y:e.y+e.height}}_layoutRightNode(t,e,i,n,s){var r=this.root.getMind(),o=i.x+i.width/2,a=i.y+i.height;if(0==e){var h=t.getCBox(!0);t.setPosition(o+this.levelDis,a+this.nodeDis+h.th+i.bh)}else{var l=t.getCBox(!0);if(n){let i=this.rights[e-1];if(this.isCache&&i.boundingRect)var d=i.boundingRect;else{d=r.getBBox(i);i.boundingRect=d}var c=i.getPosition();if(i.layout){var{x:u}=this.getParentPos(i.parent);t.setPosition(u+this.levelDis,d.y+d.height+this.nodeDis+l.th)}else t.setPosition(c.x,d.y+d.height+this.nodeDis+l.th)}else{var p=t.parent.children[e-1];let i=p.getPosition();if(this.isCache&&p.boundingRect)d=p.boundingRect;else{d=r.getBBox(p);p.boundingRect=d}if(p.layout){var{x:u}=this.getParentPos(p.parent);t.setPosition(u+this.levelDis,d.y+d.height+this.nodeDis+l.th)}else t.setPosition(i.x,d.y+d.height+this.nodeDis+l.th)}}if(t.layout){if("table"!=t.layout.layoutName){t.layout.layout(t,t.layout.direct||"");let e=t.getPosition();i=r.getBBox(t);t.boundingRect=i;var m=Math.abs(e.x-i.x);if(h)var f=Math.abs(e.y-i.y)-h.th;else f=Math.abs(e.y-i.y);return this.moveNode(t,m,f),t.direct="right",void this._updateNodeAssist(t)}return t.boundingRect=null,t.direct="right",void this._updateNodeAssist(t)}if(this._updateNodeAssist(t),t.isExpand){var g=t.getCBox(!0);t.children.forEach(((t,e)=>{t.callout&&t.callout.refresh(),this._layoutRightNode(t,e,g)}))}}_layoutLeft(){var t=this.root.getCBox();this.lefts.forEach(((e,i)=>{e.callout&&e.callout.refresh(),this._layoutLeftNode(e,i,t,!0,e.getLevel()-1)}))}_layoutLeftNode(t,e,i,n,s){var r=this.root.getMind(),o=i.x+i.width/2,a=i.y+i.height,{width:h,th:l}=t.getCBox(!0);if(0==e){var d=0;s==this.rootLevel&&(d=20),t.setPosition(o-h-this.levelDis,a+this.nodeDis+d+l+i.bh)}else{var c=t.getCBox(!0);if(n){var u=this.lefts[e-1];if(this.isCache&&u.boundingRect)var p=u.boundingRect;else{p=r.getBBox(u);u.boundingRect=p}if(u.layout){var{x:m}=this.getParentPos(u.parent);t.setPosition(m-this.levelDis-h,p.y+p.height+this.nodeDis+c.th)}else{var f=u.getCBox(!0);t.setPosition(f.x+f.width-h,p.y+p.height+this.nodeDis+c.th)}}else{let i=t.parent.children[e-1];p=r.getBBox(i);if(this.isCache&&i.boundingRect)p=i.boundingRect;else{p=r.getBBox(i);i.boundingRect=p}if(i.layout){var{x:m}=this.getParentPos(i.parent);t.setPosition(m-this.levelDis-h,p.y+p.height+this.nodeDis+c.th)}else{let e=i.getCBox(!0);t.setPosition(e.x+e.width-h,p.y+p.height+this.nodeDis+c.th)}}}if(t.layout){if("table"!=t.layout.layoutName){t.layout.layout(t,t.layout.direct||"");var g=t.getPosition(),A=(i=r.getBBox(t),Math.abs(g.x+h-i.x-i.width)),v=Math.abs(g.y-i.y)-l;return this.moveNode(t,-A,v),t.direct="left",void this._updateNodeAssist(t)}g=t.getPosition(),i=r.getBBox(t),A=Math.abs(g.x+h-i.x-i.width),v=Math.abs(g.y-i.y)-l;return this.moveNode(t,-A,v),t.direct="left",t.boundingRect=null,void this._updateNodeAssist(t)}if(this._updateNodeAssist(t),t.isExpand){var y=t.getCBox(!0);t.children.forEach(((t,e)=>{t.callout&&t.callout.refresh(),this._layoutLeftNode(t,e,y)}))}}createLink(){var t=this;if(this.svgDom&&this.svgDom.clear(),this.svgDom&&this.root.isShow()&&0!=this.root.getChildren().length){var e=this.lineWidth;kt(),this.root.children.forEach(((t,e)=>{t.stroke||(t.stroke=this.colors[e]||kt())})),function i(n){if(n.isExpand){var s=Object.assign({},n.getBox());n!=t.root&&(s.height+=1);var r=[s.x+s.width/2,s.y+s.height];n.children.forEach((s=>{var o=Object.assign({},s.getBox());o.height+=1;var a=n.stroke?n.stroke:s.stroke?s.stroke:kt();if(s.stroke||(s.stroke=a),s._barDom&&(s._barDom.style.backgroundColor=a,s._barDom.style.borderColor=a),"right"==s.direct)var h=t.linePoint([[r[0],o.y+o.height-6]],e)[0],l=t.linePoint([[o.x+o.width,o.y+o.height]],e)[0],d=t.linePoint([[h[0]+6,l[1]]],e)[0],c=`M${h[0]} ${h[1]},Q${h[0]} ${h[1]+6},${d[0]} ${d[1]}`;else h=t.linePoint([[r[0],o.y+o.height-6]],e)[0],l=t.linePoint([[o.x,o.y+o.height]],e)[0],d=t.linePoint([[h[0]-6,l[1]]],e)[0],c=`M${h[0]} ${h[1]},Q${h[0]} ${h[1]+6},${d[0]} ${d[1]} `;var u=t.svgDom.path().stroke({color:a,width:e,linecap:"round",linejoin:"round"});u.plot(c),u.fill("none");var p=t.svgDom.line(t.linePoint([r,h],e));p.fill("none"),p.stroke({color:a,width:e,linecap:"round",linejoin:"round"});var m=t.svgDom.line(t.linePoint([d,l],e));m.fill("none"),m.stroke({color:a,width:e,linecap:"round",linejoin:"round"}),s.layout||i(s)}))}}(this.root),this.root.children.forEach(((t,e)=>{i(t)}))}function i(t){if(t.isExpand){if(t.layout)return void t.layout.createLink();t.children.forEach((t=>{i(t)}))}}}refresh(){this.layout(this.root,this.direct),this.createLink()}},vertical:class extends It{constructor(t,e,i){if(super("vertical"),this.layoutName="vertical",this.type="vertical",this.dis=40,this.direct="vertical",this.isCache=!0,this.root=null,this.colors=[],this.svgDom=null,this.root=t,this.direct=e||"vertical",this.colors=i||[],!t.stroke){var n=kt();t.data.stroke=n,t.stroke=n}}layout(t,e){this.direct=e||"vertical",this.root=t||this.root,this.root.parent||this.root.containEl.classList.contains("mm-root")||this.root.containEl.classList.add("mm-root"),this.svgDom||(this.svgDom=this.root.getMind().edgeGroup.group()),this.root.layout=this,this._layout(this.root,this.direct),this._updateRootAssist(),this.createLink()}_layout(t,e){var i=this;this.root=t,this.direct=e||"vertical";var n=this.root.mindmap,s=this.root.getPosition(),r=this.root.getBox(),o=s.x+r.width/2,a=s.y+r.height;this.root.isExpand&&(this.root.children.forEach(((t,e)=>{var s="right";e%2==0&&(s="left");var r;if(t.stroke)var h=t.stroke;else h=this.colors[e]||kt(),t.data.stroke=h,t.stroke=h;r=new Array(100).fill(h),!t.layout&&(t.layout=new Dt(t,s,r)),t.layout.root=t;var l=t.getBox();if(0==e)t.setPosition(o-l.width/2,a+this.dis);else{var d=this.root.children[e-1],c=n.getBBox(d);t.boundingRect=c;var u=c.bottom;t.setPosition(o-l.width/2,u+this.dis)}t.layout.layout(t,s||this.direct||""),t.callout&&t.callout.refresh();var p=t.getPosition(),m=(l=n.getBBox(t),Math.abs(p.y-l.y));this.moveNode(t,0,m),t.containEl.classList=[],t.containEl.classList.add("mm-node"),t.containEl.classList.add("mm-node-"+s),t.containEl.classList.add("mm-node-second"),t.containEl.classList.add("mm-vertical-node"),t.isLeaf()?t.containEl.classList.contains("mm-node-leaf")||t.containEl.classList.add("mm-node-leaf"):t.containEl.classList.contains("mm-node-leaf")&&t.containEl.classList.remove("mm-node-leaf"),this._updateNodeAssist(t,i.root)})),this._updateNodeAssist(this.root,this.root))}createLink(){var t=this.root.children,e=t.length;if(this.svgDom&&this.svgDom.clear(),!this.svgDom||!this.root.isShow())return;if(0==e)return;let i=this.root.stroke?this.root.stroke:kt();var n=t[e-1];var s=this.root.getPosition(),r=this.root.getCBox();n.getCBox();var o=n.getPosition(),a=s.x+r.width/2,h=a,l=s.y+r.height,d=o.y;this.svgDom.line(a,l,h,d).stroke({color:i,width:2,linecap:"round",linejoin:"round"}),t.forEach((t=>{t.layout.createLink()}))}refresh(){this.layout(this.root,this.direct)}},table:class extends It{constructor(t,e){super("table"),this.layoutName="table",this.direct="",this.data=null,this.levelDis=50,this.nodeDis=6,this.firstLevelDis=80,this.firstNodeDis=20,this.isCache=!0,this.lefts=[],this.rights=[],this.colors=[],this.lineWidth=2,this.tableDom=null,this.lastNode=null,this.x=0,this.y=0,this.root=t,this.direct=e||"right",this.mind=this.root.getMind();var i=this.getData(t),{x:n,y:s}=t.getPosition();this.x=n,this.y=s,this.initTableDom(),this.initTableNode(i),this.layout()}layout(t,e){var i=document.createElement("table");i.classList.add("mm-table"),i.classList.add("mm-table-bordered"),this.tableDom.innerHTML="",this.tableDom.appendChild(i);var n=this.getMaxlevel(),s=document.createElement("thead"),r=document.createElement("tr");i.appendChild(s),this.root.init(n),this.root.tdDom.setAttribute("colspan",n),r.appendChild(this.root.tdDom),s.appendChild(r);var o=[];this.root.children.forEach((t=>{this.mind.traverseDF((t=>{if(t.init(),t.isLeaf()&&1!=t.getLevel()){var e=document.createElement("tr");t.trDom=e,i.appendChild(e),e.appendChild(t.tdDom),o.push(t),t.tdDom.setAttribute("colspan",n-t.getLevel()+1),t.tdDom.setAttribute("rowspan",1)}}),t)})),o.forEach((t=>{for(var e=t.parent;e&&e!=this.root&&!i.querySelector(`[data-id='${e.data.id}']`);){e.tdDom.setAttribute("colspan",1);var n=e.children[0].trDom;n.insertBefore(e.tdDom,n.firstChild),e.trDom=n;var s=this.getRowspan(e);e.tdDom.setAttribute("rowspan",s),e=e.parent}})),this.root.children.forEach(((t,e)=>{if(!i.querySelector(`[data-id='${t.data.id}']`)){var r=document.createElement("tr");if(r.appendChild(t.tdDom),t.tdDom.setAttribute("colspan",n),t.tdDom.setAttribute("rowspan",1),t.trDom=r,0==e)Ui(r,s);else{var o=this.getLastNode(this.root.children[e-1]);o&&Ui(r,o.trDom)}}}))}initTableDom(){if(!this.tableDom){var t=document.createElement("div");t.classList.add("mm-table-content"),t.style.position="absolute",t.style.left=this.x+"px",t.style.top=this.y+"px",this.tableDom=t,this.mind.contentEL.appendChild(t)}}initTableNode(t){var e=this;!function t(i,n,s){var r=new bt(i,e.mind);r._tableDom=e.tableDom,n?(e.root=r,r.layout=e):(s.children.push(r),r.parent=s),r.direct=e.direct,e.lastNode=r,i.children&&i.children.length&&i.children.forEach((e=>{t(e,!1,r)}))}(t,!0),this.initTableDom()}getLastNode(t){return function t(e){var i=e.children.length;return i?t(e.children[i-1]):e}(t)}getMaxlevel(t){var e=0;return this.mind.traverseDF((t=>{var i=t.getLevel();et.children&&t.children.length));if(n.length){var s=[i];n.forEach((e=>{var i=t(e);s.push(i)}));var r=0;return s.forEach((t=>{r+=t})),r-n.length}return i}(t)}getData(t){var e=t.getData();return t.getChildren().length&&(e.children=[],t.getChildren().forEach((t=>{e.children.push(this.getData(t))}))),e}createLink(){}refresh(){this.layout()}setPosition(t,e){this.x=t,this.y=e,this.tableDom&&(this.tableDom.style.left=t+"px",this.tableDom.style.top=e+"px")}getBox(){return this.tableDom?{x:this.x,y:this.y,width:this.tableDom.clientWidth,height:this.tableDom.clientHeight}:{x:this.x,y:this.y,width:0,height:0}}}},St=Ct((function(t,e){!function(e,i){t.exports=e.document?i(e,e.document):function(t){return i(t,t.document)}}("undefined"!=typeof window?window:wt,(function(t,e){var i=(void 0!==this?this:t).SVG=function(t){if(i.supported)return t=new i.Doc(t),i.parser.draw||i.prepare(),t};if(i.ns="http://www.w3.org/2000/svg",i.xmlns="http://www.w3.org/2000/xmlns/",i.xlink="http://www.w3.org/1999/xlink",i.svgjs="http://svgjs.com/svgjs",i.supported=!!e.createElementNS&&!!e.createElementNS(i.ns,"svg").createSVGRect,!i.supported)return!1;i.did=1e3,i.eid=function(t){return"Svgjs"+c(t)+i.did++},i.create=function(t){var i=e.createElementNS(this.ns,t);return i.setAttribute("id",this.eid(t)),i},i.extend=function(){var t,e,n,s;for(e=(t=[].slice.call(arguments)).pop(),s=t.length-1;s>=0;s--)if(t[s])for(n in e)t[s].prototype[n]=e[n];i.Set&&i.Set.inherit&&i.Set.inherit()},i.invent=function(t){var e="function"==typeof t.create?t.create:function(){this.constructor.call(this,i.create(t.create))};return t.inherit&&(e.prototype=new t.inherit),t.extend&&i.extend(e,t.extend),t.construct&&i.extend(t.parent||i.Container,t.construct),e},i.adopt=function(e){return e?e.instance?e.instance:((n="svg"==e.nodeName?e.parentNode instanceof t.SVGElement?new i.Nested:new i.Doc:"linearGradient"==e.nodeName?new i.Gradient("linear"):"radialGradient"==e.nodeName?new i.Gradient("radial"):i[c(e.nodeName)]?new(i[c(e.nodeName)]):new i.Element(e)).type=e.nodeName,n.node=e,e.instance=n,n instanceof i.Doc&&n.namespace().defs(),n.setData(JSON.parse(e.getAttribute("svgjs:data"))||{}),n):null;var n},i.prepare=function(){var t=e.getElementsByTagName("body")[0],n=(t?new i.Doc(t):i.adopt(e.documentElement).nested()).size(2,0);i.parser={body:t||e.documentElement,draw:n.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:n.polyline().node,path:n.path().node,native:i.create("svg")}},i.parser={native:i.create("svg")},e.addEventListener("DOMContentLoaded",(function(){i.parser.draw||i.prepare()}),!1),i.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},i.utils={map:function(t,e){var i,n=t.length,s=[];for(i=0;i1?1:t,new i.Color({r:~~(this.r+(this.destination.r-this.r)*t),g:~~(this.g+(this.destination.g-this.g)*t),b:~~(this.b+(this.destination.b-this.b)*t)})):this}}),i.Color.test=function(t){return t+="",i.regex.isHex.test(t)||i.regex.isRgb.test(t)},i.Color.isRgb=function(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b},i.Color.isColor=function(t){return i.Color.isRgb(t)||i.Color.test(t)},i.Array=function(t,e){0==(t=(t||[]).valueOf()).length&&e&&(t=e.valueOf()),this.value=this.parse(t)},i.extend(i.Array,{morph:function(t){if(this.destination=this.parse(t),this.value.length!=this.destination.length){for(var e=this.value[this.value.length-1],i=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(i);for(;this.value.length=0;n--)this.value[n]=[this.value[n][0]+t,this.value[n][1]+e];return this},size:function(t,e){var i,n=this.bbox();for(i=this.value.length-1;i>=0;i--)n.width&&(this.value[i][0]=(this.value[i][0]-n.x)*t/n.width+n.x),n.height&&(this.value[i][1]=(this.value[i][1]-n.y)*e/n.height+n.y);return this},bbox:function(){return i.parser.poly.setAttribute("points",this.toString()),i.parser.poly.getBBox()}});for(var n={M:function(t,e,i){return e.x=i.x=t[0],e.y=i.y=t[1],["M",e.x,e.y]},L:function(t,e){return e.x=t[0],e.y=t[1],["L",t[0],t[1]]},H:function(t,e){return e.x=t[0],["H",t[0]]},V:function(t,e){return e.y=t[0],["V",t[0]]},C:function(t,e){return e.x=t[4],e.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,e){return e.x=t[2],e.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,e){return e.x=t[2],e.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,e){return e.x=t[0],e.y=t[1],["T",t[0],t[1]]},Z:function(t,e,i){return e.x=i.x,e.y=i.y,["Z"]},A:function(t,e){return e.x=t[5],e.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},s="mlhvqtcsaz".split(""),r=0,o=s.length;r=0;s--)"M"==(n=this.value[s][0])||"L"==n||"T"==n?(this.value[s][1]+=t,this.value[s][2]+=e):"H"==n?this.value[s][1]+=t:"V"==n?this.value[s][1]+=e:"C"==n||"S"==n||"Q"==n?(this.value[s][1]+=t,this.value[s][2]+=e,this.value[s][3]+=t,this.value[s][4]+=e,"C"==n&&(this.value[s][5]+=t,this.value[s][6]+=e)):"A"==n&&(this.value[s][6]+=t,this.value[s][7]+=e);return this},size:function(t,e){var i,n,s=this.bbox();for(i=this.value.length-1;i>=0;i--)"M"==(n=this.value[i][0])||"L"==n||"T"==n?(this.value[i][1]=(this.value[i][1]-s.x)*t/s.width+s.x,this.value[i][2]=(this.value[i][2]-s.y)*e/s.height+s.y):"H"==n?this.value[i][1]=(this.value[i][1]-s.x)*t/s.width+s.x:"V"==n?this.value[i][1]=(this.value[i][1]-s.y)*e/s.height+s.y:"C"==n||"S"==n||"Q"==n?(this.value[i][1]=(this.value[i][1]-s.x)*t/s.width+s.x,this.value[i][2]=(this.value[i][2]-s.y)*e/s.height+s.y,this.value[i][3]=(this.value[i][3]-s.x)*t/s.width+s.x,this.value[i][4]=(this.value[i][4]-s.y)*e/s.height+s.y,"C"==n&&(this.value[i][5]=(this.value[i][5]-s.x)*t/s.width+s.x,this.value[i][6]=(this.value[i][6]-s.y)*e/s.height+s.y)):"A"==n&&(this.value[i][1]=this.value[i][1]*t/s.width,this.value[i][2]=this.value[i][2]*e/s.height,this.value[i][6]=(this.value[i][6]-s.x)*t/s.width+s.x,this.value[i][7]=(this.value[i][7]-s.y)*e/s.height+s.y);return this},equalCommands:function(t){var e,n,s;for(t=new i.PathArray(t),s=this.value.length===t.value.length,e=0,n=this.value.length;s&&el);return r},bbox:function(){return i.parser.path.setAttribute("d",this.toString()),i.parser.path.getBBox()}}),i.Number=i.invent({create:function(t,e){this.value=0,this.unit=e||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(e=t.match(i.regex.numberAndUnit))&&(this.value=parseFloat(e[1]),"%"==e[5]?this.value/=100:"s"==e[5]&&(this.value*=1e3),this.unit=e[5]):t instanceof i.Number&&(this.value=t.valueOf(),this.unit=t.unit)},extend:{toString:function(){return("%"==this.unit?~~(1e8*this.value)/1e6:"s"==this.unit?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(t){return t=new i.Number(t),new i.Number(this+t,this.unit||t.unit)},minus:function(t){return t=new i.Number(t),new i.Number(this-t,this.unit||t.unit)},times:function(t){return t=new i.Number(t),new i.Number(this*t,this.unit||t.unit)},divide:function(t){return t=new i.Number(t),new i.Number(this/t,this.unit||t.unit)},to:function(t){var e=new i.Number(this);return"string"==typeof t&&(e.unit=t),e},morph:function(t){return this.destination=new i.Number(t),t.relative&&(this.destination.value+=this.value),this},at:function(t){return this.destination?new i.Number(this.destination).minus(this).times(t).plus(this):this}}}),i.Element=i.invent({create:function(t){this._stroke=i.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=t)&&(this.type=t.nodeName,this.node.instance=this,this._events=t._events||{},this._stroke=t.getAttribute("stroke")||this._stroke)},extend:{x:function(t){return this.attr("x",t)},y:function(t){return this.attr("y",t)},cx:function(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)},cy:function(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)},move:function(t,e){return this.x(t).y(e)},center:function(t,e){return this.cx(t).cy(e)},width:function(t){return this.attr("width",t)},height:function(t){return this.attr("height",t)},size:function(t,e){var n=p(this,t,e);return this.width(new i.Number(n.width)).height(new i.Number(n.height))},clone:function(t){this.writeDataToDom();var e=A(this.node.cloneNode(!0));return t?t.add(e):this.after(e),e},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(t){return this.after(t).remove(),t},addTo:function(t){return t.put(this)},putIn:function(t){return t.add(this)},id:function(t){return this.attr("id",t)},inside:function(t,e){var i=this.bbox();return t>i.x&&e>i.y&&t/,"").replace(/<\/svg>$/,"");n.innerHTML=""+t.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2>")+"";for(var s=0,r=n.firstChild.childNodes.length;s":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)}},i.morph=function(t){return function(e,n){return new i.MorphObj(e,n).at(t)}},i.Situation=i.invent({create:function(t){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new i.Number(t.duration).valueOf(),this.delay=new i.Number(t.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=t.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),i.FX=i.invent({create:function(t){this._target=t,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(t,e,n){"object"==typeof t&&(e=t.ease,n=t.delay,t=t.duration);var s=new i.Situation({duration:t||1e3,delay:n||0,ease:i.easing[e||"-"]||e});return this.queue(s),this},delay:function(t){var e=new i.Situation({duration:t,delay:0,ease:i.easing["-"]});return this.queue(e)},target:function(t){return t&&t instanceof i.Element?(this._target=t,this):this._target},timeToAbsPos:function(t){return(t-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(t){return this.situation.duration/this._speed*t+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=t.requestAnimationFrame(function(){this.step()}.bind(this))},stopAnimFrame:function(){t.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(t){return("function"==typeof t||t instanceof i.Situation)&&this.situations.push(t),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof i.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var t,e,n,s=this.situation;if(s.init)return this;for(t in s.animations)for(n=this.target()[t](),Array.isArray(n)||(n=[n]),Array.isArray(s.animations[t])||(s.animations[t]=[s.animations[t]]),e=n.length;e--;)s.animations[t][e]instanceof i.Number&&(n[e]=new i.Number(n[e])),s.animations[t][e]=n[e].morph(s.animations[t][e]);for(t in s.attrs)s.attrs[t]=new i.MorphObj(this.target().attr(t),s.attrs[t]);for(t in s.styles)s.styles[t]=new i.MorphObj(this.target().style(t),s.styles[t]);return s.initialTransformation=this.target().matrixify(),s.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(t,e){var i=this.active;return this.active=!1,e&&this.clearQueue(),t&&this.situation&&(!i&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var t=this.situation;this.stop(),this.situation=t,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return!0===this.situation.loops&&(this.situation.loops=this.situation.loop+1),"number"==typeof this.situation.loops?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(t,e){var i=this.situation.duration/this._speed;return this.absPos=t,e||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*i,this.situation.finish=this.situation.start+i,this.step(!0)},speed:function(t){return 0===t?this.pause():t?(this._speed=t,this.at(this.absPos,!0)):this._speed},loop:function(t,e){var i=this.last();return i.loops=null==t||t,i.loop=0,e&&(i.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(t){var e=this.last();return e.reversed=void 0===t?!e.reversed:t,this},progress:function(t){return t?this.situation.ease(this.pos):this.pos},after:function(t){var e=this.last();return this.target().on("finished.fx",(function i(n){n.detail.situation==e&&(t.call(this,e),this.off("finished.fx",i))})),this._callStart()},during:function(t){var e=this.last(),n=function(n){n.detail.situation==e&&t.call(this,n.detail.pos,i.morph(n.detail.pos),n.detail.eased,e)};return this.target().off("during.fx",n).on("during.fx",n),this.after((function(){this.off("during.fx",n)})),this._callStart()},afterAll:function(t){var e=function e(i){t.call(this),this.off("allfinished.fx",e)};return this.target().off("allfinished.fx",e).on("allfinished.fx",e),this._callStart()},duringAll:function(t){var e=function(e){t.call(this,e.detail.pos,i.morph(e.detail.pos),e.detail.eased,e.detail.situation)};return this.target().off("during.fx",e).on("during.fx",e),this.afterAll((function(){this.off("during.fx",e)})),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(t,e,i){return this.last()[i||"animations"][t]=e,this._callStart()},step:function(t){var e,i,n;(t||(this.absPos=this.timeToAbsPos(+new Date)),!1!==this.situation.loops)?(e=Math.max(this.absPos,0),i=Math.floor(e),!0===this.situation.loops||ithis.lastPos&&r<=s&&(this.situation.once[r].call(this.target(),this.pos,s),delete this.situation.once[r]);return this.active&&this.target().fire("during",{pos:this.pos,eased:s,fx:this,situation:this.situation}),this.situation?(this.eachAt(),1==this.pos&&!this.situation.reversed||this.situation.reversed&&0==this.pos?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=s,this):this},eachAt:function(){var t,e,n,s=this,r=this.target(),o=this.situation;for(t in o.animations)n=[].concat(o.animations[t]).map((function(t){return"string"!=typeof t&&t.at?t.at(o.ease(s.pos),s.pos):t})),r[t].apply(r,n);for(t in o.attrs)n=[t].concat(o.attrs[t]).map((function(t){return"string"!=typeof t&&t.at?t.at(o.ease(s.pos),s.pos):t})),r.attr.apply(r,n);for(t in o.styles)n=[t].concat(o.styles[t]).map((function(t){return"string"!=typeof t&&t.at?t.at(o.ease(s.pos),s.pos):t})),r.style.apply(r,n);if(o.transforms.length){for(n=o.initialTransformation,t=0,e=o.transforms.length;t=0;--e)this[x[e]]=null!=t[x[e]]?t[x[e]]:n[x[e]]},extend:{extract:function(){var t=m(this,0,1),e=m(this,1,0),n=180/Math.PI*Math.atan2(t.y,t.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(n*Math.PI/180)+this.f*Math.sin(n*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(n*Math.PI/180)+this.e*Math.sin(-n*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-n,skewY:180/Math.PI*Math.atan2(e.y,e.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:n,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new i.Matrix(this)}},clone:function(){return new i.Matrix(this)},morph:function(t){return this.destination=new i.Matrix(t),this},at:function(t){return this.destination?new i.Matrix({a:this.a+(this.destination.a-this.a)*t,b:this.b+(this.destination.b-this.b)*t,c:this.c+(this.destination.c-this.c)*t,d:this.d+(this.destination.d-this.d)*t,e:this.e+(this.destination.e-this.e)*t,f:this.f+(this.destination.f-this.f)*t}):this},multiply:function(t){return new i.Matrix(this.native().multiply(function(t){t instanceof i.Matrix||(t=new i.Matrix(t));return t}(t).native()))},inverse:function(){return new i.Matrix(this.native().inverse())},translate:function(t,e){return new i.Matrix(this.native().translate(t||0,e||0))},scale:function(t,e,n,s){return 1==arguments.length?e=t:3==arguments.length&&(s=n,n=e,e=t),this.around(n,s,new i.Matrix(t,0,0,e,0,0))},rotate:function(t,e,n){return t=i.utils.radians(t),this.around(e,n,new i.Matrix(Math.cos(t),Math.sin(t),-Math.sin(t),Math.cos(t),0,0))},flip:function(t,e){return"x"==t?this.scale(-1,1,e,0):"y"==t?this.scale(1,-1,0,e):this.scale(-1,-1,t,null!=e?e:t)},skew:function(t,e,n,s){return 1==arguments.length?e=t:3==arguments.length&&(s=n,n=e,e=t),t=i.utils.radians(t),e=i.utils.radians(e),this.around(n,s,new i.Matrix(1,Math.tan(e),Math.tan(t),1,0,0))},skewX:function(t,e,i){return this.skew(t,0,e,i)},skewY:function(t,e,i){return this.skew(0,t,e,i)},around:function(t,e,n){return this.multiply(new i.Matrix(1,0,0,1,t||0,e||0)).multiply(n).multiply(new i.Matrix(1,0,0,1,-t||0,-e||0))},native:function(){for(var t=i.parser.native.createSVGMatrix(),e=x.length-1;e>=0;e--)t[x[e]]=this[x[e]];return t},toString:function(){return"matrix("+y(this.a)+","+y(this.b)+","+y(this.c)+","+y(this.d)+","+y(this.e)+","+y(this.f)+")"}},parent:i.Element,construct:{ctm:function(){return new i.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof i.Nested){var t=this.rect(1,1),e=t.node.getScreenCTM();return t.remove(),new i.Matrix(e)}return new i.Matrix(this.node.getScreenCTM())}}}),i.Point=i.invent({create:function(t,e){var i;i=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:null!=t?{x:t,y:null!=e?e:t}:{x:0,y:0},this.x=i.x,this.y=i.y},extend:{clone:function(){return new i.Point(this)},morph:function(t,e){return this.destination=new i.Point(t,e),this},at:function(t){return this.destination?new i.Point({x:this.x+(this.destination.x-this.x)*t,y:this.y+(this.destination.y-this.y)*t}):this},native:function(){var t=i.parser.native.createSVGPoint();return t.x=this.x,t.y=this.y,t},transform:function(t){return new i.Point(this.native().matrixTransform(t.native()))}}}),i.extend(i.Element,{point:function(t,e){return new i.Point(t,e).transform(this.screenCTM().inverse())}}),i.extend(i.Element,{attr:function(t,e,n){if(null==t){for(t={},n=(e=this.node.attributes).length-1;n>=0;n--)t[e[n].nodeName]=i.regex.isNumber.test(e[n].nodeValue)?parseFloat(e[n].nodeValue):e[n].nodeValue;return t}if("object"==typeof t)for(e in t)this.attr(e,t[e]);else if(null===e)this.node.removeAttribute(t);else{if(null==e)return null==(e=this.node.getAttribute(t))?i.defaults.attrs[t]:i.regex.isNumber.test(e)?parseFloat(e):e;"stroke-width"==t?this.attr("stroke",parseFloat(e)>0?this._stroke:null):"stroke"==t&&(this._stroke=e),"fill"!=t&&"stroke"!=t||(i.regex.isImage.test(e)&&(e=this.doc().defs().image(e,0,0)),e instanceof i.Image&&(e=this.doc().defs().pattern(0,0,(function(){this.add(e)})))),"number"==typeof e?e=new i.Number(e):i.Color.isColor(e)?e=new i.Color(e):Array.isArray(e)&&(e=new i.Array(e)),"leading"==t?this.leading&&this.leading(e):"string"==typeof n?this.node.setAttributeNS(n,t,e.toString()):this.node.setAttribute(t,e.toString()),!this.rebuild||"font-size"!=t&&"x"!=t||this.rebuild(t,e)}return this}}),i.extend(i.Element,{transform:function(t,e){var n,s,r=this;if("object"!=typeof t)return n=new i.Matrix(r).extract(),"string"==typeof t?n[t]:n;if(n=new i.Matrix(r),e=!!e||!!t.relative,null!=t.a)n=e?n.multiply(new i.Matrix(t)):new i.Matrix(t);else if(null!=t.rotation)g(t,r),n=e?n.rotate(t.rotation,t.cx,t.cy):n.rotate(t.rotation-n.extract().rotation,t.cx,t.cy);else if(null!=t.scale||null!=t.scaleX||null!=t.scaleY){if(g(t,r),t.scaleX=null!=t.scale?t.scale:null!=t.scaleX?t.scaleX:1,t.scaleY=null!=t.scale?t.scale:null!=t.scaleY?t.scaleY:1,!e){var o=n.extract();t.scaleX=1*t.scaleX/o.scaleX,t.scaleY=1*t.scaleY/o.scaleY}n=n.scale(t.scaleX,t.scaleY,t.cx,t.cy)}else if(null!=t.skew||null!=t.skewX||null!=t.skewY){if(g(t,r),t.skewX=null!=t.skew?t.skew:null!=t.skewX?t.skewX:0,t.skewY=null!=t.skew?t.skew:null!=t.skewY?t.skewY:0,!e){o=n.extract();n=n.multiply((new i.Matrix).skew(o.skewX,o.skewY,t.cx,t.cy).inverse())}n=n.skew(t.skewX,t.skewY,t.cx,t.cy)}else t.flip?("x"==t.flip||"y"==t.flip?t.offset=null==t.offset?r.bbox()["c"+t.flip]:t.offset:null==t.offset?(s=r.bbox(),t.flip=s.cx,t.offset=s.cy):t.flip=t.offset,n=(new i.Matrix).flip(t.flip,t.offset)):null==t.x&&null==t.y||(e?n=n.translate(t.x,t.y):(null!=t.x&&(n.e=t.x),null!=t.y&&(n.f=t.y)));return this.attr("transform",n)}}),i.extend(i.FX,{transform:function(t,e){var n,s,r=this.target();return"object"!=typeof t?(n=new i.Matrix(r).extract(),"string"==typeof t?n[t]:n):(e=!!e||!!t.relative,null!=t.a?n=new i.Matrix(t):null!=t.rotation?(g(t,r),n=new i.Rotate(t.rotation,t.cx,t.cy)):null!=t.scale||null!=t.scaleX||null!=t.scaleY?(g(t,r),t.scaleX=null!=t.scale?t.scale:null!=t.scaleX?t.scaleX:1,t.scaleY=null!=t.scale?t.scale:null!=t.scaleY?t.scaleY:1,n=new i.Scale(t.scaleX,t.scaleY,t.cx,t.cy)):null!=t.skewX||null!=t.skewY?(g(t,r),t.skewX=null!=t.skewX?t.skewX:0,t.skewY=null!=t.skewY?t.skewY:0,n=new i.Skew(t.skewX,t.skewY,t.cx,t.cy)):t.flip?("x"==t.flip||"y"==t.flip?t.offset=null==t.offset?r.bbox()["c"+t.flip]:t.offset:null==t.offset?(s=r.bbox(),t.flip=s.cx,t.offset=s.cy):t.flip=t.offset,n=(new i.Matrix).flip(t.flip,t.offset)):null==t.x&&null==t.y||(n=new i.Translate(t.x,t.y)),n?(n.relative=e,this.last().transforms.push(n),this._callStart()):this)}}),i.extend(i.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(i.regex.transforms).slice(0,-1).map((function(t){var e=t.trim().split("(");return[e[0],e[1].split(i.regex.delimiter).map((function(t){return parseFloat(t)}))]})).reduce((function(t,e){return"matrix"==e[0]?t.multiply(f(e[1])):t[e[0]].apply(t,e[1])}),new i.Matrix)},toParent:function(t){if(this==t)return this;var e=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t).untransform().transform(i.multiply(e)),this},toDoc:function(){return this.toParent(this.doc())}}),i.Transformation=i.invent({create:function(t,e){if(arguments.length>1&&"boolean"!=typeof e)return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(t))for(var i=0,n=this.arguments.length;i=0},index:function(t){return[].slice.call(this.node.childNodes).indexOf(t.node)},get:function(t){return i.adopt(this.node.childNodes[t])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(t,e){var n,s,r=this.children();for(n=0,s=r.length;ns/r?this.height/r:this.width/s,this.x=e,this.y=n,this.width=s,this.height=r)}else t="string"==typeof t?t.match(c).map((function(t){return parseFloat(t)})):Array.isArray(t)?t:"object"==typeof t?[t.x,t.y,t.width,t.height]:4==arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(t,e,n,s){return this.destination=new i.ViewBox(t,e,n,s),this},at:function(t){return this.destination?new i.ViewBox([this.x+(this.destination.x-this.x)*t,this.y+(this.destination.y-this.y)*t,this.width+(this.destination.width-this.width)*t,this.height+(this.destination.height-this.height)*t]):this}},parent:i.Container,construct:{viewbox:function(t,e,n,s){return 0==arguments.length?new i.ViewBox(this):this.attr("viewBox",new i.ViewBox(t,e,n,s))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach((function(t){i.Element.prototype[t]=function(e){return null==e?i.off(this,t):i.on(this,t,e),this}})),i.listenerId=0,i.on=function(t,e,n,s,r){var o=n.bind(s||t),a=t instanceof i.Element?t.node:t;a.instance=a.instance||{_events:{}};var h=a.instance._events;n._svgjsListenerId||(n._svgjsListenerId=++i.listenerId),e.split(i.regex.delimiter).forEach((function(t){var e=t.split(".")[0],i=t.split(".")[1]||"*";h[e]=h[e]||{},h[e][i]=h[e][i]||{},h[e][i][n._svgjsListenerId]=o,a.addEventListener(e,o,r||!1)}))},i.off=function(t,e,n,s){var r=t instanceof i.Element?t.node:t;if(r.instance&&("function"!=typeof n||(n=n._svgjsListenerId))){var o=r.instance._events;(e||"").split(i.regex.delimiter).forEach((function(t){var e,a,h=t&&t.split(".")[0],l=t&&t.split(".")[1];if(n)o[h]&&o[h][l||"*"]&&(r.removeEventListener(h,o[h][l||"*"][n],s||!1),delete o[h][l||"*"][n]);else if(h&&l){if(o[h]&&o[h][l]){for(a in o[h][l])i.off(r,[h,l].join("."),a);delete o[h][l]}}else if(l)for(t in o)for(e in o[t])l===e&&i.off(r,[t,l].join("."));else if(h){if(o[h]){for(e in o[h])i.off(r,[h,e].join("."));delete o[h]}}else{for(t in o)i.off(r,t);r.instance._events={}}}))}},i.extend(i.Element,{on:function(t,e,n,s){return i.on(this,t,e,n,s),this},off:function(t,e){return i.off(this.node,t,e),this},fire:function(e,n){return e instanceof t.Event?this.node.dispatchEvent(e):this.node.dispatchEvent(e=new i.CustomEvent(e,{detail:n,cancelable:!0})),this._event=e,this},event:function(){return this._event}}),i.Defs=i.invent({create:"defs",inherit:i.Container}),i.G=i.invent({create:"g",inherit:i.Container,extend:{x:function(t){return null==t?this.transform("x"):this.transform({x:t-this.x()},!0)},y:function(t){return null==t?this.transform("y"):this.transform({y:t-this.y()},!0)},cx:function(t){return null==t?this.gbox().cx:this.x(t-this.gbox().width/2)},cy:function(t){return null==t?this.gbox().cy:this.y(t-this.gbox().height/2)},gbox:function(){var t=this.bbox(),e=this.transform();return t.x+=e.x,t.x2+=e.x,t.cx+=e.x,t.y+=e.y,t.y2+=e.y,t.cy+=e.y,t}},construct:{group:function(){return this.put(new i.G)}}}),i.Doc=i.invent({create:function(t){t&&("svg"==(t="string"==typeof t?e.getElementById(t):t).nodeName?this.constructor.call(this,t):(this.constructor.call(this,i.create("svg")),t.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:i.Container,extend:{namespace:function(){return this.attr({xmlns:i.ns,version:"1.1"}).attr("xmlns:xlink",i.xlink,i.xmlns).attr("xmlns:svgjs",i.svgjs,i.xmlns)},defs:function(){var t;this._defs||((t=this.node.getElementsByTagName("defs")[0])?this._defs=i.adopt(t):this._defs=new i.Defs,this.node.appendChild(this._defs.node));return this._defs},parent:function(){return this.node.parentNode&&"#document"!=this.node.parentNode.nodeName&&"#document-fragment"!=this.node.parentNode.nodeName?this.node.parentNode:null},spof:function(){var t=this.node.getScreenCTM();return t&&this.style("left",-t.e%1+"px").style("top",-t.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,i.parser.draw.parentNode||this.node.appendChild(i.parser.draw),this},clone:function(t){this.writeDataToDom();var e=this.node,i=A(e.cloneNode(!0));return t?(t.node||t).appendChild(i.node):e.parentNode.insertBefore(i.node,e.nextSibling),i}}}),i.extend(i.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var t=this.position()+1,e=this.parent();return e.removeElement(this).add(this,t),e instanceof i.Doc&&e.node.appendChild(e.defs().node),this},backward:function(){var t=this.position();return t>0&&this.parent().removeElement(this).add(this,t-1),this},front:function(){var t=this.parent();return t.node.appendChild(this.node),t instanceof i.Doc&&t.node.appendChild(t.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(t){t.remove();var e=this.position();return this.parent().add(t,e),this},after:function(t){t.remove();var e=this.position();return this.parent().add(t,e+1),this}}),i.Mask=i.invent({create:function(){this.constructor.call(this,i.create("mask")),this.targets=[]},inherit:i.Container,extend:{remove:function(){for(var t=this.targets.length-1;t>=0;t--)this.targets[t]&&this.targets[t].unmask();return this.targets=[],i.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new i.Mask)}}}),i.extend(i.Element,{maskWith:function(t){return this.masker=t instanceof i.Mask?t:this.parent().mask().add(t),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),i.ClipPath=i.invent({create:function(){this.constructor.call(this,i.create("clipPath")),this.targets=[]},inherit:i.Container,extend:{remove:function(){for(var t=this.targets.length-1;t>=0;t--)this.targets[t]&&this.targets[t].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new i.ClipPath)}}}),i.extend(i.Element,{clipWith:function(t){return this.clipper=t instanceof i.ClipPath?t:this.parent().clip().add(t),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),i.Gradient=i.invent({create:function(t){this.constructor.call(this,i.create(t+"Gradient")),this.type=t},inherit:i.Container,extend:{at:function(t,e,n){return this.put(new i.Stop).update(t,e,n)},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(t,e,n){return"transform"==t&&(t="gradientTransform"),i.Container.prototype.attr.call(this,t,e,n)}},construct:{gradient:function(t,e){return this.defs().gradient(t,e)}}}),i.extend(i.Gradient,i.FX,{from:function(t,e){return"radial"==(this._target||this).type?this.attr({fx:new i.Number(t),fy:new i.Number(e)}):this.attr({x1:new i.Number(t),y1:new i.Number(e)})},to:function(t,e){return"radial"==(this._target||this).type?this.attr({cx:new i.Number(t),cy:new i.Number(e)}):this.attr({x2:new i.Number(t),y2:new i.Number(e)})}}),i.extend(i.Defs,{gradient:function(t,e){return this.put(new i.Gradient(t)).update(e)}}),i.Stop=i.invent({create:"stop",inherit:i.Element,extend:{update:function(t){return("number"==typeof t||t instanceof i.Number)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new i.Number(t.offset)),this}}}),i.Pattern=i.invent({create:"pattern",inherit:i.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(t){return this.clear(),"function"==typeof t&&t.call(this,this),this},toString:function(){return this.fill()},attr:function(t,e,n){return"transform"==t&&(t="patternTransform"),i.Container.prototype.attr.call(this,t,e,n)}},construct:{pattern:function(t,e,i){return this.defs().pattern(t,e,i)}}}),i.extend(i.Defs,{pattern:function(t,e,n){return this.put(new i.Pattern).update(n).attr({x:0,y:0,width:t,height:e,patternUnits:"userSpaceOnUse"})}}),i.Shape=i.invent({create:function(t){this.constructor.call(this,t)},inherit:i.Element}),i.Bare=i.invent({create:function(t,e){if(this.constructor.call(this,i.create(t)),e)for(var n in e.prototype)"function"==typeof e.prototype[n]&&(this[n]=e.prototype[n])},inherit:i.Element,extend:{words:function(t){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(e.createTextNode(t)),this}}}),i.extend(i.Parent,{element:function(t,e){return this.put(new i.Bare(t,e))}}),i.Symbol=i.invent({create:"symbol",inherit:i.Container,construct:{symbol:function(){return this.put(new i.Symbol)}}}),i.Use=i.invent({create:"use",inherit:i.Shape,extend:{element:function(t,e){return this.attr("href",(e||"")+"#"+t,i.xlink)}},construct:{use:function(t,e){return this.put(new i.Use).element(t,e)}}}),i.Rect=i.invent({create:"rect",inherit:i.Shape,construct:{rect:function(t,e){return this.put(new i.Rect).size(t,e)}}}),i.Circle=i.invent({create:"circle",inherit:i.Shape,construct:{circle:function(t){return this.put(new i.Circle).rx(new i.Number(t).divide(2)).move(0,0)}}}),i.extend(i.Circle,i.FX,{rx:function(t){return this.attr("r",t)},ry:function(t){return this.rx(t)}}),i.Ellipse=i.invent({create:"ellipse",inherit:i.Shape,construct:{ellipse:function(t,e){return this.put(new i.Ellipse).size(t,e).move(0,0)}}}),i.extend(i.Ellipse,i.Rect,i.FX,{rx:function(t){return this.attr("rx",t)},ry:function(t){return this.attr("ry",t)}}),i.extend(i.Circle,i.Ellipse,{x:function(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())},y:function(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())},cx:function(t){return null==t?this.attr("cx"):this.attr("cx",t)},cy:function(t){return null==t?this.attr("cy"):this.attr("cy",t)},width:function(t){return null==t?2*this.rx():this.rx(new i.Number(t).divide(2))},height:function(t){return null==t?2*this.ry():this.ry(new i.Number(t).divide(2))},size:function(t,e){var n=p(this,t,e);return this.rx(new i.Number(n.width).divide(2)).ry(new i.Number(n.height).divide(2))}}),i.Line=i.invent({create:"line",inherit:i.Shape,extend:{array:function(){return new i.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(t,e,n,s){return null==t?this.array():(t=void 0!==e?{x1:t,y1:e,x2:n,y2:s}:new i.PointArray(t).toLine(),this.attr(t))},move:function(t,e){return this.attr(this.array().move(t,e).toLine())},size:function(t,e){var i=p(this,t,e);return this.attr(this.array().size(i.width,i.height).toLine())}},construct:{line:function(t,e,n,s){return i.Line.prototype.plot.apply(this.put(new i.Line),null!=t?[t,e,n,s]:[0,0,0,0])}}}),i.Polyline=i.invent({create:"polyline",inherit:i.Shape,construct:{polyline:function(t){return this.put(new i.Polyline).plot(t||new i.PointArray)}}}),i.Polygon=i.invent({create:"polygon",inherit:i.Shape,construct:{polygon:function(t){return this.put(new i.Polygon).plot(t||new i.PointArray)}}}),i.extend(i.Polyline,i.Polygon,{array:function(){return this._array||(this._array=new i.PointArray(this.attr("points")))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new i.PointArray(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("points",this.array().move(t,e))},size:function(t,e){var i=p(this,t,e);return this.attr("points",this.array().size(i.width,i.height))}}),i.extend(i.Line,i.Polyline,i.Polygon,{morphArray:i.PointArray,x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},width:function(t){var e=this.bbox();return null==t?e.width:this.size(t,e.height)},height:function(t){var e=this.bbox();return null==t?e.height:this.size(e.width,t)}}),i.Path=i.invent({create:"path",inherit:i.Shape,extend:{morphArray:i.PathArray,array:function(){return this._array||(this._array=new i.PathArray(this.attr("d")))},plot:function(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new i.PathArray(t))},clear:function(){return delete this._array,this},move:function(t,e){return this.attr("d",this.array().move(t,e))},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)},size:function(t,e){var i=p(this,t,e);return this.attr("d",this.array().size(i.width,i.height))},width:function(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)},height:function(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}},construct:{path:function(t){return this.put(new i.Path).plot(t||new i.PathArray)}}}),i.Image=i.invent({create:"image",inherit:i.Shape,extend:{load:function(e){if(!e)return this;var n=this,s=new t.Image;return i.on(s,"load",(function(){i.off(s);var t=n.parent(i.Pattern);null!==t&&(0==n.width()&&0==n.height()&&n.size(s.width,s.height),t&&0==t.width()&&0==t.height()&&t.size(n.width(),n.height()),"function"==typeof n._loaded&&n._loaded.call(n,{width:s.width,height:s.height,ratio:s.width/s.height,url:e}))})),i.on(s,"error",(function(t){i.off(s),"function"==typeof n._error&&n._error.call(n,t)})),this.attr("href",s.src=this.src=e,i.xlink)},loaded:function(t){return this._loaded=t,this},error:function(t){return this._error=t,this}},construct:{image:function(t,e,n){return this.put(new i.Image).load(t).size(e||0,n||e||0)}}}),i.Text=i.invent({create:function(){this.constructor.call(this,i.create("text")),this.dom.leading=new i.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",i.defaults.attrs["font-family"])},inherit:i.Shape,extend:{x:function(t){return null==t?this.attr("x"):this.attr("x",t)},y:function(t){var e=this.attr("y"),i="number"==typeof e?e-this.bbox().y:0;return null==t?"number"==typeof e?e-i:e:this.attr("y","number"==typeof t.valueOf()?t+i:t)},cx:function(t){return null==t?this.bbox().cx:this.x(t-this.bbox().width/2)},cy:function(t){return null==t?this.bbox().cy:this.y(t-this.bbox().height/2)},text:function(t){if(void 0===t){t="";for(var e=this.node.childNodes,n=0,s=e.length;n=0;n--)e.childNodes[n]instanceof t.SVGElement&&A(e.childNodes[n]);return i.adopt(e).id(i.eid(e.nodeName))}function v(t){return null==t.x&&(t.x=0,t.y=0,t.width=0,t.height=0),t.w=t.width,t.h=t.height,t.x2=t.x+t.width,t.y2=t.y+t.height,t.cx=t.x+t.width/2,t.cy=t.y+t.height/2,t}function y(t){return Math.abs(t)>1e-37?t:0}["fill","stroke"].forEach((function(t){var e,n={};n[t]=function(n){if(void 0===n)return this;if("string"==typeof n||i.Color.isRgb(n)||n&&"function"==typeof n.fill)this.attr(t,n);else for(e=a[t].length-1;e>=0;e--)null!=n[a[t][e]]&&this.attr(a.prefix(t,a[t][e]),n[a[t][e]]);return this},i.extend(i.Element,i.FX,n)})),i.extend(i.Element,i.FX,{rotate:function(t,e,i){return this.transform({rotation:t,cx:e,cy:i})},skew:function(t,e,i,n){return 1==arguments.length||3==arguments.length?this.transform({skew:t,cx:e,cy:i}):this.transform({skewX:t,skewY:e,cx:i,cy:n})},scale:function(t,e,i,n){return 1==arguments.length||3==arguments.length?this.transform({scale:t,cx:e,cy:i}):this.transform({scaleX:t,scaleY:e,cx:i,cy:n})},translate:function(t,e){return this.transform({x:t,y:e})},flip:function(t,e){return e="number"==typeof t?t:e,this.transform({flip:t||"both",offset:e})},matrix:function(t){return this.attr("transform",new i.Matrix(6==arguments.length?[].slice.call(arguments):t))},opacity:function(t){return this.attr("opacity",t)},dx:function(t){return this.x(new i.Number(t).plus(this instanceof i.FX?0:this.x()),!0)},dy:function(t){return this.y(new i.Number(t).plus(this instanceof i.FX?0:this.y()),!0)},dmove:function(t,e){return this.dx(t).dy(e)}}),i.extend(i.Rect,i.Ellipse,i.Circle,i.Gradient,i.FX,{radius:function(t,e){var n=(this._target||this).type;return"radial"==n||"circle"==n?this.attr("r",new i.Number(t)):this.rx(t).ry(null==e?t:e)}}),i.extend(i.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(t){return this.node.getPointAtLength(t)}}),i.extend(i.Parent,i.Text,i.Tspan,i.FX,{font:function(t,e){if("object"==typeof t)for(e in t)this.font(e,t[e]);return"leading"==t?this.leading(e):"anchor"==t?this.attr("text-anchor",e):"size"==t||"family"==t||"weight"==t||"stretch"==t||"variant"==t||"style"==t?this.attr("font-"+t,e):this.attr(t,e)}}),i.Set=i.invent({create:function(t){t instanceof i.Set?this.members=t.members.slice():Array.isArray(t)?this.members=t:this.clear()},extend:{add:function(){var t,e,i=[].slice.call(arguments);for(t=0,e=i.length;t-1&&this.members.splice(e,1),this},each:function(t){for(var e=0,i=this.members.length;e=0},index:function(t){return this.members.indexOf(t)},get:function(t){return this.members[t]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(0==this.members.length)return new i.RBox;var t=this.members[0].rbox(this.members[0].doc());return this.each((function(){t=t.merge(this.rbox(this.doc()))})),t}},construct:{set:function(t){return new i.Set(t)}}}),i.FX.Set=i.invent({create:function(t){this.set=t}}),i.Set.inherit=function(){var t=[];for(var e in i.Shape.prototype)"function"==typeof i.Shape.prototype[e]&&"function"!=typeof i.Set.prototype[e]&&t.push(e);for(var e in t.forEach((function(t){i.Set.prototype[t]=function(){for(var e=0,n=this.members.length;e=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory||(this._memory={})}}),i.get=function(t){var n=e.getElementById(function(t){var e=(t||"").toString().match(i.regex.reference);if(e)return e[1]}(t)||t);return i.adopt(n)},i.select=function(t,n){return new i.Set(i.utils.map((n||e).querySelectorAll(t),(function(t){return i.adopt(t)})))},i.extend(i.Parent,{select:function(t){return i.select(t,this.node)}});var x="abcdef".split("");if("function"!=typeof t.CustomEvent){var b=function(t,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var n=e.createEvent("CustomEvent");return n.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),n};b.prototype=t.Event.prototype,i.CustomEvent=b}else i.CustomEvent=t.CustomEvent;return function(e){for(var i=0,n=["moz","webkit"],s=0;s * @license MIT * * BUILT: Fri Nov 30 2018 10:01:55 GMT+0100 (GMT+01:00) */class Tt{constructor(t){this.limit=50,this.undos=[],this.redos=[],this.saveCommand=null,this.limit=t||50}execute(t){this.clearRedo(),t.execute(),this.undos.length>=this.limit&&this.undos.shift(),this.undos.push(t),this.change(t)}undo(){if(this.canUndo()){var t=this.undos.pop();this.redos.push(t),t.undo(),this.change(t)}}canUndo(){return!!this.undos.length}redo(){if(this.canRedo()){var t=this.redos.pop();this.undos.push(t),t.redo(),this.change(t)}}canRedo(){return!!this.redos.length}save(){this.saveCommand=this.undos[this.undos.length-1]}dirty(){return this.saveCommand!=this.undos[this.undos.length-1]}clearRedo(){this.redos=[]}clear(){this.undos=[],this.redos=[],this.saveCommand=null,this.change()}change(t){}}class Lt{constructor(t,e,i="#666",n){this.name="induce",this.node=t,this.endNode=t,this.root=e||new xt,this.root.containEl.classList.add("mm-node-induce"),this.root.containEl.classList.add("mm-node-leaf"),this.root.direct=this.node.direct,this.root.box={width:48,height:32},this.root.shapeType="bubble",this.lineType=n||"solid",this.stroke=i,this.lineWidth=2,this.type="right",this.lineDash=[0,0],this.visible=!0,this.isHide=!1,this.id=+new Date,this.node.induce=this,this.root.belongInduce=this,this.root.isRoot=!0,this.root.mind=this.node.getMind(),this.root.nodeType="induce",this.box={width:48,height:32},this.position=[],this.node.mindmap.contentEL.contains(this.root.containEl)||(this.node.mindmap.contentEL.appendChild(this.root.containEl),this.root.refreshBox()),this.refreshItems()}getId(){return this.id}init(){this.group&&this.group.remove(),this.group=this.node.getMind().induceGroup.group(),this.createInduceLine(),this.refreshBox(),this.render()}createInduceLine(){this.pl1&&this.pl1.remove()&&this.pl1,this.pl1=this.group.polyline().stroke({color:`${this.stroke}`,width:`${this.lineWidth}`,dasharray:`${this.lineDash}`,linecap:"round",linejoin:"round"}).fill("none"),this.pl2&&this.pl2.remove()&&this.pl2,this.pl2=this.group.polyline().stroke({color:`${this.stroke}`,width:`${this.lineWidth}`,dasharray:`${this.lineDash}`,linecap:"round",linejoin:"round"}).fill("none")}refreshItems(){var t=this.getInduces(),e=this.listNode;t.forEach((t=>{t.isShow()&&(e=e.concat(t.getAllItem()))})),this.items=e,this.node.isHide&&this.endNode.isHide&&this.hide()}render(){this.adjustType();var t=this.getNodeBox();this.renderInduce(t)}adjustType(){this.node.getMind().getRootByNode(this.node);var t="node-"+this.type;this.root.containEl.classList.contains(t)&&this.root.containEl.classList.remove(t),this.type=this.node.direct,this.direct=this.node.direct;var e="node-"+this.type;this.root.containEl.classList.contains(e)||this.root.containEl.classList.add(e)}getInduces(){var t=this,e=[],i=[],n=[],s=[];if(this.rangeNode&&this.rangeNode.length)this.rangeNode.forEach((t=>{e=e.concat(t.getShowNodeList())}));else{this.rangeNode=[];var r=this.node.parent,o=r.children.indexOf(this.node),a=r.children.indexOf(this.endNode);r.children.forEach(((i,n)=>{n>=o&&n<=a&&(t.rangeNode.push(i),e=e.concat(i.getShowNodeList()))})),t.rangeNode=qi(t.rangeNode)}return e.forEach((t=>{t.summaries.length&&t.summaries.forEach((t=>{t.isShow()&&i.push(t)})),t.callout&&t.callout.isShow&&e.push(t.callout),t.wireFrames.length&&t.wireFrames.forEach((t=>{t.isHide||n.push(t)})),t.layout&&t.layout.isShow&&s.push(t.layout)})),i=qi(i),n=qi(n),this.listNode=e.concat(n),this.groups=qi(s),i}getNodeBox(){var t=this.items,e=this.groups,i=this.node.getMind().getBoundingRect(t);return e.length&&e.forEach((t=>{if("fish"==t.layoutName&&("right"==t.direct?t.creatBone():t.creatBone1(),t.fishTail)){var e=t.fishTail.bbox();e.xi.right&&(i.right=e.x+e.width),e.y+e.height>i.bottom&&(i.bottom=e.y+e.height),i.width=i.right-i.x,i.height=i.bottom-i.y}})),i}getBoxRect(){return this.node.getMind().getBoundingRect(this.getAllItem())}getBBox(){return this.getNodeBox()}refreshBox(){var t=this.node.getMind();this.box=t.getBoundingRect(this.getAllItem())}getBox(){var t=this.group.gbox();if(this.box)var e=this.box;else{e=this.root.getBox();this.box=e}return t.x{e.isHide||t.push(e)})),i.summaries.length&&i.summaries.forEach((e=>{e.isShow()&&(t=t.concat(e.getAllItem()))})),i.isExpand&&i.children.forEach((t=>{e(t)}))}(this.root),this.allItems=qi(t)}getAllItem(){return this.refreshAllItems(),this.allItems}hide(){this.isHide=!0,this.group&&this.group.hide(),this.root.hide()}isShow(){return!this.isHide}show(){this.isHide=!1,this.group&&this.group.show(),this.root.show()}doLayout(){if(0!=this.root.getChildren().length){var t=this.root.layout.direct;this.root.layout.layout(this.root,t)}}getWireFrame(){var t=[],e=[];return this.rangeNode&&this.rangeNode.length&&this.rangeNode.forEach((t=>{e=e.concat(t.getShowNodeList())})),e.forEach((e=>{e.wireFrames.length&&e.wireFrames.forEach((i=>{i.isHide||(t=t.concat(e.wireFrames))}))})),qi(t)}setEndNode(t){this.endNode=t,this.refreshNode(),this.refresh()}refreshNode(){var t=this.node.getShowNodeList();this.endNode&&this.endNode!=this.node&&(t=t.concat(this.endNode.getShowNodeList()));var e=this.node.getMind().getBoundingRect(t);this.topNode=e.topNode,this.bottomNode=e.bottomNode,this.leftNode=e.leftNode,this.rightNode=e.rightNode}renderInduce(t){if(t&&this.pl1){if("solid"==this.lineType?this.lineDash=[0]:this.lineDash=[4,2],"right"==this.type){t.x1=t.x+t.width,this.setPosition(parseInt(t.x1)+5,t.y),this.pl1.plot([[4,0],[12,0],[12,parseInt(t.height/2)],[22,parseInt(t.height/2)]]),this.pl2.plot([[22,parseInt(t.height/2)],[12,parseInt(t.height/2)],[12,parseInt(t.height)],[4,parseInt(t.height)]]);var e=this.root.getBox();this.root.setPosition(t.x1+30,t.y+t.height/2-e.height/2)}else if("left"==this.type){e=this.root.getBox();this.setPosition(parseInt(t.x-e.width-26),parseInt(t.y)),this.pl2.plot([[parseInt(e.width+2),parseInt(t.height/2)],[parseInt(e.width+12),parseInt(t.height/2)],[parseInt(e.width+12),parseInt(t.height)],[parseInt(e.width+18),parseInt(t.height)]]),this.pl1.plot([[parseInt(e.width+2),parseInt(t.height/2)],[parseInt(e.width+12),parseInt(t.height/2)],[parseInt(e.width+12),0],[parseInt(e.width+18),0]]),this.root.setPosition(t.x-e.width-28,parseInt(t.y+(t.height-e.height)/2))}else if("top"==this.type||"up"==this.type){e=this.root.getBox();this.setPosition(parseInt(t.x),parseInt(t.y-e.height-30)),this.pl1.plot([[0,parseInt(e.height+20)],[0,parseInt(e.height+12)],[parseInt(t.width/2),parseInt(e.height+12)],[parseInt(t.width/2),parseInt(e.height+4)]]),this.pl2.plot([[parseInt(t.width/2),parseInt(e.height+4)],[parseInt(t.width/2),parseInt(e.height+12)],[parseInt(t.width),parseInt(e.height+12)],[parseInt(t.width),parseInt(e.height+20)]]),this.root.setPosition(parseInt(t.x+(t.width-e.width)/2),t.y-e.height-25)}else{this.setPosition(parseInt(t.x),parseInt(t.y+t.height+5)),this.pl1.plot([[0,4],[0,12],[parseInt(t.width/2),12],[parseInt(t.width/2),20]]),this.pl2.plot([[parseInt(t.width/2),20],[parseInt(t.width/2),12],[parseInt(t.width),12],[parseInt(t.width),4]]);e=this.root.getBox();this.root.setPosition(t.x+(t.width-e.width)/2,t.y+t.height+26)}this.doLayout()}}getPosition(){return{x:this.position[0],y:this.position[1]}}setPosition(t,e){this.group.attr({transform:`translate(${t},${e})`}),this.position=[t,e]}setText(t){}getText(){return this.induceText}getTextBox(){return this.text.getBox()}refresh(){if(this.node.isShow()&&this.endNode&&this.endNode.isShow())!this.isHide&&this.root.isShow()||(this.show(),function t(e){e.show(),e.isExpand&&e.children.forEach((e=>{t(e)}))}(this.root)),this.render(),this.refreshBox();else{if(this.isHide)return;this.hide(),function t(e){e.hide(),e.isExpand&&e.children.forEach((e=>{t(e)}))}(this.root),this.root.layout&&this.root.layout.group&&(this.root.layout.group.clear(),this.root.layout.group.remove(),this.root.layout.group=null)}}active(){this.status="active",this.root.setStyle("stroke","rgb(247,186,134)")}move(t,e){var i=this.getPosition();this.setPosition(i.x+t,i.y+e),this.box&&(this.box.x+=t,this.box.y+=e)}unactive(){this.status="unactive",this.root.setStyle("stroke",this.color)}isactive(){return"active"==this.status}remove(){this.pl1&&this.pl1.remove(),this.pl2&&this.pl2.remove(),this.pl1=null,this.pl2=null,this.root.layout&&this.root.layout.svgDom&&this.root.layout.svgDom.remove()&&(this.root.layout.svgDom=null),this.root.iNode&&this.root.layout&&this.root.mindmap.contentEL.removeChild(this.root.layout.tableDom)}initEvent(){this.pl1.on("click",(t=>{t.induce=this,this.__zr.trigger("touchInduce",t),this.__zr.trigger("selectInduce",t)})),this.pl2.on("click",(t=>{t.induce=this,this.__zr.trigger("touchInduce",t),this.__zr.trigger("selectInduce",t)}))}getData(){if(this.node&&this.endNode){var t=this.node.parent,e=0,i=0;return t&&(e=t.children.indexOf(this.node),i=t.children.indexOf(this.endNode)),{nodeId:this.node.getId(),endNodeId:this.endNode.getId(),stroke:this.stroke,root:this.root.getId(),lineType:this.lineType,id:this.id,range:`${e},${i}`,type:this.type}}return null}setData(t){this.stroke=t.stroke,this.lineType=t.lineType,this.refresh(),this.pl1.attr({stroke:this.stroke,fill:"none"}),this.pl2.attr({stroke:this.stroke,fill:"none"})}judgeNodePos(t,e){if(!e)return"right";var i=t.getPosition(),n=t.getBox(),s=e.getPosition(),r=e.getBox();return"right"==t.direct?i.x>s.x+r.width?"right":"left":s.x>i.x+n.width?"left":"right"}getChildren(){return this.childrens}addChild(t,e){t._parent=this,"number"==typeof e?this.childrens.splice(e,0,t):this.childrens.push(t)}removeChild(t){var e=this.childrens.indexOf(t);return e>-1&&this.childrens.splice(e,1),e}}class Qt{constructor(t){this.name=t}execute(){}undo(){}redo(){this.execute()}refresh(t,e){var i=t||this.mind;i&&(i.emit("renderEditNode",{node:e}),i.emit("mindMapChange",{node:e}))}updateItems(t){for(var e=t;e;)e.wireFrames.length&&e.wireFrames.forEach((t=>{t.refreshItems(),t.refreshNode()})),e.summaries.length&&e.summaries.forEach((t=>{t.refreshItems(),t.refreshNode()})),e=e.belongInduce?e.belongInduce.node:e.parent}initTable(t){t&&(t.initTable(),setTimeout((()=>{t.mindMapChange()}),0))}}class Mt extends Qt{constructor(t,e,i,n,s){super("addNode"),this.parent=null,this.mind=null,this.index=-1,this.isNotEditNode=!0,this.node=t,this.parent=e,this.mind=i||this.node.mindmap,this.isNotEditNode=n||!1,null!=s&&(this.index=s)}execute(){if(this.index>-1?this.mind.addNode(this.node,this.parent,this.index):this.mind.addNode(this.node,this.parent),"table"!=this.mind._mode){if(this.node.iNode){var t=this.node.getLayout();this.node._tableDom=t.tableDom,t.refresh(),t.root.clearCacheData(),t.root.refreshBox()}this.node.refreshBox(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),setTimeout((()=>{this.isNotEditNode||(this.mind.clearSelectNode(),this.node.select(),this.node.edit()),this.isNotEditNode=!1}),0)}else this.initTable(this.mind)}undo(){var t=this.node.parent;if(this.index=this.mind.removeNode(this.node),"table"!=this.mind._mode){if(t)if(t.iNode)t.getLayout().refresh();this.mind.clearSelectNode(),this.updateItems(t),setTimeout((()=>{this.refresh(this.node.mindmap,t),t&&t.select()}),0)}else this.initTable(this.mind)}}class Pt extends Qt{constructor(t,e){super("removeNode"),this.parent=null,this.mind=null,this.index=-1,this.node=t,this.parent=this.node.parent||null,this.mind=e||this.node.mindmap,this.isFreeRoot="freeNode"==this.node.nodeType,this.isInduce="induce"==this.node.nodeType,this.isRelateLink="relateLink"==this.node.nodeType}execute(){var t=this;if(this.isFreeRoot)this.mind.removeFreeNode(this.node),this.mind.removeNode(this.node),this.node.iNode&&this.mind.contentEL.removeChild(this.node.layout.tableDom),this.refresh(this.mind);else if(this.isInduce)this.relateNode=this.node.belongInduce.node,this.induce=this.node.belongInduce,this.mind.removeInduce(this.induce),this.relateNode.induce=null,this.mind.removeNode(this.node),this.node.iNode&&this.node.layout&&this.node.layout.tableDom&&this.mind.contentEL.removeChild(this.node.layout.tableDom),this.relateNode.clearCacheData(),this.updateItems(this.relateNode),this.refresh(this.relateNode.mindmap),this.relateNode.mindmap.updateAssist();else if(this.isRelateLink)this.mind.removeRelateLink(this.node.relateLink),this.mind.removeNode(this.node);else{this.node.clearCacheData(),this.node.refreshBox();var e=this.parent.wireFrames.slice()||[],i=this.parent.summaries.slice()||[];if(this.cacheInfo={wfs:[],induces:[]},e.forEach((e=>{var i;if(e.node==e.endNode)e.node==t.node&&(t.mind.removeWireFrame(e),t.cacheInfo.wfs.push({item:e,type:"remove"}));else if(e.rangeNode.indexOf(t.node)>-1)if(e.rangeNode[0]==t.node){t.node.wfs.splice(t.node.wfs.indexOf(e),1);var n=e.rangeNode.slice();e.rangeNode.shift(),null===(i=e.rangeNode[0])||void 0===i||i.wfs.push(e),e.node=e.rangeNode[0],t.cacheInfo.wfs.push({item:e,type:"changeRangeNode-start",oldRange:n,newRange:e.rangeNode.slice()})}else if(e.rangeNode[e.rangeNode.length-1]==t.node){n=e.rangeNode.slice();e.rangeNode.pop(),e.endNode=e.rangeNode[e.rangeNode.length-1],t.cacheInfo.wfs.push({item:e,type:"changeRangeNode-end",oldRange:n,newRange:e.rangeNode.slice()})}else{n=e.rangeNode.slice();var s=e.rangeNode.indexOf(t.node);e.rangeNode.splice(s,1),e.node=e.rangeNode[0],e.endNode=e.rangeNode[e.rangeNode.length-1],t.cacheInfo.wfs.push({item:e,type:"changeRangeNode",oldRange:n,newRange:e.rangeNode.slice(),num:s})}})),i.forEach((e=>{var i;if(e.node==e.endNode)e.node==t.node&&(t.mind.removeInduce(e),t.cacheInfo.induces.push({item:e,type:"remove"}),t.mind.removeNode(e.root),e.root.iNode&&e.root.layout&&e.root.layout.tableDom&&t.mind.contentEL.removeChild(e.root.layout.tableDom));else if(e.rangeNode.indexOf(t.node)>-1)if(e.rangeNode[0]==t.node){t.node.induces.splice(t.node.induces.indexOf(e),1);var n=e.rangeNode.slice();e.rangeNode.shift(),null===(i=e.rangeNode[0])||void 0===i||i.induces.push(e),e.node=e.rangeNode[0],t.cacheInfo.induces.push({item:e,type:"changeRangeNode-start",oldRange:n,newRange:e.rangeNode.slice()})}else if(e.rangeNode[e.rangeNode.length-1]==t.node){n=e.rangeNode.slice();e.rangeNode.pop(),e.endNode=e.rangeNode[e.rangeNode.length-1],t.cacheInfo.induces.push({item:e,type:"changeRangeNode-end",oldRange:n,newRange:e.rangeNode.slice()})}else{n=e.rangeNode.slice();var s=e.rangeNode.indexOf(t.node);e.rangeNode.splice(s,1),e.node=e.rangeNode[0],e.endNode=e.rangeNode[e.rangeNode.length-1],t.cacheInfo.induces.push({item:e,type:"changeRangeNode",oldRange:n,newRange:e.rangeNode.slice(),num:s})}})),this.node.iNode){var n=this.node.getLayout();n&&n.root&&(n.root.boundingRect=null)}if(this.index=this.mind.removeNode(this.node),"table"==this.node.mindmap._mode)return void this.initTable(this.mind);this.node.iNode&&(this.node.layout?this.node.layout.tableDom&&this.mind.contentEL.removeChild(this.node.layout.tableDom):n.refresh()),this.updateItems(this.parent),this.refresh(this.parent.mindmap,this.parent)}setTimeout((()=>{if(this.parent)if(0==this.index)this.parent.children.length?this.parent.children[0].select():this.parent.select();else{var t=this.parent.children[this.index-1];t?t.select():this.parent.select()}}),0)}undo(){var t=this;if(this.isFreeRoot?(this.mind.addFreeNode(this.node),this.node.iNode&&this.node.layout&&this.node.layout.tableDom&&(this.mind.contentEL.appendChild(this.node.layout.tableDom),this.node.layout.refresh())):this.isInduce?(this.relateNode.clearCacheData(),this.relateNode.induce=this.induce,this.mind.addInduce(this.induce),this.induce.init(),this.node.iNode&&this.node.layout&&(this.mind.contentEL.appendChild(this.node.layout.tableDom),this.node.layout.refresh())):this.isRelateLink?this.mind.addRelateLink(this.node.relateLink):this.mind.addNode(this.node,this.parent,this.index),"table"!=this.mind._mode){if(this.node.iNode){var e=this.node.getLayout();this.node.layout&&this.node.layout.tableDom&&this.mind.contentEL.appendChild(this.node.layout.tableDom),e.refresh()}this.mind.traverseDF((t=>{t.layout&&"table"==t.layout.layoutName&&(this.mind.contentEL.contains(t.layout.tableDom)||this.mind.contentEL.appendChild(t.layout.tableDom)),this.mind._addNodeDom(t)}),this.node),this.node._removeLink&&this.node._removeLink.forEach((t=>{this.mind.addRelateLink(t)})),this.node.clearCacheData(),this.node.refreshBox(),this.cacheInfo&&this.cacheInfo.wfs.forEach((e=>{if("remove"==e.type&&(t.mind.addWireFrame(e.item),e.item.init()),"changeRangeNode-start"==e.type){t.node.wfs.push(e.item);var i=e.item.rangeNode[0];null==i||i.wfs.splice(i.wfs.indexOf(e.item),1),e.item.rangeNode=e.oldRange}"changeRangeNode-end"!=e.type&&"changeRangeNode"!=e.type||(e.item.rangeNode=e.oldRange)})),this.cacheInfo&&this.cacheInfo.induces.forEach((e=>{if("remove"==e.type&&(t.mind.addInduce(e.item),e.item.init(),e.item.root.iNode&&e.item.root.layout&&e.item.root.layout.tableDom&&(this.mind.contentEL.contains(e.item.root.layout.tableDom)||this.mind.contentEL.appendChild(e.item.root.layout.tableDom)),this.mind.traverseDF((t=>{this.mind._addNodeDom(t)}),e.item.root)),"changeRangeNode-start"==e.type){t.node.induces.push(e.item);var i=e.item.rangeNode[0];null==i||i.induces.splice(i.induces.indexOf(e.item),1),e.item.rangeNode=e.oldRange}"changeRangeNode-end"!=e.type&&"changeRangeNode"!=e.type||(e.item.rangeNode=e.oldRange)})),this.updateItems(this.node),this.mind.clearSelectNode(),this.refresh(this.node.mindmap,this.node),setTimeout((()=>{this.node.select()}),0)}else this.initTable(this.mind)}}class Ot extends Qt{constructor(t,e,i){super("changeNodeText"),this._mode="",this.node=t,this.oldText=e,this.text=i,this.isFirst=!0,this._mode=this.node.mindmap._mode}execute(){var t;this.isFirst||(this.node.setText(this.text),this.node.tNode&&this.node.tNode.setText(this.text)),"table"!=this._mode?(this.node.refreshBox(),this.node.clearCacheData(),"wireFrame"!=this.node.nodeType?this.refresh(this.node.mindmap,this.node):this.refresh(this.node.mindmap,null===(t=this.node.wireFrame)||void 0===t?void 0:t.node)):this.initTable(this.node.mindmap)}undo(){var t;this.isFirst=!1,this.node.setText(this.oldText),this.node.tNode&&this.node.tNode.setText(this.oldText),"table"!=this._mode?(this.node.clearCacheData(),this.node.refreshBox(),"wireFrame"!=this.node.nodeType?this.refresh(this.node.mindmap,this.node):this.refresh(this.node.mindmap,null===(t=this.node.wireFrame)||void 0===t?void 0:t.node)):this.initTable(this.node.mindmap)}}class Rt extends Qt{constructor(t){super("moveNode"),this.data={},this.index=-1,this.data=t,this.data.type.indexOf("child")>-1?(this.node=this.data.node,this.oldParent=this.data.oldParent,this.parent=this.data.parent):(this.node=this.data.node,this.oldParent=this.node.parent,this.dropNode=this.data.dropNode,this.newParent=this.dropNode.parent,this.type=this.data.direct),this._wfs=this.node.wfs,this._summary=this.node.induces}execute(){if(this._wfs&&this._wfs.length){var t=this.parent||this.newParent;this._wfs.forEach((e=>{if(this.oldParent&&this.oldParent.wireFrames){var i=this.oldParent.wireFrames.indexOf(e);i>-1&&(this.oldParent.wireFrames.splice(i,1),-1==t.wireFrames.indexOf(e)&&t.wireFrames.push(e))}}))}if(this._summary&&this._summary.length){t=this.parent||this.newParent;this._summary.forEach((e=>{if(this.oldParent&&this.oldParent.summaries){var i=this.oldParent.summaries.indexOf(e);i>-1&&(this.oldParent.summaries.splice(i,1),-1==t.summaries.indexOf(e)&&t.summaries.push(e))}}))}if(this.node.mindmap.clearSelectNode(),this.data.type.indexOf("child")>-1)this.oldParent&&(this.index=this.oldParent.removeChild(this.node)),this.parent.addChild(this.node),this.node.mindmap.traverseBF((t=>{t.boundingRect=null,t.stroke=""}),this.node),this.updateItems(this.node),this.updateItems(this.oldParent),this.node.clearCacheData(),this.oldParent.clearCacheData(),this.refresh(this.node.mindmap,this.node),this.refresh(this.node.mindmap,this.oldParent),this.node.select();else{this.oldParent&&(this.index=this.oldParent.removeChild(this.node)),this.node.mindmap.traverseBF((t=>{t.boundingRect=null,t.stroke=""}),this.node),this.oldParent.clearCacheData();var e=this.newParent.children.indexOf(this.dropNode);"top"==this.type||"left"==this.type?this.newParent.addChild(this.node,e):this.newParent.addChild(this.node,e+1),this.updateItems(this.node),this.updateItems(this.oldParent),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node),this.refresh(this.node.mindmap,this.oldParent),this.node.select()}}undo(){if(this._wfs&&this._wfs.length){var t=this.parent||this.newParent;this._wfs.forEach((e=>{if(this.oldParent&&this.oldParent.wireFrames){var i=t.wireFrames.indexOf(e);i>-1&&(t.wireFrames.splice(i,1),-1==this.oldParent.wireFrames.indexOf(e)&&this.oldParent.wireFrames.push(e))}}))}if(this._summary&&this._summary.length){t=this.parent||this.newParent;this._summary.forEach((e=>{if(this.oldParent&&this.oldParent.summaries){var i=t.summaries.indexOf(e);i>-1&&(t.summaries.splice(i,1),-1==this.oldParent.summaries.indexOf(e)&&this.oldParent.summaries.push(e))}}))}this.node.mindmap.clearSelectNode(),this.data.type.indexOf("child")>-1?(this.parent.removeChild(this.node),this.oldParent&&this.oldParent.addChild(this.node,this.index),this.node.mindmap.traverseBF((t=>{t.boundingRect=null,t.stroke=""}),this.node),this.updateItems(this.node),this.updateItems(this.parent),this.node.mindmap.updateAssist(),this.parent.clearCacheData(),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node),this.refresh(this.node.mindmap,this.parent),this.node.select()):(this.newParent.removeChild(this.node),this.dropNode.clearCacheData(),this.oldParent.addChild(this.node,this.index),this.updateItems(this.node),this.updateItems(this.parent),this.node.mindmap.updateAssist(),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node),this.refresh(this.node.mindmap,this.parent),this.node.select())}}class Ft extends Qt{constructor(t){super("moveNodes"),this.data={},this.index=-1,this._wfs=[],this._summary=[],this.data=t,this.data.type.indexOf("child")>-1?(this.nodes=this.data.nodes,this.oldParent=this.data.oldParent,this.parent=this.data.parent):(this.nodes=this.data.nodes,this.oldParent=this.nodes[0].parent,this.dropNode=this.data.dropNode,this.newParent=this.dropNode.parent,this.type=this.data.direct),this.nodes.forEach((t=>{this._wfs=this._wfs.concat(t.wfs),this._summary=this._summary.concat(t.induces)}))}execute(){if(this._wfs&&this._wfs.length){var t=this.parent||this.newParent;this._wfs.forEach((e=>{if(this.oldParent&&this.oldParent.wireFrames){var i=this.oldParent.wireFrames.indexOf(e);i>-1&&(this.oldParent.wireFrames.splice(i,1),-1==t.wireFrames.indexOf(e)&&t.wireFrames.push(e))}}))}if(this._summary&&this._summary.length){t=this.parent||this.newParent;this._summary.forEach((e=>{if(this.oldParent&&this.oldParent.summaries){var i=this.oldParent.summaries.indexOf(e);i>-1&&(this.oldParent.summaries.splice(i,1),-1==t.summaries.indexOf(e)&&t.summaries.push(e))}}))}if(this.nodes[0].mindmap.clearSelectNode(),this.data.type.indexOf("child")>-1)this.nodes.forEach(((t,e)=>{this.oldParent&&(0==e?this.index=this.oldParent.removeChild(t):this.oldParent.removeChild(t)),this.parent.addChild(t),this.nodes[0].mindmap.traverseBF((t=>{t.boundingRect=null,t.stroke=""}),t),t.clearCacheData(),this.updateItems(t),this.updateItems(this.oldParent)})),this.oldParent.clearCacheData(),this.refresh(this.nodes[0].mindmap,this.nodes[0]),this.refresh(this.nodes[0].mindmap,this.oldParent);else{this.nodes.forEach(((t,e)=>{this.oldParent&&(0==e?this.index=this.oldParent.removeChild(t):this.oldParent.removeChild(t)),this.nodes[0].mindmap.traverseBF((t=>{t.boundingRect=null,t.stroke=""}),t),t.clearCacheData(),this.updateItems(t),this.updateItems(this.oldParent)})),this.oldParent.clearCacheData();var e=this.newParent.children.indexOf(this.dropNode);this.nodes.forEach(((t,i)=>{"top"==this.type||"left"==this.type?this.newParent.addChild(t,e):this.newParent.addChild(t,e+1+i),e=this.newParent.children.indexOf(this.dropNode)})),this.refresh(this.nodes[0].mindmap,this.nodes[0]),this.refresh(this.nodes[0].mindmap,this.oldParent)}}undo(){if(this._wfs&&this._wfs.length){var t=this.parent||this.newParent;this._wfs.forEach((e=>{if(this.oldParent&&this.oldParent.wireFrames){var i=t.wireFrames.indexOf(e);i>-1&&(t.wireFrames.splice(i,1),-1==this.oldParent.wireFrames.indexOf(e)&&this.oldParent.wireFrames.push(e))}}))}if(this._summary&&this._summary.length){t=this.parent||this.newParent;this._summary.forEach((e=>{if(this.oldParent&&this.oldParent.summaries){var i=t.summaries.indexOf(e);i>-1&&(t.summaries.splice(i,1),-1==this.oldParent.summaries.indexOf(e)&&this.oldParent.summaries.push(e))}}))}this.nodes[0].mindmap.clearSelectNode(),this.data.type.indexOf("child")>-1?(this.nodes.forEach(((t,e)=>{this.parent.removeChild(t),this.oldParent&&this.oldParent.addChild(t,this.index+e),t.mindmap.traverseBF((t=>{t.boundingRect=null,t.stroke=""}),t),this.updateItems(t)})),this.updateItems(this.parent),this.nodes[0].mindmap.updateAssist(),this.parent.clearCacheData(),this.nodes[0].clearCacheData(),this.refresh(this.nodes[0].mindmap,this.nodes[0]),this.refresh(this.nodes[0].mindmap,this.parent)):(this.nodes.forEach(((t,e)=>{this.newParent.removeChild(t),this.oldParent&&this.oldParent.addChild(t,this.index+e),t.mindmap.traverseBF((t=>{t.boundingRect=null,t.stroke=""}),t),this.updateItems(t)})),this.dropNode.clearCacheData(),this.updateItems(this.parent),this.nodes[0].mindmap.updateAssist(),this.nodes[0].clearCacheData(),this.refresh(this.nodes[0].mindmap,this.nodes[0]),this.refresh(this.nodes[0].mindmap,this.parent))}}class zt extends Qt{constructor(t,e,i){super("movePos"),this.node=t,this.oldPos=e,this.newPos=i}execute(){this.node.setPosition(this.newPos.x,this.newPos.y),this.node.callout?this.refresh(this.node.mindmap,this.node.callout.node):this.refresh(this.node.mindmap,this.node),this.node.mindmap.clearSelectNode()}undo(){this.node.setPosition(this.oldPos.x,this.oldPos.y),this.node.callout?this.refresh(this.node.mindmap,this.node.callout.node):this.refresh(this.node.mindmap,this.node),this.node.mindmap.clearSelectNode()}}class Ht extends Qt{constructor(t){super("collapseNOde"),this.node=t,this.node.mindmap.clearSelectNode(),this.node.refreshBox()}execute(){this.node.clearCacheData(),this.node.collapse(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.select()}undo(){this.node.clearCacheData(),this.node.expand(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.select()}}class jt extends Qt{constructor(t){super("collapseNOde"),this.node=t,this.node.mindmap.clearSelectNode(),this.node.refreshBox()}execute(){this.node.clearCacheData(),this.node.expand(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.select()}undo(){this.node.clearCacheData(),this.node.collapse(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.select()}}class qt extends Qt{constructor(t,e){super("addInduce"),this.node=t,this.induce=e,this.mind=this.node.getMind(),this.added=!1}execute(){this.added||(this.mind.addInduce(this.induce),this.added=!0),this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node)}undo(){this.added=!1,this.mind.contentEL.removeChild(this.induce.root.containEl),this.mind.removeInduce(this.induce),this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node)}}class Ut extends Qt{constructor(t,e){super("addWireFrame"),this.num=1,this.wireFrame=t,this.mind=e,this.node=this.wireFrame.node,this.num=1}execute(){this.node.clearCacheData(),this.mind.addWireFrame(this.wireFrame),1!=this.num&&(this.node.wireFrame=this.wireFrame,this.wireFrame.init()),this.num++,this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode()}undo(){this.mind.removeWireFrame(this.wireFrame),this.node.wireFrame=null,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode()}}class Wt extends Qt{constructor(t,e){super("remmoveWireFrame"),this.mind=e,this.node=t.node,this.wireFrame=t}execute(){this.mind.removeWireFrame(this.wireFrame),this.node.wireFrame=null,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode(),this.mind._dragFrame.style.display="none",this.mind._indicateDom.style.display="none"}undo(){this.node.wireFrame=this.wireFrame,this.node.clearCacheData(),this.mind.addWireFrame(this.wireFrame),this.wireFrame.init(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode(),this.mind._dragFrame.style.display="none",this.mind._indicateDom.style.display="none"}}class Vt extends Qt{constructor(t,e,i){super("changeRangeNode"),this.item=t,this.old=e,this.new=i}pre(){var t=this.old[0];"wireFrame"==this.item.name?t.wfs.splice(t.wfs.indexOf(this.item),1):t.induces.splice(t.induces.indexOf(this.item),1)}execute(){this.pre(),this.item.rangeNode=this.new,this.item.node=this.new[0],this.item.endNode=this.new[this.new.length-1],"wireFrame"==this.item.name?-1==this.new[0].wfs.indexOf(this.item)&&this.new[0].wfs.push(this.item):-1==this.new[0].induces.indexOf(this.item)&&this.new[0].induces.push(this.item),this.old.forEach((t=>{t&&t.clearCacheData()})),this.new.forEach((t=>{t&&t.clearCacheData()})),this.updateItems(this.item.node),this.refresh(this.item.node.mindmap,this.item.node)}undo(){"wireFrame"==this.item.name?this.new[0].wfs.splice(this.new[0].wfs.indexOf(this.item),1):this.new[0].induces.splice(this.new[0].induces.indexOf(this.item),1),this.item.rangeNode=this.old,this.item.node=this.old[0],this.item.endNode=this.old[this.old.length-1],"wireFrame"==this.item.name?this.old[0].wfs.indexOf(this.item)&&this.old[0].wfs.push(this.item):this.old[0].induces.indexOf(this.item)&&this.old[0].induces.push(this.item),this.old.forEach((t=>{t&&t.clearCacheData()})),this.new.forEach((t=>{t&&t.clearCacheData()})),this.updateItems(this.item.node),this.refresh(this.item.node.mindmap,this.item.node)}}class Xt extends Qt{constructor(t){super("addRelate"),this.link=t,this.mind=this.link.startNode.getMind()}execute(){this.mind.addRelateLink(this.link),this.mind.status="",this.link.status="added"}undo(){this.mind.removeRelateLink(this.link)}}class _t extends Qt{constructor(t,e,i){super("relateLinkBox"),this.relateLink=t,this.oldBox=e,this.box=i}execute(){this.relateLink.data=this.box.data,this.relateLink.setBox(Object.assign({},this.box)),this.refresh(this.relateLink.startNode.mindmap,this.relateLink.startNode)}undo(){this.relateLink.data=this.oldBox.data,this.relateLink.setBox(Object.assign({},this.oldBox)),this.refresh(this.relateLink.startNode.mindmap,this.relateLink.startNode)}}class Jt extends Qt{constructor(t,e){super("setAnnotate"),this.node=t,this.annotate=e,t.getAnnotateId()&&(this.oldAnnotate=t.getAnnotate())}execute(){this.node.setAnnotate(this.annotate),this.refresh(this.node.mindmap,this.node)}undo(){this.oldAnnotate?this.node.setAnnotate(this.oldAnnotate):this.node.deleteAnnotate(),this.refresh(this.node.mindmap,this.node)}}class Gt extends Qt{constructor(t){super("setAnnotate"),this.node=t,this.annotate=t.getAnnotate()}execute(){this.node.deleteAnnotate(),this.refresh(this.node.mindmap,this.node)}undo(){this.node.setAnnotate(this.annotate),this.refresh(this.node.mindmap,this.node)}}class Kt extends Qt{constructor(t){super("changeNodeToFreeRoot"),this.node=t,this.mind=t.getMind(),this.pos=this.node.getPosition(),this.parent=this.node.parent,this.node.data.main=!1,this.node.layout&&(this.layout=this.node.layout)}execute(){var t=this;if(this.layout&&(this.node.layout=this.layout),this.node.clearCacheData(),this.node.containEl.classList.contains("mm-root")||this.node.containEl.classList.add("mm-root"),this.node.containEl.classList.contains("mm-freeNode")||this.node.containEl.classList.add("mm-freeNode"),this.node.refreshBox(),this.parent)var e=this.parent.wireFrames,i=this.parent.summaries;this.cacheInfo={wfs:[],induces:[]},e&&e.forEach((e=>{if(e.node==e.endNode){if(e.node==t.node){var i=e.node.parent,n=i.wireFrames.indexOf(e);i.wireFrames.splice(n,1),e.node.wireFrame=e,t.cacheInfo.wfs.push({item:e,type:"toFreeRoot"})}}else if(e.rangeNode.indexOf(t.node)>-1)if(e.rangeNode[0]==t.node){t.node.wfs.splice(t.node.wfs.indexOf(e),1);var s=e.rangeNode.slice();e.rangeNode.shift(),e.rangeNode[0].wfs.push(e),t.cacheInfo.wfs.push({item:e,type:"changeRangeNode-start",oldRange:s,newRange:e.rangeNode.slice()})}else if(e.rangeNode[e.rangeNode.length-1]==t.node){s=e.rangeNode.slice();e.rangeNode.pop(),t.cacheInfo.wfs.push({item:e,type:"changeRangeNode-end",oldRange:s,newRange:e.rangeNode.slice()})}else{s=e.rangeNode.slice();var r=e.rangeNode.indexOf(t.node);e.rangeNode.splice(r,1),t.cacheInfo.wfs.push({item:e,type:"changeRangeNode",oldRange:s,newRange:e.rangeNode.slice(),num:r})}})),i&&i.forEach((e=>{if(e.node==e.endNode)e.node==t.node&&(t.mind.removeInduce(e),t.cacheInfo.induces.push({item:e,type:"remove"}),t.mind.removeNode(e.root));else if(e.rangeNode.indexOf(t.node)>-1)if(e.rangeNode[0]==t.node){t.node.induces.splice(t.node.induces.indexOf(e),1);var i=e.rangeNode.slice();e.rangeNode.shift(),e.rangeNode[0].induces.push(e),t.cacheInfo.induces.push({item:e,type:"changeRangeNode-start",oldRange:i,newRange:e.rangeNode.slice()})}else if(e.rangeNode[e.rangeNode.length-1]==t.node){i=e.rangeNode.slice();e.rangeNode.pop(),t.cacheInfo.induces.push({item:e,type:"changeRangeNode-end",oldRange:i,newRange:e.rangeNode.slice()})}else{i=e.rangeNode.slice();var n=e.rangeNode.indexOf(t.node);e.rangeNode.splice(n,1),t.cacheInfo.induces.push({item:e,type:"changeRangeNode",oldRange:i,newRange:e.rangeNode.slice(),num:n})}})),this.parent&&(this.index=this.parent.removeChild(this.node)),this.node.parent=null,this.mind.addFreeNode(this.node),this.mind.traverseDF((t=>{t.boundingRect=null,t.stroke=""}),this.node),this.node.nodeType="freeNode",this.node.setPosition(this.pos.x,this.pos.y),this.updateItems(this.parent),this.updateItems(this.node),this.parent.clearCacheData(),this.refresh(this.parent.mindmap,this.parent),this.refresh(this.node.mindmap,this.node),this.layout||(this.layout=this.node.layout),this.mind.clearSelectNode()}undo(){var t=this;this.mind.removeFreeNode(this.node),this.node.containEl.classList.contains("mm-root")&&this.node.containEl.classList.remove("mm-root"),this.node.containEl.classList.contains("mm-freeNode")&&this.node.containEl.classList.remove("mm-freeNode"),this.node.refreshBox(),this.node.layout&&(this.node.layout.svgDom&&this.node.layout.svgDom.clear()&&this.node.layout.svgDom.remove(),this.node.layout.group&&this.node.layout.group.clear()&&this.node.layout.group.remove(),this.node.layout.svgDom=null,this.node.layout.group=null,this.node.layout=null),this.node.nodeType="richText",this.parent&&this.parent.addChild(this.node,this.index),this.node.clearCacheData(),this.mind.traverseDF((t=>{t.boundingRect=null,t.stroke=""}),this.node),this.node._isRoot||this.node.layout&&(this.node.layout.svgDom&&this.node.layout.svgDom.remove(),this.node.layout.svgDom=null,this.node.layout=null),this.cacheInfo&&this.cacheInfo.wfs.forEach((e=>{if("toFreeRoot"==e.type){var i=e.item.node.parent;i&&(i.wireFrames.push(e.item),i.wireFrames.unique(),i.wireFrames.sort((function(t,e){return t.rangeNode.length-e.rangeNode.length}))),e.item.node.wireFrame=null}if("remove"==e.type&&(t.mind.addWireFrame(e.item),e.item.init()),"changeRangeNode-start"==e.type){t.node.wfs.push(e.item);var n=e.item.rangeNode[0];n.wfs.splice(n.wfs.indexOf(e.item),1),e.item.rangeNode=e.oldRange}"changeRangeNode-end"!=e.type&&"changeRangeNode"!=e.type||(e.item.rangeNode=e.oldRange)})),this.cacheInfo&&this.cacheInfo.induces.forEach((e=>{if("remove"==e.type&&(t.mind.addInduce(e.item),e.item.init(),this.mind.traverseDF((t=>{this.mind._addNodeDom(t)}),e.item.root)),"changeRangeNode-start"==e.type){t.node.induces.push(e.item);var i=e.item.rangeNode[0];i.induces.splice(i.induces.indexOf(e.item),1),e.item.rangeNode=e.oldRange}"changeRangeNode-end"!=e.type&&"changeRangeNode"!=e.type||(e.item.rangeNode=e.oldRange)})),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.node.layout=null,this.mind.clearSelectNode()}}class Yt extends Qt{constructor(t,e){super("changeFreeRootToNode"),this.node=t,this.pos=this.node.getPosition(),this.parent=e,this.mind=this.node.getMind(),this.oldLayout=this.node.layout}execute(){if(this.node.containEl.classList.contains("mm-root")&&(this.node.containEl.classList.remove("mm-root"),this.node.containEl.classList.remove("mm-freeNode")),this.node.refreshBox(),this.mind.removeFreeNode(this.node),this.node.layout.svgDom&&this.node.layout.svgDom.clear(),this.node.nodeType="richText",this.parent.addChild(this.node),this.node.clearCacheData(),this.mind.traverseDF((t=>{t.boundingRect=null,t.direct="",t.stroke=this.parent.stroke,t.data.stroke=this.parent.stroke}),this.node),this.node.wfs.length){var t=this.node.parent;t&&(-1==t.wireFrames.indexOf(this.node.wfs[0])&&t.wireFrames.push(this.node.wfs[0]),t.wireFrames.sort((function(t,e){return t.rangeNode.length-e.rangeNode.length}))),this.rootWf=this.node.wfs[0],this.node.wireFrame=null}this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),this.mind.clearSelectNode()}undo(){if(this.node.layout=this.oldLayout,this.node.clearCacheData(),this.mind.addFreeNode(this.node),this.node.nodeType="freeNode",this.parent.removeChild(this.node),this.node.setPosition(this.pos.x,this.pos.y),this.mind.traverseDF((t=>{t.boundingRect=null,t.direct="",t.stroke="",t.data.stroke=""}),this.node),this.node.containEl.classList.contains("mm-root")||(this.node.containEl.classList.add("mm-root"),this.node.containEl.classList.add("mm-freeNode")),this.node.refreshBox(),this.mind.clearSelectNode(),this.rootWf){var t=this.rootWf.node.parent;t&&t.wireFrames.splice(t.wireFrames.indexOf(this.rootWf),1),this.rootWf.node.wireFrame=this.rootWf,this.rootWf=null}this.updateItems(this.parent),this.updateItems(this.node),this.refresh(this.parent.mindmap,this.parent),this.refresh(this.node.mindmap,this.node)}}class Zt extends Qt{constructor(t){super("removeCommand"),this.node=t.node,this.induce=t}execute(){var t=this.node.getMind();t.removeInduce(this.induce),this.induce.root.layout&&this.induce.root.layout.svgDom&&this.induce.root.layout.svgDom.remove()&&(this.induce.root.layout.svgDom=null),function e(i){t.removeNode(i),i.wireFrames&&i.wireFrames.forEach((e=>{t.removeWireFrame(e)})),i.summaries&&i.summaries.forEach((i=>{t.removeInduce(i),i.root.layout&&i.root.layout.svgDom&&i.root.layout.svgDom.remove()&&(i.root.layout.svgDom=null),e(i.root)})),i.getChildren().forEach((t=>{e(t)}))}(this.induce.root),this.node.induce=null,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(t,this.node),t.updateAssist(),t._dragFrame.style.display="none",t._indicateDom.style.display="none"}undo(){var t=this.node.getMind();t.addInduce(this.induce),function e(i){t.addNode(i),i.wireFrames.length&&i.wireFrames.forEach((e=>{t.addWireFrame(e)})),i.summaries.length&&i.summaries.forEach((i=>{t.addInduce(i),e(i.root)})),i.getChildren().forEach((t=>{e(t)}))}(this.induce.root),this.node.induce=this.induce,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node),t._dragFrame.style.display="none",t._indicateDom.style.display="none"}}class $t extends Qt{constructor(t){super("removeRelateLink"),this.link=t,this.mind=t.startNode.getMind()}execute(){this.mind.removeNode(this.link.textNode),this.mind.removeRelateLink(this.link),this.refresh(this.mind,this.link.startNode)}undo(){this.mind.addRelateLink(this.link),this.refresh(this.mind,this.link.startNode)}}class te extends Qt{constructor(t,e){super("changeLayout"),this.isTable=!1,this.oldNode=null,this.tableLayout=null,this.forceChange=!1,this.newLayout=null,this.node=t,this.mind=this.node.mindmap,this.direct=e}execute(){if(this.mind.traverseDF((t=>{t.boundingRect=null}),this.node),"right"==this.direct||"left"==this.direct||"mindmap"==this.direct||"up"==this.direct||"down"==this.direct||this.direct.indexOf("mindmapBasic")>-1){if(r=this.node.getNodeLayout()){if(this.mind.traverseDF((t=>{t.boundingRect=null}),r.root),this.oldLayout=r,"table"==r.layoutName){this.forceChange=!0;var t=r.getData(r.root),e=this.initNode(t,this.direct);e.nodeType=r.root.nodeType,this.oldIndex=this.mind.removeNode(r.root),this.oldIndex>-1&&this.mind.addNode(e,r.root.parent,this.oldIndex),this.mind.traverseBF((t=>{this.mind._addNodeDom(t)}),e),this.mind.contentEL.contains(r.tableDom)&&this.mind.contentEL.removeChild(r.tableDom),e.data.main&&(this.mind.root=e,t.x&&t.y&&e.setPosition(t.x,t.y),this.mind.traverseBF((t=>{t.refreshBox(),t.boundingRect=null}),e)),"freeNode"==r.root.nodeType&&(this.mind.removeFreeNode(r.root),this.mind.addFreeNode(e),t.x&&t.y&&e.setPosition(t.x,t.y),this.mind.traverseBF((t=>{t.refreshBox(),t.boundingRect=null}),e)),"induce"==r.root.nodeType&&(r.root.incuce.root=e,e.incuce=r.root.incuce,e.nodeType,this.mind.traverseBF((t=>{t.refreshBox(),t.boundingRect=null}),e)),this.effect()}r.svgDom&&r.svgDom.clear()&&r.svgDom.remove()&&(r.svgDom=null),r.group&&r.group.clear()&&r.group.remove()&&(r.group=null)}this.node.clearCacheData();var i="up"==this.direct||"down"==this.direct?"tree":"mindmap2";if("mindmapBasic"==this.direct){i="mindmap6";var n="mindmap"}if("mindmapBasicLeft"==this.direct){i="mindmap6";n="left"}if("mindmapBasicRight"==this.direct){i="mindmap6";n="right"}var s=new Nt[i](e||this.node,n||this.direct,this.mind.view.colors.slice());(e||this.node).layout=s,this.newLayout=s,this.node.isRoot&&this.node.data.main&&(this.node.mindmap.mmLayout=s)}if("lTree"==this.direct&&this.changeLayout("multipleTree","multipleTree"),"vertical"==this.direct&&this.changeLayout("vertical","vertical"),"fishRight"==this.direct&&this.changeLayout("fish","right"),"fishLeft"==this.direct&&this.changeLayout("fish","left"),"multip"==this.direct&&this.changeLayout("multipleTree","multipleTree"),"multipLeft"==this.direct&&this.changeLayout("multipleTree","left"),"multipRight"==this.direct&&this.changeLayout("multipleTree","right"),"table"==this.direct){var r=this.node.getNodeLayout();this.isTable=!0,r&&"table"!=r.layoutName&&(this.oldLayout=r),this.oldNode=this.node;s=new Nt.table(this.node,"");var o=this.node.parent;s.root.parent=o,this.oldIndex=this.mind.removeNode(this.node,!1),this.mind.addNode(s.root,s.root.parent,this.oldIndex),this.tableLayout=s,this.oldNode&&this.oldNode.isRoot&&this.oldNode.data.main&&(this.mind.root=s.root,this.mind.mmLayout=s),this.oldNode&&"freeNode"==this.oldNode.nodeType&&(this.mind.removeFreeNode(this.oldNode),this.mind.addFreeNode(s.root),s.root.nodeType),this.oldNode&&"induce"==this.oldNode.nodeType&&this.oldNode.incuce&&(this.oldNode.incuce.root=s.root,s.root.induce=this.oldNode.induce,s.root.nodeType),this.effect()}this.oldLayout?(this.newLayout&&this.refresh(this.mind,this.newLayout.root),this.refresh(this.mind,this.oldLayout.root)):this.refresh(this.mind,this.node)}changeLayout(t,e){var i=this.node.getNodeLayout();if(i){if(this.mind.traverseDF((t=>{t.boundingRect=null,t.refreshBox(),t.direct=""}),i.root),this.oldLayout=i,"table"==i.layoutName){this.forceChange=!0;var n=i.getData(i.root),s=this.initNode(n,this.direct);s.nodeType=i.root.nodeType,this.oldIndex=this.mind.removeNode(i.root),this.oldIndex>-1&&this.mind.addNode(s,i.root.parent,this.oldIndex),this.mind.traverseBF((t=>{this.mind._addNodeDom(t)}),s),s.data.main&&(this.mind.root=s,n.x&&n.y&&s.setPosition(n.x,n.y),this.mind.traverseBF((t=>{t.refreshBox(),t.boundingRect=null}),s)),"freeNode"==i.root.nodeType&&(this.mind.removeFreeNode(i.root),this.mind.addFreeNode(s),s.nodeType,n.x&&n.y&&s.setPosition(n.x,n.y),this.mind.traverseBF((t=>{t.refreshBox(),t.boundingRect=null}),s)),"induce"==i.root.nodeType&&(i.root.incuce.root=s,s.incuce=i.root.incuce,s.nodeType,this.mind.traverseBF((t=>{t.refreshBox(),t.boundingRect=null}),s)),this.mind.contentEL.contains(i.tableDom)&&this.mind.contentEL.removeChild(i.tableDom),this.effect()}i.svgDom&&i.svgDom.clear()&&i.svgDom.remove()&&(i.svgDom=null),i.group&&i.group.clear()&&i.group.remove()&&(i.group=null)}this.node.clearCacheData();var r=new Nt[t](s||this.node,e,this.mind.view.colors.slice());(s||this.node).layout=r,this.newLayout=r,this.node.isRoot&&this.node.data.main&&(this.node.mindmap.mmLayout=r)}undo(){this.oldLayout&&!this.isTable?this.forceChange?(this.oldIndex>-1&&(this.mind.removeNode(this.newLayout.root),this.mind.addNode(this.oldLayout.root,this.oldLayout.root.parent,this.oldIndex)),this.newLayout&&this.newLayout.root.data.main&&(this.mind.root=this.oldLayout.root,this.mind._removeChildDom(this.newLayout.root),this.mind.mmLayout=this.oldLayout),this.newLayout&&"freeNode"==this.newLayout.root.nodeType&&(this.mind.removeFreeNode(this.newLayout.root),this.mind.addFreeNode(this.oldLayout.root),this.oldLayout.root.nodeType,this.mind._removeChildDom(this.newLayout.root)),this.newLayout&&"induce"==this.newLayout.root.nodeType&&(this.oldLayout.root.nodeType,this.mind._removeChildDom(this.newLayout.root),this.oldLayout.root.induce.root=this.oldLayout.root),this.oldLayout.tableDom&&(this.mind.contentEL.contains(this.oldLayout.tableDom)||this.mind.contentEL.appendChild(this.oldLayout.tableDom)),this.effect()):(this.oldLayout.root.layout.svgDom&&this.oldLayout.root.layout.svgDom.clear()&&this.oldLayout.root.layout.svgDom.remove()&&(this.oldLayout.root.layout.svgDom=null),this.oldLayout.root.layout.group&&this.oldLayout.root.layout.group.clear()&&this.oldLayout.root.layout.group.remove()&&(this.oldLayout.root.layout.group=null),this.mind.traverseDF((t=>{t.boundingRect=null,t.refreshBox(),t.direct=""}),this.oldLayout.root),this.oldLayout.root.layout=this.oldLayout,this.oldLayout.svgDom&&(this.oldLayout.svgDom=null),this.oldLayout.group&&(this.oldLayout.group=null),this.oldLayout.layout(this.oldLayout.root,this.oldLayout.direct)):this.oldLayout&&this.isTable?(this.mind.removeNode(this.tableLayout.root),this.mind.addNode(this.oldNode,this.oldNode.parent,this.oldIndex),this.mind.traverseBF((t=>{this.mind._addNodeDom(t),t.refreshBox(),t.boundingRect=null}),this.oldNode),this.mind.contentEL.removeChild(this.tableLayout.tableDom),this.oldNode&&this.oldNode.data.main&&(this.mind.root=this.oldNode,this.mind.mmLayout=this.oldLayout),this.oldNode&&"freeNode"==this.tableLayout.root.nodeType&&(this.mind.removeFreeNode(this.tableLayout.root),this.mind.addFreeNode(this.oldNode),this.mind.traverseBF((t=>{t.refreshBox(),t.boundingRect=null}),this.oldNode)),this.oldNode&&"induce"==this.tableLayout.root.nodeType&&this.oldNode.incuce&&(this.oldNode.incuce.root=this.oldNode,this.mind.traverseBF((t=>{t.refreshBox(),t.boundingRect=null}),this.oldNode)),this.tableLayout.tableDom=null,this.tableLayout=null,this.effect()):this.isTable?(this.mind.removeNode(this.tableLayout.root),this.mind.addNode(this.oldNode,this.oldNode.parent,this.oldIndex),this.mind.traverseBF((t=>{this.mind._addNodeDom(t),t.boundingRect=null,t.refreshBox()}),this.oldNode),this.mind.contentEL.contains(this.tableLayout.tableDom)&&this.mind.contentEL.removeChild(this.tableLayout.tableDom),this.tableLayout.tableDom=null,this.tableLayout=null,this.effect()):this.node.layout&&(this.mind.traverseDF((t=>{t.boundingRect=null,t.refreshBox(),t.direct=""}),this.node.layout.root),this.node.layout.svgDom&&this.node.layout.svgDom.clear()&&this.node.layout.svgDom.remove()&&(this.node.layout.svgDom=null),this.node.layout.group&&this.node.layout.group.clear()&&this.node.layout.group.remove()&&(this.node.layout.group=null),this.node.layout=null,this.node.clearCacheData()),this.oldLayout?(this.newLayout&&this.refresh(this.mind,this.newLayout.root),this.refresh(this.mind,this.oldLayout.root)):this.refresh(this.mind,this.node),this.node.isRoot&&this.node.data.main&&(this.node.mindmap.mmLayout=this.oldLayout)}initNode(t,e){var i=this,n=null;return function t(s,r,o){var a=new xt(s,i.mind);s.isRoot&&s.main&&(i.mind.root=a,a.isRoot=!0),r?n=a:(o.children.push(a),a.parent=o),a.direct=e||s.direct,s.children&&s.children.length&&s.children.forEach((e=>{e.x=100,e.y=100,t(e,!1,a)}))}(t,!0),n}effect(){var t=this.mind.induces,e=this.mind.wireFrames,i=this.mind.relateLinks;t.concat(e).forEach((t=>{var e=t.node,i=t.endNode;if(e){var n=e.getId();(s=this.mind.getNodeById(n))!=e&&(t.node=s,t.rangeNode=[s,i],"wireFrame"==t.name?(s.wfs||(s.wfs=[]),-1==s.wfs.indexOf(t)&&s.wfs.push(t)):(s.induces||(s.induces=[]),-1==s.induces.indexOf(t)&&s.induces.push(t)))}if(i){var s;n=i.getId();(s=this.mind.getNodeById(n))!=i&&(t.endNode=s,t.rangeNode=[t.node,s])}t.refreshNode(),t.refreshItems()})),i.forEach((t=>{var e=t.startNode,i=t.endNode;if(e){var n=e.getId();(s=this.mind.getNodeById(n))!=e&&(t.startNode=s)}if(i){var s;n=i.getId();(s=this.mind.getNodeById(n))!=i&&(t.endNode=s)}}))}}class ee extends Qt{constructor(t,e){super("changeSummary"),this.summary=t,this.stroke=e,this.oldStroke=t.stroke}execute(){this.summary.setData({stroke:this.stroke,lineType:"solid"});var t=this.summary.node;this.refresh(t.mindmap,t)}undo(){this.summary.setData({stroke:this.oldStroke,lineType:"solid"});var t=this.summary.node;this.refresh(t.mindmap,t)}}class ie extends Qt{constructor(t,e,i){super("ChangeWireframe"),this.wf=t,this.stroke=e,this.oldStroke=t.stroke,this.background=i,this.oldBackground=t.fill}execute(){this.wf.fill=this.background,this.wf.stroke=this.stroke,this.wf.refresh();var t=this.wf.node;this.refresh(t.mindmap,t)}undo(){this.wf.fill=this.oldBackground,this.wf.stroke=this.oldStroke;var t=this.wf.node;this.refresh(t.mindmap,t)}}class ne extends Qt{constructor(t,e){super("changeLinkStroke"),this.link=t,this.stroke=e,this.oldStroke=t.data.color}execute(){this.link.data.color=this.stroke,this.link.refresh(),this.refresh(this.link.mind,this.link.startNode)}undo(){this.link.data.color=this.oldStroke,this.link.refresh(),this.refresh(this.link.mind,this.link.startNode)}}class se extends Qt{constructor(t,e){super("changeLinkType"),this.link=t,this.type=e,this.oldType=t.data.type}execute(){this.link.data.type=this.type,this.link.bs&&(this.link.bs.remove(),this.link._createLine(),this.link._addLineEvent()),this.link.refresh(),this.refresh(this.link.mind,this.link.startNode)}undo(){this.link.data.type=this.oldType,this.link.bs&&(this.link.bs.remove(),this.link._createLine(),this.link._addLineEvent()),this.link.refresh(),this.refresh(this.link.mind,this.link.startNode)}}class re extends Qt{constructor(t,e){super("note"),this.node=t,this.note=e,this.oldNote=t.data.note}execute(){this.node.setNote(this.note),this.node.refreshBox(),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node)}undo(){this.node.setNote(this.oldNote),this.node.refreshBox(),this.node.clearCacheData(),this.refresh(this.node.mindmap,this.node)}}class oe extends Qt{constructor(t){super("addFreeNode"),this.node=t}execute(){this.node.mindmap.addFreeNode(this.node),this.refresh(this.node.mindmap,this.node)}undo(){this.node.mindmap.removeFreeNode(this.node),this.node.mindmap.removeNode(this.node),this.refresh(this.node.mindmap,this.node)}}class ae extends Qt{constructor(t,e,i){super("copyNode"),this.waitCollapse=[],this.summary=[],this.node=t,this.data=e,this.mind=this.node.mindmap,this.waitCollapse=[],this.summary=i}execute(){this.paste()}undo(){this.firstNode&&(this.mind.removeNode(this.firstNode),this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.node.mindmap,this.node))}paste(){var t=this;this.data.forEach(((t,e)=>{var i=new xt(t,this.mind);if(i.mindmap=this.mind,t.isExpand||this.waitCollapse.push(i),0==e)i.data.pid=this.node.getId(),this.mind.addNode(i,this.node),this.firstNode=i,i.setPosition(0,0),i.refreshBox();else{var n=this.mind.getNodeById(t.pid);n&&(this.mind.addNode(i,n),i.setPosition(0,0),i.refreshBox())}e==this.data.length-1&&(i.clearCacheData(),this.updateItems(i),this.refresh(this.mind,i))}));var e=null;this.summary.sort(((t,e)=>t.index-e.index)),this.summary.forEach((i=>{var n=i.range,s=this.mind.getNodeById(i.nodeId);console.log(s),e=s;var r=s.parent,o=[];if(n){var a=n.split(",");r.children.forEach(((t,e)=>{e>=a[0]&&e<=a[1]&&o.push(t)}));var h=o[o.length-1]}else{h=s;o=[s]}i.nodeArr.forEach(((e,n)=>{if(0==n){var r=new xt(e,t.mind),a=new Lt(s,r,i.stroke,i.lineType);a.endNode=h,a.rangeNode=o,a.refreshItems(),a.refreshNode(),a.type=i.type,t.mind.addInduce(a)}else{r=new xt(e,t.mind);var l=t.mind.getNodeById(e.pid);t.mind.contentEL.appendChild(r.containEl),l&&(l.children.push(r),r.setPosition(0,0),r.parent=l)}if(e.x&&e.y&&r.setPosition(e.x,e.y),e.boundingRect&&(r.boundingRect=e.boundingRect),r.refreshBox(),e.layout){var d=new Array(100).fill(o[0].stroke||o[0].data.stroke);r.layout=new Nt[e.layout.layoutName](s,e.layout.layoutDirect,d),r.layout.direct=e.layout.layoutDirect,r.layout.root=r}}))})),e&&(e.clearCacheData(),this.updateItems(e),this.refresh(this.mind,e))}}class he extends Qt{constructor(t,e){super("setNodeStyle"),this.oldStyles={},this.nodes=t,this.newStyle=e}execute(){var t,e=[];this.nodes.forEach((t=>{var i=t.getStyle();this.oldStyles[t.getId()]=JSON.stringify(i);var n=Object.assign({},i,this.newStyle);t.setStyle(n),t.clearCacheData(),t.refreshBox();var s=t.getTopLayout();-1==e.indexOf(s)&&e.push(s),t.callout&&t.callout.refresh()})),e.length&&e.forEach((t=>{t&&t.refresh()})),1==this.nodes.length&&"wireFrame"==this.nodes[0].nodeType?this.refresh(this.nodes[0].mindmap,null===(t=this.nodes[0].wireFrame)||void 0===t?void 0:t.node):this.refresh(this.nodes[0].mindmap,this.nodes[0])}undo(){var t=[];this.nodes.forEach((e=>{var i=e.getId(),n=JSON.parse(this.oldStyles[i]);e.setStyle(n,!0),e.clearCacheData(),e.refreshBox();var s=e.getTopLayout();-1==t.indexOf(s)&&t.push(s),e.callout&&e.callout.refresh()})),t.length&&t.forEach((t=>{t&&t.refresh()})),this.refresh(this.nodes[0].mindmap,this.nodes[0])}}class le extends Qt{constructor(t,e){super("addCallout"),this.node=t,this.callout=e,this.mind=t.getMind(),this.num=1}execute(){this.mind.addCallout(this.callout),1!=this.num&&(this.callout.init(),this.mind.contentEL.appendChild(this.callout.root.containEl)),this.callout.node.callout=this.callout,this.num++,this.updateItems(this.callout.node),this.node.clearCacheData(),this.refresh(this.mind,this.callout.node)}undo(){this.mind.removeCallout(this.callout),this.mind.contentEL.removeChild(this.callout.root.containEl),this.callout.off(),this.callout.remove(),this.node.callout=null,this.node.clearCacheData(),this.updateItems(this.node),this.refresh(this.mind,this.node)}}class de extends Qt{constructor(t){super("RemoveCallout"),this.callout=t,this.mind=t.node.getMind()}execute(){this.mind.contentEL.removeChild(this.callout.root.containEl),this.mind.removeCallout(this.callout),this.callout.node.clearCacheData(),this.callout.off(),this.callout.node.callout=null,this.updateItems(this.callout.node),this.refresh(this.mind,this.callout.node)}undo(){this.mind.addCallout(this.callout),this.mind.contentEL.appendChild(this.callout.root.containEl),this.callout.init(),this.callout.node.callout=this.callout,this.callout.node.clearCacheData(),this.updateItems(this.callout.node),this.refresh(this.mind,this.callout.node)}}class ce extends Qt{constructor(t){super("removeNodeLayout"),this.node=t,this.mind=this.node.getMind(),this.layout=t.layout}execute(){if(this.layout){if("table"!=this.layout.layoutName)this.layout.svgDom&&this.layout.svgDom.clear()&&this.layout.svgDom.remove()&&(this.layout.svgDom=null),this.layout.group&&this.layout.group.clear()&&this.layout.group.remove()&&(this.layout.group=null),this.node.getMind().traverseDF((t=>{t.boundingRect=null,t.direct=""}),this.node),this.node.layout=null;else{var t=this.initNode(this.layout.getData(this.node)),e=this.node.parent;this.iNode=t,this.index=this.node.getMind().removeNode(this.node),this.node.getMind().addNode(t,e,this.index),this.mind.traverseBF((t=>{this.mind._addNodeDom(t),t.refreshBox()}),t),this.mind.contentEL.removeChild(this.layout.tableDom),this.effect()}this.refresh(this.mind,t||this.node)}}undo(){this.layout&&("table"!=this.layout.layoutName?(this.node.layout=this.layout,this.node.getMind().traverseDF((t=>{t.boundingRect=null,t.direct=""}),this.node)):(this.iNode&&this.mind.removeNode(this.iNode),this.mind.addNode(this.node,this.node.parent,this.index),this.mind.contentEL.contains(this.node.layout.tableDom)||this.mind.contentEL.appendChild(this.node.layout.tableDom),this.effect()),this.refresh(this.mind,this.node))}initNode(t,e){var i=this,n=null;return function t(s,r,o){var a=new xt(s,i.mind);r?n=a:(o.children.push(a),a.parent=o),a.direct=e||s.direct||"",s.children&&s.children.length&&s.children.forEach((e=>{e.x=100,e.y=100,t(e,!1,a)}))}(t,!0),n}effect(){var t=this.mind.induces,e=this.mind.wireFrames,i=this.mind.relateLinks;t.concat(e).forEach((t=>{var e=t.node,i=t.endNode;if(e){var n=e.getId();(s=this.mind.getNodeById(n))!=e&&(t.node=s,t.rangeNode=[s,i],"wireFrame"==t.name?(s.wfs||(s.wfs=[]),-1==s.wfs.indexOf(t)&&s.wfs.push(t)):(s.induces||(s.induces=[]),-1==s.induces.indexOf(t)&&s.induces.push(t)))}if(i){var s;n=i.getId();(s=this.mind.getNodeById(n))!=i&&(t.endNode=s,t.rangeNode=[t.node,s])}t.refreshNode(),t.refreshItems()})),i.forEach((t=>{var e=t.startNode,i=t.endNode;if(e){var n=e.getId();(s=this.mind.getNodeById(n))!=e&&(t.startNode=s)}if(i){var s;n=i.getId();(s=this.mind.getNodeById(n))!=i&&(t.endNode=s)}}))}}class ue extends Qt{constructor(t,e){super("removeNodes"),this.realCmds=[],this.nodes=t.sort(((t,e)=>t.getLevel()-e.getLevel())),this.mind=e}execute(){this.nodes.forEach(((t,e)=>{if(0==e){(i=new Pt(t,t.mindmap)).execute(),this.realCmds.push(i)}else{var i,n=t.getId(),s=this.mind.getNodeById(n);if(s)(i=new Pt(s,s.mindmap)).execute(),this.realCmds.push(i)}}))}undo(){this.realCmds.length&&this.realCmds.reverse().forEach((t=>{t.undo()}))}}class pe extends Qt{constructor(t,e){super("changeBoundaryName"),this.wireFrame=null,this.text="",this.oldText="",this.wireFrame=t,this.oldText=this.wireFrame.getGroupName(),this.text=e}execute(){this.wireFrame.setGroupName(this.text),this.wireFrame.refreshBox(),this.refresh(this.wireFrame.node.mindmap,this.wireFrame.node)}undo(){this.wireFrame.setGroupName(this.oldText),this.wireFrame.refreshBox(),this.refresh(this.wireFrame.node.mindmap,this.wireFrame.node)}}class me extends Qt{constructor(t,e){super("setTextCover"),this.nodes=[],this.flag=null,this.nodes=t,this.flag=e}execute(){this.nodes.forEach((t=>{t.setCoverText(this.flag)})),this.refresh(this.nodes[0].mindmap,this.nodes[0])}undo(){this.nodes.forEach((t=>{t.setCoverText(!this.flag)})),this.refresh(this.nodes[0].mindmap,this.nodes[0])}}class fe extends Qt{constructor(t,e,i,n){super("changeMarker"),this.link=t,this.pos=e,this.type=i,this.oldType=n}execute(){"start"==this.pos?this.link&&(this.link.data.startMarker=this.type):this.link.data.endMarker=this.type,this.link.createMarker(),this.refresh(this.link.startNode.mindmap,this.link.startNode)}undo(){"start"==this.pos?this.link&&(this.link.data.startMarker=this.oldType):this.link.data.endMarker=this.oldType,this.link.createMarker(),this.refresh(this.link.startNode.mindmap,this.link.startNode)}}class ge{constructor(){this.history=new Tt(100)}execute(t,e){var i;switch(t){case"addChildNode":case"addSiblingNode":if(e){var n={id:Cs(),text:e.text||r("Sub title")},s=e.data;s&&(s.text&&(n.text=s.text),s.note&&(n.note=s.note));var o=e.parent;if(n.stroke=o.stroke,o.belongInduce&&!o.layout){for(var a=o.direct,h=[],l=0;l<50;l++)h.push(o.belongInduce.node.stroke);o.layout="right"==a||"left"==a?new Nt.mindmap1(o,a,h):new Nt.tree(o,a,h)}if(o.isExpand||o.expand(),"table"==o.mindmap._mode||o.iNode)var d=e.node||new bt(n,o.mindmap);else d=e.node||new xt(n,o.mindmap);if(e.hasOwnProperty("index"))var c=e.index;this.history.execute(new Mt(d,e.parent,o.mindmap,!!s,c))}break;case"deleteNodeAndChild":if(e){if((d=e.node).mindmap.isRead)return;this.history.execute(new Pt(d,d.mindmap))}break;case"deleteNodes":var u=e.nodes;this.history.execute(new ue(u,u[0].mindmap));break;case"deleteNodeExcludeChild":break;case"changeNodeText":if(e){if((d=e.node).mindmap.isRead)return;"wireFrame"==d.nodeType?this.history.execute(new pe(d.wireFrame,e.text)):this.history.execute(new Ot(e.node,e.oldText,e.text))}break;case"moveNode":e&&this.history.execute(new Rt(e));break;case"moveNodes":e&&this.history.execute(new Ft(e));break;case"movePosition":e&&this.history.execute(new zt(e.node,e.oldPos,e.newPos));break;case"expandNode":e&&this.history.execute(new jt(e.node));break;case"collapseNode":e&&this.history.execute(new Ht(e.node));break;case"addSummary":if(e){if((d=e.node).mindmap.isRead)return;this.history.execute(new qt(e.node,e.summary))}break;case"addWireFrame":if(e){if((d=e.node).mindmap.isRead)return;this.history.execute(new Ut(e.wireFrame,e.node.mindmap))}break;case"changeRangeNode":this.history.execute(new Vt(e.item,e.oldRangeNode,e.newRangeNode));break;case"addRelateLink":this.history.execute(new Xt(e.link));break;case"changeRelateLink":this.history.execute(new _t(e.link,e.oldBox,e.box));break;case"setAnnotate":this.history.execute(new Jt(e.node,e.annotate));break;case"deleteAnnotate":if((d=e.node).mindmap.isRead)return;this.history.execute(new Gt(e.node));break;case"changeNodeToFreeRoot":if((d=e.node).mindmap.isRead)return;this.history.execute(new Kt(e.node));break;case"changeFreeRootToNode":if((d=e.node).mindmap.isRead)return;this.history.execute(new Yt(e.node,e.parent));break;case"deleteInduce":if((d=e.summary.node).mindmap.isRead)return;this.history.execute(new Zt(e.summary));break;case"deleteWireFrame":if((d=e.wireFrame.node).mindmap.isRead)return;this.history.execute(new Wt(e.wireFrame,e.wireFrame.node.mindmap));break;case"deleteRelateLink":if((d=e.link.startNode).mindmap.isRead)return;this.history.execute(new $t(e.link));break;case"changeLayout":d=e.node;if("table"==(n=e.direct)||"up"==n){var p=!0;d.mindmap.traverseBF((t=>{t!=d&&"table"==n?(t.callout&&(p=!1),t.layout&&(p=!1),t.wfs&&t.wfs.length&&(p=!1),t.induces&&t.induces.length&&(p=!1)):t!=d&&"up"==n&&t.layout&&(p=!1)}),d),p?this.history.execute(new te(e.node,e.direct)):null===(i=d.mindmap.view)||void 0===i||i.showChangelayoutMessage()}else this.history.execute(new te(e.node,e.direct));break;case"changeSummary":this.history.execute(new ee(e.summary,e.stroke));break;case"changeWireFrame":this.history.execute(new ie(e.wireFrame,e.stroke,e.background));break;case"changeLinkStroke":this.history.execute(new ne(e.link,e.stroke));break;case"changeLinkType":this.history.execute(new se(e.link,e.type));break;case"note":d=e.node;var m=e.note;d&&this.history.execute(new re(d,m));break;case"addFreeNode":this.history.execute(new oe(e.node));break;case"pasteNode":this.history.execute(new ae(e.node,e.data,e.summary));break;case"setNodeStyle":this.history.execute(new he(e.nodes,e.style));break;case"addCallout":this.history.execute(new le(e.node,e.callout));break;case"removeCallout":this.history.execute(new de(e.callout));break;case"removeNodeLayout":this.history.execute(new ce(e.node));break;case"changeWireFrameName":this.history.execute(new pe(e.wireFrame,e.text));break;case"setTextCover":this.history.execute(new me(e.nodes,e.flag));break;case"changeMarker":this.history.execute(new fe(e.link,e.pos,e.type,e.oldType))}}undo(){this.history.undo()}redo(){this.history.redo()}}class Ae{constructor(t,e="rgba(213,233,252,.1)",i="rgb(42,122,194)",n={text:"",nodeType:"wireFrame"}){this.node=t,this.endNode=t,this.node.clearCacheData(),this.stroke=i,this.fill=e,this.lineDash=[6,2],this.data=n,this.status="",this.shapeType="rect",this.lineWidth=1,this.radius=10,this.node.wireFrame=this,this.mind=this.node.getMind(),this.name="wireFrame",this.isHide=!1,this.rangeNode=[],this.refreshNode(),this.refreshItems(),this.init()}init(){this.direct=this.node.direct,this.beforeCreate(),this.create()}setEndNode(t){this.endNode=t,this.refreshNode(),this.refresh()}refreshNode(){var t=this.node.getShowNodeList();this.endNode&&this.endNode!=this.node&&(t=t.concat(this.endNode.getShowNodeList()));var e=this.node.getMind().getBoundingRect(t);this.topNode=e.topNode,this.bottomNode=e.bottomNode,this.leftNode=e.leftNode,this.rightNode=e.rightNode,this.node.refreshCBox(),this.endNode&&this.endNode.refreshCBox()}beforeCreate(){if(this.group||(this.group=this.mind.wireFrameGroup.group()),this.data.text){if(!this.t)if(this._t)this.t=this._t,this._t=null;else{var t=this.data.nodeData||{id:Cs(),text:this.data.text,nodeType:"wireFrame",style:{"padding-left":6,"padding-right":6,"padding-bottom":4,"padding-top":4,"background-color":"rgb(16, 151, 232)",color:"#333",fontSize:12}};this.t=new xt(t,this.mind),this.t.wireFrame=this,this.t.containEl.setAttribute("draggable",!1),this.t.nodeType="wireFrame"}this.t.containEl.classList.contains("node-wireFrame")||this.t.containEl.classList.add("node-wireFrame"),this.mind.contentEL.contains(this.t.containEl)||this.mind.contentEL.appendChild(this.t.containEl),this.t.mindmap=this.mind}else this.t&&(this.mind.contentEL.removeChild(this.t.containEl),this._t=this.t,this.t=null);this.rect||("rect"==this.shapeType?this.rect=this.group.rect().fill(this.fill).stroke(`color:${this.stroke},width:${this.lineWidth},dasharray:${this.lineDash}`).radius(this.radius):this.rect=this.group.polygon().stroke(`color:${this.stroke},width:${this.lineWidth||2},dasharray:${this.lineDash}`)),this.rect.off("click").on("click",(t=>{t.preventDefault(),t.stopPropagation(),this.node.getMind().emit("showWireFrame",{wf:this})}))}getTextBox(){return this.data.text?this.t.getDomBox():{x:0,y:0,width:0,height:0}}move(t,e){t=parseInt(t),e=parseInt(e);var i=this.position.slice();if(this.setPosition(i[0]+t,i[1]+e),this.t){var n=this.t.getPosition();this.t.setPosition(n.x+t,n.y+e)}this.refreshBox()}refreshItems(){var t=this,e=[],i=[],n=[];if(this.rangeNode&&this.rangeNode.length)this.rangeNode.forEach((t=>{n=n.concat(t.getShowNodeList())})),this.node.isHide&&this.endNode.isHide&&this.hide();else{this.rangeNode=[];var s=this.node.parent;if(s){var r=s.children.indexOf(this.node),o=s.children.indexOf(this.endNode);s.children.forEach(((e,i)=>{i>=r&&i<=o&&(t.rangeNode.push(e),n=n.concat(e.getShowNodeList()))})),t.rangeNode=qi(t.rangeNode)}else t.rangeNode=[this.node],n=n.concat(this.node.getShowNodeList())}n.forEach((t=>{i.push(t),t.containBar=!1,t.isExpand||(t.containBar=!0),t.layout&&t.layout.isShow&&t.layout.group&&e.push(t.layout),t.callout&&t.callout.isShow&&i.push(t.callout),t.layout&&t.layout.isShow&&t.layout.group&&e.push(t.layout),t.wireFrames.length&&t.wireFrames.forEach((t=>{t.isHide||i.push(t)})),t.summaries.length&&t.summaries.forEach((t=>{t.isShow()&&(i=i.concat(t.getAllItem()))}))}));var a=this.node.mindmap.wireFrames,h=[];a.forEach((t=>{t&&t!=this&&t.node.parent==this.node.parent&&h.push(t)}));var l=[],d=this.node.parent;if(d){var c=d.children.indexOf(this.node);if(this.endNode)var u=d.children.indexOf(this.endNode);else u=c;qi(h).forEach((t=>{if(t){var e=d.children.indexOf(t.node);if(t.endNode)var i=d.children.indexOf(t.endNode);else i=e;if(e==c&&i==u)return;e>=c&&i<=u&&l.push(t)}}))}this.items=qi(i.concat(l)),this._wfs=l,this.groups=qi(e)}create(){if(this.group)if(this.node.isShow()&&this.endNode.isShow()&&!this.isShow){this.show();var t=this.items,e=this.groups,i=this.mind.getBoundingRect(t);if(e.length&&e.forEach((t=>{if("fish"==t.layoutName&&("right"==t.direct?t.creatBone():t.creatBone1(),t.fishTail)){var e=t.fishTail.bbox();e.xi.right&&(i.right=e.x+e.width),e.y+e.height>i.bottom&&(i.bottom=e.y+e.height),i.width=i.right-i.x,i.height=i.bottom-i.y}})),i){var n=parseInt(i.width+12),s=parseInt(i.height+12);if("rect"==this.shapeType)this.rect.attr({width:n,height:s,fill:this.fill,cursor:"pointer"}).stroke({color:this.stroke,width:this.lineWidth,dasharray:this.lineDash}).radius(this.radius).move(0,0);else{var r=this.node.getBox(),o=this.node.getPosition(),a=[0,Math.abs(o.y-i.y-6)],h=[0,Math.abs(i.y-o.y-r.height-6)],l=[r.width,0],d=[r.width,i.height+12],c=[i.width+12,0],u=[i.width+12,i.height+12];this.rect.plot([a,l,c,u,d,h]).attr({fill:this.fill,stroke:this.stroke,dasharray:this.lineDash,cursor:"pointer"}).move(0,0)}this.position=[];var p=0;if(this.lineWidth%2==1&&(p=.5),this.setPosition(parseInt(i.x-6)+p,parseInt(i.y-6)+p),this.t)if("rect"==this.shapeType){this.t.isShow()||this.t.show();var m=this.t.getDomBox();this.textBox=m,this.t.setPosition(i.x,i.y-m.height-5-this.lineWidth),this.t.containEl.style.maxWidth=i.width-30+"px"}else this.t.isShow()&&this.t.hide();this.refreshBox()}}else this.hide()}refresh(){this.init()}setPosition(t,e){this.group&&(t||e)&&(this.position=[t,e],this.group.attr({transform:`translate(${t},${e})`}))}getPosition(){return{x:this.position.slice()[0],y:this.position.slice()[1]}}show(){this.group.show(),this.t&&this.t.show(),this.isHide=!1}hide(){this.group.hide(),this.t&&this.t.hide(),this.isHide=!0}remove(){this.group&&this.group.clear()&&this.group.remove(),this.rect&&this.rect.remove(),this.t&&this.mind.contentEL.removeChild(this.t.containEl),this.rect=null,this.t=null,this.group=null}off(){this.rect.off()}active(){this.status="active",this.rect.setStyle("stroke","orange")}unactive(){this.status="unactive",this.rect.setStyle("stroke",this.stroke)}isactive(){return"active"==this.status}getData(){var t=this.node.parent,e=0,i=0;t&&(e=t.children.indexOf(this.node),i=t.children.indexOf(this.endNode));var n={stroke:this.stroke,fill:this.fill,lineDash:this.lineDash.slice(),data:{...this.data},radius:this.radius,lineWidth:this.lineWidth,nodeId:this.node.getId(),endNodeId:this.endNode.getId(),range:`${e},${i}`};if(this.t){var s=this.t.getData();n.nodeData=s,n.text=s.text}return n}setData(t){this.stroke=t.stroke,this.fill=t.fill,this.lineDash=t.lineDash,this.data=t.data,this.lineWidth=t.lineWidth,this.radius=t.radius,this.refresh()}setGroupName(t){this.data.text=t,this.t&&t&&this.t.setText(t),this.refresh()}getGroupName(){return this.t&&this.t.getData().text||""}refreshBox(){var t=this.rect.bbox();this.box={...t,x:this.position[0],y:this.position[1]}}getBox(){return this.box}getBBox(){if(this.t){var t={...this.getBox()},e=this.t.getDomBox(),i=this.t.getPosition();t.y=i.y,t.height=t.height+e.height}else t=this.getBox();return t}}const ve=function(t,e){return[t[0]+e[0],t[1]+e[1]]},ye=function(t,e){return[t[0]*e,t[1]*e]},xe=function(t,e){return t[0]*e[1]-t[1]*e[0]==0},be=function(t,e){return t[0]*e[0]+t[1]*e[1]},we=function(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]};function Ce(t,e){return t.find((t=>t!=e))}function Ee(t){return(0!=t[0]||0!=t[1])&&(0==t[0]?[0,t[1]/Math.abs(t[1])]:0==t[1]?[t[0]/Math.abs(t[0]),0]:we(t))}function ke(t){var e=function(t){for(var e=0,i=0;iMath.abs(e[1])?[e[0]/Math.abs(e[0]),0]:[0,e[1]/Math.abs(e[1])]}var a,h;let l=ve(t,ye(e,i)),d=ve(n,ye(s,r));s=ye(s,-1);let c,u,p=[[d[0]-l[0],0],[0,d[1]-l[1]]],m=p.find((t=>xe(t,e)));c=be(m,e)>0?m:Ce(p,m);let f=p.find((t=>xe(t,s)));u=be(f,s)>0?f:Ce(p,f);let g=be(c,u)>0?2:1,A=Ce(p,u),v=[];if(v.push({position:t,direction:null},{position:l,direction:e}),1==g){let t=ve(l,c),e=Ee(c),i=ve(t,u),n=Ee(u);v.push({position:t,direction:e},{position:i,direction:n})}else{let t=ve(l,ye(c,o)),e=Ee(c),i=ve(t,A),n=Ee(A),s=ve(i,ye(u,1-o)),r=Ee(u);v.push({position:t,direction:e},{position:i,direction:n,type:"pathMiddleP"},{position:s,direction:r})}return v.push({position:n,direction:s}),v.filter((t=>!1!==t.direction))}({entryPoint:[this.box.x,this.box.y],exitPoint:[this.box.x1,this.box.y1],entryDirection:this.entryDirection,exitDirection:this.exitDirection,entryExt:this.entryExt,exitExt:this.exitExt}),o=[];r.forEach((t=>{o.push(t.position)})),this.data.width%2==1?o.forEach((t=>{t[0]=parseInt(t[0])+.5,t[1]=parseInt(t[1])+.5})):o.forEach((t=>{t[0]=parseInt(t[0]),t[1]=parseInt(t[1])}));var a=ke(o);i=this.textNode.getDomBox();this.textNode.setPosition(a[0]-i.width/2,a[1]-i.height/2),this.bs.plot(o)}this.bs.stroke({color:this.data.color,width:this.data.width,dasharray:this.data.dashArray,linecap:"round",linejoin:"round"}).fill("none"),this.createMarker(),this.bs.attr("cursor","pointer"),this.corl1.style.left=this.box.cpx1-5+"px",this.corl1.style.top=this.box.cpy1-5+"px",this.corl2.style.left=this.box.cpx2-5+"px",this.corl2.style.top=this.box.cpy2-5+"px",this.line1.plot(this.box.x,this.box.y,this.box.cpx1,this.box.cpy1),this.line2.plot(this.box.x1,this.box.y1,this.box.cpx2,this.box.cpy2)}select(){this.isSelect=!0}unSelect(){this.isSelect=!1}calcPos(t,e){return e.x<=t.x&&e.y<=t.y?"lefttop":e.x<=t.x&&e.y>t.y?"leftbottom":e.x>t.x&&e.y<=t.y?"righttop":"rightbotom"}move(t,e){this.box.x1=t,this.box.y1=e,this.calcPoint(),this.refresh()}setEndNode(t){this.endNode=t,this.calcLimit(),this.calcDirect()}setStartPoint(t,e){if(t&&e)this.box.x=t,this.box.y=e;else{var i=this.startNode.getBox();this.box.x=i.x+i.width/2,this.box.y=i.y+i.height/2}}setEndPoint(t,e){this.box.x1=t,this.box.y1=e}setBox(t){this.box=t,this.refresh()}getData(){this.data.nodeData=this.textNode.getData();var t={startNodeId:this.startNode.getId(),endNodeId:this.endNode.getId(),...this.data,box:{...this.box}};return t.entryDirection=this.entryDirection,t.exitDirection=this.exitDirection,t.box&&t.box.data&&delete t.box.data,t}_mouseDown(t){t.preventDefault(),t.stopPropagation(),this.func1&&(this.mind.isMobile?document.removeEventListener("touchmove",this.func1,!1):document.removeEventListener("mousemove",this.func1)),this.func2&&(this.mind.isMobile?document.removeEventListener("touchend",this.func2):document.removeEventListener("mouseup",this.func2)),this.mind=this.startNode.getMind(),this.mind.isMobile?(this.sx=t.touches[0].pageX,this.sy=t.touches[0].pageY,this.pageX=t.touches[0].pageX,this.pageY=t.touches[0].pageY):(this.sx=t.pageX,this.sy=t.pageY,this.pageX=t.pageX,this.pageY=t.pageY),this.dx=0,this.dy=0,this.drag=!0,this.status="changeRelate",this.target=t.target,this.oldBox=JSON.parse(JSON.stringify({...this.box}));var e=JSON.parse(JSON.stringify(this.data));this.oldBox.data=e,this.func1=this._mouseMove.bind(this),this.func2=this._mouseUp.bind(this),this.mind.isMobile?(document.addEventListener("touchmove",this.func1,!1),document.addEventListener("touchend",this.func2)):(document.addEventListener("mousemove",this.func1),document.addEventListener("mouseup",this.func2))}_mouseUp(){this.drag=!1,this.sx=0,this.sy=0,this.dx=0,this.dy=0,this.mind=this.startNode.getMind();var t=JSON.parse(JSON.stringify({...this.box})),e=JSON.parse(JSON.stringify(this.data));t.data=e,this.mind.execute("changeRelateLink",{link:this,oldBox:this.oldBox,box:t,type:"changeRelateLinkBox"}),this.target=null,this.mind.isMobile?(document.removeEventListener("touchmove",this.func1,!1),document.removeEventListener("touchend",this.func2)):(document.removeEventListener("mousemove",this.func1),document.removeEventListener("mouseup",this.func2))}_mouseMove(t){if("addRelate"==this.status)this.mind.isMobile||this.move(t.offsetX-8,t.offsetY);else{if(!this.drag)return;if(this.target){if(t.preventDefault(),t.stopPropagation(),this.mind.isMobile)var e=t.touches[0].pageX,i=t.touches[0].pageY;else e=t.pageX,i=t.pageY;var n=e-this.pageX,s=i-this.pageY;this.dx=e-this.sx,this.dy=i-this.sy,this.pageX=e,this.pageY=i;var r=this.target.getAttribute("direct");if(this.calcLimit(),"start"==r){this.box.cpx1=this.oldBox.cpx1+this.dx,this.box.cpy1=this.oldBox.cpy1+this.dy;var o=this.calcStroke({x:this.box.x,y:this.box.y},this.startBox);if(this.startBox.width>400)var a=1.2;else if(this.startBox.width>200)a=1.5;else a=2;switch(o){case"left":this.entryDirection=[-1,0],this.box.y>=this.startLimit.y&&this.box.y<=this.startLimit.y1?this.box.y+=s/a:(this.box.ythis.startLimit.y1&&(this.box.y=this.startLimit.y1));break;case"right":this.entryDirection=[1,0],this.box.y>=this.startLimit.y&&this.box.y<=this.startLimit.y1?this.box.y+=s/a:(this.box.ythis.startLimit.y1&&(this.box.y=this.startLimit.y1));break;case"top":this.entryDirection=[0,-1],this.box.x>=this.startLimit.x&&this.box.x<=this.startLimit.x1?this.box.x+=n/a:(this.box.xthis.startLimit.x1&&(this.box.x=this.startLimit.x1));break;case"bottom":this.entryDirection=[0,1],this.box.x>=this.startLimit.x&&this.box.x<=this.startLimit.x1?this.box.x+=n/a:(this.box.xthis.startLimit.x1&&(this.box.x=this.startLimit.x1));break;default:this.box.x>=this.startLimit.x&&this.box.x<=this.startLimit.x1?this.box.x+=n/a:(this.box.xthis.startLimit.x1&&(this.box.x=this.startLimit.x1)),this.box.y>=this.startLimit.y&&this.box.y<=this.startLimit.y1?this.box.y+=s/a:(this.box.ythis.startLimit.y1&&(this.box.y=this.startLimit.y1))}}else{switch(this.box.cpx2=this.oldBox.cpx2+this.dx,this.box.cpy2=this.oldBox.cpy2+this.dy,o=this.calcStroke({x:this.box.x1,y:this.box.y1},this.endBox)){case"left":this.exitDirection=[-1,0],this.box.y1>=this.endLimit.y&&this.box.y1<=this.endLimit.y1?this.box.y1+=s/3:(this.box.y1this.endLimit.y1&&(this.box.y1=this.endLimit.y1));break;case"right":this.exitDirection=[1,0],this.box.y1>=this.endLimit.y&&this.box.y1<=this.endLimit.y1?this.box.y1+=s/3:(this.box.y1this.endLimit.y1&&(this.box.y1=this.endLimit.y1));break;case"top":this.exitDirection=[0,-1],this.box.x1>=this.endLimit.x&&this.box.x1<=this.endLimit.x1?this.box.x1+=n/3:(this.box.x1this.endLimit.x1&&(this.box.x1=this.endLimit.x1));break;case"bottom":this.exitDirection=[0,1],this.box.x1>=this.endLimit.x&&this.box.x1<=this.endLimit.x1?this.box.x1+=n/3:(this.box.x1this.endLimit.x1&&(this.box.x1=this.endLimit.x1));break;default:this.box.x1>=this.endLimit.x&&this.box.x1<=this.endLimit.x1?this.box.x1+=n/3:(this.box.x1this.endLimit.x1&&(this.box.x1=this.endLimit.x1)),this.box.y1>=this.endLimit.y&&this.box.y1<=this.endLimit.y1?this.box.y1+=s/3:(this.box.y1this.endLimit.y1&&(this.box.y1=this.endLimit.y1))}}this.clacDD(),this.refresh()}}}_clickFn(t){t.preventDefault(),t.stopPropagation()}_addEvent(){this.drawFunc1=this._mouseMove.bind(this),this.drawFunc2=this._mouseUp.bind(this),this.mind.isMobile?this.mind.draw.on("touchend",this.drawFunc2):(this.mind.draw.on("mousemove",this.drawFunc1),this.mind.draw.on("mouseup",this.drawFunc2)),this._addLineEvent()}_addLineEvent(){this.bs.off("click"),this.bs.off("dblclick");var t=this;this.bs.dblclick((()=>{this.textNode.data.text||this.textNode.data.isImageNode||(this.data.nodeHide=!1,this.startNode.mindmap.clearSelectNode(),this.startNode.mindmap.updateRelateLink(),this.textNode.edit())})),this.bs.click((e=>{e.preventDefault(),e.stopPropagation();var i=e.offsetX,n=e.offsetY;t.active(),t.mind._changeAssistItem=t,t.mind.emit("showRelateLink",{x:i,y:n,relateLink:t})}))}addEvent(){this.func=this._mouseDown.bind(this),this.clickFn=this._clickFn.bind(this),this.mind.isMobile?(this.corl1.addEventListener("touchstart",this.func),this.corl2.addEventListener("touchstart",this.func)):(this.corl1.addEventListener("mousedown",this.func),this.corl2.addEventListener("mousedown",this.func)),this.corl1.addEventListener("click",this.clickFn),this.corl2.addEventListener("click",this.clickFn)}}class De{constructor(t,e={id:Cs(),text:"callout",nodeType:"callout",style:{"background-color":"#f06",color:"#fff","font-size":"12px"}}){this.node=t,this.data=e,e.style?this.color=e.style["background-color"]||"#f06":this.color="#f06",this.root=new xt(e,this.node.getMind()),this.root.nodeType="callout",this.group=this.node.getMind().calloutGroup,this.node.getMind().contentEL.appendChild(this.root.containEl),this.root.mind=this.node.getMind(),this.root.refreshBox(),this.node.clearCacheData(),this.node.callout=this,this.root.callout=this,this.direct=this.data.direct||"top",this.name="callout",this.init()}init(){this.calcLimit(),this.create(),this.initEvent()}off(){t.Platform.isDesktopApp?this.root.containEl.removeEventListener("mousedown",this._mouseDown):t.Platform.isMobileApp&&this.root.containEl.removeEventListener("touchstart",this._mouseDown)}remove(){this.polygon&&this.polygon.remove(),this.polygon=null}move(t,e){this.point={x:this.point.x+t,y:this.point.y+e},this.root.move(t,e),this.refresh()}calcLimit(){var t=this.node.getBox();this.limit={x:t.x,y:t.y,width:t.width,height:t.height,cx:t.x+t.width/2,cy:t.y+t.height/2,x1:t.x+t.width,y1:t.y+t.height}}beforeCreate(){!this.polygon&&(this.polygon=this.group.polygon().fill(this.color)),this.root.containEl.setAttribute("draggable",!1),this.root.containEl.classList.add("mm-node-callout")}create(){if(this.beforeCreate(),this.data.x&&this.data.y)this.root.setPosition(this.data.x,this.data.y),this.data.box&&(this.box=this.data.box);else{var t=this.root.getBox();this.root.setPosition(this.limit.x+this.limit.width/2-t.width/2,this.limit.y-t.height-10)}if(this.data.point?this.point=this.data.point:this.point={x:this.limit.cx,y:this.limit.y},!this.box){var e=this.root.getPosition();this.box={dx:(e.x-this.limit.x)/this.limit.width,dy:(e.y-this.limit.y)/this.limit.height,px:(this.point.x-this.limit.x)/this.limit.width,py:(this.point.y-this.limit.y)/this.limit.height}}this.refresh(!0)}refresh(t){if(this.polygon)if(this.node.isShow()){this.show(),this.calcLimit(),t||(this.point.x=this.box.px*this.limit.width+this.limit.x,this.point.y=this.box.py*this.limit.height+this.limit.y,this.root.setPosition(this.box.dx*this.limit.width+this.limit.x,this.box.dy*this.limit.height+this.limit.y));var e=this.root.getBox(),i=e.x+e.width/2,n=e.y+e.height/2;(this.point.x||this.point.y)&&("top"==this.direct||"bottom"==this.direct?this.polygon.plot(`${this.point.x},${this.point.y} ${i-8},${n} ${i+8},${n}`).fill(this.color):this.polygon.plot(`${this.point.x},${this.point.y} ${i},${n-8} ${i},${n+8}`).fill(this.color))}else this.hide()}hide(){this.isShow=!1,this.root.hide(),this.polygon.hide()}show(){this.isShow=!0,this.root.show(),this.polygon.show()}getData(){var t=this.root.getData();return t.point=this.point,t.box=this.box,{nodeId:this.node.getId(),rootData:t,color:this.color,direct:this.direct}}setData(t){this.color=t.color}getBox(){var t=this.polygon.bbox(),e=this.root.getBox(),i=Math.min(t.x,e.x),n=Math.min(t.y,e.y),s=Math.max(t.x2,e.x+e.width),r=Math.max(t.y2,e.y+e.height);return{x:i,y:n,x1:s,y1:r,width:s-i,height:r-n}}initEvent(){var e,i,n,s,r,o,a,h=!1;this._mouseDown=function(n){if(!this.root.isEdit){h=!0,t.Platform.isDesktopApp?(e=n.pageX,i=n.pageY,this.px=n.pageX,this.py=n.pageY):(e=n.touches[0].pageX,i=n.touches[0].pageY,this.px=e,this.py=i),a=this.root.getPosition();var s={...this.box};a.direct=this.direct,a.box=s,t.Platform.isDesktopApp?(document.addEventListener("mousemove",this._mouseMove),document.addEventListener("mouseup",this._mouseUp)):(document.addEventListener("touchmove",this._mouseMove,{passive:!1}),document.addEventListener("touchend",this._mouseUp))}}.bind(this),t.Platform.isDesktopApp?this.root.containEl.addEventListener("mousedown",this._mouseDown):this.root.containEl.addEventListener("touchstart",this._mouseDown),this._mouseMove=function(t){h&&(t.touches?(t.preventDefault(),r=t.touches[0].pageX-this.px,o=t.touches[0].pageY-this.py,n=t.touches[0].pageX-e,s=t.touches[0].pageY-i):(r=t.pageX-this.px,o=t.pageY-this.py,n=t.pageX-e,s=t.pageY-i),this.point.x<=this.limit.x||this.point.x>=this.limit.x1?this.point.y+=o/4:this.point.x+=r/4,this.point.y<=this.limit.y||this.point.y>=this.limit.y1?this.point.x+=r/4:this.point.y+=o/4,this.point.x<=this.limit.x&&(this.point.x=this.limit.x,this.direct="left"),this.point.x>=this.limit.x1&&(this.point.x=this.limit.x1,this.direct="right"),this.point.y<=this.limit.y&&(this.point.y=this.limit.y,this.direct="top"),this.point.y>=this.limit.y1&&(this.point.y=this.limit.y1,this.direct="bottom"),this.root.setPosition(a.x+n,a.y+s),this.box={dx:(a.x+n-this.limit.x)/this.limit.width,dy:(a.y+s-this.limit.y)/this.limit.height,px:(this.point.x-this.limit.x)/this.limit.width,py:(this.point.y-this.limit.y)/this.limit.height},this.refresh(!0),t.touches?(this.px=t.touches[0].pageX,this.py=t.touches[0].pageY):(this.px=t.pageX,this.py=t.pageY))}.bind(this),this._mouseUp=function(e){h=!1,this.node.clearCacheData(),this.refresh(),this.node.refreshCBox();var i=this.root.getPosition();i.box={...this.box},i.direct=this.direct,this.node.getMind().execute("movePosition",{node:this.root,oldPos:a,newPos:i}),t.Platform.isDesktopApp?(document.removeEventListener("mousemove",this._mouseMove),document.removeEventListener("mouseup",this._mouseUp)):(document.removeEventListener("touchmove",this._mouseMove,{passive:!1}),document.removeEventListener("touchend",this._mouseUp))}.bind(this)}}function Ne(t){return Array.isArray?Array.isArray(t):"[object Array]"===Fe(t)}const Se=1/0;function Te(t){return null==t?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-Se?"-0":e}(t)}function Le(t){return"string"==typeof t}function Qe(t){return"number"==typeof t}function Me(t){return!0===t||!1===t||function(t){return Pe(t)&&null!==t}(t)&&"[object Boolean]"==Fe(t)}function Pe(t){return"object"==typeof t}function Oe(t){return null!=t}function Re(t){return!t.trim().length}function Fe(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const ze=t=>`Missing ${t} property in key`,He=t=>`Property 'weight' in key '${t}' must be a positive integer`,je=Object.prototype.hasOwnProperty;class qe{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach((t=>{let i=Ue(t);e+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,e+=i.weight})),this._keys.forEach((t=>{t.weight/=e}))}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ue(t){let e=null,i=null,n=null,s=1,r=null;if(Le(t)||Ne(t))n=t,e=We(t),i=Ve(t);else{if(!je.call(t,"name"))throw new Error(ze("name"));const o=t.name;if(n=o,je.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(He(o));e=We(o),i=Ve(o),r=t.getFn}return{path:e,id:i,weight:s,src:n,getFn:r}}function We(t){return Ne(t)?t:t.split(".")}function Ve(t){return Ne(t)?t.join("."):t}const Xe={useExtendedSearch:!1,getFn:function(t,e){let i=[],n=!1;const s=(t,e,r)=>{if(Oe(t))if(e[r]){const o=t[e[r]];if(!Oe(o))return;if(r===e.length-1&&(Le(o)||Qe(o)||Me(o)))i.push(Te(o));else if(Ne(o)){n=!0;for(let t=0,i=o.length;tt.score===e.score?t.idx{this._keysMap[t.id]=e}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,Le(this.docs[0])?this.docs.forEach(((t,e)=>{this._addString(t,e)})):this.docs.forEach(((t,e)=>{this._addObject(t,e)})),this.norm.clear())}add(t){const e=this.size();Le(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,i=this.size();e{let s=e.getFn?e.getFn(t):this.getFn(t,e.path);if(Oe(s))if(Ne(s)){let t=[];const e=[{nestedArrIndex:-1,value:s}];for(;e.length;){const{nestedArrIndex:i,value:n}=e.pop();if(Oe(n))if(Le(n)&&!Re(n)){let e={v:n,i:i,n:this.norm.get(n)};t.push(e)}else Ne(n)&&n.forEach(((t,i)=>{e.push({nestedArrIndex:i,value:t})}))}i.$[n]=t}else if(Le(s)&&!Re(s)){let t={v:s,n:this.norm.get(s)};i.$[n]=t}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Ke(t,e,{getFn:i=_e.getFn,fieldNormWeight:n=_e.fieldNormWeight}={}){const s=new Ge({getFn:i,fieldNormWeight:n});return s.setKeys(t.map(Ue)),s.setSources(e),s.create(),s}function Ye(t,{errors:e=0,currentLocation:i=0,expectedLocation:n=0,distance:s=_e.distance,ignoreLocation:r=_e.ignoreLocation}={}){const o=e/t.length;if(r)return o;const a=Math.abs(n-i);return s?o+a/s:a?1:o}const Ze=32;function $e(t,e,i,{location:n=_e.location,distance:s=_e.distance,threshold:r=_e.threshold,findAllMatches:o=_e.findAllMatches,minMatchCharLength:a=_e.minMatchCharLength,includeMatches:h=_e.includeMatches,ignoreLocation:l=_e.ignoreLocation}={}){if(e.length>Ze)throw new Error(`Pattern length exceeds max of ${Ze}.`);const d=e.length,c=t.length,u=Math.max(0,Math.min(n,c));let p=r,m=u;const f=a>1||h,g=f?Array(c):[];let A;for(;(A=t.indexOf(e,m))>-1;){let t=Ye(e,{currentLocation:A,expectedLocation:u,distance:s,ignoreLocation:l});if(p=Math.min(t,p),m=A+d,f){let t=0;for(;t=h;r-=1){let o=r-1,a=i[t.charAt(o)];if(f&&(g[o]=+!!a),w[r]=(w[r+1]<<1|1)&a,n&&(w[r]|=(v[r+1]|v[r])<<1|1|v[r+1]),w[r]&b&&(y=Ye(e,{errors:n,currentLocation:o,expectedLocation:u,distance:s,ignoreLocation:l}),y<=p)){if(p=y,m=o,m<=u)break;h=Math.max(1,2*u-m)}}if(Ye(e,{errors:n+1,currentLocation:u,expectedLocation:u,distance:s,ignoreLocation:l})>p)break;v=w}const w={isMatch:m>=0,score:Math.max(.001,y)};if(f){const t=function(t=[],e=_e.minMatchCharLength){let i=[],n=-1,s=-1,r=0;for(let o=t.length;r=e&&i.push([n,s]),n=-1)}return t[r-1]&&r-n>=e&&i.push([n,r-1]),i}(g,a);t.length?h&&(w.indices=t):w.isMatch=!1}return w}function ti(t){let e={};for(let i=0,n=t.length;i{this.chunks.push({pattern:t,alphabet:ti(t),startIndex:e})},d=this.pattern.length;if(d>Ze){let t=0;const e=d%Ze,i=d-e;for(;t{const{isMatch:m,score:f,indices:g}=$e(t,e,u,{location:n+p,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:a,includeMatches:i,ignoreLocation:h});m&&(c=!0),d+=f,m&&g&&(l=[...l,...g])}));let u={isMatch:c,score:c?d/this.chunks.length:1};return c&&i&&(u.indices=l),u}}class ii{constructor(t){this.pattern=t}static isMultiMatch(t){return ni(t,this.multiRegex)}static isSingleMatch(t){return ni(t,this.singleRegex)}search(){}}function ni(t,e){const i=t.match(e);return i?i[1]:null}class si extends ii{constructor(t,{location:e=_e.location,threshold:i=_e.threshold,distance:n=_e.distance,includeMatches:s=_e.includeMatches,findAllMatches:r=_e.findAllMatches,minMatchCharLength:o=_e.minMatchCharLength,isCaseSensitive:a=_e.isCaseSensitive,ignoreLocation:h=_e.ignoreLocation}={}){super(t),this._bitapSearch=new ei(t,{location:e,threshold:i,distance:n,includeMatches:s,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:a,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class ri extends ii{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,i=0;const n=[],s=this.pattern.length;for(;(e=t.indexOf(this.pattern,i))>-1;)i=e+s,n.push([e,i-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const oi=[class extends ii{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},ri,class extends ii{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends ii{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends ii{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends ii{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends ii{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},si],ai=oi.length,hi=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const li=new Set([si.type,ri.type]);class di{constructor(t,{isCaseSensitive:e=_e.isCaseSensitive,includeMatches:i=_e.includeMatches,minMatchCharLength:n=_e.minMatchCharLength,ignoreLocation:s=_e.ignoreLocation,findAllMatches:r=_e.findAllMatches,location:o=_e.location,threshold:a=_e.threshold,distance:h=_e.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:i,minMatchCharLength:n,findAllMatches:r,ignoreLocation:s,location:o,threshold:a,distance:h},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map((t=>{let i=t.trim().split(hi).filter((t=>t&&!!t.trim())),n=[];for(let t=0,s=i.length;t!(!t[pi]&&!t[mi]),vi=t=>({[pi]:Object.keys(t).map((e=>({[e]:t[e]})))});function yi(t,e,{auto:i=!0}={}){const n=t=>{let s=Object.keys(t);const r=(t=>!!t[fi])(t);if(!r&&s.length>1&&!Ai(t))return n(vi(t));if((t=>!Ne(t)&&Pe(t)&&!Ai(t))(t)){const n=r?t[fi]:s[0],o=r?t[gi]:t[n];if(!Le(o))throw new Error((t=>`Invalid value for key ${t}`)(n));const a={keyId:Ve(n),pattern:o};return i&&(a.searcher=ui(o,e)),a}let o={children:[],operator:s[0]};return s.forEach((e=>{const i=t[e];Ne(i)&&i.forEach((t=>{o.children.push(n(t))}))})),o};return Ai(t)||(t=vi(t)),n(t)}function xi(t,e){const i=t.matches;e.matches=[],Oe(i)&&i.forEach((t=>{if(!Oe(t.indices)||!t.indices.length)return;const{indices:i,value:n}=t;let s={indices:i,value:n};t.key&&(s.key=t.key.src),t.idx>-1&&(s.refIndex=t.idx),e.matches.push(s)}))}function bi(t,e){e.score=t.score}class wi{constructor(t,e={},i){this.options={..._e,...e},this.options.useExtendedSearch,this._keyStore=new qe(this.options.keys),this.setCollection(t,i)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof Ge))throw new Error("Incorrect 'index' type");this._myIndex=e||Ke(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){Oe(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=(()=>!1)){const e=[];for(let i=0,n=this._docs.length;i{let i=1;t.matches.forEach((({key:t,norm:n,score:s})=>{const r=t?t.weight:null;i*=Math.pow(0===s&&r?Number.EPSILON:s,(r||1)*(e?1:n))})),t.score=i}))}(a,{ignoreFieldNorm:o}),s&&a.sort(r),Qe(e)&&e>-1&&(a=a.slice(0,e)),function(t,e,{includeMatches:i=_e.includeMatches,includeScore:n=_e.includeScore}={}){const s=[];return i&&s.push(xi),n&&s.push(bi),t.map((t=>{const{idx:i}=t,n={item:e[i],refIndex:i};return s.length&&s.forEach((e=>{e(t,n)})),n}))}(a,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(t){const e=ui(t,this.options),{records:i}=this._myIndex,n=[];return i.forEach((({v:t,i:i,n:s})=>{if(!Oe(t))return;const{isMatch:r,score:o,indices:a}=e.searchIn(t);r&&n.push({item:t,idx:i,matches:[{score:o,value:t,norm:s,indices:a}]})})),n}_searchLogical(t){const e=yi(t,this.options),i=(t,e,n)=>{if(!t.children){const{keyId:i,searcher:s}=t,r=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(e,i),searcher:s});return r&&r.length?[{idx:n,item:e,matches:r}]:[]}const s=[];for(let r=0,o=t.children.length;r{if(Oe(t)){let o=i(e,t,n);o.length&&(s[n]||(s[n]={idx:n,item:t,matches:[]},r.push(s[n])),o.forEach((({matches:t})=>{s[n].matches.push(...t)})))}})),r}_searchObjectList(t){const e=ui(t,this.options),{keys:i,records:n}=this._myIndex,s=[];return n.forEach((({$:t,i:n})=>{if(!Oe(t))return;let r=[];i.forEach(((i,n)=>{r.push(...this._findMatches({key:i,value:t[n],searcher:e}))})),r.length&&s.push({idx:n,item:t,matches:r})})),s}_findMatches({key:t,value:e,searcher:i}){if(!Oe(e))return[];let n=[];if(Ne(e))e.forEach((({v:e,i:s,n:r})=>{if(!Oe(e))return;const{isMatch:o,score:a,indices:h}=i.searchIn(e);o&&n.push({score:a,key:t,value:e,idx:s,norm:r,indices:h})}));else{const{v:s,n:r}=e,{isMatch:o,score:a,indices:h}=i.searchIn(s);o&&n.push({score:a,key:t,value:s,norm:r,indices:h})}return n}}wi.version="6.6.2",wi.createIndex=Ke,wi.parseIndex=function(t,{getFn:e=_e.getFn,fieldNormWeight:i=_e.fieldNormWeight}={}){const{keys:n,records:s}=t,r=new Ge({getFn:e,fieldNormWeight:i});return r.setKeys(n),r.setIndexRecords(s),r},wi.config=_e,wi.parseQuery=yi,function(...t){ci.push(...t)}(di); /*! * jQuery JavaScript Library v3.7.1 * https://jquery.com/ * * Copyright OpenJS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2023-08-28T13:37Z */ var Ci=Ct((function(t){!function(e,i){t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}}("undefined"!=typeof window?window:wt,(function(t,e){var i=[],n=Object.getPrototypeOf,s=i.slice,r=i.flat?function(t){return i.flat.call(t)}:function(t){return i.concat.apply([],t)},o=i.push,a=i.indexOf,h={},l=h.toString,d=h.hasOwnProperty,c=d.toString,u=c.call(Object),p={},m=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},f=function(t){return null!=t&&t===t.window},g=t.document,A={type:!0,src:!0,nonce:!0,noModule:!0};function v(t,e,i){var n,s,r=(i=i||g).createElement("script");if(r.text=t,e)for(n in A)(s=e[n]||e.getAttribute&&e.getAttribute(n))&&r.setAttribute(n,s);i.head.appendChild(r).parentNode.removeChild(r)}function y(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?h[l.call(t)]||"object":typeof t}var x="3.7.1",b=/HTML$/i,w=function(t,e){return new w.fn.init(t,e)};function C(t){var e=!!t&&"length"in t&&t.length,i=y(t);return!m(t)&&!f(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function E(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}w.fn=w.prototype={jquery:x,constructor:w,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=w.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return w.each(this,t)},map:function(t){return this.pushStack(w.map(this,(function(e,i){return t.call(e,i,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(w.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(w.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i+~]|"+D+")"+D+"*"),j=new RegExp(D+"|>"),q=new RegExp(R),U=new RegExp("^"+P+"$"),W={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},V=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,G=new RegExp("\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\([^\\r\\n\\f])","g"),K=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},Y=function(){ht()},Z=ut((function(t){return!0===t.disabled&&E(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{g.apply(i=s.call(L.childNodes),L.childNodes),i[L.childNodes.length].nodeType}catch(t){g={apply:function(t,e){Q.apply(t,s.call(e))},call:function(t){Q.apply(t,s.call(arguments,1))}}}function $(t,e,i,n){var s,r,o,a,h,d,c,f=e&&e.ownerDocument,v=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==v&&9!==v&&11!==v)return i;if(!n&&(ht(e),e=e||l,u)){if(11!==v&&(h=_.exec(t)))if(s=h[1]){if(9===v){if(!(o=e.getElementById(s)))return i;if(o.id===s)return g.call(i,o),i}else if(f&&(o=f.getElementById(s))&&$.contains(e,o)&&o.id===s)return g.call(i,o),i}else{if(h[2])return g.apply(i,e.getElementsByTagName(t)),i;if((s=h[3])&&e.getElementsByClassName)return g.apply(i,e.getElementsByClassName(s)),i}if(!(S[t+" "]||m&&m.test(t))){if(c=t,f=e,1===v&&(j.test(t)||H.test(t))){for((f=J.test(t)&&at(e.parentNode)||e)==e&&p.scope||((a=e.getAttribute("id"))?a=w.escapeSelector(a):e.setAttribute("id",a=A)),r=(d=dt(t)).length;r--;)d[r]=(a?"#"+a:":scope")+" "+ct(d[r]);c=d.join(",")}try{return g.apply(i,f.querySelectorAll(c)),i}catch(e){S(t,!0)}finally{a===A&&e.removeAttribute("id")}}}return vt(t.replace(N,"$1"),e,i,n)}function tt(){var t=[];return function e(i,s){return t.push(i+" ")>n.cacheLength&&delete e[t.shift()],e[i+" "]=s}}function et(t){return t[A]=!0,t}function it(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function nt(t){return function(e){return E(e,"input")&&e.type===t}}function st(t){return function(e){return(E(e,"input")||E(e,"button"))&&e.type===t}}function rt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Z(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ot(t){return et((function(e){return e=+e,et((function(i,n){for(var s,r=t([],i.length,e),o=r.length;o--;)i[s=r[o]]&&(i[s]=!(n[s]=i[s]))}))}))}function at(t){return t&&void 0!==t.getElementsByTagName&&t}function ht(t){var e,i=t?t.ownerDocument||t:L;return i!=l&&9===i.nodeType&&i.documentElement?(c=(l=i).documentElement,u=!w.isXMLDoc(l),f=c.matches||c.webkitMatchesSelector||c.msMatchesSelector,c.msMatchesSelector&&L!=l&&(e=l.defaultView)&&e.top!==e&&e.addEventListener("unload",Y),p.getById=it((function(t){return c.appendChild(t).id=w.expando,!l.getElementsByName||!l.getElementsByName(w.expando).length})),p.disconnectedMatch=it((function(t){return f.call(t,"*")})),p.scope=it((function(){return l.querySelectorAll(":scope")})),p.cssHas=it((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),p.getById?(n.filter.ID=function(t){var e=t.replace(G,K);return function(t){return t.getAttribute("id")===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i=e.getElementById(t);return i?[i]:[]}}):(n.filter.ID=function(t){var e=t.replace(G,K);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&u){var i,n,s,r=e.getElementById(t);if(r){if((i=r.getAttributeNode("id"))&&i.value===t)return[r];for(s=e.getElementsByName(t),n=0;r=s[n++];)if((i=r.getAttributeNode("id"))&&i.value===t)return[r]}return[]}}),n.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},n.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&u)return e.getElementsByClassName(t)},m=[],it((function(t){var e;c.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||m.push("\\["+D+"*(?:value|"+M+")"),t.querySelectorAll("[id~="+A+"-]").length||m.push("~="),t.querySelectorAll("a#"+A+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll(":checked").length||m.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),c.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+D+"*name"+D+"*="+D+"*(?:''|\"\")")})),p.cssHas||m.push(":has"),m=m.length&&new RegExp(m.join("|")),T=function(t,e){if(t===e)return h=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!p.sortDetached&&e.compareDocumentPosition(t)===i?t===l||t.ownerDocument==L&&$.contains(L,t)?-1:e===l||e.ownerDocument==L&&$.contains(L,e)?1:o?a.call(o,t)-a.call(o,e):0:4&i?-1:1)},l):l}for(e in $.matches=function(t,e){return $(t,null,null,e)},$.matchesSelector=function(t,e){if(ht(t),u&&!S[e+" "]&&(!m||!m.test(e)))try{var i=f.call(t,e);if(i||p.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){S(e,!0)}return $(e,l,null,[t]).length>0},$.contains=function(t,e){return(t.ownerDocument||t)!=l&&ht(t),w.contains(t,e)},$.attr=function(t,e){(t.ownerDocument||t)!=l&&ht(t);var i=n.attrHandle[e.toLowerCase()],s=i&&d.call(n.attrHandle,e.toLowerCase())?i(t,e,!u):void 0;return void 0!==s?s:t.getAttribute(e)},$.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},w.uniqueSort=function(t){var e,i=[],n=0,r=0;if(h=!p.sortStable,o=!p.sortStable&&s.call(t,0),I.call(t,T),h){for(;e=t[r++];)e===t[r]&&(n=i.push(r));for(;n--;)B.call(t,i[n],1)}return o=null,t},w.fn.uniqueSort=function(){return this.pushStack(w.uniqueSort(s.apply(this)))},n=w.expr={cacheLength:50,createPseudo:et,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(G,K),t[3]=(t[3]||t[4]||t[5]||"").replace(G,K),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||$.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&$.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return W.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&q.test(i)&&(e=dt(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(G,K).toLowerCase();return"*"===t?function(){return!0}:function(t){return E(t,e)}},CLASS:function(t){var e=x[t+" "];return e||(e=new RegExp("(^|"+D+")"+t+"("+D+"|$)"))&&x(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,i){return function(n){var s=$.attr(n,t);return null==s?"!="===e:!e||(s+="","="===e?s===i:"!="===e?s!==i:"^="===e?i&&0===s.indexOf(i):"*="===e?i&&s.indexOf(i)>-1:"$="===e?i&&s.slice(-i.length)===i:"~="===e?(" "+s.replace(F," ")+" ").indexOf(i)>-1:"|="===e&&(s===i||s.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,s){var r="nth"!==t.slice(0,3),o="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===s?function(t){return!!t.parentNode}:function(e,i,h){var l,d,c,u,p,m=r!==o?"nextSibling":"previousSibling",f=e.parentNode,g=a&&e.nodeName.toLowerCase(),y=!h&&!a,x=!1;if(f){if(r){for(;m;){for(c=e;c=c[m];)if(a?E(c,g):1===c.nodeType)return!1;p=m="only"===t&&!p&&"nextSibling"}return!0}if(p=[o?f.firstChild:f.lastChild],o&&y){for(x=(u=(l=(d=f[A]||(f[A]={}))[t]||[])[0]===v&&l[1])&&l[2],c=u&&f.childNodes[u];c=++u&&c&&c[m]||(x=u=0)||p.pop();)if(1===c.nodeType&&++x&&c===e){d[t]=[v,u,x];break}}else if(y&&(x=u=(l=(d=e[A]||(e[A]={}))[t]||[])[0]===v&&l[1]),!1===x)for(;(c=++u&&c&&c[m]||(x=u=0)||p.pop())&&(!(a?E(c,g):1===c.nodeType)||!++x||(y&&((d=c[A]||(c[A]={}))[t]=[v,x]),c!==e)););return(x-=s)===n||x%n==0&&x/n>=0}}},PSEUDO:function(t,e){var i,s=n.pseudos[t]||n.setFilters[t.toLowerCase()]||$.error("unsupported pseudo: "+t);return s[A]?s(e):s.length>1?(i=[t,t,"",e],n.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,i){for(var n,r=s(t,e),o=r.length;o--;)t[n=a.call(t,r[o])]=!(i[n]=r[o])})):function(t){return s(t,0,i)}):s}},pseudos:{not:et((function(t){var e=[],i=[],n=At(t.replace(N,"$1"));return n[A]?et((function(t,e,i,s){for(var r,o=n(t,null,s,[]),a=t.length;a--;)(r=o[a])&&(t[a]=!(e[a]=r))})):function(t,s,r){return e[0]=t,n(e,null,r,i),e[0]=null,!i.pop()}})),has:et((function(t){return function(e){return $(t,e).length>0}})),contains:et((function(t){return t=t.replace(G,K),function(e){return(e.textContent||w.text(e)).indexOf(t)>-1}})),lang:et((function(t){return U.test(t||"")||$.error("unsupported lang: "+t),t=t.replace(G,K).toLowerCase(),function(e){var i;do{if(i=u?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===c},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:rt(!1),disabled:rt(!0),checked:function(t){return E(t,"input")&&!!t.checked||E(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!n.pseudos.empty(t)},header:function(t){return X.test(t.nodeName)},input:function(t){return V.test(t.nodeName)},button:function(t){return E(t,"input")&&"button"===t.type||E(t,"button")},text:function(t){var e;return E(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:ot((function(){return[0]})),last:ot((function(t,e){return[e-1]})),eq:ot((function(t,e,i){return[i<0?i+e:i]})),even:ot((function(t,e){for(var i=0;ie?e:i;--n>=0;)t.push(n);return t})),gt:ot((function(t,e,i){for(var n=i<0?i+e:i;++n1?function(e,i,n){for(var s=t.length;s--;)if(!t[s](e,i,n))return!1;return!0}:t[0]}function mt(t,e,i,n,s){for(var r,o=[],a=0,h=t.length,l=null!=e;a-1&&(r[d]=!(o[d]=u))}}else p=mt(p===o?p.splice(A,p.length):p),s?s(null,o,p,l):g.apply(o,p)}))}function gt(t){for(var e,i,s,o=t.length,h=n.relative[t[0].type],l=h||n.relative[" "],d=h?1:0,c=ut((function(t){return t===e}),l,!0),u=ut((function(t){return a.call(e,t)>-1}),l,!0),p=[function(t,i,n){var s=!h&&(n||i!=r)||((e=i).nodeType?c(t,i,n):u(t,i,n));return e=null,s}];d1&&pt(p),d>1&&ct(t.slice(0,d-1).concat({value:" "===t[d-2].type?"*":""})).replace(N,"$1"),i,d0,s=t.length>0,o=function(o,a,h,d,c){var p,m,f,A=0,y="0",x=o&&[],b=[],C=r,E=o||s&&n.find.TAG("*",c),I=v+=null==C?1:Math.random()||.1,B=E.length;for(c&&(r=a==l||a||c);y!==B&&null!=(p=E[y]);y++){if(s&&p){for(m=0,a||p.ownerDocument==l||(ht(p),h=!u);f=t[m++];)if(f(p,a||l,h)){g.call(d,p);break}c&&(v=I)}i&&((p=!f&&p)&&A--,o&&x.push(p))}if(A+=y,i&&y!==A){for(m=0;f=e[m++];)f(x,b,a,h);if(o){if(A>0)for(;y--;)x[y]||b[y]||(b[y]=k.call(d));b=mt(b)}g.apply(d,b),c&&!o&&b.length>0&&A+e.length>1&&w.uniqueSort(d)}return c&&(v=I,r=C),x};return i?et(o):o}(o,s)),a.selector=t}return a}function vt(t,e,i,s){var r,o,a,h,l,d="function"==typeof t&&t,c=!s&&dt(t=d.selector||t);if(i=i||[],1===c.length){if((o=c[0]=c[0].slice(0)).length>2&&"ID"===(a=o[0]).type&&9===e.nodeType&&u&&n.relative[o[1].type]){if(!(e=(n.find.ID(a.matches[0].replace(G,K),e)||[])[0]))return i;d&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(r=W.needsContext.test(t)?0:o.length;r--&&(a=o[r],!n.relative[h=a.type]);)if((l=n.find[h])&&(s=l(a.matches[0].replace(G,K),J.test(o[0].type)&&at(e.parentNode)||e))){if(o.splice(r,1),!(t=s.length&&ct(o)))return g.apply(i,s),i;break}}return(d||At(t,c))(s,e,!u,i,!e||J.test(t)&&at(e.parentNode)||e),i}lt.prototype=n.filters=n.pseudos,n.setFilters=new lt,p.sortStable=A.split("").sort(T).join("")===A,ht(),p.sortDetached=it((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),w.find=$,w.expr[":"]=w.expr.pseudos,w.unique=w.uniqueSort,$.compile=At,$.select=vt,$.setDocument=ht,$.tokenize=dt,$.escape=w.escapeSelector,$.getText=w.text,$.isXML=w.isXMLDoc,$.selectors=w.expr,$.support=w.support,$.uniqueSort=w.uniqueSort}();var M=function(t,e,i){for(var n=[],s=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(s&&w(t).is(i))break;n.push(t)}return n},P=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},O=w.expr.match.needsContext,R=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function F(t,e,i){return m(e)?w.grep(t,(function(t,n){return!!e.call(t,n,t)!==i})):e.nodeType?w.grep(t,(function(t){return t===e!==i})):"string"!=typeof e?w.grep(t,(function(t){return a.call(e,t)>-1!==i})):w.filter(e,t,i)}w.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?w.find.matchesSelector(n,t)?[n]:[]:w.find.matches(t,w.grep(e,(function(t){return 1===t.nodeType})))},w.fn.extend({find:function(t){var e,i,n=this.length,s=this;if("string"!=typeof t)return this.pushStack(w(t).filter((function(){for(e=0;e1?w.uniqueSort(i):i},filter:function(t){return this.pushStack(F(this,t||[],!1))},not:function(t){return this.pushStack(F(this,t||[],!0))},is:function(t){return!!F(this,"string"==typeof t&&O.test(t)?w(t):t||[],!1).length}});var z,H=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,j=w.fn.init=function(t,e,i){var n,s;if(!t)return this;if(i=i||z,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:H.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof w?e[0]:e,w.merge(this,w.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:g,!0)),R.test(n[1])&&w.isPlainObject(e))for(n in e)m(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(s=g.getElementById(n[2]))&&(this[0]=s,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):m(t)?void 0!==i.ready?i.ready(t):t(w):w.makeArray(t,this)};j.prototype=w.fn,z=w(g);var q=/^(?:parents|prev(?:Until|All))/,U={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}w.fn.extend({has:function(t){var e=w(t,this),i=e.length;return this.filter((function(){for(var t=0;t-1:1===i.nodeType&&w.find.matchesSelector(i,t))){r.push(i);break}return this.pushStack(r.length>1?w.uniqueSort(r):r)},index:function(t){return t?"string"==typeof t?a.call(w(t),this[0]):a.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),w.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return M(t,"parentNode")},parentsUntil:function(t,e,i){return M(t,"parentNode",i)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return M(t,"nextSibling")},prevAll:function(t){return M(t,"previousSibling")},nextUntil:function(t,e,i){return M(t,"nextSibling",i)},prevUntil:function(t,e,i){return M(t,"previousSibling",i)},siblings:function(t){return P((t.parentNode||{}).firstChild,t)},children:function(t){return P(t.firstChild)},contents:function(t){return null!=t.contentDocument&&n(t.contentDocument)?t.contentDocument:(E(t,"template")&&(t=t.content||t),w.merge([],t.childNodes))}},(function(t,e){w.fn[t]=function(i,n){var s=w.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(s=w.filter(n,s)),this.length>1&&(U[t]||w.uniqueSort(s),q.test(t)&&s.reverse()),this.pushStack(s)}}));var V=/[^\x20\t\r\n\f]+/g;function X(t){return t}function _(t){throw t}function J(t,e,i,n){var s;try{t&&m(s=t.promise)?s.call(t).done(e).fail(i):t&&m(s=t.then)?s.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}w.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return w.each(t.match(V)||[],(function(t,i){e[i]=!0})),e}(t):w.extend({},t);var e,i,n,s,r=[],o=[],a=-1,h=function(){for(s=s||t.once,n=e=!0;o.length;a=-1)for(i=o.shift();++a-1;)r.splice(i,1),i<=a&&a--})),this},has:function(t){return t?w.inArray(t,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return s=o=[],r=i="",this},disabled:function(){return!r},lock:function(){return s=o=[],i||e||(r=i=""),this},locked:function(){return!!s},fireWith:function(t,i){return s||(i=[t,(i=i||[]).slice?i.slice():i],o.push(i),e||h()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!n}};return l},w.extend({Deferred:function(e){var i=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],n="pending",s={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},catch:function(t){return s.then(null,t)},pipe:function(){var t=arguments;return w.Deferred((function(e){w.each(i,(function(i,n){var s=m(t[n[4]])&&t[n[4]];r[n[1]]((function(){var t=s&&s.apply(this,arguments);t&&m(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[n[0]+"With"](this,s?[t]:arguments)}))})),t=null})).promise()},then:function(e,n,s){var r=0;function o(e,i,n,s){return function(){var a=this,h=arguments,l=function(){var t,l;if(!(e=r&&(n!==_&&(a=void 0,h=[t]),i.rejectWith(a,h))}};e?d():(w.Deferred.getErrorHook?d.error=w.Deferred.getErrorHook():w.Deferred.getStackHook&&(d.error=w.Deferred.getStackHook()),t.setTimeout(d))}}return w.Deferred((function(t){i[0][3].add(o(0,t,m(s)?s:X,t.notifyWith)),i[1][3].add(o(0,t,m(e)?e:X)),i[2][3].add(o(0,t,m(n)?n:_))})).promise()},promise:function(t){return null!=t?w.extend(t,s):s}},r={};return w.each(i,(function(t,e){var o=e[2],a=e[5];s[e[1]]=o.add,a&&o.add((function(){n=a}),i[3-t][2].disable,i[3-t][3].disable,i[0][2].lock,i[0][3].lock),o.add(e[3].fire),r[e[0]]=function(){return r[e[0]+"With"](this===r?void 0:this,arguments),this},r[e[0]+"With"]=o.fireWith})),s.promise(r),e&&e.call(r,r),r},when:function(t){var e=arguments.length,i=e,n=Array(i),r=s.call(arguments),o=w.Deferred(),a=function(t){return function(i){n[t]=this,r[t]=arguments.length>1?s.call(arguments):i,--e||o.resolveWith(n,r)}};if(e<=1&&(J(t,o.done(a(i)).resolve,o.reject,!e),"pending"===o.state()||m(r[i]&&r[i].then)))return o.then();for(;i--;)J(r[i],a(i),o.reject);return o.promise()}});var G=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(e,i){t.console&&t.console.warn&&e&&G.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,i)},w.readyException=function(e){t.setTimeout((function(){throw e}))};var K=w.Deferred();function Y(){g.removeEventListener("DOMContentLoaded",Y),t.removeEventListener("load",Y),w.ready()}w.fn.ready=function(t){return K.then(t).catch((function(t){w.readyException(t)})),this},w.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==t&&--w.readyWait>0||K.resolveWith(g,[w]))}}),w.ready.then=K.then,"complete"===g.readyState||"loading"!==g.readyState&&!g.documentElement.doScroll?t.setTimeout(w.ready):(g.addEventListener("DOMContentLoaded",Y),t.addEventListener("load",Y));var Z=function(t,e,i,n,s,r,o){var a=0,h=t.length,l=null==i;if("object"===y(i))for(a in s=!0,i)Z(t,e,a,i[a],!0,r,o);else if(void 0!==n&&(s=!0,m(n)||(o=!0),l&&(o?(e.call(t,n),e=null):(l=e,e=function(t,e,i){return l.call(w(t),i)})),e))for(;a1,null,!0)},removeData:function(t){return this.each((function(){ot.remove(this,t)}))}}),w.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=rt.get(t,e),i&&(!n||Array.isArray(i)?n=rt.access(t,e,w.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=w.queue(t,e),n=i.length,s=i.shift(),r=w._queueHooks(t,e);"inprogress"===s&&(s=i.shift(),n--),s&&("fx"===e&&i.unshift("inprogress"),delete r.stop,s.call(t,(function(){w.dequeue(t,e)}),r)),!n&&r&&r.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return rt.get(t,i)||rt.access(t,i,{empty:w.Callbacks("once memory").add((function(){rt.remove(t,[e+"queue",i])}))})}}),w.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length\x20\t\r\n\f]*)/i,kt=/^$|^module$|\/(?:java|ecma)script/i;bt=g.createDocumentFragment().appendChild(g.createElement("div")),(wt=g.createElement("input")).setAttribute("type","radio"),wt.setAttribute("checked","checked"),wt.setAttribute("name","t"),bt.appendChild(wt),p.checkClone=bt.cloneNode(!0).cloneNode(!0).lastChild.checked,bt.innerHTML="",p.noCloneChecked=!!bt.cloneNode(!0).lastChild.defaultValue,bt.innerHTML="",p.option=!!bt.lastChild;var It={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Bt(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&E(t,e)?w.merge([t],i):i}function Dt(t,e){for(var i=0,n=t.length;i",""]);var Nt=/<|&#?\w+;/;function St(t,e,i,n,s){for(var r,o,a,h,l,d,c=e.createDocumentFragment(),u=[],p=0,m=t.length;p-1)s&&s.push(r);else if(l=mt(r),o=Bt(c.appendChild(r),"script"),l&&Dt(o),i)for(d=0;r=o[d++];)kt.test(r.type||"")&&i.push(r);return c}var Tt=/^([^.]*)(?:\.(.+)|)/;function Lt(){return!0}function Qt(){return!1}function Mt(t,e,i,n,s,r){var o,a;if("object"==typeof e){for(a in"string"!=typeof i&&(n=n||i,i=void 0),e)Mt(t,a,i,n,e[a],r);return t}if(null==n&&null==s?(s=i,n=i=void 0):null==s&&("string"==typeof i?(s=n,n=void 0):(s=n,n=i,i=void 0)),!1===s)s=Qt;else if(!s)return t;return 1===r&&(o=s,s=function(t){return w().off(t),o.apply(this,arguments)},s.guid=o.guid||(o.guid=w.guid++)),t.each((function(){w.event.add(this,e,s,n,i)}))}function Pt(t,e,i){i?(rt.set(t,e,!1),w.event.add(t,e,{namespace:!1,handler:function(t){var i,n=rt.get(this,e);if(1&t.isTrigger&&this[e]){if(n)(w.event.special[e]||{}).delegateType&&t.stopPropagation();else if(n=s.call(arguments),rt.set(this,e,n),this[e](),i=rt.get(this,e),rt.set(this,e,!1),n!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else n&&(rt.set(this,e,w.event.trigger(n[0],n.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Lt)}})):void 0===rt.get(t,e)&&w.event.add(t,e,Lt)}w.event={global:{},add:function(t,e,i,n,s){var r,o,a,h,l,d,c,u,p,m,f,g=rt.get(t);if(nt(t))for(i.handler&&(i=(r=i).handler,s=r.selector),s&&w.find.matchesSelector(pt,s),i.guid||(i.guid=w.guid++),(h=g.events)||(h=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(e){return void 0!==w&&w.event.triggered!==e.type?w.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(V)||[""]).length;l--;)p=f=(a=Tt.exec(e[l])||[])[1],m=(a[2]||"").split(".").sort(),p&&(c=w.event.special[p]||{},p=(s?c.delegateType:c.bindType)||p,c=w.event.special[p]||{},d=w.extend({type:p,origType:f,data:n,handler:i,guid:i.guid,selector:s,needsContext:s&&w.expr.match.needsContext.test(s),namespace:m.join(".")},r),(u=h[p])||((u=h[p]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(t,n,m,o)||t.addEventListener&&t.addEventListener(p,o)),c.add&&(c.add.call(t,d),d.handler.guid||(d.handler.guid=i.guid)),s?u.splice(u.delegateCount++,0,d):u.push(d),w.event.global[p]=!0)},remove:function(t,e,i,n,s){var r,o,a,h,l,d,c,u,p,m,f,g=rt.hasData(t)&&rt.get(t);if(g&&(h=g.events)){for(l=(e=(e||"").match(V)||[""]).length;l--;)if(p=f=(a=Tt.exec(e[l])||[])[1],m=(a[2]||"").split(".").sort(),p){for(c=w.event.special[p]||{},u=h[p=(n?c.delegateType:c.bindType)||p]||[],a=a[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=r=u.length;r--;)d=u[r],!s&&f!==d.origType||i&&i.guid!==d.guid||a&&!a.test(d.namespace)||n&&n!==d.selector&&("**"!==n||!d.selector)||(u.splice(r,1),d.selector&&u.delegateCount--,c.remove&&c.remove.call(t,d));o&&!u.length&&(c.teardown&&!1!==c.teardown.call(t,m,g.handle)||w.removeEvent(t,p,g.handle),delete h[p])}else for(p in h)w.event.remove(t,p+e[l],i,n,!0);w.isEmptyObject(h)&&rt.remove(t,"handle events")}},dispatch:function(t){var e,i,n,s,r,o,a=new Array(arguments.length),h=w.event.fix(t),l=(rt.get(this,"events")||Object.create(null))[h.type]||[],d=w.event.special[h.type]||{};for(a[0]=h,e=1;e=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==t.type||!0!==l.disabled)){for(r=[],o={},i=0;i-1:w.find(s,this,null,[l]).length),o[s]&&r.push(n);r.length&&a.push({elem:l,handlers:r})}return l=this,h\s*$/g;function zt(t,e){return E(t,"table")&&E(11!==e.nodeType?e:e.firstChild,"tr")&&w(t).children("tbody")[0]||t}function Ht(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function jt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function qt(t,e){var i,n,s,r,o,a;if(1===e.nodeType){if(rt.hasData(t)&&(a=rt.get(t).events))for(s in rt.remove(e,"handle events"),a)for(i=0,n=a[s].length;i1&&"string"==typeof g&&!p.checkClone&&Rt.test(g))return t.each((function(s){var r=t.eq(s);A&&(e[0]=g.call(this,s,r.html())),Wt(r,e,i,n)}));if(u&&(o=(s=St(e,t[0].ownerDocument,!1,t,n)).firstChild,1===s.childNodes.length&&(s=o),o||n)){for(h=(a=w.map(Bt(s,"script"),Ht)).length;c0&&Dt(o,!h&&Bt(t,"script")),a},cleanData:function(t){for(var e,i,n,s=w.event.special,r=0;void 0!==(i=t[r]);r++)if(nt(i)){if(e=i[rt.expando]){if(e.events)for(n in e.events)s[n]?w.event.remove(i,n):w.removeEvent(i,n,e.handle);i[rt.expando]=void 0}i[ot.expando]&&(i[ot.expando]=void 0)}}}),w.fn.extend({detach:function(t){return Vt(this,t,!0)},remove:function(t){return Vt(this,t)},text:function(t){return Z(this,(function(t){return void 0===t?w.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||zt(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=zt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(w.cleanData(Bt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return w.clone(this,t,e)}))},html:function(t){return Z(this,(function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Ot.test(t)&&!It[(Et.exec(t)||["",""])[1].toLowerCase()]){t=w.htmlPrefilter(t);try{for(;i=0&&(h+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-r-h-a-.5))||0),h+l}function he(t,e,i){var n=Jt(t),s=(!p.boxSizingReliable()||i)&&"border-box"===w.css(t,"boxSizing",!1,n),r=s,o=Yt(t,e,n),a="offset"+e[0].toUpperCase()+e.slice(1);if(Xt.test(o)){if(!i)return o;o="auto"}return(!p.boxSizingReliable()&&s||!p.reliableTrDimensions()&&E(t,"tr")||"auto"===o||!parseFloat(o)&&"inline"===w.css(t,"display",!1,n))&&t.getClientRects().length&&(s="border-box"===w.css(t,"boxSizing",!1,n),(r=a in t)&&(o=t[a])),(o=parseFloat(o)||0)+ae(t,e,i||(s?"border":"content"),r,n,o)+"px"}function le(t,e,i,n,s){return new le.prototype.init(t,e,i,n,s)}w.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Yt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var s,r,o,a=it(e),h=_t.test(e),l=t.style;if(h||(e=ie(a)),o=w.cssHooks[e]||w.cssHooks[a],void 0===i)return o&&"get"in o&&void 0!==(s=o.get(t,!1,n))?s:l[e];"string"===(r=typeof i)&&(s=ct.exec(i))&&s[1]&&(i=At(t,e,s),r="number"),null!=i&&i==i&&("number"!==r||h||(i+=s&&s[3]||(w.cssNumber[a]?"":"px")),p.clearCloneStyle||""!==i||0!==e.indexOf("background")||(l[e]="inherit"),o&&"set"in o&&void 0===(i=o.set(t,i,n))||(h?l.setProperty(e,i):l[e]=i))}},css:function(t,e,i,n){var s,r,o,a=it(e);return _t.test(e)||(e=ie(a)),(o=w.cssHooks[e]||w.cssHooks[a])&&"get"in o&&(s=o.get(t,!0,i)),void 0===s&&(s=Yt(t,e,n)),"normal"===s&&e in re&&(s=re[e]),""===i||i?(r=parseFloat(s),!0===i||isFinite(r)?r||0:s):s}}),w.each(["height","width"],(function(t,e){w.cssHooks[e]={get:function(t,i,n){if(i)return!ne.test(w.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?he(t,e,n):Gt(t,se,(function(){return he(t,e,n)}))},set:function(t,i,n){var s,r=Jt(t),o=!p.scrollboxSize()&&"absolute"===r.position,a=(o||n)&&"border-box"===w.css(t,"boxSizing",!1,r),h=n?ae(t,e,n,a,r):0;return a&&o&&(h-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(r[e])-ae(t,e,"border",!1,r)-.5)),h&&(s=ct.exec(i))&&"px"!==(s[3]||"px")&&(t.style[e]=i,i=w.css(t,e)),oe(0,i,h)}}})),w.cssHooks.marginLeft=Zt(p.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Yt(t,"marginLeft"))||t.getBoundingClientRect().left-Gt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),w.each({margin:"",padding:"",border:"Width"},(function(t,e){w.cssHooks[t+e]={expand:function(i){for(var n=0,s={},r="string"==typeof i?i.split(" "):[i];n<4;n++)s[t+ut[n]+e]=r[n]||r[n-2]||r[0];return s}},"margin"!==t&&(w.cssHooks[t+e].set=oe)})),w.fn.extend({css:function(t,e){return Z(this,(function(t,e,i){var n,s,r={},o=0;if(Array.isArray(e)){for(n=Jt(t),s=e.length;o1)}}),w.Tween=le,le.prototype={constructor:le,init:function(t,e,i,n,s,r){this.elem=t,this.prop=i,this.easing=s||w.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=r||(w.cssNumber[i]?"":"px")},cur:function(){var t=le.propHooks[this.prop];return t&&t.get?t.get(this):le.propHooks._default.get(this)},run:function(t){var e,i=le.propHooks[this.prop];return this.options.duration?this.pos=e=w.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):le.propHooks._default.set(this),this}},le.prototype.init.prototype=le.prototype,le.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=w.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){w.fx.step[t.prop]?w.fx.step[t.prop](t):1!==t.elem.nodeType||!w.cssHooks[t.prop]&&null==t.elem.style[ie(t.prop)]?t.elem[t.prop]=t.now:w.style(t.elem,t.prop,t.now+t.unit)}}},le.propHooks.scrollTop=le.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},w.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},w.fx=le.prototype.init,w.fx.step={};var de,ce,ue=/^(?:toggle|show|hide)$/,pe=/queueHooks$/;function me(){ce&&(!1===g.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(me):t.setTimeout(me,w.fx.interval),w.fx.tick())}function fe(){return t.setTimeout((function(){de=void 0})),de=Date.now()}function ge(t,e){var i,n=0,s={height:t};for(e=e?1:0;n<4;n+=2-e)s["margin"+(i=ut[n])]=s["padding"+i]=t;return e&&(s.opacity=s.width=t),s}function Ae(t,e,i){for(var n,s=(ve.tweeners[e]||[]).concat(ve.tweeners["*"]),r=0,o=s.length;r1)},removeAttr:function(t){return this.each((function(){w.removeAttr(this,t)}))}}),w.extend({attr:function(t,e,i){var n,s,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===t.getAttribute?w.prop(t,e,i):(1===r&&w.isXMLDoc(t)||(s=w.attrHooks[e.toLowerCase()]||(w.expr.match.bool.test(e)?ye:void 0)),void 0!==i?null===i?void w.removeAttr(t,e):s&&"set"in s&&void 0!==(n=s.set(t,i,e))?n:(t.setAttribute(e,i+""),i):s&&"get"in s&&null!==(n=s.get(t,e))?n:null==(n=w.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!p.radioValue&&"radio"===e&&E(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,s=e&&e.match(V);if(s&&1===t.nodeType)for(;i=s[n++];)t.removeAttribute(i)}}),ye={set:function(t,e,i){return!1===e?w.removeAttr(t,i):t.setAttribute(i,i),i}},w.each(w.expr.match.bool.source.match(/\w+/g),(function(t,e){var i=xe[e]||w.find.attr;xe[e]=function(t,e,n){var s,r,o=e.toLowerCase();return n||(r=xe[o],xe[o]=s,s=null!=i(t,e,n)?o:null,xe[o]=r),s}}));var be=/^(?:input|select|textarea|button)$/i,we=/^(?:a|area)$/i;function Ce(t){return(t.match(V)||[]).join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function ke(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(V)||[]}w.fn.extend({prop:function(t,e){return Z(this,w.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[w.propFix[t]||t]}))}}),w.extend({prop:function(t,e,i){var n,s,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&w.isXMLDoc(t)||(e=w.propFix[e]||e,s=w.propHooks[e]),void 0!==i?s&&"set"in s&&void 0!==(n=s.set(t,i,e))?n:t[e]=i:s&&"get"in s&&null!==(n=s.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=w.find.attr(t,"tabindex");return e?parseInt(e,10):be.test(t.nodeName)||we.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(w.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){w.propFix[this.toLowerCase()]=this})),w.fn.extend({addClass:function(t){var e,i,n,s,r,o;return m(t)?this.each((function(e){w(this).addClass(t.call(this,e,Ee(this)))})):(e=ke(t)).length?this.each((function(){if(n=Ee(this),i=1===this.nodeType&&" "+Ce(n)+" "){for(r=0;r-1;)i=i.replace(" "+s+" "," ");o=Ce(i),n!==o&&this.setAttribute("class",o)}})):this:this.attr("class","")},toggleClass:function(t,e){var i,n,s,r,o=typeof t,a="string"===o||Array.isArray(t);return m(t)?this.each((function(i){w(this).toggleClass(t.call(this,i,Ee(this),e),e)})):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(i=ke(t),this.each((function(){if(a)for(r=w(this),s=0;s-1)return!0;return!1}});var Ie=/\r/g;w.fn.extend({val:function(t){var e,i,n,s=this[0];return arguments.length?(n=m(t),this.each((function(i){var s;1===this.nodeType&&(null==(s=n?t.call(this,i,w(this).val()):t)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=w.map(s,(function(t){return null==t?"":t+""}))),(e=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))}))):s?(e=w.valHooks[s.type]||w.valHooks[s.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(s,"value"))?i:"string"==typeof(i=s.value)?i.replace(Ie,""):null==i?"":i:void 0}}),w.extend({valHooks:{option:{get:function(t){var e=w.find.attr(t,"value");return null!=e?e:Ce(w.text(t))}},select:{get:function(t){var e,i,n,s=t.options,r=t.selectedIndex,o="select-one"===t.type,a=o?null:[],h=o?r+1:s.length;for(n=r<0?h:o?r:0;n-1)&&(i=!0);return i||(t.selectedIndex=-1),r}}}}),w.each(["radio","checkbox"],(function(){w.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=w.inArray(w(t).val(),e)>-1}},p.checkOn||(w.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Be=t.location,De={guid:Date.now()},Ne=/\?/;w.parseXML=function(e){var i,n;if(!e||"string"!=typeof e)return null;try{i=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return n=i&&i.getElementsByTagName("parsererror")[0],i&&!n||w.error("Invalid XML: "+(n?w.map(n.childNodes,(function(t){return t.textContent})).join("\n"):e)),i};var Se=/^(?:focusinfocus|focusoutblur)$/,Te=function(t){t.stopPropagation()};w.extend(w.event,{trigger:function(e,i,n,s){var r,o,a,h,l,c,u,p,A=[n||g],v=d.call(e,"type")?e.type:e,y=d.call(e,"namespace")?e.namespace.split("."):[];if(o=p=a=n=n||g,3!==n.nodeType&&8!==n.nodeType&&!Se.test(v+w.event.triggered)&&(v.indexOf(".")>-1&&(y=v.split("."),v=y.shift(),y.sort()),l=v.indexOf(":")<0&&"on"+v,(e=e[w.expando]?e:new w.Event(v,"object"==typeof e&&e)).isTrigger=s?2:3,e.namespace=y.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),i=null==i?[e]:w.makeArray(i,[e]),u=w.event.special[v]||{},s||!u.trigger||!1!==u.trigger.apply(n,i))){if(!s&&!u.noBubble&&!f(n)){for(h=u.delegateType||v,Se.test(h+v)||(o=o.parentNode);o;o=o.parentNode)A.push(o),a=o;a===(n.ownerDocument||g)&&A.push(a.defaultView||a.parentWindow||t)}for(r=0;(o=A[r++])&&!e.isPropagationStopped();)p=o,e.type=r>1?h:u.bindType||v,(c=(rt.get(o,"events")||Object.create(null))[e.type]&&rt.get(o,"handle"))&&c.apply(o,i),(c=l&&o[l])&&c.apply&&nt(o)&&(e.result=c.apply(o,i),!1===e.result&&e.preventDefault());return e.type=v,s||e.isDefaultPrevented()||u._default&&!1!==u._default.apply(A.pop(),i)||!nt(n)||l&&m(n[v])&&!f(n)&&((a=n[l])&&(n[l]=null),w.event.triggered=v,e.isPropagationStopped()&&p.addEventListener(v,Te),n[v](),e.isPropagationStopped()&&p.removeEventListener(v,Te),w.event.triggered=void 0,a&&(n[l]=a)),e.result}},simulate:function(t,e,i){var n=w.extend(new w.Event,i,{type:t,isSimulated:!0});w.event.trigger(n,null,e)}}),w.fn.extend({trigger:function(t,e){return this.each((function(){w.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var i=this[0];if(i)return w.event.trigger(t,e,i,!0)}});var Le=/\[\]$/,Qe=/\r?\n/g,Me=/^(?:submit|button|image|reset|file)$/i,Pe=/^(?:input|select|textarea|keygen)/i;function Oe(t,e,i,n){var s;if(Array.isArray(e))w.each(e,(function(e,s){i||Le.test(t)?n(t,s):Oe(t+"["+("object"==typeof s&&null!=s?e:"")+"]",s,i,n)}));else if(i||"object"!==y(e))n(t,e);else for(s in e)Oe(t+"["+s+"]",e[s],i,n)}w.param=function(t,e){var i,n=[],s=function(t,e){var i=m(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!w.isPlainObject(t))w.each(t,(function(){s(this.name,this.value)}));else for(i in t)Oe(i,t[i],e,s);return n.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=w.prop(this,"elements");return t?w.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!w(this).is(":disabled")&&Pe.test(this.nodeName)&&!Me.test(t)&&(this.checked||!Ct.test(t))})).map((function(t,e){var i=w(this).val();return null==i?null:Array.isArray(i)?w.map(i,(function(t){return{name:e.name,value:t.replace(Qe,"\r\n")}})):{name:e.name,value:i.replace(Qe,"\r\n")}})).get()}});var Re=/%20/g,Fe=/#.*$/,ze=/([?&])_=[^&]*/,He=/^(.*?):[ \t]*([^\r\n]*)$/gm,je=/^(?:GET|HEAD)$/,qe=/^\/\//,Ue={},We={},Ve="*/".concat("*"),Xe=g.createElement("a");function _e(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,s=0,r=e.toLowerCase().match(V)||[];if(m(i))for(;n=r[s++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Je(t,e,i,n){var s={},r=t===We;function o(a){var h;return s[a]=!0,w.each(t[a]||[],(function(t,a){var l=a(e,i,n);return"string"!=typeof l||r||s[l]?r?!(h=l):void 0:(e.dataTypes.unshift(l),o(l),!1)})),h}return o(e.dataTypes[0])||!s["*"]&&o("*")}function Ge(t,e){var i,n,s=w.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((s[i]?t:n||(n={}))[i]=e[i]);return n&&w.extend(!0,t,n),t}Xe.href=Be.href,w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Be.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Be.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ve,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ge(Ge(t,w.ajaxSettings),e):Ge(w.ajaxSettings,t)},ajaxPrefilter:_e(Ue),ajaxTransport:_e(We),ajax:function(e,i){"object"==typeof e&&(i=e,e=void 0),i=i||{};var n,s,r,o,a,h,l,d,c,u,p=w.ajaxSetup({},i),m=p.context||p,f=p.context&&(m.nodeType||m.jquery)?w(m):w.event,A=w.Deferred(),v=w.Callbacks("once memory"),y=p.statusCode||{},x={},b={},C="canceled",E={readyState:0,getResponseHeader:function(t){var e;if(l){if(!o)for(o={};e=He.exec(r);)o[e[1].toLowerCase()+" "]=(o[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=o[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return l?r:null},setRequestHeader:function(t,e){return null==l&&(t=b[t.toLowerCase()]=b[t.toLowerCase()]||t,x[t]=e),this},overrideMimeType:function(t){return null==l&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(l)E.always(t[E.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||C;return n&&n.abort(e),k(0,e),this}};if(A.promise(E),p.url=((e||p.url||Be.href)+"").replace(qe,Be.protocol+"//"),p.type=i.method||i.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(V)||[""],null==p.crossDomain){h=g.createElement("a");try{h.href=p.url,h.href=h.href,p.crossDomain=Xe.protocol+"//"+Xe.host!=h.protocol+"//"+h.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=w.param(p.data,p.traditional)),Je(Ue,p,i,E),l)return E;for(c in(d=w.event&&p.global)&&0==w.active++&&w.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!je.test(p.type),s=p.url.replace(Fe,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Re,"+")):(u=p.url.slice(s.length),p.data&&(p.processData||"string"==typeof p.data)&&(s+=(Ne.test(s)?"&":"?")+p.data,delete p.data),!1===p.cache&&(s=s.replace(ze,"$1"),u=(Ne.test(s)?"&":"?")+"_="+De.guid+++u),p.url=s+u),p.ifModified&&(w.lastModified[s]&&E.setRequestHeader("If-Modified-Since",w.lastModified[s]),w.etag[s]&&E.setRequestHeader("If-None-Match",w.etag[s])),(p.data&&p.hasContent&&!1!==p.contentType||i.contentType)&&E.setRequestHeader("Content-Type",p.contentType),E.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ve+"; q=0.01":""):p.accepts["*"]),p.headers)E.setRequestHeader(c,p.headers[c]);if(p.beforeSend&&(!1===p.beforeSend.call(m,E,p)||l))return E.abort();if(C="abort",v.add(p.complete),E.done(p.success),E.fail(p.error),n=Je(We,p,i,E)){if(E.readyState=1,d&&f.trigger("ajaxSend",[E,p]),l)return E;p.async&&p.timeout>0&&(a=t.setTimeout((function(){E.abort("timeout")}),p.timeout));try{l=!1,n.send(x,k)}catch(t){if(l)throw t;k(-1,t)}}else k(-1,"No Transport");function k(e,i,o,h){var c,u,g,x,b,C=i;l||(l=!0,a&&t.clearTimeout(a),n=void 0,r=h||"",E.readyState=e>0?4:0,c=e>=200&&e<300||304===e,o&&(x=function(t,e,i){for(var n,s,r,o,a=t.contents,h=t.dataTypes;"*"===h[0];)h.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(s in a)if(a[s]&&a[s].test(n)){h.unshift(s);break}if(h[0]in i)r=h[0];else{for(s in i){if(!h[0]||t.converters[s+" "+h[0]]){r=s;break}o||(o=s)}r=r||o}if(r)return r!==h[0]&&h.unshift(r),i[r]}(p,E,o)),!c&&w.inArray("script",p.dataTypes)>-1&&w.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),x=function(t,e,i,n){var s,r,o,a,h,l={},d=t.dataTypes.slice();if(d[1])for(o in t.converters)l[o.toLowerCase()]=t.converters[o];for(r=d.shift();r;)if(t.responseFields[r]&&(i[t.responseFields[r]]=e),!h&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),h=r,r=d.shift())if("*"===r)r=h;else if("*"!==h&&h!==r){if(!(o=l[h+" "+r]||l["* "+r]))for(s in l)if((a=s.split(" "))[1]===r&&(o=l[h+" "+a[0]]||l["* "+a[0]])){!0===o?o=l[s]:!0!==l[s]&&(r=a[0],d.unshift(a[1]));break}if(!0!==o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+h+" to "+r}}}return{state:"success",data:e}}(p,x,E,c),c?(p.ifModified&&((b=E.getResponseHeader("Last-Modified"))&&(w.lastModified[s]=b),(b=E.getResponseHeader("etag"))&&(w.etag[s]=b)),204===e||"HEAD"===p.type?C="nocontent":304===e?C="notmodified":(C=x.state,u=x.data,c=!(g=x.error))):(g=C,!e&&C||(C="error",e<0&&(e=0))),E.status=e,E.statusText=(i||C)+"",c?A.resolveWith(m,[u,C,E]):A.rejectWith(m,[E,C,g]),E.statusCode(y),y=void 0,d&&f.trigger(c?"ajaxSuccess":"ajaxError",[E,p,c?u:g]),v.fireWith(m,[E,C]),d&&(f.trigger("ajaxComplete",[E,p]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(t,e,i){return w.get(t,e,i,"json")},getScript:function(t,e){return w.get(t,void 0,e,"script")}}),w.each(["get","post"],(function(t,e){w[e]=function(t,i,n,s){return m(i)&&(s=s||n,n=i,i=void 0),w.ajax(w.extend({url:t,type:e,dataType:s,data:i,success:n},w.isPlainObject(t)&&t))}})),w.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),w._evalUrl=function(t,e,i){return w.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){w.globalEval(t,e,i)}})},w.fn.extend({wrapAll:function(t){var e;return this[0]&&(m(t)&&(t=t.call(this[0])),e=w(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return m(t)?this.each((function(e){w(this).wrapInner(t.call(this,e))})):this.each((function(){var e=w(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)}))},wrap:function(t){var e=m(t);return this.each((function(i){w(this).wrapAll(e?t.call(this,i):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){w(this).replaceWith(this.childNodes)})),this}}),w.expr.pseudos.hidden=function(t){return!w.expr.pseudos.visible(t)},w.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ke={0:200,1223:204},Ye=w.ajaxSettings.xhr();p.cors=!!Ye&&"withCredentials"in Ye,p.ajax=Ye=!!Ye,w.ajaxTransport((function(e){var i,n;if(p.cors||Ye&&!e.crossDomain)return{send:function(s,r){var o,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];for(o in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)a.setRequestHeader(o,s[o]);i=function(t){return function(){i&&(i=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?r(0,"error"):r(a.status,a.statusText):r(Ke[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=i(),n=a.onerror=a.ontimeout=i("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&t.setTimeout((function(){i&&n()}))},i=i("abort");try{a.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}})),w.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return w.globalEval(t),t}}}),w.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),w.ajaxTransport("script",(function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(n,s){e=w("