text: (window["webpackJsonphypothesis-testing-mindmap"]=window["webpackJsonphypothesis-testing-mindmap"]||[]).push([[0],{287:function(e,t,n){e.exports=n.p+"static/media/default.4f8c4983.jpg"},288:function(e,t,n){e.exports=n.p+"static/media/theme1.2f59f00b.jpg"},289:function(e,t,n){e.exports=n.p+"static/media/theme2.b18193fb.jpg"},290:function(e,t,n){e.exports=n.p+"static/media/theme3.61c97910.jpg"},291:function(e,t,n){e.exports=n.p+"static/media/theme4.1e21408c.jpg"},343:function(e,t,n){},346:function(e,t,n){},847:function(e,t,n){},868:function(e,t,n){},869:function(e,t,n){},870:function(e,t,n){},871:function(e,t,n){"use strict";n.r(t);var o=n(0),r=n.n(o),i=n(15),a=n.n(i),l=(n(343),n(43)),c=n(44),s=n(49),p=n(48),u=n(81),d=n(7),f=n(12),h=n.n(f),m=n(71),y=n(2),g=n(21),b=n(47),v=n(102),x=n(3),T=n(101),w=function(e,t){return(w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function O(e,t){function n(){this.constructor=e}w(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var k=function(){return(k=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function E(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function C(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(E(arguments[t]));return e}h()("core:controller");function S(e){var t,n;if(!Array.isArray(e))throw new TypeError("Middleware stack must be an array!");try{for(var o=function(e){var t="function"===typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(e),r=o.next();!r.done;r=o.next()){if("function"!==typeof r.value)throw new TypeError("Middleware must be composed of functions!")}}catch(i){t={error:i}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return function(t,n){var o=-1;return function r(i){if(i<=o)throw new Error("next() called multiple times");o=i;var a=e[i];i===e.length&&(a=n);if(!a)return null;try{return a(t,r.bind(null,i+1))}catch(l){throw l}}(0)}}var j,K=function(){function e(e){void 0===e&&(e={});var t=e.plugins,n=void 0===t?[]:t,o=e.onChange,r=e.readOnly;this.readOnly=r,this.onChange=o,this.middleware=new Map,function e(t,n){if(Array.isArray(n))n.forEach((function(n){return e(t,n)}));else if(null!=n)for(var o in n){var r=n[o];t.middleware[o]=t.middleware[o]||[],t.middleware[o].push(r)}}(this,function(e){void 0===e&&(e={});var t=e.plugins;return C(void 0===t?[]:t)}({plugins:n}))}return e.prototype.run=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=this.middleware,r=o[e]||[];Object(v.a)(0!==r.length,"the middleware function "+e+" is not found!");var i=Object(b.a)(S)(r);return i.apply(void 0,C(t))},e.prototype.getValue=function(e,t){return this.run("getValue",k(k({},t),{propKey:e}))},e.prototype.change=function(e,t){this.onChange(e,t),this.currentModel=e},e}(),R="L",D="R",_="M";!function(e){e[e.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",e[e.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",e[e.LEFT_AND_RIGHT=2]="LEFT_AND_RIGHT",e[e.TOP_TO_BOTTOM=3]="TOP_TO_BOTTOM"}(j||(j={}));var N=0,P=1,I="CONTENT",M="DESC",A="NORMAL",L="EDITING_CONTENT",z="EDITING_DESC",F="SHOW_POPUP",H="DRAGGING",B="ANCESTOR",V="DESCENDANT",W="SIBLING",G="NONE",U="TOGGLE_COLLAPSE",q="COLLAPSE_ALL",Y="EXPAND_ALL",Z="EXPAND_TO",J="ADD_CHILD",X="ADD_SIBLING",Q="DELETE_TOPIC",$="FOCUS_TOPIC",ee="SET_FOCUS_MODE",te="SET_STYLE",ne="SET_THEME",oe="SET_TOPIC_BLOCK",re="DELETE_TOPIC_BLOCK",ie="START_EDITING_CONTENT",ae="START_EDITING_DESC",le="DRAG_AND_DROP",ce="SET_EDITOR_ROOT";function se(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}var pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),Object.defineProperty(t.prototype,"data",{get:function(){return this.get("data")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.get("type")},enumerable:!0,configurable:!0}),t.create=function(e){return new t(e)},t.createList=function(e){if(x.List.isList(e)||Array.isArray(e))return Object(x.List)(e.map(t.create));throw new Error("Block.createList only accepts Array or List, but you passed it: "+e)},t}(Object(x.Record)({type:null,key:null,data:null})),ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),Object.defineProperty(t.prototype,"key",{get:function(){return this.get("key")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentKey",{get:function(){return this.get("parentKey")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collapse",{get:function(){return this.get("collapse")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subKeys",{get:function(){return this.get("subKeys")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"blocks",{get:function(){return this.get("blocks")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"relations",{get:function(){return this.get("relations")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.get("style")},enumerable:!0,configurable:!0}),t.prototype.getBlock=function(e){var t=this.blocks.findIndex((function(t){return t.type===e}));return-1===t?{index:t,block:null}:{index:t,block:this.blocks.get(t)}},t.fromJSON=function(e){var n=e.key,o=e.parentKey,r=void 0===o?null:o,i=e.blocks,a=e.subKeys,l=void 0===a?[]:a,c=e.collapse;return new t({key:n,parentKey:r,collapse:void 0!==c&&c,subKeys:Object(x.List)(l),blocks:pe.createList(i)})},t.create=function(e){var n=e.key,o=e.parentKey,r=void 0===o?null:o,i=e.content,a=void 0===i?"":i,l=e.subKeys,c=void 0===l?[]:l,s=e.collapse,p=void 0!==s&&s,u=pe.create({type:I,data:a,key:null});return new t({key:n,parentKey:r,blocks:Object(x.List)([u]),subKeys:Object(x.List)(c),collapse:p})},t}(Object(x.Record)({key:null,parentKey:null,collapse:!1,subKeys:null,blocks:null,relations:null,style:null}));function de(e,t){var n=e.getTopic(t),o=[];if(n.subKeys.size>0){var r=n.subKeys.toArray();o.push.apply(o,C(r)),o=r.reduce((function(t,n){return t.push.apply(t,C(de(e,n))),t}),o)}return o}function fe(e,t,n){var o=e.getTopic(t),r=e.getTopic(n);if(o&&r){if(o.parentKey==r.parentKey)return W;for(var i=o;i.parentKey;){if(i.parentKey===r.key)return V;i=e.getParentTopic(i.key)}for(i=r;i.parentKey;){if(i.parentKey===o.key)return B;i=e.getParentTopic(i.key)}}return G}var he=h()("modifier");function me(e){var t=e.model,n=e.topicKey,o=e.focusMode;return he("focus topic"),n!==t.focusKey&&(t=t.set("focusKey",n)),o!==t.focusMode&&(t=t.set("focusMode",o)),t}var ye={addChild:function(e){var t=e.model,n=e.topicKey;he("addChild:",n);var o=t.getTopic(n);if(o){var r=ue.create({key:se(),parentKey:o.key});return o=o.set("collapse",!1).update("subKeys",(function(e){return e.push(r.key)})),me({model:t=t.update("topics",(function(e){return e.set(n,o).set(r.key,r)})),topicKey:r.key,focusMode:L})}return t},addSibling:function(e){var t=e.model,n=e.topicKey;if(n===t.rootTopicKey)return t;var o=t.getTopic(n);if(o){var r=t.getTopic(o.parentKey),i=r.subKeys.indexOf(n),a=ue.create({key:se(),parentKey:r.key});return me({model:t=t.update("topics",(function(e){return e.set(a.key,a)})).updateIn(["topics",r.key,"subKeys"],(function(e){return e.insert(i+1,a.key)})),topicKey:a.key,focusMode:L})}return t},toggleCollapse:function(e){var t=e.model,n=e.topicKey,o=t.getTopic(n);return o&&0!==o.subKeys.size&&(o=o.merge({collapse:!o.collapse}),t=t.updateIn(["topics",o.key,"collapse"],(function(e){return!e}))),t=me({model:t,topicKey:n,focusMode:A})},collapseAll:function(e){var t=e.model;he("collapseAll");var n=de(t,t.editorRootTopicKey);return he(t),t=t.withMutations((function(e){n.forEach((function(t){e.setIn(["topics",t,"collapse"],!0)}))})),he(t),t},expandAll:function(e){var t=e.model,n=de(t,t.editorRootTopicKey);return he(t),t=t.withMutations((function(e){n.forEach((function(t){e.setIn(["topics",t,"collapse"],!1)}))})),he(t),t},expandTo:function(e){var t=e.model,n=e.topicKey,o=function(e,t,n){void 0===n&&(n=!1);for(var o=[t],r=e.getTopic(t);r.parentKey;)n?o.push(r.parentKey):o.unshift(r.parentKey),r=e.getParentTopic(r.key);return o}(t,n).filter((function(e){return e!==n}));return fe(t=t.withMutations((function(e){o.forEach((function(t){e.setIn(["topics",t,"collapse"],!1)}))})),n,t.editorRootTopicKey)!==V&&(t=t.set("editorRootTopicKey",t.rootTopicKey)),t},focusTopic:me,setFocusMode:function(e){var t=e.model,n=e.focusMode;return he("setFocusMode"),n!==t.focusMode&&(t=t.set("focusMode",n)),t},deleteTopic:function(e){var t=e.model,n=e.topicKey;if(n===t.editorRootTopicKey)return t;var o=t.getTopic(n);return o&&(t=t.withMutations((function(e){e.update("topics",(function(e){e=e.delete(n);var o=de(t,n);return e=e.withMutations((function(e){o.forEach((function(t){e.delete(t)}))}))})),e.updateIn(["topics",o.parentKey,"subKeys"],(function(e){return e.delete(e.indexOf(n))})),e.focusKey===n&&e.set("focusKey",null).set("focusMode",null)}))),t},setBlockData:function(e){var t=e.model,n=e.topicKey,o=e.blockType,r=e.focusMode,i=e.data,a=t.getTopic(n);if(a){var l=a.getBlock(o),c=l.index,s=l.block;-1===c?t=t.updateIn(["topics",n,"blocks"],(function(e){return e.push(pe.create({type:o,data:i}))})):s.data!==i&&(t=t.updateIn(["topics",n,"blocks",c,"data"],(function(e){return i}))),r&&(t=me({model:t,topicKey:n,focusMode:r}))}return t},deleteBlock:function(e){var t=e.model,n=e.topicKey,o=e.blockType,r=t.getTopic(n);if(r){var i=r.getBlock(o).index;-1!==i&&(t=t.updateIn(["topics",n,"blocks"],(function(e){return e.delete(i)}))),t=me({model:t,topicKey:null,focusMode:null})}return t},setStyle:function(e){var t=e.model,n=e.topicKey,o=e.style,r=t.getTopic(n);return r&&o!==r.style&&(t=t.updateIn(["topics",n,"style"],(function(e){return o}))),t},setTheme:function(e){var t=e.model,n=e.theme;return t=t.setIn(["config","theme"],n)},setLayoutDir:function(e){var t=e.model,n=e.layoutDir;return t.config.layoutDir===n?t:t=t.setIn(["config","layoutDir"],n)},setEditorRootTopicKey:function(e){var t=e.model,n=e.topicKey;return t.editorRootTopicKey!==n&&(t=t.set("editorRootTopicKey",n)),t.getTopic(n).collapse&&(t=t.setIn(["topics",n,"collapse"],!1)),t},setZoomFactor:function(e){var t=e.model,n=e.zoomFactor;return t.zoomFactor!==n&&(t=t.set("zoomFactor",n)),t}};var ge,be={name:"default",randomColor:!0,background:"rgb(57,60,65)",highlightColor:"#50C9CE",marginH:60,marginV:20,contentStyle:{lineHeight:"1.5"},linkStyle:{lineRadius:5,lineType:"curve",lineWidth:"3px"},rootTopic:{contentStyle:{fontSize:"34px",borderRadius:"35px",padding:"16px 18px 16px 18px"},subLinkStyle:{lineType:"curve",lineWidth:"3px",lineColor:"rgb(113, 203, 45)"}},primaryTopic:{contentStyle:{borderWidth:"1px",borderStyle:"solid",borderRadius:"20px",fontSize:"17px",padding:"10px 15px 10px 15px"},subLinkStyle:{lineType:"curve",lineWidth:"3px",lineColor:"rgb(113, 203, 45)"}},normalTopic:{contentStyle:{border:"1px solid #e8eaec",borderRadius:"20px",fontSize:"17px",padding:"4px 10px"},subLinkStyle:{lineType:"curve",lineWidth:"3px",lineColor:"white"}}},ve={readOnly:!1,allowUndo:!0,layoutDir:j.LEFT_AND_RIGHT,theme:be},xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),Object.defineProperty(t.prototype,"layoutDir",{get:function(){return this.get("layoutDir")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this.get("readOnly")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowUndo",{get:function(){return this.get("allowUndo")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"theme",{get:function(){return this.get("theme")},enumerable:!0,configurable:!0}),t.fromJSON=function(e){return new t(e)},t}(Object(x.Record)(ve)),Te={topics:Object(x.Map)(),extData:Object(x.Map)(),config:null,rootTopicKey:null,editorRootTopicKey:null,focusKey:null,focusMode:null,formatVersion:null,zoomFactor:1},we=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.isModel=function(e){return e instanceof t},t.create=function(e){if(void 0===e&&(e=null),null==e)return t.createEmpty();var n;if(t.isModel(e)&&(n=e),Object(T.a)(e)&&(n=t.fromJSON(e)),n)return null==n.focusKey&&(n=n.set("focusKey",n.rootTopicKey)),null==n.focusMode&&(n=n.set("focusMode",A)),n;throw new Error("`Value.create` only accepts objects or values, but you passed it: "+e)},t.createEmpty=function(){var e=new t,n=ue.create({key:se()});return e.update("topics",(function(e){return e.set(n.key,n)})).set("rootTopicKey",n.key).set("focusKey",n.key).set("focusMode",A)},t.fromJSON=function(e){var n=new t,o=e.topics,r=void 0===o?[]:o,i=e.config,a=void 0===i?{}:i,l=e.rootTopicKey,c=e.editorRootTopicKey;return void 0===c&&(c=l),n=(n=n.merge({rootTopicKey:l,editorRootTopicKey:c})).withMutations((function(e){r.forEach((function(t){e.update("topics",(function(e){return e.set(t.key,ue.fromJSON(t))}))})),e.set("config",xe.fromJSON(a))}))},t.prototype.toJS=function(){return{rootTopicKey:this.rootTopicKey,topics:Object.values(this.topics.toJS()),config:this.config,extData:this.extData,zoomFactor:this.zoomFactor}},Object.defineProperty(t.prototype,"extData",{get:function(){return this.get("extData")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topics",{get:function(){return this.get("topics")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"config",{get:function(){return this.get("config")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formatVersion",{get:function(){return this.get("formatVersion")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rootTopicKey",{get:function(){return this.get("rootTopicKey")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"editorRootTopicKey",{get:function(){return this.get("editorRootTopicKey")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focusKey",{get:function(){return this.get("focusKey")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focusMode",{get:function(){return this.get("focusMode")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"editingContentKey",{get:function(){return this.focusMode===L?this.focusKey:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"editingDescKey",{get:function(){return this.focusMode===z?this.focusKey:null},enumerable:!0,configurable:!0}),t.prototype.getTopic=function(e){return this.topics.get(e)},t.prototype.getExtDataItem=function(e,t){return this.extData.get(e)||new t},t.prototype.getParentTopic=function(e){var t=this.getTopic(e);return t.parentKey?this.getTopic(t.parentKey):null},t.prototype.getTopicVisualLevel=function(e){for(var t=this.getTopic(e),n=0;t&&t.key!==this.editorRootTopicKey;)n++,t=this.getParentTopic(t.key);return n},Object.defineProperty(t.prototype,"rootTopic",{get:function(){return this.getTopic(this.rootTopicKey)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"zoomFactor",{get:function(){return this.get("zoomFactor")},enumerable:!0,configurable:!0}),t}(Object(x.Record)(Te)),Oe=(n(346),n(347),n(32));n(268),n(107);!function(e){e[e.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",e[e.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",e[e.LEFT_AND_RIGHT=2]="LEFT_AND_RIGHT",e[e.TOP_TO_BOTTOM=3]="TOP_TO_BOTTOM"}(ge||(ge={}));var ke="CONTENT",Ee="DESC",Ce="NORMAL",Se="EDITING_CONTENT",je="EDITING_DESC",Ke="SET_TOPIC_BLOCK",Re=function(e){Object(s.a)(n,e);var t=Object(p.a)(n);function n(){return Object(l.a)(this,n),t.apply(this,arguments)}return Object(c.a)(n,[{key:"data",get:function(){return this.get("data")}},{key:"type",get:function(){return this.get("type")}}],[{key:"create",value:function(e){return new n(e)}},{key:"createList",value:function(e){if(x.List.isList(e)||Array.isArray(e))return Object(x.List)(e.map(n.create));throw new Error("Block.createList only accepts Array or List, but you passed it: ".concat(e))}}]),n}(Object(x.Record)({type:null,key:null,data:null}));var De={readOnly:!1,allowUndo:!0,layoutDir:ge.LEFT_AND_RIGHT,theme:{name:"default",randomColor:!0,background:"rgb(57,60,65)",highlightColor:"#50C9CE",marginH:60,marginV:20,contentStyle:{lineHeight:"1.5"},linkStyle:{lineRadius:5,lineType:"curve",lineWidth:"3px"},rootTopic:{contentStyle:{fontSize:"34px",borderRadius:"35px",padding:"16px 18px 16px 18px"},subLinkStyle:{lineType:"curve",lineWidth:"3px",lineColor:"rgb(113, 203, 45)"}},primaryTopic:{contentStyle:{borderWidth:"1px",borderStyle:"solid",borderRadius:"20px",fontSize:"17px",padding:"10px 15px 10px 15px"},subLinkStyle:{lineType:"curve",lineWidth:"3px",lineColor:"rgb(113, 203, 45)"}},normalTopic:{contentStyle:{border:"1px solid #e8eaec",borderRadius:"20px",fontSize:"17px",padding:"4px 10px"},subLinkStyle:{lineType:"curve",lineWidth:"3px",lineColor:"white"}}}},_e=function(e){Object(s.a)(n,e);var t=Object(p.a)(n);function n(){return Object(l.a)(this,n),t.apply(this,arguments)}return Object(c.a)(n,[{key:"layoutDir",get:function(){return this.get("layoutDir")}},{key:"readOnly",get:function(){return this.get("readOnly")}},{key:"allowUndo",get:function(){return this.get("allowUndo")}},{key:"theme",get:function(){return this.get("theme")}}],[{key:"fromJSON",value:function(e){return new n(e)}}]),n}(Object(x.Record)(De));function Ne(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}var Pe=function(e){Object(s.a)(n,e);var t=Object(p.a)(n);function n(){return Object(l.a)(this,n),t.apply(this,arguments)}return Object(c.a)(n,[{key:"key",get:function(){return this.get("key")}},{key:"parentKey",get:function(){return this.get("parentKey")}},{key:"collapse",get:function(){return this.get("collapse")}},{key:"subKeys",get:function(){return this.get("subKeys")}},{key:"blocks",get:function(){return this.get("blocks")}},{key:"relations",get:function(){return this.get("relations")}},{key:"style",get:function(){return this.get("style")}},{key:"getBlock",value:function(e){var t=this.blocks.findIndex((function(t){return t.type===e}));return-1===t?{index:t,block:null}:{index:t,block:this.blocks.get(t)}}}],[{key:"fromJSON",value:function(e){var t=e.key,o=e.parentKey,r=void 0===o?null:o,i=e.blocks,a=e.subKeys,l=void 0===a?[]:a,c=e.collapse;return new n({key:t,parentKey:r,collapse:void 0!==c&&c,subKeys:Object(x.List)(l),blocks:Re.createList(i)})}},{key:"create",value:function(e){var t=e.key,o=e.parentKey,r=void 0===o?null:o,i=e.content,a=void 0===i?"":i,l=e.subKeys,c=void 0===l?[]:l,s=e.collapse,p=void 0!==s&&s,u=Re.create({type:ke,data:a,key:null});return new n({key:t,parentKey:r,blocks:Object(x.List)([u]),subKeys:Object(x.List)(c),collapse:p})}}]),n}(Object(x.Record)({key:null,parentKey:null,collapse:!1,subKeys:null,blocks:null,relations:null,style:null}));h()("modifier");var Ie={topics:Object(x.Map)(),extData:Object(x.Map)(),config:new _e,rootTopicKey:null,editorRootTopicKey:null,focusKey:null,focusMode:null,formatVersion:null,zoomFactor:1};Object(x.Record)(Ie);h()("core:controller");var Me=n(68),Ae=n(31),Le=function(e,t){return(Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function ze(e,t){function n(){this.constructor=e}Le(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Fe=function(){return(Fe=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};var He,Be,Ve,We=h()("node:text-editor"),Ge=d.default.div(Ve||(He=["\n  padding: 6px;\n  background-color: ",";\n  cursor: ",";\n  min-width: 50px;\n"],Be=["\n  padding: 6px;\n  background-color: ",";\n  cursor: ",";\n  min-width: 50px;\n"],Object.defineProperty?Object.defineProperty(He,"raw",{value:Be}):He.raw=Be,Ve=He),(function(e){return e.readOnly?null:"white"}),(function(e){return e.readOnly?"pointer":"text"})),Ue=function(e){function t(t){var n=e.call(this,t)||this;return n.state={content:null},n.onMouseDown=function(e){e.stopPropagation()},n.onMouseMove=function(e){},n.onKeyDown=function(e){},n._handleClick=function(e){!n.root.contains(e.target)&&n.onClickOutSide(e)},n.rootRef=function(e){return function(t){e(t),n.root=t}},n.initState(),n}return ze(t,e),t.prototype.onChange=function(e){var t=e.value;We("onChange",t),this.setState({content:t})},t.prototype.componentDidMount=function(){this.props.readOnly||document.addEventListener("click",this._handleClick)},t.prototype.componentWillUnmount=function(){this.props.readOnly||document.removeEventListener("click",this._handleClick)},t.prototype.onClickOutSide=function(e){},t.prototype.getCustomizeProps=function(){return null},t.prototype.getContent=function(){var e=this.getCustomizeProps().block.data;return null==e?null:("string"===typeof e&&(e=Me.a.deserialize(e)),e)},t.prototype.initState=function(){var e=this.getContent();this.state={content:e}},t.prototype.render=function(){var e=this.props,t=e.topicKey,n=e.saveRef,r=this.getCustomizeProps(),i=r.readOnly,a=r.getRefKeyFunc,l=r.placeholder,c=r.style;We(i);var s=a(t),p=i?this.getContent():this.state.content,u=this.onMouseDown,d=this.onMouseMove,f=this.onKeyDown,h={value:p,readOnly:i,onChange:this.onChange.bind(this),placeholder:l,style:c},m={key:s,readOnly:i,ref:this.rootRef(n(s)),onMouseDown:u,onMouseMove:d,onKeyDown:f};return Object(o.createElement)(Ge,Fe({},m),Object(o.createElement)(Ae.Editor,Fe({},h,{autoFocus:!0})))},t}(o.PureComponent),qe=h()("node:topic-content-editor");function Ye(e){return"content-editor-"+e}var Ze=function(e){function t(t){var n=e.call(this,t)||this;return n.onKeyDown=function(e){e.nativeEvent.ctrlKey&&"Enter"===e.nativeEvent.code&&n.save()},n}return ze(t,e),t.prototype.getCustomizeProps=function(){var e=this.props,t=e.model,n=e.topicKey,o=e.readOnly;return{block:t.getTopic(n).getBlock(ke).block,readOnly:o,getRefKeyFunc:Ye,placeholder:"new",style:{whiteSpace:"pre"}}},t.prototype.onClickOutSide=function(e){qe("onClickOutSide"),this.save()},t.prototype.save=function(){var e=this.props,t=e.model,n=e.topicKey;t.editingContentKey!==n||this.props.controller.run("operation",Fe(Fe({},this.props),{opType:Ke,blockType:ke,data:this.state.content,focusMode:Ce}))},t}(Ue),Je=h()("node:topic-desc-editor");function Xe(e){return"desc-editor-"+e}var Qe=function(e){function t(t){var n=e.call(this,t)||this;return Je("constructor"),n}return ze(t,e),t.prototype.initState=function(){e.prototype.initState.call(this);var t=this.props,n=t.controller,o="topic-desc-data-"+t.topicKey,r=this.state.content;n.run("setTempValue",{key:o,value:r})},t.prototype.getCustomizeProps=function(){var e=this.props,t=e.model,n=e.topicKey;return{block:t.getTopic(n).getBlock(Ee).block,readOnly:t.editingDescKey!==n,getRefKeyFunc:Xe,placeholder:"write topic notes here"}},t.prototype.onChange=function(e){var t=e.value;Je("onChange");var n=this.props,o=n.controller,r=n.topicKey;if(!(n.model.editingDescKey!==r)){var i="topic-desc-data-"+r;o.run("setTempValue",{key:i,value:t}),this.setState({content:t})}},t}(Ue);var $e=function(){return{getTopicTitle:function(e){var t=e.model,n=e.controller,o=e.topicKey,r=e.maxLength,i=t.getTopic(o).getBlock(ke).block,a=n.run("serializeBlockData",Fe(Fe({},e),{block:i}));return null!=r&&(a=a.length>r?a.substr(0,r)+"...":a),a},renderTopicContentEditor:function(e){return Object(o.createElement)(Ze,Fe({},e))},renderTopicDescEditor:function(e){return Object(o.createElement)(Qe,Fe({},e))},isBlockEmpty:function(e,t){var n=e.block,o=e.controller;return n.type===ke||n.type===Ee?null==n.data||""===o.run("serializeBlockData",e):t()},serializeBlockData:function(e,t){var n=e.block;return n.type===ke||n.type===Ee?"string"===typeof n.data?n.data:Me.a.serialize(n.data):t()}}},et=n(9),tt=n.n(et),nt=n(875),ot=n(292),rt=n(40),it=function(e,t){return(it=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function at(e,t){function n(){this.constructor=e}it(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var lt=function(){return(lt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function ct(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function st(e,t,n,o){var r,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function pt(e){var t="function"===typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function ut(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function dt(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ut(arguments[t]));return e}function ft(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var ht,mt,yt,gt,bt,vt,xt,Tt,wt,Ot,kt,Et,Ct,St=function(e){function t(t){return e.call(this,t)||this}return at(t,e),t.prototype.operation=function(e,t){this.props.controller.run("operation",lt({opType:e},t))},t.prototype.run=function(e,t){this.props.controller.run(e,t)},Object.defineProperty(t.prototype,"topic",{get:function(){return this.props.model.getTopic(this.props.topicKey)},enumerable:!0,configurable:!0}),t}(o.PureComponent),jt=h()("node:drag-scroll-widget"),Kt=d.default.div(ht||(ht=ft(["\n  position: relative;\n  width: 100%;\n  height: 100%;\n  overflow: scroll;\n"],["\n  position: relative;\n  width: 100%;\n  height: 100%;\n  overflow: scroll;\n"]))),Rt=d.default.div(mt||(mt=ft(["\n  position: relative;\n  width: max-content;\n"],["\n  position: relative;\n  width: max-content;\n"]))),Dt=function(e){function t(t){var n=e.call(this,t)||this;return n.contentResizeCallback=function(e,t){if(n.oldContentRect){var o={width:n.content.clientWidth+2*n.viewBox.clientWidth,height:n.content.clientHeight+2*n.viewBox.clientHeight};n.bigView.style.width=o.width+"px",n.bigView.style.height=o.height+"px"}n.oldContentRect=e[0].contentRect},n.contentResizeObserver=new u.a(n.contentResizeCallback),n.contentRef=function(e){e&&(n.content=e,n.contentResizeObserver.observe(n.content))},n.viewBoxRef=function(e){e&&(n.viewBox=e,n.props.enableMouseWheel||(jt("addEventListener onwheel"),n.viewBox.addEventListener("wheel",(function(e){jt("onwheel"),(e.ctrlKey||e.altKey)&&e.preventDefault()}),{passive:!1})),n.setViewBoxScroll(n.viewBox.clientWidth,n.viewBox.clientHeight))},n.bigViewRef=function(e){e&&(n.bigView=e)},n.setWidgetStyle=function(){n.content&&n.viewBox&&n.bigView&&(n.bigView.style.width=2*(n.content.clientWidth+n.viewBox.clientWidth)+"px",n.bigView.style.height=2*(n.content.clientHeight+n.viewBox.clientHeight)+"px",n.content.style.left=n.viewBox.clientWidth+"px",n.content.style.top=n.viewBox.clientHeight+"px")},n.setViewBoxScroll=function(e,t){jt("setViewBoxScroll "+e+" "+t),n.viewBox&&(n.viewBox.scrollLeft=e,n.viewBox.scrollTop=t)},n.setViewBoxScrollDelta=function(e,t){jt("setViewBoxScrollDelta "+e+" "+t),n.viewBox&&(n.viewBox.scrollLeft+=e,n.viewBox.scrollTop+=t)},n.onMouseDown=function(e){var t=n.props,o=t.mouseKey,r=t.needKeyPressed,i=t.canDragFunc;if((!i||i())&&(0===e.button&&"left"===o||2===e.button&&"right"===o)){if(r&&!e.ctrlKey)return;n._lastCoordX=n.viewBox.scrollLeft+e.nativeEvent.clientX,n._lastCoordY=n.viewBox.scrollTop+e.nativeEvent.clientY;var a=n.viewBox;a.addEventListener("mousemove",n.onMouseMove),a.addEventListener("mouseup",n.onMouseUp)}},n.onMouseUp=function(e){var t=n.viewBox;t.removeEventListener("mousemove",n.onMouseMove),t.removeEventListener("mouseup",n.onMouseUp)},n.onMouseMove=function(e){n.viewBox.scrollLeft=n._lastCoordX-e.clientX,n.viewBox.scrollTop=n._lastCoordY-e.clientY},n.handleContextMenu=function(e){e.preventDefault()},n.state={widgetStyle:{width:"10000px",height:"10000px"}},n}return at(t,e),t.prototype.componentDidMount=function(){this.setWidgetStyle(),document.addEventListener("contextmenu",this.handleContextMenu)},t.prototype.componentWillUnmount=function(){document.removeEventListener("contextmenu",this.handleContextMenu)},t.prototype.setZoomFactor=function(e){this.bigView.style.transform="scale("+e+")",this.bigView.style.transformOrigin="50% 50%"},t.prototype.render=function(){var e=lt({},this.state.widgetStyle);return Object(o.createElement)(Kt,{ref:this.viewBoxRef,onMouseDown:this.onMouseDown},Object(o.createElement)("div",{style:e,ref:this.bigViewRef},Object(o.createElement)(Rt,{ref:this.contentRef,style:this.state.contentStyle},this.props.children(this.setViewBoxScroll,this.setViewBoxScrollDelta))))},t.defaultProps={mouseKey:"left",needKeyPressed:!1},t}(o.Component),_t=h()("node:save-ref"),Nt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.getRef=function(e){return _t(t),t[e]},t.saveRef=function(e){return function(n){n&&(t[e]=n,t.fireListener(e,n))}},t.deleteRef=function(e){_t("deleteRef:",e),delete t[e]},t.observers=new Map,t.fireListener=function(e,n){var o,r;if(t.observers.has(e)){var i=t.observers.get(e);try{for(var a=pt(i),l=a.next();!l.done;l=a.next()){(0,l.value)(e,n)}}catch(c){o={error:c}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}}},t.registerRefListener=function(e,n){t.observers.has(e)?t.observers.get(e).push(n):t.observers.set(e,[n])},t}return at(t,e),t.prototype.render=function(){return this.props.children(this.saveRef,this.getRef,this.deleteRef,this.registerRefListener.bind(this))},t}(o.Component),Pt=d.default.div(yt||(yt=ft(["\n  display: flex;\n  flex-direction: ",";\n  align-items: ",";\n  justify-content: ",";\n"],["\n  display: flex;\n  flex-direction: ",";\n  align-items: ",";\n  justify-content: ",";\n"])),(function(e){return e.flexDirection?e.flexDirection:"row"}),(function(e){return e.alignItems}),(function(e){return e.justifyContent})),It=d.default.div(gt||(gt=ft(["\n  margin: ",";\n"],["\n  margin: ",";\n"])),(function(e){return e.margin})),Mt=d.default.a(bt||(bt=ft(["\n  font-size: 20px !important;\n"],["\n  font-size: 20px !important;\n"]))),At=d.default.div(vt||(vt=ft(["\n  padding: 5px;\n  cursor: pointer;\n"],["\n  padding: 5px;\n  cursor: pointer;\n"]))),Lt=d.default.div(xt||(xt=ft(["\n  cursor: pointer;\n  &:hover {\n    color: #1ea7fd;\n  }\n"],["\n  cursor: pointer;\n  &:hover {\n    color: #1ea7fd;\n  }\n"]))),zt=Object(d.default)(m.e)(Tt||(Tt=ft(["\n  margin-bottom: 0px !important;\n"],["\n  margin-bottom: 0px !important;\n"]))),Ft=Object(d.default)(Lt)(wt||(wt=ft(["\n  position: absolute;\n  right: 5px;\n  top: 5px;\n  //padding: 5px;\n"],["\n  position: absolute;\n  right: 5px;\n  top: 5px;\n  //padding: 5px;\n"]))),Ht=d.default.div(Ot||(Ot=ft(["\n  height: 16px;\n"],["\n  height: 16px;\n"]))),Bt=d.default.span(kt||(kt=ft(["\n  margin: 0px 10px;\n  &:hover {\n    color: palevioletred;\n  }\n"],["\n  margin: 0px 10px;\n  &:hover {\n    color: palevioletred;\n  }\n"]))),Vt=d.default.div(Et||(Et=ft(["\n  z-index: ",";\n"],["\n  z-index: ",";\n"])),(function(e){return e.zIndex})),Wt=d.default.div(Ct||(Ct=ft(["\n  min-width: 360px;\n  max-height: 470px;\n  overflow: auto;\n"],["\n  min-width: 360px;\n  max-height: 470px;\n  overflow: auto;\n"]))),Gt=h()("plugin:event");function Ut(){var e={};return{handleTopicClick:function(e){Gt("handleTopicClick");var t=e.controller,n=e.model,o=e.topicKey;Gt(n.zoomFactor),null===n.editingDescKey&&n.editingContentKey!==o&&(n.focusKey===o&&n.focusMode===L||t.run("operation",lt(lt({},e),{opType:$,focusMode:A})))},handleTopicDoubleClick:function(e){var t=e.controller;null===e.model.editingDescKey&&t.run("operation",lt(lt({},e),{opType:$,focusMode:L}))},handleTopicContextMenu:function(e){e.controller.run("operation",lt(lt({},e),{opType:$,focusMode:F}))},handleActiveModalClose:function(e){var t=e.controller,n=t.run("getActiveModalProps",e);return null==n?null:"edit-desc"===n.name?function(){t.run("operation",lt(lt({},e),{focusMode:A,opType:$}))}:void 0},addEventListener:function(t){var n=t.key,o=t.listener,r=t.once,i=t.controller;function a(){o(),i.run("removeEventListener",{key:n,listener:o})}e[n]||(e[n]=[]),r?(a.origin=o,e[n].push(a)):e[n].push(o)},removeEventListener:function(t){var n=t.key,o=t.listener;e[n]&&(e[n]=e[n].filter((function(e){return e!==o&&e.origin!==o})))},fireEvent:function(t){var n=t.key;e[n]&&e[n].forEach((function(e){return e()}))}}}var qt="show-menu",Yt="close",Zt="color-picker",Jt="notes",Xt="plus",Qt="minus",$t="collapse",en="expand",tn="center",nn="trash",on="search";function rn(e){return"icon iconfont bm-"+e}function an(e){return Object(o.createElement)("span",{className:rn(e)})}function ln(e){return"content-"+e}function cn(e){return"content-editor-"+e}function sn(e){return"desc-editor-"+e}function pn(e){return"topic-widget-"+e}function un(e){return"topic-"+e}function dn(e){return"links-"+e}function fn(e){return"links-svg-"+e}function hn(e){return"collapse-"+e}function mn(e,t){return"dropArea-"+t+"-"+e}var yn="DIAGRAM-ROOT",gn="DragScrollWidget",bn="svg-highlight",vn="focus-highlight",xn="drop-effect",Tn="CENTER_ROOT_TOPIC",wn="DIAGRAM_CUSTOMIZE_BASE_Z_INDEX",On="TOPIC_CONTEXT_MENU_ENABLED",kn="TOPIC_TITLE",En=function(e){e.stopPropagation()};function Cn(e,t){!function(e,t){var n=document.createElement("a");n.href=e,n.download=t,n.click()}("data:text/plain,"+encodeURIComponent(e),t)}function Sn(e){var t=document.createElement("input");return t.type="file",t.accept=e,new Promise((function(e,n){t.addEventListener("change",(function(t){var o=t.target.files[0],r=new FileReader;r.onload=function(t){var n=t.target.result;e(n)},r.onerror=function(e){n(e.target.error)},r.readAsText(o)})),t.click()}))}function jn(e){var t=e.top,n=void 0===t?0:t,o=e.right,r=void 0===o?0:o,i=e.bottom,a=void 0===i?0:i,l=e.left;return n+"px "+r+"px "+a+"px "+(void 0===l?0:l)+"px"}function Kn(e){return(e.top+e.bottom)/2}function Rn(e,t){return(e.x+t.x)/2}function Dn(e,t){return(e.y+t.y)/2}function _n(e){return[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Nn(e,t,n){void 0===n&&(n=1);var o=e.getBoundingClientRect(),r=_n(t.getBoundingClientRect()),i=_n(o);i[0]=(i[0]-r[0])/n,i[1]=(i[1]-r[1])/n;var a=o.width/n,l=o.height/n;return{left:i[0]-a/2,right:i[0]+a/2,top:i[1]-l/2,bottom:i[1]+l/2,width:a,height:l}}function Pn(e,t){var n=e.getBoundingClientRect(),o=_n(t.getBoundingClientRect()),r=_n(n);return[r[0]-o[0],r[1]-o[1]]}var In="ADD_CHILD",Mn="ADD_SIBLING",An="DELETE_TOPIC",Ln="EDIT_CONTENT",zn="EDIT_NOTES",Fn="SET_EDITOR_ROOT";function Hn(){return{customizeHotKeys:function(e){var t=function(t){return function(n){!function(e,t){var n=t.topicKey,o=t.model,r=t.controller;void 0===n&&(t=lt(lt({},t),{topicKey:o.focusKey})),r.run("operation",lt(lt({},t),{opType:e}))}(t,e)}};return{topicHotKeys:new Map([[In,{label:"add child",combo:"tab",onKeyDown:t(J)}],[Mn,{label:"add sibling",combo:"enter",onKeyDown:t(X)}],[An,{label:"delete topic",combo:"del",onKeyDown:t(Q)}],[Ln,{label:"edit content",combo:"space",onKeyDown:t(ie)}],[zn,{label:"edit notes",combo:"alt + d",onKeyDown:t(ae)}],[Fn,{label:"set editor root",combo:"alt + shift + f",onKeyDown:t(ce)}]]),globalHotKeys:new Map}}}}var Bn=h()("plugin:operation");function Vn(){var e=new Map([[U,ye.toggleCollapse],[q,ye.collapseAll],[Y,ye.expandAll],[Z,ye.expandTo],[J,ye.addChild],[X,ye.addSibling],[Q,ye.deleteTopic],[$,ye.focusTopic],[ee,ye.setFocusMode],[te,ye.setStyle],[ne,ye.setTheme],[oe,ye.setBlockData],[re,ye.deleteBlock],[ie,function(e){var t=e.model,n=e.topicKey;return ye.focusTopic({model:t,topicKey:n,focusMode:L})}],[ae,function(e){var t=e.model,n=e.topicKey,o=t.getTopic(n).getBlock(M);return null!=o.block&&null!=o.block.data||(t=ye.setBlockData({model:t,topicKey:n,blockType:M,data:""})),t=ye.focusTopic({model:t,topicKey:n,focusMode:z})}],[le,function(e){var t=e.srcKey,n=e.dstKey,o=e.dropDir,r=e.model,i=r.getTopic(t),a=r.getTopic(n),l=i.parentKey,c=r.getTopic(l).subKeys,s=c.indexOf(t);if(c=c.delete(s),"in"===o){var p=a.subKeys;p=p.push(t),r=r.withMutations((function(e){e.setIn(["topics",l,"subKeys"],c).setIn(["topics",t,"parentKey"],n).setIn(["topics",n,"subKeys"],p).setIn(["topics",n,"collapse"],!1)}))}else{var u=a.parentKey,d=r.getTopic(u).subKeys,f=d.indexOf(n);if(l===u){var h=Object(x.List)();d.forEach((function(e){e!==t&&(h=e===n?"prev"===o?h.push(t).push(e):h.push(e).push(t):h.push(e))})),r=r.withMutations((function(e){e.setIn(["topics",u,"subKeys"],h)}))}else"prev"===o?d=d.insert(f,t):"next"===o&&(d=d.insert(f+1,t)),r=r.withMutations((function(e){e.setIn(["topics",l,"subKeys"],c).setIn(["topics",t,"parentKey"],u).setIn(["topics",u,"subKeys"],d).setIn(["topics",u,"collapse"],!1)}))}return r}],[ce,ye.setEditorRootTopicKey]]),t=Object(x.Stack)(),n=Object(x.Stack)(),o=!0,r=new Set;return{isOperationEnabled:function(e){return o},enableOperation:function(){o=!0},disableOperation:function(e){var t=e.whiteList;o=!1,t?r=new Set(t):r.clear()},getOpMap:function(t){return e},getAllowUndo:function(e){var t=e.model,n=e.opType;if(n)switch(n){case $:case ie:case ae:return!1}switch(t.focusMode){case"EDITING_DESC":case"EDITING_CONTENT":return!1}return t.config.allowUndo},getUndoRedoStack:function(){return{undoStack:t,redoStack:n}},setUndoStack:function(e){Bn("setUndoStack",e.undoStack),t=e.undoStack},setRedoStack:function(e){Bn("setRedoStack",e.redoStack),n=e.redoStack},canUndo:function(e){var t=e.controller,n=t.run("getUndoRedoStack",e).undoStack,o=t.run("getAllowUndo",e);return n.size>0&&o},canRedo:function(e){var t=e.controller,n=t.run("getUndoRedoStack",e).redoStack,o=t.run("getAllowUndo",e);return n.size>0&&o},undo:function(e){var t=e.controller,n=e.model;if(t.run("getAllowUndo",e)){var o=t.run("getUndoRedoStack",e),r=o.undoStack,i=o.redoStack,a=r.peek();a&&(t.run("setUndoStack",lt(lt({},e),{undoStack:r.shift()})),t.run("setRedoStack",lt(lt({},e),{redoStack:i.push(n)})),Bn(a),t.change(a))}},redo:function(e){var t=e.controller,n=e.model;if(t.run("getAllowUndo",e)){var o=t.run("getUndoRedoStack",e),r=o.undoStack,i=o.redoStack,a=i.peek();a&&(t.run("setUndoStack",lt(lt({},e),{undoStack:r.push(n)})),t.run("setRedoStack",lt(lt({},e),{redoStack:i.shift()})),t.change(a))}},operation:function(e){var t=e.controller,n=e.opType,o=e.model,i=e.opArray,a=e.callback;if(null!=i&&!Array.isArray(i))throw new Error("operation: the type of opArray must be array!");if(null!=n&&null!=i)throw new Error("operation: opType and opArray conflict!");if(!t.run("isOperationEnabled",e)){if(0===r.size)return;if(null!=i){var l=i.filter((function(e){return!r.has(e.opType)}));if(l&&l.length>0)return}else if(!r.has(n))return}Bn("operation:",n),Bn("operation:",o),Bn("operation:",e);var c,s=t.run("getOpMap",e);if(t.run("beforeOperation",e),t.run("getAllowUndo",e)){var p=t.run("getUndoRedoStack",e).undoStack;t.run("setUndoStack",lt(lt({},e),{undoStack:p.push(o)}))}if(null!=i)c=i.reduce((function(e,n){var o=n.opType;if(!s.has(o))throw new Error("opType:"+o+" not exist!");var r=s.get(o),i=lt(lt({controller:t},n),{model:e}),a=t.run("beforeOpFunction",i);return a=r(lt(lt({},i),{model:a})),a=t.run("afterOpFunction",lt(lt({},i),{model:a}))}),o);else{if(!s.has(n))throw new Error("opType:"+n+" not exist!");var u=s.get(n);c=t.run("beforeOpFunction",e),c=u(lt(lt({},e),{model:c})),c=t.run("afterOpFunction",lt(lt({},e),{model:c}))}Bn("newModel:",c),t.change(c,a),t.run("afterOperation",e)},deleteRefKey:function(e){var t,n,o=e.model,r=e.topicKey,i=e.deleteRef,a=de(o,r);a.push(r);try{for(var l=pt(a),c=l.next();!c.done;c=l.next()){var s=c.value;i(dn(s)),i(fn(s)),i(ln(s)),i(cn(s)),i(sn(s)),i(pn(s)),i(un(s)),i(hn(s)),i(mn(s,"next")),i(mn(s,"prev"))}}catch(p){t={error:p}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}},beforeOperation:function(e){},afterOperation:function(e){},beforeOpFunction:function(e){var t=e.controller,n=e.opType,o=e.model,r=e.topicKey;return n===Q&&r!==o.editorRootTopicKey&&t.run("deleteRefKey",e),o},afterOpFunction:function(e){return e.model}}}var Wn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return at(t,e),t.prototype.render=function(){var e=this.props.controller;return Object(o.createElement)(m.n,null,e.run("customizeTopicContextMenu",this.props))},t}(St),Gn=[{icon:"edit",label:"edit",shortcut:"Space",rootCanUse:!0,opType:ie},{icon:"add-sibling",label:"add sibling",shortcut:"Enter",opType:X},{icon:"add-child",label:"add child",shortcut:"Tab",rootCanUse:!0,opType:J},{icon:"notes",label:"edit notes",shortcut:"Alt + D",rootCanUse:!0,opType:ae},{icon:"delete-node",label:"delete node",shortcut:"Del",opType:Q},{icon:"root",label:"set as editor root",shortcut:"Alt + Shift + F",opType:ce}];var Un,qn,Yn=h()("node:topic-drop-effect"),Zn=d.default.svg(Un||(Un=ft(["\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 2;\n  pointer-events: none;\n"],["\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 2;\n  pointer-events: none;\n"]))),Jn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={content:null},t}return at(t,e),t.prototype.layout=function(){var e=this.props,t=this.props,n=t.getRef,r=t.model,i=t.zoomFactor,a=t.controller.run("getDragTargetProps",e),l=a.key,c=a.dropDir;if(Yn("layout",c),null!==l){var s=n("in"===c?ln(l):mn(l,c)),p=n("svg-drop-effect"),u=n(gn).bigView,d=Nn(s,u,i),f=Nn(p,u,i),h=d.left-f.left-3,m=d.top-f.top-3,y=d.width+6,g=d.height+6;this.setState({content:Object(o.createElement)("g",null,Object(o.createElement)("rect",{x:h,y:m,width:y,height:g,fill:"none",stroke:r.config.theme.highlightColor,strokeDasharray:"5,5",strokeWidth:2}))})}else this.setState({content:null})},t.prototype.render=function(){var e=this.props.saveRef;return Object(o.createElement)(Zn,{ref:e("svg-drop-effect")},this.state.content)},t}(St),Xn=h()("plugin:drag-and-drop"),Qn=d.default.div(qn||(qn=ft(["\n  height: ",";\n  width: 100%;\n  margin: 5px 0px;\n"],["\n  height: ",";\n  width: 100%;\n  margin: 5px 0px;\n"])),(function(e){return e.height+"px"}));function $n(){var e=null,t=null;return{renderTopicDropArea:function(e){var t=e.topicKey,n=e.dropDir,r=e.saveRef,i=e.controller,a=e.model,l={onDragEnter:function(o){Xn("onDragEnter",t,n),i.run("handleTopicDragEnter",lt(lt({},e),{ev:o,dropDir:n}))},onDragLeave:function(o){Xn("onDragLeave",t,n),i.run("handleTopicDragLeave",lt(lt({},e),{ev:o,dropDir:n}))},onDragOver:function(e){e.preventDefault()},onDrop:function(o){Xn("onDrop",t,n),i.run("handleTopicDrop",lt(lt({},e),{ev:o,dropDir:n}))}};return Object(o.createElement)(Qn,lt({height:a.config.theme.marginV/2,ref:r(mn(t,n))},l))},renderDragAndDropEffect:function(e){Xn("renderDragAndDropEffect");var t=e.saveRef;return Object(o.createElement)(Jn,lt({ref:t(xn)},e))},getDragTargetProps:function(n){return{key:e,dropDir:t}},handleTopicDragStart:function(e){var t=e.controller;e.ev.stopPropagation(),t.run("operation",lt(lt({},e),{opType:$,focusMode:H}))},canDrop:function(e){var t=e.srcKey,n=e.dstKey,o=e.model,r=e.dropDir;return t!==o.editorRootTopicKey&&t!==n&&fe(o,t,n)!==B&&((n!==o.editorRootTopicKey||"in"===r)&&(o.getTopic(t).parentKey!==n||"in"!==r))},handleTopicDragEnter:function(n){var o=n.dropDir,r=n.topicKey,i=n.controller,a=n.model;Xn("handleTopicDragEnter:",r,o),i.run("canDrop",lt(lt({},n),{srcKey:a.focusKey,dstKey:r}))&&(e=r,t=o,i.change(a))},handleTopicDragLeave:function(n){var o=n.controller,r=n.model,i=n.topicKey,a=n.dropDir,l=n.getRef,c=n.ev.nativeEvent.relatedTarget;Xn("handleTopicDragLeave:",i,a);var s=l(ln(i));s==c||s.contains(c)||(e=null,t=null,o.change(r))},handleTopicDrop:function(n){Xn("handleTopicDrop");var o=n.controller,r=n.topicKey,i=n.model;n=lt(lt({},n),{srcKey:i.focusKey,dstKey:r}),e=null,t=null,o.run("canDrop",n)&&o.run("operation",lt(lt({},n),{opType:le}))}}}var eo,to,no,oo,ro,io,ao,lo,co,so,po,uo=Object(d.default)(Vt)(eo||(eo=ft(["\n  position: absolute;\n  width: 20%;\n  padding: 0 5px;\n  background: white;\n  left: 30px;\n  top: 20px;\n  border-radius: 2px;\n"],["\n  position: absolute;\n  width: 20%;\n  padding: 0 5px;\n  background: white;\n  left: 30px;\n  top: 20px;\n  border-radius: 2px;\n"]))),fo=d.default.div(to||(to=ft(["\n  max-width: 600px;\n"],["\n  max-width: 600px;\n"]))),ho=d.default.span(no||(no=ft([""],[""]))),mo=function(e){function t(t){var n=e.call(this,t)||this;return n.setEditorRootTopicKey=function(e){return function(){var t=n.props,o=t.model,r=t.controller;o.editorRootTopicKey!==e&&r.change(ye.setEditorRootTopicKey({model:o,topicKey:e}))}},n.breadcrumbRenderer=function(e){var t=e.text,n=ct(e,["text"]),r=t.length>8,i=r?t.substr(0,8)+"...":t,a={content:Object(o.createElement)(fo,null,t),position:m.u.BOTTOM_RIGHT},l=Object(o.createElement)(m.b,lt({},n),Object(o.createElement)(ho,null,i));return r?Object(o.createElement)(m.x,lt({},a),l):l},n.state={show:!1},n}return at(t,e),t.prototype.render=function(){var e=this.props,t=e.model,n=e.controller,r=e.zIndex,i=t.editorRootTopicKey;if(i===t.rootTopicKey)return null;for(var a=[],l=t.getTopic(i);null!=l;){var c=n.getValue(kn,lt(lt({},e),{topicKey:l.key}));a.unshift({text:c,onClick:this.setEditorRootTopicKey(l.key)}),l=t.getTopic(l.parentKey)}var s={items:a,breadcrumbRenderer:this.breadcrumbRenderer};return Object(o.createElement)(uo,{zIndex:r},Object(o.createElement)(m.c,lt({},s)))},t}(St),yo=d.default.div(oo||(oo=ft(["\n  position: relative;\n  display: flex;\n  align-items: center;\n  padding: 5px;\n"],["\n  position: relative;\n  display: flex;\n  align-items: center;\n  padding: 5px;\n"]))),go=d.default.div(ro||(ro=ft(["\n  width: 100%;\n  height: 100%;\n  background: ",";\n"],["\n  width: 100%;\n  height: 100%;\n  background: ",";\n"])),(function(e){return e.theme.background})),bo=function(e){function t(t){var n=e.call(this,t)||this;return n.setZoomFactor=function(e){n.dragScrollWidget.setZoomFactor(e)},n.onWheel=function(e){if(e.altKey||e.ctrlKey){var t=n.props.controller,o=t.run("getZoomFactor",n.props);(o-=e.nativeEvent.deltaY>0?.1:-.1)<.5&&(o=.5),o>4&&(o=4),t.run("setZoomFactor",lt(lt({},n.props),{zoomFactor:o}))}},n}return at(t,e),t.prototype.renderHotkeys=function(){var e=this.props,t=e.controller,n=e.model,r=t.run("customizeHotKeys",e);if(null===r)return null;if(!(r.topicHotKeys instanceof Map&&r.globalHotKeys instanceof Map))throw new TypeError("topicHotKeys and globalHotKeys must be a Map");var i=[];return n.focusMode!==A&&n.focusMode!==F||r.topicHotKeys.forEach((function(e,t){i.push(Object(o.createElement)(m.j,lt({key:t},e,{global:!0})))})),r.globalHotKeys.forEach((function(e,t){i.push(Object(o.createElement)(m.j,lt({key:t},e,{global:!0})))})),Object(o.createElement)(m.k,null,i)},t.prototype.componentDidMount=function(){var e=this.props,t=e.getRef,n=e.model;e.controller.run("addZoomFactorChangeEventListener",lt(lt({},this.props),{listener:this.setZoomFactor}));var o=t(un(n.editorRootTopicKey)),r=t("node-layer"),i=o.getBoundingClientRect(),a=r.getBoundingClientRect();this.dragScrollWidget.setViewBoxScrollDelta(0,i.top-a.top-this.dragScrollWidget.viewBox.getBoundingClientRect().height/2+i.height),this.layout()},t.prototype.componentWillUnmount=function(){this.props.controller.run("removeZoomFactorChangeEventListener",lt(lt({},this.props),{listener:this.setZoomFactor}))},Object.defineProperty(t.prototype,"dragScrollWidget",{get:function(){return this.props.getRef(gn)},enumerable:!0,configurable:!0}),t.prototype.componentDidUpdate=function(){this.props.controller.run("fireEvent",lt(lt({},this.props),{key:Tn})),this.layout()},t.prototype.layout=function(){this.props.controller.run("layout",this.props)},t.prototype.render=function(){var e=this,t=this.props,n=t.saveRef,r=t.model,i=t.controller,a=r.editorRootTopicKey;return Object(o.createElement)(go,{onWheel:this.onWheel},Object(o.createElement)(Dt,lt({},this.state,{enableMouseWheel:!1,zoomFactor:r.zoomFactor,ref:n(gn)}),(function(t,r){var l=lt(lt({},e.props),{topicKey:a,setViewBoxScroll:t,setViewBoxScrollDelta:r});return Object(o.createElement)(yo,{ref:n("node-layer")},i.run("renderRootWidget",l))})))},t=st([m.l],t)}(o.Component),vo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleClose=function(){var e=t.props.controller.run("handleActiveModalClose",t.props);e&&e()},t}return at(t,e),t.prototype.render=function(){var e=this.props.controller,t=e.run("renderModal",this.props),n=e.run("getActiveModalProps",this.props);return Object(o.createElement)(m.g,{onClose:this.handleClose,isOpen:null!==t,autoFocus:!0,enforceFocus:!0,usePortal:!0,title:n&&n.title,style:n&&n.style},Object(o.createElement)("div",{className:y.a.DIALOG_BODY,style:{minHeight:0}},t))},t}(St),xo=d.default.svg(io||(io=ft(["\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 1;\n  pointer-events: none;\n"],["\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 1;\n  pointer-events: none;\n"]))),To=h()("node:root-sub-links"),wo=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={curves:[]},t}return at(t,e),t.prototype.layout=function(){var e,t,n,r=this.props,i=r.model,a=r.getRef,l=r.topicKey,c=r.zoomFactor,s=r.controller,p=i.getTopic(l),u=a(ln(l)),d=a(fn(l)),f=a(gn).bigView,h=Nn(u,f,c),m=Nn(d,f,c);e={x:(n=h,(n.left+n.right)/2-m.left),y:Kn(h)-m.top};var y=[];p.subKeys.forEach((function(n){var i,l=s.run("getLinkStyle",lt(lt({},r),{topicKey:n})),p=l.lineType,u=Nn(a(ln(n)),f,c);if(t={x:(t=u.left>h.right?{x:u.left,y:Kn(u)}:{x:u.right,y:Kn(u)}).x-m.left,y:t.y-m.top},"curve"===p)i="M "+e.x+" "+e.y+" C "+e.x+" "+Dn(e,t)+" "+Rn(e,t)+" "+t.y+" "+t.x+" "+t.y;else if("line"===p)i="M "+e.x+" "+e.y+" L "+t.x+" "+t.y;else if("round"===p){var d=t.y>e.y?1:-1,g=t.x>e.x?1:-1,b=l.lineRadius;if(null==b)throw new Error("link line type is round, but lineRadius is not provided!");i=t.y===e.y?"M "+e.x+" "+e.y+" H "+t.x:"M "+e.x+" "+e.y+"  V "+(t.y-d*b)+" A "+b+" "+b+" 0 0 "+(d*g===1?0:1)+" "+(e.x+b*g)+" "+t.y+" H "+t.x}y.push(Object(o.createElement)("path",{key:"link-"+n,d:i,strokeWidth:l.lineWidth,stroke:l.lineColor,fill:"none"}))})),this.setState({curves:y})},t.prototype.render=function(){To("render");var e=this.props,t=e.topicKey,n=e.saveRef;return Object(o.createElement)(xo,{ref:n(fn(t))},Object(o.createElement)("g",null,this.state.curves))},t}(St),Oo=h()("RootNode"),ko=d.default.div(ao||(ao=ft(["\n  display: flex;\n  position: relative;\n\n  align-items: ",";\n  flex-direction: column;\n\n  padding: ",";\n"],["\n  display: flex;\n  position: relative;\n\n  align-items: ",";\n  flex-direction: column;\n\n  padding: ",";\n"])),(function(e){return e.topicDirection===R?"flex-end":"flex-start"}),(function(e){return e.topicDirection===R?"15px 60px 15px 0px":"15px 0px 15px 60px"})),Eo=d.default.div(lo||(lo=ft(["\n  display: flex;\n  position: relative;\n  align-items: center;\n  z-index: 3;\n"],["\n  display: flex;\n  position: relative;\n  align-items: center;\n  z-index: 3;\n"]))),Co=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return at(t,e),t.prototype.renderPartTopics=function(e,t){var n=this.props,r=n.controller,i=n.saveRef,a=r.run("createSubTopics",lt(lt({},this.props),{dir:t,isRoot:!0,topics:e}));if(!a)return null;var l=a.subTopics,c="bm-layer-"+(t===R?"left":"right");return Object(o.createElement)(ko,{topicDirection:t,ref:i(c)},l)},t.prototype.render=function(){Oo("render");var e=this.props,t=e.model,n=e.topicKey,r=e.saveRef,i=e.controller,a=i.run("getTopicContentStyle",e),l=t.config,c=i.run("renderTopicContent",lt(lt({},e),{topicStyle:a,dir:_})),s=i.run("getPartTopics",{layout:l.layoutDir,model:t,topicKey:n}),p=Object(o.createElement)(Eo,{ref:r(un(n))},c),u=i.run("renderRootWidgetOtherChildren",e);switch(l.layoutDir){case j.LEFT_AND_RIGHT:return Object(o.createElement)(o.Fragment,null,this.renderPartTopics(s.L,"L"),p,this.renderPartTopics(s.R,"R"),u);case j.LEFT_TO_RIGHT:return Object(o.createElement)(o.Fragment,null,p,this.renderPartTopics(s.R,"R"),u);case j.RIGHT_TO_LEFT:return Object(o.createElement)(o.Fragment,null,this.renderPartTopics(s.L,"L"),p,u);case j.TOP_TO_BOTTOM:return Object(o.createElement)(o.Fragment,null,p,this.renderPartTopics(s.B,"B"),u)}return null},t}(o.Component),So=d.default.div(po||(po=ft(["\n  position: absolute;\n  top: calc(50% - 10px);\n  ",";\n  border-radius: 50%;\n  width: 20px;\n  height: 20px;\n  text-align: center;\n  //@ts-ignore\n  background: ",";\n  cursor: pointer;\n  padding: 0;\n  font-size: 14px;\n  line-height: 20px;\n  border: 0;\n  z-index: 2;\n"],["\n  position: absolute;\n  top: calc(50% - 10px);\n  ",";\n  border-radius: 50%;\n  width: 20px;\n  height: 20px;\n  text-align: center;\n  //@ts-ignore\n  background: ",";\n  cursor: pointer;\n  padding: 0;\n  font-size: 14px;\n  line-height: 20px;\n  border: 0;\n  z-index: 2;\n"])),(function(e){var t=e.dir;return t===D?Object(d.css)(co||(co=ft(["\n        right: -25px;\n      "],["\n        right: -25px;\n      "]))):t===R?Object(d.css)(so||(so=ft(["\n        left: -25px;\n      "],["\n        left: -25px;\n      "]))):void 0}),(function(e){return e.background}));function jo(e){var t,n=e.model,r=e.topicKey,i=e.topicStyle,a=e.dir,l=e.saveRef,c=e.onClickCollapse,s=n.getTopic(r);return s.subKeys.size>0?Object(o.createElement)(So,{ref:l(hn(r)),onClick:c,background:i.background,dir:a,className:tt()((t={icon:!0,iconfont:!0},t["bm-"+(s.collapse?"plus":"minus")]=!0,t))}):null}var Ko,Ro,Do=h()("node:topic-content2"),_o=d.default.div(Ko||(Ko=ft(["\n  position: relative;\n"],["\n  position: relative;\n"]))),No=d.default.div(Ro||(Ro=ft(["\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: auto;\n  z-index: 10;\n  color: black;\n"],["\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: auto;\n  z-index: 10;\n  color: black;\n"]))),Po=function(e){Do("cancelEvent"),e.preventDefault(),e.stopPropagation()};function Io(e){var t,n=e.controller,r=e.model,i=e.topicKey,a=e.getRef,l=r.editingContentKey!==i,c=n.run("renderTopicContentEditor",lt(lt({},e),{readOnly:l}));if(l)t=c;else{var s,p={width:50,height:40},d=a("content-editor-"+i);d&&(p=d.getBoundingClientRect());var f=new u.a((function(e,t){var n=e[0].contentRect;s.style.left=(p.width-n.width)/2+"px",s.style.top=(p.height-n.height)/2+"px"}));Do(p),t=Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{style:{width:p.width,height:p.height}}),Object(o.createElement)(No,{ref:function(e){e&&(s=e,f.observe(s))}},c))}return Object(o.createElement)(_o,{onDragEnter:Po,onDragOver:Po},t)}var Mo,Ao,Lo,zo=h()("node:topic-content-widget"),Fo=d.default.div(Mo||(Mo=ft(["\n  display: flex;\n  align-items: center;\n  cursor: pointer;\n  //overflow: hidden;\n  position: relative;\n"],["\n  display: flex;\n  align-items: center;\n  cursor: pointer;\n  //overflow: hidden;\n  position: relative;\n"]))),Ho=d.default.div(Ao||(Ao=ft(["\n  position: relative;\n"],["\n  position: relative;\n"]))),Bo=function(e){function t(t){var n=e.call(this,t)||this;return n.onDragStart=function(e){n.run("handleTopicDragStart",lt(lt({},n.props),{ev:e}))},n.onDragOver=function(e){e.preventDefault()},n.onDragEnter=function(e){zo("onDragEnter",n.props.topicKey),n.run("handleTopicDragEnter",lt(lt({},n.props),{ev:e,dropDir:"in"}))},n.onDragLeave=function(e){n.run("handleTopicDragLeave",lt(lt({},n.props),{ev:e,dropDir:"in"}))},n.onDrop=function(e){zo("onDrop"),n.run("handleTopicDrop",lt(lt({},n.props),{ev:e,dropDir:"in"}))},n.onClick=function(e){var t=n.props.controller;n.handleTopicClickTimeout=setTimeout((function(){t.run("handleTopicClick",lt(lt({},n.props),{ev:e}))}),200)},n.onDoubleClick=function(e){clearTimeout(n.handleTopicClickTimeout),n.props.controller.run("handleTopicDoubleClick",lt(lt({},n.props),{ev:e}))},n.needRelocation=!1,n.onClickCollapse=function(e){e.stopPropagation();var t=n.props,o=t.topicKey,r=t.getRef;n.needRelocation=!0;var i=r(hn(o)).getBoundingClientRect();zo("oldRect",i),n.oldCollapseIconVector=[i.left+i.width/2,i.top+i.height/2],zo("oldCollapseIconVector",n.oldCollapseIconVector),n.operation(U,n.props)},n.state={dragEnter:!1},n}return at(t,e),t.prototype.renderContextMenu=function(){var e=this.props.controller;if(e.getValue(On,lt({},this.props)))return this.operation($,lt(lt({},this.props),{focusMode:F})),e.run("renderTopicContextMenu",this.props)},t.prototype.onContextMenuClose=function(){},t.prototype.componentDidUpdate=function(){if(this.needRelocation){var e=this.props,t=e.getRef,n=e.topicKey,o=e.setViewBoxScrollDelta,r=t(hn(n)).getBoundingClientRect(),i=[r.left+r.width/2,r.top+r.height/2];zo("newVector:",i),zo("oldVector:",this.oldCollapseIconVector);var a=[i[0]-this.oldCollapseIconVector[0],i[1]-this.oldCollapseIconVector[1]];zo("vector",a),o(a[0],a[1]),this.needRelocation=!1}},t.prototype.render=function(){var e=this.props,t=e.saveRef,n=e.topicKey,r=e.model,i=e.controller,a=e.topicStyle,l=e.dir;zo("render",n,r.focusMode);var c=i.run("isOperationEnabled",e)&&r.editingContentKey!==n,s=i.run("renderTopicCollapseIcon",lt(lt({},e),{onClickCollapse:this.onClickCollapse.bind(this)})),p=i.run("renderTopicDropArea",lt(lt({},e),{dropDir:"prev"})),u=i.run("renderTopicDropArea",lt(lt({},e),{dropDir:"next"})),d={onDragEnter:this.onDragEnter,onDragLeave:this.onDragLeave,onDragOver:this.onDragOver,onDrop:this.onDrop};return Object(o.createElement)(Ho,null,p,Object(o.createElement)(Fo,lt({style:a,draggable:c,ref:t(ln(n)),onDragStart:this.onDragStart,onClick:this.onClick,onDoubleClick:this.onDoubleClick},d),i.run("renderTopicBlocks",e),i.run("renderTopicContentOthers",e)),u,l!==_&&s)},t=st([m.f],t)}(St),Vo=h()("node:topic-desc"),Wo=d.default.div(Lo||(Lo=ft(["\n  overflow: auto;\n"],["\n  overflow: auto;\n"])));function Go(e){var t=e.controller,n=e.model,r=e.topicKey,i=e.getRef,a=n.editingDescKey===r;Vo("isEditing",a);var l=n.getTopic(r).getBlock(M);if(!a&&t.run("isBlockEmpty",lt(lt({},e),{block:l.block})))return null;var c=t.run("renderTopicDescEditor",e),s=i(yn),p={maxWidth:"800px",maxHeight:"600px"};if(s){var u=s.getBoundingClientRect();p.maxWidth=.6*u.width+"px",p.maxHeight=.8*u.height+"px"}var d={autoFocus:!1,content:Object(o.createElement)(Wo,{onClick:En,classname:y.a.POPOVER_DISMISS,style:p},c),target:Object(o.createElement)(Bt,{onClick:function(n){n.stopPropagation(),t.run("operation",lt(lt({},e),{opType:ae}))},className:rn(Jt),tabIndex:-1}),interactionKind:m.t.HOVER,hoverOpenDelay:500};return l.block&&Object(o.createElement)(m.s,lt({},d))}var Uo,qo,Yo,Zo,Jo,Xo,Qo,$o,er,tr=d.default.svg(Uo||(Uo=ft(["\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 2;\n  pointer-events: none;\n"],["\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 2;\n  pointer-events: none;\n"]))),nr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={content:null},t}return at(t,e),t.prototype.layout=function(){var e=this.props,t=e.getRef,n=e.model,r=e.zoomFactor,i=n.focusKey,a=n.focusMode;if(i&&a!==L){var l=t(ln(i)),c=t(gn).bigView,s=t(bn),p=Nn(l,c,r),u=Nn(s,c,r),d=p.left-u.left-3,f=p.top-u.top-3,h=p.width+6,m=p.height+6;this.setState({content:Object(o.createElement)("rect",{x:d,y:f,width:h,height:m,fill:"none",stroke:n.config.theme.highlightColor,strokeWidth:2})})}else this.setState({content:null})},t.prototype.render=function(){var e=this.props.saveRef;return Object(o.createElement)(tr,{ref:e(bn)},this.state.content)},t}(St),or=d.default.svg(qo||(qo=ft(["\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 1;\n  pointer-events: none;\n"],["\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 1;\n  pointer-events: none;\n"]))),rr=h()("node:topic-sub-links"),ir=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={curves:[]},t}return at(t,e),t.prototype.layout=function(){var e,t,n,r=this.props,i=r.model,a=r.getRef,l=r.topicKey,c=r.dir,s=r.controller,p=s.run("getZoomFactor",r),u=i.getTopic(l),d=a(ln(l)),f=a(fn(l)),h=a(hn(l)),m=a(gn).bigView,y=Nn(f,m,p),g=Nn(h,m,p),b=Nn(d,m,p);rr(l),rr("svgRect",y),rr("collapseRect",g),rr("contentRect",b),c===D?(e={x:0,y:Kn(b)-y.top},t={x:g.right-y.left+10,y:e.y}):c===R&&(e={x:y.right-y.left,y:Kn(b)-y.top},t={x:g.left-y.left-10,y:e.y});var v=[];u.subKeys.forEach((function(i){var l,d=s.run("getLinkStyle",lt(lt({},r),{topicKey:i})),f=a(ln(i));if(f){var h=Nn(f,m,p);c===D&&(n={x:h.left-y.left,y:Kn(h)-y.top}),c===R&&(n={x:h.right-y.left,y:Kn(h)-y.top});var g=d.lineType;if("curve"===g)l="M "+e.x+" "+e.y+" L "+t.x+" "+t.y+" C "+t.x+" "+Dn(t,n)+" "+Rn(t,n)+" "+n.y+" "+n.x+" "+n.y;else if("round"===g){var b=n.y>e.y?1:-1,x=n.x>e.x?1:-1,T=d.lineRadius;l=1===u.subKeys.size||Math.abs(n.y-e.y)<=1?"M "+e.x+" "+e.y+" L "+n.x+" "+n.y:"M "+e.x+" "+e.y+" H "+t.x+" V "+(n.y-b*T)+" A "+T+" "+T+" 0 0 "+(b*x===1?0:1)+" "+(t.x+T*x)+" "+n.y+" H "+n.x}else"line"===g&&(l="M "+e.x+" "+e.y+" H "+t.x+" L "+n.x+" "+n.y);v.push(Object(o.createElement)("path",{key:"link-"+i,d:l,strokeWidth:d.lineWidth,stroke:d.lineColor,fill:"none"}))}})),this.setState({curves:v})},t.prototype.render=function(){var e=this.props,t=e.topicKey,n=e.saveRef;return Object(o.createElement)(or,{ref:n(fn(t))},Object(o.createElement)("g",null,this.state.curves))},t}(St),ar=h()("node:topic-widget"),lr=d.default.div(Yo||(Yo=ft(["\n  display: flex;\n  align-items: center;\n  flex-direction: ",";\n"],["\n  display: flex;\n  align-items: center;\n  flex-direction: ",";\n"])),(function(e){return e.topicDirection===D?"row":"row-reverse"})),cr=d.default.div(Zo||(Zo=ft(["\n  position: relative;\n  padding: ",";\n"],["\n  position: relative;\n  padding: ",";\n"])),(function(e){return e.dir===D?"0 0 0 "+e.marginH+"px":"0 "+e.marginH+"px 0 0"})),sr=d.default.div(Jo||(Jo=ft(["\n  display: flex;\n  position: relative;\n  align-items: center;\n\n  flex-direction: ",";\n"],["\n  display: flex;\n  position: relative;\n  align-items: center;\n\n  flex-direction: ",";\n"])),(function(e){return e.topicDirection===D?"row":"row-reverse"})),pr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return at(t,e),t.prototype.renderSubTopics=function(){var e=this.props,t=e.controller,n=e.model,r=e.topicKey,i=e.dir,a=n.getTopic(r).subKeys.toArray(),l=t.run("createSubTopics",lt(lt({},e),{topics:a}));if(!l)return null;var c=l.subTopics,s=t.run("renderSubLinks",e);return Object(o.createElement)(cr,{dir:i,marginH:n.config.theme.marginH},c," ",s)},t.prototype.layoutLinks=function(){var e=this.props,t=e.getRef,n=e.topicKey,o=e.model.getTopic(n);if(0!==o.subKeys.size&&!o.collapse){ar("layoutLinks",n);var r=t(dn(n));r&&r.layout()}},t.prototype.render=function(){var e=this.props,t=e.controller,n=e.topicKey,r=e.dir,i=e.saveRef;ar("render",n);var a=t.run("getTopicContentStyle",e),l=lt(lt({},e),{topicStyle:a}),c=t.run("renderTopicContent",l);return Object(o.createElement)(lr,{topicDirection:r},Object(o.createElement)(sr,{topicDirection:r,ref:i(un(n))},c),this.renderSubTopics())},t}(o.Component),ur=h()("node:view-port-viewer"),dr=Object(d.default)(Vt)(Xo||(Xo=ft(["\n  position: absolute;\n  background: white;\n  right: 30px;\n  bottom: 20px;\n  border-radius: 2px;\n  display: flex;\n  flex-direction: row;\n  user-select: none;\n"],["\n  position: absolute;\n  background: white;\n  right: 30px;\n  bottom: 20px;\n  border-radius: 2px;\n  display: flex;\n  flex-direction: row;\n  user-select: none;\n"]))),fr=Object(d.default)(Lt)(Qo||(Qo=ft(["\n  margin: 10px;\n"],["\n  margin: 10px;\n"]))),hr=d.default.span($o||($o=ft(["\n  display: inline-block;\n  width: 80px;\n  height: 18px;\n"],["\n  display: inline-block;\n  width: 80px;\n  height: 18px;\n"]))),mr=function(e){return Object(o.createElement)(m.x,{content:e.tooltip,position:g.a.TOP,className:y.a.ICON},Object(o.createElement)(fr,{onClick:e.onClick,tabIndex:-1},e.children))},yr=function(e){function t(t){var n=e.call(this,t)||this;return n.zoomFactorChange=function(e){ur("zoomFactorChange",e),n.setState({zoomFactor:e})},n.onClickResetZoom=function(e){var t=n.props;t.controller.run("setZoomFactor",lt(lt({},t),{zoomFactor:1}))},n.onClickAddZoom=function(e){var t=n.props,o=t.controller,r=o.run("getZoomFactor",t);o.run("setZoomFactor",lt(lt({},t),{zoomFactor:r+.1}))},n.onClickMinusZoom=function(e){var t=n.props,o=t.controller,r=o.run("getZoomFactor",t);o.run("setZoomFactor",lt(lt({},t),{zoomFactor:r-.1}))},n.onClickCollapseAll=function(e){var t=n.props,o=t.controller;o.run("addEventListener",lt(lt({},t),{key:Tn,listener:n.centerRootTopic,once:!0})),o.run("operation",lt(lt({},t),{opType:q}))},n.onClickExpandAll=function(e){var t=n.props,o=t.controller;o.run("addEventListener",lt(lt({},t),{key:Tn,listener:n.centerRootTopic,once:!0})),o.run("operation",lt(lt({},t),{opType:Y}))},n.centerRootTopic=function(){var e=n.props,t=e.model;e.controller.run("moveTopicToCenter",lt(lt({},n.props),{topicKey:t.editorRootTopicKey}))},n}return at(t,e),t.prototype.componentDidMount=function(){var e=this.props;e.controller.run("addZoomFactorChangeEventListener",lt(lt({},e),{listener:this.zoomFactorChange}))},t.prototype.componentWillUnmount=function(){var e=this.props;e.controller.run("removeZoomFactorChangeEventListener",lt(lt({},e),{listener:this.zoomFactorChange}))},t.prototype.render=function(){ur("render");var e=this.props,t=e.controller,n=e.zIndex,r=t.run("getZoomFactor",e);return Object(o.createElement)(dr,{zIndex:n},Object(o.createElement)(mr,{onClick:this.onClickCollapseAll,tooltip:"collapse all"},an($t)),Object(o.createElement)(mr,{onClick:this.onClickExpandAll,tooltip:"expand all"},an(en)),Object(o.createElement)(mr,{onClick:this.centerRootTopic,tooltip:"center root topic"},an(tn)),Object(o.createElement)(mr,{onClick:this.onClickMinusZoom,tooltip:"zoom in"},an(Qt)),Object(o.createElement)(mr,{onClick:this.onClickResetZoom,tooltip:"reset zoom"},Object(o.createElement)(hr,null,"zoom:"+Math.floor(100*r)+"%")),Object(o.createElement)(mr,{onClick:this.onClickAddZoom,tooltip:"zoom out"},an(Xt)))},t}(St),gr=d.default.div(er||(er=ft(["\n  overflow: auto;\n  padding: 0px 0px 0px 20px;\n  background: #88888850;\n"],["\n  overflow: auto;\n  padding: 0px 0px 0px 20px;\n  background: #88888850;\n"])));function br(e){var t=e.controller,n=e.model,r=e.topicKey;if(n.focusMode===z){var i=t.run("renderTopicDescEditor",e);return Object(o.createElement)(m.i,{key:"drawer",title:"Edit Notes",icon:an("note"),isOpen:!0,hasBackdrop:!0,backdropProps:{onMouseDown:En},isCloseButtonShown:!1,onClose:function(n){n.stopPropagation();var o="topic-desc-data-"+r,i=t.run("deleteTempValue",{key:o});t.run("operation",lt(lt({},e),{opType:oe,topicKey:r,blockType:M,data:i,focusMode:A}))},size:"70%"},Object(o.createElement)(gr,null,i))}}function vr(e){var t=e.theme,n=e.children;return Object(o.createElement)(d.ThemeProvider,{theme:t},Object(o.createElement)(o.Fragment,null,n))}var xr,Tr=h()("plugin:rendering");function wr(){var e,t=d.default.div(xr||(xr=ft(["\n    width: 100%;\n    height: 100%;\n    background: ",";\n    position: relative;\n  "],["\n    width: 100%;\n    height: 100%;\n    background: ",";\n    position: relative;\n  "])),(function(e){return e.theme.background}));return{getDiagramProps:function(){return e},renderDiagram:function(n){var r=n.model,i=n.controller;return Object(o.createElement)(Nt,null,(function(a,l,c){return e=lt(lt({},n),{saveRef:a,getRef:l,deleteRef:c}),Tr("renderDiagram",r),Object(o.createElement)(vr,{theme:r.config.theme},Object(o.createElement)(t,{ref:a(yn)},Object(o.createElement)(bo,lt({},e)),i.run("renderDiagramCustomize",e)))}))},renderDrawer:br,renderDiagramCustomize:function(e){var t=e.controller,n=e.model,o=t.getValue(wn),r=lt(lt({},e),{zIndex:o,topicKey:n.focusKey});return[t.run("renderEditorRootBreadcrumbs",r),t.run("renderRightTopPanel",r),t.run("renderModals",lt(lt({},r),{zIndex:o+1})),t.run("renderDrawer",lt(lt({},r),{zIndex:o+1})),t.run("renderViewPortViewer",r)]},renderEditorRootBreadcrumbs:function(e){return Object(o.createElement)(mo,lt({key:"EditorRootBreadcrumbs"},e))},renderModals:function(e){return Object(o.createElement)(vo,lt({key:"modals"},e))},renderModal:function(e){return null},getActiveModalProps:function(e){return null},renderDoc:function(e){return e.children},renderRootWidget:function(e){return Object(o.createElement)(Co,lt({},e))},renderTopicWidget:function(e){return Object(o.createElement)(pr,lt({},e))},renderTopicContent:function(e){return Object(o.createElement)(Bo,lt({},e))},renderTopicCollapseIcon:function(e){return Object(o.createElement)(jo,lt({},e))},renderTopicContentOthers:function(e){return[]},renderTopicBlocks:function(e){var t=e.model,n=e.topicKey,r=e.controller,i=t.getTopic(n).blocks,a=[],l=0;return i.forEach((function(t){var n=r.run("renderTopicBlock",lt(lt({},e),{block:t,blockKey:"block-"+l}));n&&(a.push(Object(o.createElement)(o.Fragment,{key:"block-"+l},n)),l++)})),a},renderTopicBlock:function(e){var t=e.controller;switch(e.block.type){case I:return t.run("renderTopicBlockContent",e);case M:return t.run("renderTopicBlockDesc",e)}return null},renderTopicBlockContent:function(e){return Object(o.createElement)(Io,lt({},e))},renderTopicBlockDesc:function(e){return Object(o.createElement)(Go,lt({},e))},renderSubLinks:function(e){var t=e.saveRef,n=e.topicKey,r=e.model.getTopic(n);return 0===r.subKeys.size||r.collapse?null:Object(o.createElement)(ir,lt({ref:t(dn(n))},e))},renderRootSubLinks:function(e){var t=e.saveRef,n=e.topicKey;return Object(o.createElement)(wo,lt({ref:t(dn(n))},e))},renderFocusItemHighlight:function(e){var t=e.saveRef;return Object(o.createElement)(nr,lt({ref:t(vn)},e))},renderRootWidgetOtherChildren:function(e){var t=e.controller,n=t.run("getZoomFactor",e);return e=lt(lt({},e),{zoomFactor:n}),Object(o.createElement)(o.Fragment,null,t.run("renderRootSubLinks",e),t.run("renderFocusItemHighlight",e),t.run("renderDragAndDropEffect",e))},renderViewPortViewer:function(e){return Object(o.createElement)(yr,lt({key:"view-port-viewer"},e))}}}var Or,kr,Er=Object(d.default)(Vt)(Or||(Or=ft(["\n  position: absolute;\n  background: white;\n  right: 30px;\n  top: 20px;\n  border-radius: 2px;\n  user-select: none;\n"],["\n  position: absolute;\n  background: white;\n  right: 30px;\n  top: 20px;\n  border-radius: 2px;\n  user-select: none;\n"]))),Cr=Object(d.default)(m.w)(kr||(kr=ft(["\n  padding: 0px 10px;\n"],["\n  padding: 0px 10px;\n"])));function Sr(e){var t=e.controller,n=e.zIndex,r=e.selectedTabId,i=e.handleTabIdChange,a=ut(Object(o.useState)(!1),2),l=a[0],c=a[1];return l?Object(o.createElement)(Er,{zIndex:n},Object(o.createElement)(Ht,null,Object(o.createElement)(Ft,{className:rn(Yt),onClick:function(){return c(!1)}})),Object(o.createElement)(Cr,{id:r,onChange:i},t.run("renderRightTopPanelTabs",e))):Object(o.createElement)(Er,{zIndex:n},Object(o.createElement)(At,{onClick:function(){return c(!0)}},Object(o.createElement)(Mt,{className:rn(qt)})))}var jr,Kr,Rr,Dr,_r,Nr,Pr,Ir=d.default.div(jr||(jr=ft(["\n  margin-top: 10px;\n  margin-bottom: 5px;\n  font-weight: bold;\n"],["\n  margin-top: 10px;\n  margin-bottom: 5px;\n  font-weight: bold;\n"]))),Mr=d.default.span(Kr||(Kr=ft(["\n  margin: 0px 10px 0px 0px;\n"],["\n  margin: 0px 10px 0px 0px;\n"]))),Ar=d.default.div(Rr||(Rr=ft(["\n  padding: 10px;\n  margin: 0 0 10px 0;\n  border: rgba(16, 22, 26, 0.15) solid 1px;\n  border-radius: 5px;\n"],["\n  padding: 10px;\n  margin: 0 0 10px 0;\n  border: rgba(16, 22, 26, 0.15) solid 1px;\n  border-radius: 5px;\n"]))),Lr=Object(d.default)(Mr)(Dr||(Dr=ft([""],[""]))),zr=d.default.div(_r||(_r=ft(["\n  display: flex;\n  align-items: center;\n  //justify-content: center;\n  margin: 5px 0;\n"],["\n  display: flex;\n  align-items: center;\n  //justify-content: center;\n  margin: 5px 0;\n"]))),Fr=d.default.div(Nr||(Nr=ft(["\n  height: 3px;\n  width: 80%;\n  margin-left: 10%;\n  margin-right: 10%;\n  margin-bottom: 2px;\n  background: ",";\n"],["\n  height: 3px;\n  width: 80%;\n  margin-left: 10%;\n  margin-right: 10%;\n  margin-bottom: 2px;\n  background: ",";\n"])),(function(e){return e.color})),Hr=d.default.div(Pr||(Pr=ft(["\n  border: 1px solid grey;\n  cursor: pointer;\n  font-weight: bold;\n"],["\n  border: 1px solid grey;\n  cursor: pointer;\n  font-weight: bold;\n"])));function Br(e){return Object(o.createElement)("div",null,e.children,Object(o.createElement)(m.h,{style:{margin:"10px 0"}}))}function Vr(e){var t=e.color,n=e.handleColorChange;return Object(o.createElement)(Mr,null,Object(o.createElement)(m.s,null,Object(o.createElement)(Hr,null,Object(o.createElement)("div",{className:rn(Zt)}),Object(o.createElement)(Fr,{color:t})),Object(o.createElement)("div",null,Object(o.createElement)(ot.a,{color:t,onChangeComplete:function(e){return n(e.hex)}}))))}function Wr(e){var t=e.title,n=e.handleClick;return Object(o.createElement)(Mr,null,Object(o.createElement)(m.d,{onClick:n},t))}function Gr(e){var t=e.layout,n=void 0===t?"h":t,r=e.title,i=ct(e,["layout","title"]),a={flexDirection:"h"===n?"row":"column",alignItems:"center"};return Object(o.createElement)(Mr,null,Object(o.createElement)(Pt,lt({},a),Object(o.createElement)(It,{margin:"0 5px 0 0"},r),Object(o.createElement)(m.q,lt({},i))))}function Ur(e){var t=e.text,n=e.items,r=e.itemRenderer,i=e.onItemSelect,a=nt.a.ofType(),l={items:n,itemRenderer:r,onItemSelect:i,filterable:!1};return Object(o.createElement)(Mr,null,Object(o.createElement)(a,lt({},l),Object(o.createElement)(m.d,{text:t})))}var qr=function(e){return function(t,n){var r=n.handleClick;return Object(o.createElement)(m.p,{text:""+t+e,key:t,onClick:r})}},Yr=(nt.a.ofType(),dt(Array(7).keys())),Zr=dt(Array(7).keys()),Jr=[0,5,10,15,20,25,30,35],Xr=["none","solid","dotted","dashed","double"];function Qr(e){var t=e.contentStyle,n=e.setContentStyle;return Object(o.createElement)(Br,null,Object(o.createElement)(Ir,null,"Border"),Object(o.createElement)("div",null,Object(o.createElement)(Ur,{text:"width: "+(t.borderWidth?t.borderWidth:"0px"),items:Zr,itemRenderer:qr("px"),onItemSelect:function(e){n({borderWidth:e+"px"})}}),Object(o.createElement)(Ur,{text:"style: "+(t.borderStyle?t.borderStyle:"none"),items:Xr,itemRenderer:qr(""),onItemSelect:function(e){n({borderStyle:e})}}),Object(o.createElement)(Ur,{text:"radius: "+t.borderRadius,items:Jr,itemRenderer:qr("px"),onItemSelect:function(e){n({borderRadius:e+"px"})}}),Object(o.createElement)(Vr,{color:t.borderColor,handleColorChange:function(e){n({borderColor:e})}})))}var $r=["curve","round","line"],ei=function(e,t){var n=t.handleClick;t.modifiers,t.query;return Object(o.createElement)(m.p,{text:""+e,key:e,onClick:n})};function ti(e){var t=e.showLinkStyle,n=void 0===t||t,r=e.showSubLinkStyle,i=void 0===r||r,a=e.linkStyle,l=void 0===a?{}:a,c=e.subLinkStyle,s=void 0===c?{}:c,p=e.setLinkStyle,u=e.setSubLinkStyle;return Object(o.createElement)(Br,null,Object(o.createElement)(Ir,null,"Link"),n&&Object(o.createElement)(zr,{alignItems:"center"},Object(o.createElement)(It,{margin:"0 5px 0 0"},"LinkToParent: "),Object(o.createElement)(Ur,{text:"width: "+(l?l.lineWidth:"0px"),items:Yr,itemRenderer:qr("px"),onItemSelect:function(e){p({lineWidth:e+"px"})}}),Object(o.createElement)(Ur,{text:"lineType: "+l.lineType,items:$r,itemRenderer:ei,onItemSelect:function(e){p({lineType:e})}}),Object(o.createElement)(Vr,{color:l.lineColor,handleColorChange:function(e){p({lineColor:e})}})),i&&Object(o.createElement)(zr,{alignItems:"center"},Object(o.createElement)(It,{margin:"0 5px 0 0"},"SubLinks: "),Object(o.createElement)(Ur,{text:"width: "+(s?s.lineWidth:"0px"),items:Yr,itemRenderer:qr("px"),onItemSelect:function(e){u({lineWidth:e+"px"})}}),Object(o.createElement)(Ur,{text:"lineType: "+s.lineType,items:$r,itemRenderer:ei,onItemSelect:function(e){u({lineType:e})}}),Object(o.createElement)(Vr,{color:s.lineColor,handleColorChange:function(e){u({lineColor:e})}})))}function ni(e){var t=e.contentStyle,n=e.setContentStyle,r={title:"FontSize:",min:12,max:100,value:parseInt(t.fontSize),style:{width:50},onValueChange:function(e){n({fontSize:e})}},i={style:{width:50},value:t.lineHeight||"",onChange:function(e){n({lineHeight:e.target.value})}};return Object(o.createElement)(Br,null,Object(o.createElement)(Ir,null,"Text Editor"),Object(o.createElement)(Pt,null,Object(o.createElement)(Gr,lt({},r)),Object(o.createElement)(Mr,null,Object(o.createElement)(Pt,{alignItems:"center"},Object(o.createElement)(It,{margin:"0 5px 0 0"},"LineHeight: "),Object(o.createElement)(m.m,lt({},i)))),Object(o.createElement)(Vr,{color:t.color,handleColorChange:function(e){n({color:e})}})))}var oi,ri=h()("node:style-editor");function ii(e){var t=e.controller,n=e.model,r=e.topicKey,i=n.getTopic(r),a=function(n){t.run("setTopicContentStyle",lt(lt({},e),{style:n}))};if(!n.focusKey)return null;var l=t.run("getTopicContentStyle",e),c={linkStyle:t.run("getLinkStyle",e),subLinkStyle:t.run("getSubLinkStyle",e),setLinkStyle:function(n){t.run("setLinkStyle",lt(lt({},e),{linkStyle:n}))},setSubLinkStyle:function(n){t.run("setSubLinkStyle",lt(lt({},e),{subLinkStyle:n}))}},s={contentStyle:l,setContentStyle:a};return Object(o.createElement)(Wt,null,Object(o.createElement)(Qr,lt({},s)),Object(o.createElement)(ni,lt({},s)),Object(o.createElement)(Br,null,Object(o.createElement)(Ir,null,"Background"),Object(o.createElement)(Vr,{color:l.background,handleColorChange:function(e){a({background:e})}})),Object(o.createElement)(ti,lt({},c)),Object(o.createElement)(Br,null,Object(o.createElement)(Wr,{title:"Clear Topic Style",handleClick:function(){i.style&&t.run("operation",lt(lt({},e),{opType:te,style:null}))}}),Object(o.createElement)(Wr,{title:"Copy Style",handleClick:function(){oi=t.run("getTopicStyle",e),ri(oi)}}),Object(o.createElement)(Wr,{title:"Paste Style",handleClick:function(){oi&&t.run("operation",lt(lt({},e),{opType:te,style:JSON.stringify(oi)}))}})),function(e){var t=e.controller;return Object(o.createElement)(Br,null,Object(o.createElement)(Mr,null,Object(o.createElement)(m.d,{onClick:function(n){t.run("clearAllCustomStyle",e)}},"Clear All Custom Styles")))}(e))}var ai=n(496);function li(e){var t=e.contentStyle,n=e.setContentStyle,r=ai("padding",t.padding||"0"),i={layout:"v",min:0,max:99,style:{width:38}},a=parseInt(r["padding-top"]),l=parseInt(r["padding-right"]),c=parseInt(r["padding-bottom"]),s=parseInt(r["padding-left"]),p={top:a,right:l,bottom:c,left:s},u=function(e){return function(t){var o;n({padding:jn(lt(lt({},p),(o={},o[e]=t,o)))})}},d=lt(lt({},i),{title:"top",value:a,onValueChange:u("top")}),f=lt(lt({},i),{title:"right",value:l,onValueChange:u("right")}),h=lt(lt({},i),{title:"bottom",value:c,onValueChange:u("bottom")}),m=lt(lt({},i),{title:"left",value:s,onValueChange:u("left")});return Object(o.createElement)(Br,null,Object(o.createElement)(Ir,null,"Padding"),Object(o.createElement)(zr,null,Object(o.createElement)(Gr,lt({},d)),Object(o.createElement)(Gr,lt({},f)),Object(o.createElement)(Gr,lt({},h)),Object(o.createElement)(Gr,lt({},m))))}var ci,si=d.default.div(ci||(ci=ft(["\n  height: 250px;\n  overflow: auto;\n"],["\n  height: 250px;\n  overflow: auto;\n"])));function pi(e){var t=e.topicStyle,n=e.setTopicStyle,r=t.contentStyle,i=void 0===r?{}:r,a=t.linkStyle,l=void 0===a?{}:a,c=t.subLinkStyle,s=function(e){n({contentStyle:e})},p={contentStyle:i,setContentStyle:s},u={showLinkStyle:!1,linkStyle:l,subLinkStyle:void 0===c?{}:c,setLinkStyle:function(e){n({linkStyle:e})},setSubLinkStyle:function(e){n({subLinkStyle:e})}};return Object(o.createElement)(si,null,Object(o.createElement)(Qr,lt({},p)),Object(o.createElement)(li,lt({},p)),Object(o.createElement)(ni,lt({},p)),Object(o.createElement)(Br,null,Object(o.createElement)(Ir,null,"Background"),Object(o.createElement)(Vr,{color:i.background,handleColorChange:function(e){s({background:e})}})),Object(o.createElement)(ti,lt({},u)))}var ui="normal";function di(e){var t,n=ut(Object(o.useState)(!1),2),r=(n[0],n[1],ut(Object(o.useState)(!1),2)),i=r[0],a=r[1],l=e.model,c=e.controller,s=l.config.theme,p=s.rootTopic,u=s.primaryTopic,d=s.normalTopic,f=function(t){c.run("operation",lt(lt({},e),{opType:ne,theme:Object(rt.clone)(t)}))},h=(t=function(e){f(Object(rt.merge)(s,{randomColor:e}))},function(e){return t(e.target.checked)}),y={topicStyle:p,setTopicStyle:function(e){f(Object(rt.merge)(s,{rootTopic:e}))}},g=Object(o.createElement)(pi,lt({},y)),b={topicStyle:u,setTopicStyle:function(e){f(Object(rt.merge)(s,{primaryTopic:e}))}},v=Object(o.createElement)(pi,lt({},b)),x={topicStyle:d,setTopicStyle:function(e){f(Object(rt.merge)(s,{normalTopic:e}))}},T=Object(o.createElement)(pi,lt({},x)),w={id:ui,handleTabIdChange:function(e){ui=e}},O=Object(o.createElement)(Ar,null,Object(o.createElement)(m.w,lt({},w),Object(o.createElement)(m.v,{id:"normal",title:"NormalTopic",panel:T}),Object(o.createElement)(m.v,{id:"primary",title:"PrimaryTopic",panel:v}),Object(o.createElement)(m.v,{id:"root",title:"RootTopic",panel:g}))),k={isOpen:i,onClose:function(e){a(!1)}},E=Object(o.createElement)(m.a,lt({},k),Object(o.createElement)("p",null,"File format error"));return Object(o.createElement)(Wt,null,Object(o.createElement)(Br,null,Object(o.createElement)(Ir,null,"Global"),Object(o.createElement)(zr,null,Object(o.createElement)(Lr,null,"Background:"),Object(o.createElement)(Vr,{color:s.background,handleColorChange:function(e){f(Object(rt.merge)(s,{background:e}))}}),Object(o.createElement)(Lr,null,"Highlight:"),Object(o.createElement)(Vr,{color:s.highlightColor,handleColorChange:function(e){f(Object(rt.merge)(s,{highlightColor:e}))}}),Object(o.createElement)(Lr,null,"Random Color:"),Object(o.createElement)(zt,{checked:s.randomColor,onChange:h}))),O,Object(o.createElement)(Br,null,Object(o.createElement)(Wr,{title:"Export Theme",handleClick:function(e){Cn(JSON.stringify(s),"blink-mind-theme.json")}}),Object(o.createElement)(Wr,{title:"Import Theme",handleClick:function(e){Sn(".json,.txt").then((function(e){var t,n=JSON.parse(e);null!=(t=n).name&&null!=t.background&&null!=t.highlightColor?f(n):a(!0)}))}})),E)}function fi(){var e="topic-style",t=function(t){e=t};return{renderRightTopPanel:function(n){var r=lt(lt({},n),{key:"right-top-panel",selectedTabId:e,handleTabIdChange:t});return Object(o.createElement)(Sr,lt({},r))},renderRightTopPanelTabs:function(e){var t=e.controller;return[t.run("renderTopicStyleEditor",e),t.run("renderThemeEditor",e)]},renderTopicStyleEditor:function(e){var t={id:"topic-style",key:"topic-style",title:"TopicStyle",panel:Object(o.createElement)(ii,lt({},e))};return Object(o.createElement)(m.v,lt({},t))},renderThemeEditor:function(e){var t={id:"theme-editor",key:"theme-editor",title:"Theme",panel:Object(o.createElement)(di,lt({},e))};return Object(o.createElement)(m.v,lt({},t))}}}var hi=h()("plugin:utils");function mi(){var e=new Map,t=new Map;return{addTempValueChangeListener:function(e){var n=e.key,o=e.listener;t.has(n)||t.set(n,[]),t.get(n).push(o)},removeTempValueChangeListener:function(e){var n=e.key,o=e.listener;t.has(n)&&(t[n]=t.get(n).filter((function(e){return e!==o})))},getTempValue:function(t){var n=t.key;return hi("getTempValue",n),e.get(n)},setTempValue:function(n){var o,r,i=n.key,a=n.value;if(hi("setTempValue",i),e.set(i,a),t.has(i)){var l=t.get(i);try{for(var c=pt(l),s=c.next();!s.done;s=c.next()){(0,s.value)(a)}}catch(p){o={error:p}}finally{try{s&&!s.done&&(r=c.return)&&r.call(c)}finally{if(o)throw o.error}}}},deleteTempValue:function(t){var n=t.key;hi("deleteTempValue",n);var o=e.get(n);return e.delete(n),o}}}var yi=h()("plugin:StylePlugin");function gi(){var e=new Map,t=0;return{getTopicStyle:function(e){var t=e.controller;return{contentStyle:t.run("getTopicContentStyle",e),linkStyle:t.run("getLinkStyle",e),subLinkStyle:t.run("getSubLinkStyle",e)}},getTopicContentStyle:function(e){var t=e.topicKey,n=e.model,o=e.controller;yi("getTopicContentStyle:",t,n);var r,i=n.getTopicVisualLevel(t),a=n.config.theme;if(r=i===N?a.rootTopic:i===P?a.primaryTopic:a.normalTopic,r=lt(lt({},a.contentStyle),r.contentStyle),a.randomColor){var l=o.run("getRandomColor",e);r=lt(lt({},r),{background:l,borderColor:l,subLinkStyle:lt(lt({},r.subLinkStyle),{lineColor:l})})}var c=n.getTopic(t);if(!c.style)return r;var s=JSON.parse(c.style);return lt(lt({},r),s.contentStyle)},getLinkStyle:function(e){var t=e.topicKey,n=e.model,o=e.controller;yi("getLinkStyle",t);var r,i=n.getTopicVisualLevel(t),a=n.config.theme,l=a.linkStyle;r=i===N?a.rootTopic.linkStyle:i===P?a.primaryTopic.linkStyle:a.normalTopic.linkStyle,l=lt(lt({},l),r);var c=n.getTopic(t);if(null!=c.parentKey){var s=o.run("getSubLinkStyle",lt(lt({},e),{topicKey:c.parentKey}));l=lt(lt({},l),s)}if(!c.style)return l;var p=JSON.parse(c.style);return lt(lt({},l),p.linkStyle)},getSubLinkStyle:function(e){var t=e.topicKey,n=e.model,o=e.controller;yi("getLinkStyle",t);var r,i=n.getTopicVisualLevel(t),a=n.config.theme,l=a.linkStyle;r=i===N?a.rootTopic.subLinkStyle:i===P?a.primaryTopic.subLinkStyle:a.normalTopic.subLinkStyle,l=lt(lt({},l),r);var c=n.getTopic(t);if(a.randomColor){var s=o.run("getRandomColor",e);yi(s),l=lt(lt({},l),{lineColor:s})}if(!c.style)return l;var p=JSON.parse(c.style);return lt(lt({},l),p.subLinkStyle)},setTopicContentStyle:function(e){var t=e.topicKey,n=e.controller,o=e.style,r=e.model.getTopic(t).style,i=r?JSON.parse(r):{},a=lt(lt({},i),{contentStyle:lt(lt({},i.contentStyle),o)});if(!Object(rt.isEqual)(i,a)){var l=JSON.stringify(a);n.run("operation",lt(lt({},e),{opType:te,style:l}))}},setLinkStyle:function(e){var t=e.topicKey,n=e.controller,o=e.linkStyle,r=e.model.getTopic(t).style,i=r?JSON.parse(r):{},a=lt(lt({},i),{linkStyle:lt(lt({},i.linkStyle),o)});if(!Object(rt.isEqual)(i,a)){var l=JSON.stringify(a);n.run("operation",lt(lt({},e),{opType:te,style:l}))}},setSubLinkStyle:function(e){var t=e.topicKey,n=e.controller,o=e.subLinkStyle,r=e.model.getTopic(t).style,i=r?JSON.parse(r):{},a=lt(lt({},i),{subLinkStyle:lt(lt({},i.subLinkStyle),o)});if(!Object(rt.isEqual)(i,a)){var l=JSON.stringify(a);n.run("operation",lt(lt({},e),{opType:te,style:l}))}},getTopicThemeStyle:function(e){var t=e.topicKey,n=e.model,o=n.getTopicVisualLevel(t),r=n.config.theme;return o===N?r.rootTopic:o===P?r.primaryTopic:r.normalTopic},getRandomColor:function(n){var o=n.topicKey;if(e.has(o))return e.get(o);var r=["#00CC99","#FFEE88","#A167A5","#E5F993","#F5C396","#DB995A","#83BCFF","#ED7B84","#739E82","#D3BCC0","#FFA0FD","#EFD3D7","#C6878F"],i=r[++t%r.length];return e.set(o,i),yi("getRandomColor",o,i),i},clearAllCustomStyle:function(e){var t=e.model,n=e.controller,o=t.withMutations((function(e){e.topics.keySeq().forEach((function(t){e.setIn(["topics",t,"style"],null)}))}));n.change(o)}}}function bi(){return[[wr(),mi(),{renderTopicContextMenu:function(e){return Object(o.createElement)(Wn,lt({},e))},customizeTopicContextMenu:function(e){var t=e.topicKey,n=e.model,r=e.controller,i=t===n.editorRootTopicKey;function a(t){return function(n){t.opType&&r.run("operation",lt(lt({},e),{opType:t.opType}))}}return Gn.map((function(e){return i&&!e.rootCanUse?null:Object(o.createElement)(m.p,{key:e.label,icon:an(e.icon),text:e.label,labelElement:Object(o.createElement)("kbd",null,e.shortcut),onClick:a(e)})}))}},fi(),$n()],{getPartTopics:function(e){var t=e.layout,n=e.model,o=e.topicKey,r=n.getTopic(o),i=r.subKeys.size,a=r.subKeys.toArray();switch(t){case j.LEFT_TO_RIGHT:return{R:a};case j.RIGHT_TO_LEFT:return{L:a};case j.LEFT_AND_RIGHT:return{L:a.slice(Math.ceil(i/2),i),R:a.slice(0,Math.ceil(i/2))};case j.TOP_TO_BOTTOM:return{B:a}}},createSubTopics:function(e){var t=e.model,n=e.topicKey,o=e.controller,r=e.topics,i=e.saveRef,a=t.getTopic(n);if(0===r.size||a.collapse)return null;var l=[];return r.forEach((function(t){var n=lt(lt({},e),{topicKey:t,key:t,ref:i(pn(t))});l.push(o.run("renderTopicWidget",n))})),{subTopics:l}},layout:function(e){var t=e.getRef,n=e.model,o=t(dn(n.editorRootTopicKey)),r=t(vn),i=t(xn);o&&o.layout(),r&&r.layout(),i&&i.layout(),function e(o){var r,i;if(o.key!==n.editorRootTopicKey){var a=t(pn(o.key));a&&a.layoutLinks()}if(!o.collapse)try{for(var l=pt(o.subKeys),c=l.next();!c.done;c=l.next()){var s=c.value;e(n.getTopic(s))}}catch(p){r={error:p}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}(n.getTopic(n.editorRootTopicKey))},setLayoutDir:function(e){var t=e.layoutDir,n=e.model;e.controller.change(ye.setLayoutDir({model:n,layoutDir:t}))},getRelativeRect:function(e){var t=e.element,n=e.controller,o=e.getRef,r=n.run("getZoomFactor",e);return Nn(t,o(gn).bigView,r)},getRelativeRectFromViewPort:function(e){var t=e.element,n=e.controller,o=e.getRef,r=n.run("getZoomFactor",e);return Nn(t,o(gn).viewBox,r)},getRelativeVectorFromViewPort:function(e){return Pn(e.element,(0,e.getRef)(gn).viewBox)},addZoomFactorChangeEventListener:function(e){e.controller.run("addTempValueChangeListener",lt({key:"ZoomFactor"},e))},removeZoomFactorChangeEventListener:function(e){e.controller.run("removeTempValueChangeListener",lt({key:"ZoomFactor"},e))},setZoomFactor:function(e){var t=e.controller,n=e.zoomFactor;return t.run("setTempValue",{key:"ZoomFactor",value:n})},getZoomFactor:function(e){return e.controller.run("getTempValue",{key:"ZoomFactor"})||1},moveTopicToCenter:function(e){var t=e.getRef,n=e.topicKey,o=e.model;if(o.editorRootTopicKey!==n&&fe(o,n,o.editorRootTopicKey)!==V)throw new Error("moveTopicToCenter error: topicKey "+n+" is not the DESCENDANT of editor root topic");var r=t(un(n)),i=t(gn),a=i.viewBox;if(!r||!a)throw new Error("moveTopicToCenter error: topic or viewBox is null");var l=Pn(r,a);i.setViewBoxScrollDelta(l[0],l[1])},focusTopicAndMoveToCenter:function(e){var t=e.controller,n=e.topicKey;t.run("operation",lt(lt({},e),{opArray:[{opType:$,topicKey:n,focusMode:A},{opType:Z,topicKey:n}],callback:function(){t.run("moveTopicToCenter",lt(lt({},e),{topicKey:n}))}}))}},Vn(),gi(),Ut(),Hn(),{getValue:function(e,t){var n=e.propKey,o=e.controller;switch(n){case wn:return 3;case On:return o.run("isOperationEnabled",e);case kn:return o.run("getTopicTitle",e)}return t()}},$e()]}h()("node:Diagram");var vi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.resolveController=Object(b.a)((function(e,n){void 0===e&&(e=[]);var o=n();t.controller=new K({plugins:[e,o],construct:!1,onChange:t.props.onChange})})),t}return at(t,e),t.prototype.getDiagramProps=function(){return this.controller.run("getDiagramProps")},t.prototype.openNewModel=function(e){var t=this,n=this.getDiagramProps(),o=n.model,r=n.controller;r.run("deleteRefKey",lt(lt({},n),{topicKey:o.rootTopicKey})),r.run("operation",lt(lt({},n),{opType:Z,topicKey:e.focusKey,model:e,callback:function(){var e=t.getDiagramProps(),n=e.model;r.run("moveTopicToCenter",lt(lt({},e),{topicKey:n.focusKey}))}}))},t.prototype.render=function(){var e=this.props.plugins;return this.resolveController(e,bi),this.diagramProps=lt(lt({},this.props),{controller:this.controller}),this.controller.run("renderDiagram",this.diagramProps)},t}(o.Component),xi=n(280),Ti=n.n(xi),wi=n(152),Oi=n.n(wi),ki=function(e,t){return(ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Ei(e,t){function n(){this.constructor=e}ki(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ci=function(){return(Ci=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};var Si,ji=h()("node:topic-content-editor"),Ki=d.default.div(Si||(Si=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}(["\n  ",";\n"],["\n  ",";\n"])),(function(e){return!e.readOnly&&"\n    // padding: 75px\n    // min-width: 150px\n    // min-height: 150px\n  "})),Ri=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ei(t,e),t.prototype.initState=function(){e.prototype.initState.call(this);var t=this.props,n=t.controller,o="topic-desc-data-"+t.topicKey,r=this.state.content;n.run("setTempValue",{key:o,value:r})},t.prototype.getCustomizeProps=function(){var e=this.props,t=e.model,n=e.topicKey;return{block:t.getTopic(n).getBlock(M).block,readOnly:t.editingDescKey!==n,getRefKeyFunc:sn,placeholder:"write topic notes here"}},t.prototype.onChange=function(e){var t=this.props,n=t.controller,o="topic-desc-data-"+t.topicKey;n.run("setTempValue",{key:o,value:e}),this.setState({content:e})},t}(function(e){function t(t){var n=e.call(this,t)||this;return n.onMouseDown=function(e){e.stopPropagation()},n.onMouseMove=function(e){e.stopPropagation()},n.rootRef=function(e){return function(t){e(t),n.root=t}},n._handleClick=function(e){!n.root.contains(e.target)&&n.onClickOutSide(e)},n.initState(),n}return Ei(t,e),t.prototype.initState=function(){this.state={content:this.getContent()}},t.prototype.getContent=function(){return this.getCustomizeProps().block.data},t.prototype.onChange=function(e){this.setState({content:e})},t.prototype.getCustomizeProps=function(){return null},t.prototype.componentDidMount=function(){document.addEventListener("click",this._handleClick)},t.prototype.componentWillUnmount=function(){document.removeEventListener("click",this._handleClick)},t.prototype.onClickOutSide=function(e){},t.prototype.render=function(){var e=this.props,t=e.topicKey,n=e.saveRef,r=this.getCustomizeProps(),i=r.readOnly,a=r.getRefKeyFunc,l=r.placeholder;ji("readOnly:",i);var c=i?this.getContent():this.state.content;if(null==c)return null;var s=a(t),p=this.onMouseDown,u=this.onMouseMove,d={editorValue:c,readOnly:i,onChange:this.onChange.bind(this),placeholder:l},f={key:s,ref:this.rootRef(n(s)),readOnly:i,onMouseDown:p,onMouseMove:u};return Object(o.createElement)(Ki,Ci({},f),Object(o.createElement)(Ti.a,Ci({},d)))},t}(St)),Di=new Oi.a;var _i=function(){return{renderTopicDescEditor:function(e){return Object(o.createElement)(Ri,Ci({},e))},isBlockEmpty:function(e,t){var n=e.block,o=e.controller;return n.type===I||n.type===M?null==n.data||""===o.run("serializeBlockData",e):t()},serializeBlockData:function(e,t){var n=e.block;return n.type===M?"string"===typeof n.data?n.data:Di.serialize(n.data):t()}}},Ni=function(){return(Ni=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Pi=h()("plugin:json-serializer");var Ii={name:"default",randomColor:!0,background:"rgb(57,60,65)",highlightColor:"#50C9CE",marginH:60,marginV:20,contentStyle:{lineHeight:"1.5",fontSize:"16px"},linkStyle:{lineRadius:5,lineType:"curve",lineWidth:"3px"},rootTopic:{contentStyle:{fontSize:"36px"},subLinkStyle:{lineType:"curve",lineWidth:"3px"}},primaryTopic:{contentStyle:{fontSize:"24px"},subLinkStyle:{lineType:"curve",lineWidth:"3px"}},normalTopic:{subLinkStyle:{lineType:"curve",lineWidth:"3px"}}},Mi={name:"theme1",randomColor:!1,background:"rgb(250,245,205)",highlightColor:"#50C9CE",marginH:50,marginV:30,contentStyle:{lineHeight:"1.5"},linkStyle:{lineRadius:5},rootTopic:{contentStyle:{background:"rgb(221, 170, 68)",color:"#fff",fontSize:"34px",borderRadius:"5px",padding:"16px 18px 16px 18px"},subLinkStyle:{lineType:"curve",lineWidth:"2px",lineColor:"rgb(221, 170, 68)"}},primaryTopic:{contentStyle:{background:"#e8eaec",borderWidth:"2px",borderStyle:"solid",borderColor:"rgb(221, 170, 68)",borderRadius:"5px",fontSize:"17px",padding:"10px 15px 10px 15px"},subLinkStyle:{lineType:"curve",lineWidth:"2px",lineColor:"rgb(221, 170, 68)"}},normalTopic:{contentStyle:{background:"#fff",border:"1px solid #e8eaec",borderRadius:"20px",color:"rgb(187, 136, 34)",fontSize:"13px",padding:"4px 10px"},subLinkStyle:{lineType:"round",lineRadius:5,lineWidth:"1px",lineColor:"rgb(187, 136, 34)"}}},Ai={name:"theme2",randomColor:!1,background:"#f8f8f8",highlightColor:"#50C9CE",marginH:45,marginV:10,contentStyle:{lineHeight:"1.5"},linkStyle:{lineRadius:5},rootTopic:{contentStyle:{background:"#50C18A",color:"#fff",fontSize:"34px",borderRadius:"5px",padding:"16px 18px 16px 18px"},subLinkStyle:{lineType:"curve",lineWidth:"2px",lineColor:"#43a9ff"}},primaryTopic:{contentStyle:{background:"#ffffff",borderWidth:"1px",borderStyle:"solid",borderColor:"rgb(221, 170, 68)",borderRadius:"5px",color:"rgb(103,103,103)",fontSize:"14px",padding:"6px 10px 5px 10px"},subLinkStyle:{lineType:"round",lineRadius:5,lineWidth:"2px",lineColor:"#43a9ff"}},normalTopic:{contentStyle:{background:"#fff",borderRadius:"5px",color:"rgb(103,103,103)",fontSize:"13px",padding:"3px 9px 4px",boxShadow:"1px 1px 1px #ccc"},subLinkStyle:{lineType:"round",lineRadius:5,lineWidth:"1px",lineColor:"#43a9ff"}}},Li={name:"theme3",randomColor:!1,background:"#A9DEF9",highlightColor:"#50C9CE",marginH:50,marginV:20,contentStyle:{lineHeight:"1.5"},linkStyle:{lineRadius:5},rootTopic:{contentStyle:{background:"#FF99C8",color:"#fff",fontSize:"34px",borderRadius:"5px",padding:"16px 18px 16px 18px"},subLinkStyle:{lineType:"curve",lineWidth:"2px",lineColor:"#43a9ff"}},primaryTopic:{contentStyle:{background:"#FCF6BD",borderWidth:"1px",borderStyle:"solid",borderColor:"#E4C1F9",borderRadius:"5px",color:"rgb(103,103,103)",fontSize:"14px",padding:"6px 10px 5px 10px"},subLinkStyle:{lineType:"curve",lineWidth:"2px",lineColor:"#43a9ff"}},normalTopic:{contentStyle:{background:"#E4FDE1",borderRadius:"5px",color:"rgb(103,103,103)",fontSize:"13px",padding:"3px 9px 4px",boxShadow:"1px 1px 1px #ccc"},subLinkStyle:{lineType:"round",lineRadius:5,lineWidth:"1px",lineColor:"#43a9ff"}}},zi={name:"theme3",randomColor:!1,background:"#CCFBFE",highlightColor:"#50C9CE",marginH:50,marginV:20,contentStyle:{lineHeight:"1.5"},linkStyle:{lineRadius:5},rootTopic:{contentStyle:{background:"#CD8987",color:"#fff",fontSize:"34px",borderRadius:"5px",padding:"16px 18px 16px 18px"},subLinkStyle:{lineType:"curve",lineWidth:"2px",lineColor:"#43a9ff"}},primaryTopic:{contentStyle:{background:"#CDACA1",borderWidth:"1px",borderStyle:"solid",borderColor:"#E4C1F9",borderRadius:"5px",color:"rgb(103,103,103)",fontSize:"14px",padding:"6px 10px 5px 10px"},subLinkStyle:{lineType:"line",lineWidth:"2px",lineColor:"#43a9ff"}},normalTopic:{contentStyle:{background:"#CDCACC",borderRadius:"5px",color:"rgb(103,103,103)",fontSize:"13px",padding:"3px 9px 4px",boxShadow:"1px 1px 1px #ccc"},subLinkStyle:{lineType:"line",lineRadius:5,lineWidth:"1px",lineColor:"#43a9ff"}}};var Fi=n(286),Hi=n(20),Bi=n(16),Vi=(n(847),n(29)),Wi=n(63),Gi=n(50),Ui=function(e,t){return(Ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function qi(e,t){function n(){this.constructor=e}Ui(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Yi=function(){return(Yi=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function Zi(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function Ji(e){var t=e.controller,n=e.model,r=e.topicKey,i=n.focusKey===r&&"FOCUS_MODE_EDITING_TOPOLOGY"===n.focusMode,a=n.getTopic(r).getBlock("TOPOLOGY").block;if(!i&&!a)return null;var l={className:rn("topology"),onClick:function(n){n.stopPropagation(),t.run("operation",Yi(Yi({},e),{opType:"OP_TYPE_START_EDITING_TOPOLOGY"}))},tabIndex:-1};return Object(o.createElement)(Bt,Yi({},l))}var Xi,Qi,$i,ea,ta,na,oa,ra,ia,aa,la=[{group:"Basic",children:[{name:"rectangle",icon:"icon-rect",data:{text:"Topology",rect:{width:100,height:100},paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,name:"rectangle",icon:"\ue64d",iconFamily:"topology",iconColor:"#2f54eb"}},{name:"rectangle",icon:"icon-rectangle",data:{text:"rectangle",rect:{width:200,height:50},paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,borderRadius:.1,name:"rectangle"}},{name:"circle",icon:"icon-circle",data:{text:"circle",rect:{width:100,height:100},name:"circle",textMaxLine:1}},{name:"triangle",icon:"icon-triangle",data:{text:"triangle",rect:{width:100,height:100},name:"triangle"}},{name:"diamond",icon:"icon-diamond",data:{text:"diamond",rect:{width:100,height:100},name:"diamond"}},{name:"pentagon",icon:"icon-pentagon",data:{text:"pentagon",rect:{width:100,height:100},name:"pentagon"}},{name:"hexagon",icon:"icon-hexagon",data:{text:"hexagon",rect:{width:100,height:100},paddingTop:10,paddingBottom:10,name:"hexagon"}},{name:"pentagram",icon:"icon-pentagram",data:{text:"pentagram",rect:{width:100,height:100},name:"pentagram"}},{name:"left arrow",icon:"icon-arrow-left",data:{text:"",rect:{width:200,height:100},name:"leftArrow"}},{name:"right arrow",icon:"icon-arrow-right",data:{text:"",rect:{width:200,height:100},name:"rightArrow"}},{name:"bidirectional arrow",icon:"icon-twoway-arrow",data:{text:"",rect:{width:200,height:100},name:"twowayArrow"}},{name:"line",icon:"icon-line",data:{text:"line",rect:{width:100,height:100},name:"line"}},{name:"cloud",icon:"icon-cloud",data:{text:"cloud",rect:{width:100,height:100},name:"cloud"}},{name:"message",icon:"icon-msg",data:{text:"message",rect:{width:100,height:100},paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,name:"message"}},{name:"file",icon:"icon-file",data:{text:"file",rect:{width:80,height:100},paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,name:"file"}},{name:"text",icon:"icon-text",data:{text:"text",rect:{width:160,height:30},name:"text"}},{name:"image",icon:"icon-image",data:{text:"",rect:{width:100,height:100},name:"image",image:"/assets/img/logo.png"}},{name:"cube",icon:"icon-cube",data:{rect:{width:50,height:70},is3D:!0,z:10,zRotate:15,fillStyle:"#ddd",name:"cube",icon:"\ue63c",iconFamily:"topology",iconColor:"#777",iconSize:30}},{name:"people",icon:"icon-people",data:{rect:{width:70,height:100},name:"people"}},{name:"multi media",icon:"icon-pc",data:{text:"multi media",rect:{width:200,height:200},paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,name:"div"}}]},{group:"Flow Graph",children:[{name:"start/end",icon:"icon-flow-start",data:{text:"start",rect:{width:120,height:40},borderRadius:.5,name:"rectangle"}},{name:"flow",icon:"icon-rectangle",data:{text:"flow",rect:{width:120,height:40},name:"rectangle"}},{name:"judgement",icon:"icon-diamond",data:{text:"judgement",rect:{width:120,height:60},name:"diamond"}},{name:"data",icon:"icon-flow-data",data:{text:"data",rect:{width:120,height:50},name:"flowData"}},{name:"prepare",icon:"icon-flow-ready",data:{text:"prepare",rect:{width:120,height:50},name:"hexagon"}},{name:"sub flow",icon:"icon-flow-subprocess",data:{text:"sub flow",rect:{width:120,height:50},name:"flowSubprocess"}},{name:"database",icon:"icon-db",data:{text:"database",rect:{width:80,height:120},name:"flowDb"}},{name:"document",icon:"icon-flow-document",data:{text:"document",rect:{width:120,height:100},name:"flowDocument"}},{name:"internal storage",icon:"icon-internal-storage",data:{text:"internal storage",rect:{width:120,height:80},name:"flowInternalStorage"}},{name:"external storage",icon:"icon-extern-storage",data:{text:"external storage",rect:{width:120,height:80},name:"flowExternStorage"}},{name:"queue",icon:"icon-flow-queue",data:{text:"queue",rect:{width:100,height:100},name:"flowQueue"}},{name:"input manually",icon:"icon-flow-manually",data:{text:"input manually",rect:{width:120,height:80},name:"flowManually"}},{name:"display",icon:"icon-flow-display",data:{text:"display",rect:{width:120,height:80},name:"flowDisplay"}},{name:"parallel",icon:"icon-flow-parallel",data:{text:"parallel",rect:{width:120,height:50},name:"flowParallel"}},{name:"comment",icon:"icon-flow-comment",data:{text:"comment",rect:{width:100,height:100},name:"flowComment"}}]},{group:"Activity Diagram",children:[{name:"start",icon:"icon-inital",data:{text:"",rect:{width:30,height:30},name:"circle",fillStyle:"#555",strokeStyle:"transparent"}},{name:"end",icon:"icon-final",data:{text:"",rect:{width:30,height:30},name:"activityFinal"}},{name:"action",icon:"icon-action",data:{text:"action",rect:{width:120,height:50},borderRadius:.25,name:"rectangle"}},{name:"decision/merge",icon:"icon-diamond",data:{text:"\u51b3\u7b56",rect:{width:120,height:50},name:"diamond"}},{name:"vertical swimming lane",icon:"icon-swimlane-v",data:{text:"vertical swimming lane",rect:{width:200,height:500},name:"swimlaneV"}},{name:"horizontal swimming lane",icon:"icon-swimlane-h",data:{text:"horizontal swimming lane",rect:{width:500,height:200},name:"swimlaneH"}},{name:"vertical fork/merge",icon:"icon-fork-v",data:{text:"",rect:{width:10,height:150},name:"forkV",fillStyle:"#555",strokeStyle:"transparent"}},{name:"horizontal fork/merge",icon:"icon-fork",data:{text:"",rect:{width:150,height:10},name:"forkH",fillStyle:"#555",strokeStyle:"transparent"}}]},{group:"Sequence Diagram && Class Diagram",children:[{name:"lifeline",icon:"icon-lifeline",data:{text:"lifeline",rect:{width:150,height:400},name:"lifeline"}},{name:"activation",icon:"icon-focus",data:{text:"",rect:{width:12,height:200},name:"sequenceFocus"}},{name:"simple class",icon:"icon-simple-class",data:{text:"Topolgoy",rect:{width:270,height:200},paddingTop:40,font:{fontFamily:"Arial",color:"#222",fontWeight:"bold"},fillStyle:"#ffffba",strokeStyle:"#7e1212",name:"simpleClass",children:[{text:"- name: string\n+ setName(name: string): void",name:"text",paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rectInParent:{x:0,y:0,width:"100%",height:"100%",rotate:0},font:{fontFamily:"Arial",color:"#222",textAlign:"left",textBaseline:"top"}}]}},{name:"class",icon:"icon-class",data:{text:"Topolgoy",rect:{width:270,height:200},paddingTop:40,font:{fontFamily:"Arial",color:"#222",fontWeight:"bold"},fillStyle:"#ffffba",strokeStyle:"#7e1212",name:"interfaceClass",children:[{text:"- name: string",name:"text",paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rectInParent:{x:0,y:0,width:"100%",height:"50%",rotate:0},font:{fontFamily:"Arial",color:"#222",textAlign:"left",textBaseline:"top"}},{text:"+ setName(name: string): void",name:"text",paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10,rectInParent:{x:0,y:"50%",width:"100%",height:"50%",rotate:0},font:{fontFamily:"Arial",color:"#222",textAlign:"left",textBaseline:"top"}}]}}]}],ca=d.default.div(Xi||(Xi=Zi(["\n  position: relative;\n  display: flex;\n  width: 100%;\n  height: 100%;\n"],["\n  position: relative;\n  display: flex;\n  width: 100%;\n  height: 100%;\n"]))),sa=d.default.div(Qi||(Qi=Zi(["\n  flex: 1;\n  width: initial;\n  position: relative;\n  overflow: auto;\n  background: #fff;\n"],["\n  flex: 1;\n  width: initial;\n  position: relative;\n  overflow: auto;\n  background: #fff;\n"]))),pa=d.default.div($i||($i=Zi(["\n  flex-shrink: 0;\n  width: 1.75rem;\n  background-color: #f8f8f8;\n  border-right: 1px solid #d9d9d9;\n  overflow-y: auto;\n"],["\n  flex-shrink: 0;\n  width: 1.75rem;\n  background-color: #f8f8f8;\n  border-right: 1px solid #d9d9d9;\n  overflow-y: auto;\n"]))),ua=d.default.div(ea||(ea=Zi(["\n  color: #0d1a26;\n  font-weight: 600;\n  font-size: 0.12rem;\n  padding: 0.05rem 0.1rem;\n  margin-top: 0.08rem;\n  border-bottom: 1px solid #ddd;\n\n  &:first-child {\n    border-top: none;\n  }\n"],["\n  color: #0d1a26;\n  font-weight: 600;\n  font-size: 0.12rem;\n  padding: 0.05rem 0.1rem;\n  margin-top: 0.08rem;\n  border-bottom: 1px solid #ddd;\n\n  &:first-child {\n    border-top: none;\n  }\n"]))),da=d.default.div(ta||(ta=Zi(["\n  padding: 0.1rem 0;\n  a {\n    display: inline-block;\n    color: @text-color;\n    line-height: 1;\n    width: 0.4rem;\n    height: 0.4rem;\n    text-align: center;\n    text-decoration: none !important;\n\n    .iconfont {\n      font-size: 0.24rem;\n    }\n  }\n"],["\n  padding: 0.1rem 0;\n  a {\n    display: inline-block;\n    color: @text-color;\n    line-height: 1;\n    width: 0.4rem;\n    height: 0.4rem;\n    text-align: center;\n    text-decoration: none !important;\n\n    .iconfont {\n      font-size: 0.24rem;\n    }\n  }\n"]))),fa=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={id:"",data:null,toolsConfig:la,iconfont:{fontSize:"0.24rem"}},t.canvasOptions={},t.handleContextMenu=function(e){e.preventDefault(),e.stopPropagation()},t.onMessage=function(e,n){var o=(0,t.props.getRef)("TOPOLOGY_DIAGRAM_UTIL");switch(e){case"resize":case"scale":case"locked":t.topology&&o&&o.setCanvasData(t.topology.data)}},t}return qi(t,e),t.prototype.canvasRegister=function(){Object(Hi.registerNode)("flowData",Bi.flowData,Bi.flowDataAnchors,Bi.flowDataIconRect,Bi.flowDataTextRect),Object(Hi.registerNode)("flowSubprocess",Bi.flowSubprocess,null,Bi.flowSubprocessIconRect,Bi.flowSubprocessTextRect),Object(Hi.registerNode)("flowDb",Bi.flowDb,null,Bi.flowDbIconRect,Bi.flowDbTextRect),Object(Hi.registerNode)("flowDocument",Bi.flowDocument,Bi.flowDocumentAnchors,Bi.flowDocumentIconRect,Bi.flowDocumentTextRect),Object(Hi.registerNode)("flowInternalStorage",Bi.flowInternalStorage,null,Bi.flowInternalStorageIconRect,Bi.flowInternalStorageTextRect),Object(Hi.registerNode)("flowExternStorage",Bi.flowExternStorage,Bi.flowExternStorageAnchors,Bi.flowExternStorageIconRect,Bi.flowExternStorageTextRect),Object(Hi.registerNode)("flowQueue",Bi.flowQueue,null,Bi.flowQueueIconRect,Bi.flowQueueTextRect),Object(Hi.registerNode)("flowManually",Bi.flowManually,Bi.flowManuallyAnchors,Bi.flowManuallyIconRect,Bi.flowManuallyTextRect),Object(Hi.registerNode)("flowDisplay",Bi.flowDisplay,Bi.flowDisplayAnchors,Bi.flowDisplayIconRect,Bi.flowDisplayTextRect),Object(Hi.registerNode)("flowParallel",Bi.flowParallel,Bi.flowParallelAnchors,null,null),Object(Hi.registerNode)("flowComment",Bi.flowComment,Bi.flowCommentAnchors,null,null),Object(Hi.registerNode)("activityFinal",Vi.activityFinal,null,Vi.activityFinalIconRect,Vi.activityFinalTextRect),Object(Hi.registerNode)("swimlaneV",Vi.swimlaneV,null,Vi.swimlaneVIconRect,Vi.swimlaneVTextRect),Object(Hi.registerNode)("swimlaneH",Vi.swimlaneH,null,Vi.swimlaneHIconRect,Vi.swimlaneHTextRect),Object(Hi.registerNode)("forkH",Vi.fork,Vi.forkHAnchors,Vi.forkIconRect,Vi.forkTextRect),Object(Hi.registerNode)("forkV",Vi.fork,Vi.forkVAnchors,Vi.forkIconRect,Vi.forkTextRect),Object(Hi.registerNode)("simpleClass",Wi.simpleClass,null,Wi.simpleClassIconRect,Wi.simpleClassTextRect),Object(Hi.registerNode)("interfaceClass",Wi.interfaceClass,null,Wi.interfaceClassIconRect,Wi.interfaceClassTextRect),Object(Hi.registerNode)("lifeline",Gi.lifeline,Gi.lifelineAnchors,Gi.lifelineIconRect,Gi.lifelineTextRect),Object(Hi.registerNode)("sequenceFocus",Gi.sequenceFocus,Gi.sequenceFocusAnchors,Gi.sequenceFocusIconRect,Gi.sequenceFocusTextRect)},t.prototype.componentDidMount=function(){this.canvasRegister(),this.canvasOptions.on=this.onMessage,this.topology=new Fi.Topology("topology-canvas",this.canvasOptions),this.openData()},t.prototype.componentDidUpdate=function(){this.openData()},t.prototype.openData=function(){var e=this.props,t=e.model,n=e.topicKey,o=t.getTopic(n).getBlock("TOPOLOGY").block;o&&o.data&&""!==o.data&&(this.setState({data:o.data}),this.topology.open(o.data))},t.prototype.onDrag=function(e,t){e.dataTransfer.setData("Text",JSON.stringify(t.data))},t.prototype.renderTools=function(){var e=this;return Object(o.createElement)(pa,null,this.state.toolsConfig.map((function(t,n){return Object(o.createElement)("div",{key:n},Object(o.createElement)(ua,null,t.group),Object(o.createElement)(da,null,t.children.map((function(t,n){return Object(o.createElement)("a",{key:n,title:t.name,draggable:!0,onDragStart:function(n){e.onDrag(n,t)}},Object(o.createElement)("i",{className:"iconfont "+t.icon,style:e.state.iconfont}))}))))})))},t.prototype.render=function(){return Object(o.createElement)(ca,null,this.renderTools(),Object(o.createElement)(sa,{id:"topology-canvas",onContextMenu:this.handleContextMenu}))},t}(St),ha=d.default.div(na||(na=Zi(["\n  position: absolute;\n  background: white;\n  right: 30px;\n  bottom: 20px;\n  border-radius: 2px;\n  z-index: 3;\n  display: flex;\n  flex-direction: row;\n  user-select: none;\n"],["\n  position: absolute;\n  background: white;\n  right: 30px;\n  bottom: 20px;\n  border-radius: 2px;\n  z-index: 3;\n  display: flex;\n  flex-direction: row;\n  user-select: none;\n"]))),ma=Object(d.default)(Lt)(oa||(oa=Zi(["\n  margin: 10px;\n"],["\n  margin: 10px;\n"]))),ya=function(e){return Object(o.createElement)(m.x,{content:e.tooltip,position:g.a.TOP,className:y.a.ICON},Object(o.createElement)(ma,{onClick:e.onClick},e.children))},ga=d.default.span(ra||(ra=Zi(["\n  display: inline-block;\n  width: 80px;\n  height: 18px;\n"],["\n  display: inline-block;\n  width: 80px;\n  height: 18px;\n"]))),ba=function(e){function t(t){var n=e.call(this,t)||this;return n.setCanvasData=function(e){n.setState({canvasData:e})},n.onClickResetZoom=function(e){n.getTopology().scaleTo(1)},n.state={deleteConfirm:!1,canvasData:null},n}return qi(t,e),t.prototype.getTopology=function(){return(0,this.props.getRef)("TOPOLOGY_DIAGRAM").topology},t.prototype.render=function(){var e=this,t=this.props,n=t.controller,r={isOpen:this.state.deleteConfirm,cancelButtonText:"cancel",onConfirm:function(e){n.run("operation",Yi(Yi({},t),{opType:re,blockType:"TOPOLOGY"}))},onCancel:function(t){e.setState({deleteConfirm:!1})},onClose:function(t){e.setState({deleteConfirm:!1})}},i=this.state.canvasData,a=i?i.scale:1;return Object(o.createElement)(ha,null,Object(o.createElement)(ya,{onClick:this.onClickResetZoom,tooltip:"reset zoom"},Object(o.createElement)(ga,null,"zoom:"+Math.floor(100*a)+"%")),Object(o.createElement)(ya,{onClick:function(t){e.setState({deleteConfirm:!0})},tooltip:"delete this diagram"},an(nn)),Object(o.createElement)(m.a,Yi({},r),Object(o.createElement)("p",null,"Are you confirm to delete this topology diagram?")))},t}(o.Component),va=d.default.div(ia||(ia=Zi(["\n  position: relative;\n  overflow: auto;\n  padding: 0px 0px 0px 5px;\n  background: #88888850;\n  height: 100%;\n"],["\n  position: relative;\n  overflow: auto;\n  padding: 0px 0px 0px 5px;\n  background: #88888850;\n  height: 100%;\n"]))),xa=d.default.span(aa||(aa=Zi(["\n  padding: 0px 20px;\n"],["\n  padding: 0px 20px;\n"])));function Ta(e){var t=e.controller,n=e.topicKey,r=e.getRef,i=e.saveRef,a=Yi(Yi({},e),{ref:i("TOPOLOGY_DIAGRAM")}),l=Yi(Yi({},e),{ref:i("TOPOLOGY_DIAGRAM_UTIL")});return Object(o.createElement)(m.i,{title:Object(o.createElement)(xa,null,"Topology Diagram Editor"),icon:an("topology"),isOpen:!0,hasBackdrop:!0,backdropClassName:"backdrop",backdropProps:{onMouseDown:En},canOutsideClickClose:!1,isCloseButtonShown:!0,onClose:function(o){o.stopPropagation();var i=r("TOPOLOGY_DIAGRAM").topology.data;t.run("operation",Yi(Yi({},e),{opType:oe,topicKey:n,blockType:"TOPOLOGY",data:i,focusMode:A}))},size:"100%"},Object(o.createElement)(va,{onClick:En,onDoubleClick:En},Object(o.createElement)(fa,Yi({},a)),Object(o.createElement)(ba,Yi({},l))))}function wa(e){var t=e.model,n=e.topicKey,o=t.getTopic(n).getBlock("TOPOLOGY").block;return null!=o&&null!=o.data||(t=ye.setBlockData({model:t,topicKey:n,blockType:"TOPOLOGY",data:""})),t=ye.focusTopic({model:t,topicKey:n,focusMode:"FOCUS_MODE_EDITING_TOPOLOGY"})}var Oa=function(){return{renderTopicBlock:function(e,t){var n=e.controller;return"TOPOLOGY"===e.block.type?n.run("renderTopicBlockTopology",e):t()},renderTopicBlockTopology:function(e){return Object(o.createElement)(Ji,Yi({},e))},renderDrawer:function(e,t){var n=e.model;if("FOCUS_MODE_EDITING_TOPOLOGY"===n.focusMode){var r=Yi(Yi({},e),{topicKey:n.focusKey,key:"topology-drawer"});return Object(o.createElement)(Ta,Yi({},r))}return t()},customizeTopicContextMenu:function(e,t){var n=e.controller;return Object(o.createElement)(o.Fragment,null,t(),Object(o.createElement)(m.o,null),Object(o.createElement)(m.p,{icon:an("topology"),text:"Edit Topology Diagram",onClick:function(t){n.run("operation",Yi(Yi({},e),{opType:"OP_TYPE_START_EDITING_TOPOLOGY"}))}}))},getOpMap:function(e,t){var n=t();return n.set("OP_TYPE_START_EDITING_TOPOLOGY",wa),n}}},ka=n(876),Ea=function(e,t){return(Ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Ca(e,t){function n(){this.constructor=e}Ea(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Sa=function(){return(Sa=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function ja(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function Ka(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Ra,Da,_a=Object(d.default)(Vt)(Ra||(Ra=Ka(["\n  position: absolute;\n  left: calc(50% - 150px);\n  top: 30px;\n  width: 300px;\n  background: white;\n  padding: 10px;\n  user-select: none;\n"],["\n  position: absolute;\n  left: calc(50% - 150px);\n  top: 30px;\n  width: 300px;\n  background: white;\n  padding: 10px;\n  user-select: none;\n"]))),Na=d.default.div(Da||(Da=Ka(["\n  margin-bottom: 10px;\n"],["\n  margin-bottom: 10px;\n"])));function Pa(e){var t=e.zIndex,n=e.controller,r=e.topicKey;return Object(o.createElement)(_a,{zIndex:t},Object(o.createElement)(Na,null,"Please select the topics you want to reference. After selection, click the confirm button."),Object(o.createElement)(Pt,{justifyContent:"space-around"},Object(o.createElement)(m.d,{onClick:function(t){var o=n.run("getSelectedReferenceKeys",e);n.run("enableOperation",e),n.run("operation",Sa(Sa({},e),{opArray:[{opType:"OP_TYPE_SET_REFERENCE_TOPICS",topicKey:r,referenceKeys:o},{opType:$,topicKey:r,focusMode:A}]})),n.run("clearSelectedReferenceKeys",e)}},"Confirm"),Object(o.createElement)(m.d,{onClick:function(t){n.run("clearSelectedReferenceKeys",e),n.run("enableOperation",e),n.run("operation",Sa(Sa({},e),{opType:ee,focusMode:A}))}},"Cancel")))}var Ia={keyList:Object(x.List)(),dataMap:Object(x.Map)()},Ma=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ca(t,e),Object.defineProperty(t.prototype,"keyList",{get:function(){return this.get("keyList")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataMap",{get:function(){return this.get("dataMap")},enumerable:!0,configurable:!0}),t}(Object(x.Record)(Ia)),Aa={reference:Object(x.Map)()},La=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ca(t,e),Object.defineProperty(t.prototype,"reference",{get:function(){return this.get("reference")},enumerable:!0,configurable:!0}),t.prototype.getReferenceKeys=function(e){return this.reference.has(e)?this.reference.get(e).keyList.toArray():[]},t.prototype.getReferencedKeys=function(e){var t=[];return this.reference.forEach((function(n,o){n.keyList.includes(e)&&t.push(o)})),t},t}(Object(x.Record)(Aa));function za(e){var t=e.model,n=e.topicKey,o=e.referenceKeys,r=t.getExtDataItem("TOPIC_REFERENCE",La),i=r.reference.get(n)||new Ma;return i=i.set("keyList",Object(x.List)(o)),r=r.setIn(["reference",n],i),t=t.setIn(["extData","TOPIC_REFERENCE"],r)}var Fa,Ha,Ba,Va=d.default.div(Fa||(Fa=Ka(["\n  display: flex;\n  width: 380px;\n  margin: 10px;\n  justify-content: center;\n  align-items: center;\n"],["\n  display: flex;\n  width: 380px;\n  margin: 10px;\n  justify-content: center;\n  align-items: center;\n"]))),Wa=d.default.div(Ha||(Ha=Ka(["\n  width: 300px;\n  text-decoration: underline;\n  cursor: pointer;\n"],["\n  width: 300px;\n  text-decoration: underline;\n  cursor: pointer;\n"]))),Ga=d.default.div(Ba||(Ba=Ka(["\n  width: 80px;\n"],["\n  width: 80px;\n"])));function Ua(e){var t=e.controller,n=e.refKey,r=e.refType,i=e.removeHandler,a=ja(Object(o.useState)(!1),2),l=a[0],c=a[1],s=t.getValue(kn,Sa(Sa({},e),{topicKey:n,maxLength:100})),p={isOpen:l,cancelButtonText:"cancel",onConfirm:function(e){i(e)},onCancel:function(e){c(!1)},onClose:function(e){c(!1)}};return Object(o.createElement)(Va,null,Object(o.createElement)(Wa,{onClick:function(o){o.stopPropagation(),t.run("focusTopicAndMoveToCenter",Sa(Sa({},e),{topicKey:n}))}},s),Object(o.createElement)(Ga,null,"reference"===r&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(m.d,{onClick:function(e){c(!0)}},"Remove"),Object(o.createElement)(m.a,Sa({},p),Object(o.createElement)("p",null,"Are you confirm to remove this reference?")))))}var qa,Ya,Za,Ja,Xa,Qa=d.default.div(qa||(qa=Ka([""],[""]))),$a=d.default.div(Ya||(Ya=Ka(["\n  padding: 10px;\n"],["\n  padding: 10px;\n"]))),el=d.default.div(Za||(Za=Ka(["\n  max-height: 200px;\n  overflow: auto;\n"],["\n  max-height: 200px;\n  overflow: auto;\n"]))),tl=d.default.div(Ja||(Ja=Ka(["\n  font-size: 20px;\n  color: #106ba3;\n"],["\n  font-size: 20px;\n  color: #106ba3;\n"]))),nl=d.default.div(Xa||(Xa=Ka(["\n  text-decoration: underline;\n  color: #106ba3;\n  cursor: pointer;\n"],["\n  text-decoration: underline;\n  color: #106ba3;\n  cursor: pointer;\n"])));function ol(e){var t=e.topicKey,n=e.controller,r=e.model,i=r.extData.get("TOPIC_REFERENCE"),a=i.getReferenceKeys(t),l=0===a.length?null:Object(o.createElement)($a,null,Object(o.createElement)(tl,null,"Reference Topics:"),Object(o.createElement)(el,null,a.map((function(r){var a,l=Sa(Sa({},e),{key:r,refKey:r,refType:"reference",removeHandler:(a=r,function(o){o.stopPropagation();var r=i.reference.get(t).keyList;n.run("operation",Sa(Sa({},e),{opArray:[{opType:"OP_TYPE_SET_REFERENCE_TOPICS",topicKey:t,focusMode:A,referenceKeys:r.delete(r.indexOf(a)).toArray()}]}))})});return Object(o.createElement)(Ua,Sa({},l))})))),c=i.getReferencedKeys(t),s=0===c.length?null:Object(o.createElement)($a,null,Object(o.createElement)(tl,null,"Referenced Topics:"),Object(o.createElement)(el,null,c.map((function(t){var n=Sa(Sa({},e),{key:t,refKey:t,refType:"referenced"});return Object(o.createElement)(Ua,Sa({},n))})))),p=r.focusKey!==t&&Object(o.createElement)($a,null,Object(o.createElement)(nl,{onClick:function(t){t.stopPropagation(),n.run("focusTopicAndMoveToCenter",e)}},"Goto Origin Topic"));return Object(o.createElement)(Qa,{onMouseDown:En},l,s,p)}function rl(e){var t=e.model,n=e.topicKey,r=t.extData.get("TOPIC_REFERENCE")||new La,i=r.reference.get(n),a=[];if(r.reference.forEach((function(e,t){e.keyList.includes(n)&&a.push(t)})),(null==i||0===i.keyList.size)&&0===a.length)return null;var l={className:rn("reference"),tabIndex:-1},c=Object(o.createElement)(Bt,Sa({},l)),s={autoFocus:!1,content:Object(o.createElement)(ol,Sa({},e)),target:c,interactionKind:m.t.CLICK,hoverOpenDelay:500};return Object(o.createElement)(m.s,Sa({},s))}function il(e){var t=e.topicKey,n=e.selectedTopicKeys,r=n.has(t),i=ja(Object(o.useState)(r),2),a=i[0],l=i[1],c={checked:a,onChange:function(){n.has(t)?n.delete(t):n.add(t),l(!a)}};return Object(o.createElement)(zt,Sa({},c))}var al,ll,cl,sl,pl,ul=ka.a.ofType(),dl=Object(d.default)(ul)(al||(al=Ka(["\n  top: 20%;\n  left: 25% !important;\n  width: 50% !important;\n"],["\n  top: 20%;\n  left: 25% !important;\n  width: 50% !important;\n"]))),fl=d.default.div(ll||(ll=Ka(["\n  margin: 0 5px;\n  padding: 10px 5px;\n  width: 100%;\n  font-size: 16px;\n  cursor: pointer;\n  &:hover {\n    background: #e3e8ec;\n  }\n"],["\n  margin: 0 5px;\n  padding: 10px 5px;\n  width: 100%;\n  font-size: 16px;\n  cursor: pointer;\n  &:hover {\n    background: #e3e8ec;\n  }\n"]))),hl=Object(d.default)(m.s)(cl||(cl=Ka(["\n  display: block;\n"],["\n  display: block;\n"]))),ml=d.default.div(sl||(sl=Ka(["\n  padding: 10px;\n  font-size: 16px;\n  //max-width: 800px;\n  //max-height: 600px;\n  overflow: auto;\n"],["\n  padding: 10px;\n  font-size: 16px;\n  //max-width: 800px;\n  //max-height: 600px;\n  overflow: auto;\n"]))),yl=d.default.div(pl||(pl=Ka(["\n  white-space: break-spaces;\n"],["\n  white-space: break-spaces;\n"]))),gl={placeholder:"Search"};function bl(e){var t=e.model,n=(e.setSearchWord,e.controller),r=function(t){return function(o){n.run("focusTopicAndMoveToCenter",Sa(Sa({},e),{topicKey:t}))}},i=function(){var o=[];return t.topics.forEach((function(t,r){o.push({key:r,title:n.run("getTopicTitle",Sa(Sa({},e),{topicKey:r}))})})),o}();return Object(o.createElement)(dl,{inputProps:gl,itemListPredicate:function(e,t){return t.filter((function(t){return t.title.toLowerCase().includes(e.toLowerCase())}))},isOpen:!0,items:i,itemRenderer:function(e,t){var n=e.key,i=e.title,a=i.length>100,l=a?i.substr(0,100)+"...":i,c={key:n,onClick:r(n)},s=Object(o.createElement)(fl,Sa({},c),l),p={key:n,target:s,content:Object(o.createElement)(ml,null,Object(o.createElement)(yl,null,i)),fill:!0,interactionKind:m.t.HOVER_TARGET_ONLY,hoverOpenDelay:1e3};return a?Object(o.createElement)(hl,Sa({},p)):s},onClose:function(){n.run("operation",Sa(Sa({},e),{opType:ee,focusMode:A}))},resetOnSelect:!0})}n(868);function vl(e){return r.a.createElement("div",{className:"bm-toolbar-item ".concat(rn("openfile")),onClick:function(t){var n=e.diagram,o=n.getDiagramProps().controller;Sn(".json,.blinkmind,.bm").then((function(e){var t=JSON.parse(e),r=o.run("deserializeModel",{controller:o,obj:t});n.openNewModel(r)}))}})}function xl(e){var t=[[j.LEFT_AND_RIGHT,"Left And Right","layout-left-and-right"],[j.LEFT_TO_RIGHT,"Only Right","layout-right"],[j.RIGHT_TO_LEFT,"Only Left","layout-left"]];return r.a.createElement("div",{className:tt()("bm-toolbar-item",rn("layout-left-and-right"))},r.a.createElement(m.s,{enforceFocus:!1},r.a.createElement("div",{className:"bm-toolbar-popover-target"}),r.a.createElement(m.n,null,t.map((function(t){return r.a.createElement(m.p,{key:t[1],icon:an(t[2]),text:t[1],onClick:(n=t[0],function(t){var o=e.diagram.getDiagramProps();o.controller.run("setLayoutDir",Object(Oe.a)(Object(Oe.a)({},o),{},{layoutDir:n}))})});var n})))))}var Tl=n(287),wl=n.n(Tl),Ol=n(288),kl=n.n(Ol),El=n(289),Cl=n.n(El),Sl=n(290),jl=n.n(Sl),Kl=n(291),Rl=n.n(Kl);function Dl(e){var t=[["default",wl.a],["theme1",kl.a],["theme2",Cl.a],["theme3",jl.a],["theme4",Rl.a]];return r.a.createElement("div",{className:tt()("bm-toolbar-item",rn("theme"))},r.a.createElement(m.s,{enforceFocus:!1},r.a.createElement("div",{className:"bm-toolbar-popover-target"}),r.a.createElement("div",{className:"bm-popover-theme"},t.map((function(t){return r.a.createElement("div",{key:t[0],className:"bm-theme-item",onClick:(n=t[0],function(t){var o=e.diagram.getDiagramProps();o.controller.run("setTheme",Object(Oe.a)(Object(Oe.a)({},o),{},{themeKey:n}))})},r.a.createElement("img",{className:"bm-theme-img",src:t[1],alt:t[0]}));var n})))))}function _l(e){return r.a.createElement("div",{className:tt()("bm-toolbar-item",rn("export"))},r.a.createElement(m.s,{enforceFocus:!1},r.a.createElement("div",{className:"bm-toolbar-popover-target"}),r.a.createElement(m.n,null,r.a.createElement(m.p,{text:"JSON(.json)",onClick:function(t){var n=e.diagram.getDiagramProps(),o=n.controller,r=n.model,i=o.run("serializeModel",n),a=JSON.stringify(i),l="data:text/plain,".concat(encodeURIComponent(a)),c=o.run("getTopicTitle",Object(Oe.a)(Object(Oe.a)({},n),{},{topicKey:r.rootTopicKey}));!function(e,t){var n=document.createElement("a");n.href=e,n.download=t,n.click()}(l,"".concat(c,".blinkmind"))}}),r.a.createElement(m.o,null))))}function Nl(e){return r.a.createElement("div",{className:"bm-toolbar-item ".concat(rn(on)),onClick:function(t){var n=e.diagram.getDiagramProps();n.controller.run("operation",Object(Oe.a)(Object(Oe.a)({},n),{},{opType:ee,focusMode:"FOCUS_MODE_SEARCH"}))}})}var Pl=function(e){Object(s.a)(n,e);var t=Object(p.a)(n);function n(){return Object(l.a)(this,n),t.apply(this,arguments)}return Object(c.a)(n,[{key:"render",value:function(){var e=this.props,t=e.onClickUndo,n=e.onClickRedo,o=e.canUndo,i=e.canRedo;return r.a.createElement("div",{className:"bm-toolbar"},r.a.createElement(vl,e),r.a.createElement(_l,e),r.a.createElement(Dl,e),r.a.createElement(xl,e),r.a.createElement(Nl,e),r.a.createElement("div",{className:tt()("bm-toolbar-item",rn("undo"),{"bm-toolbar-item-disabled":!o}),onClick:t}),r.a.createElement("div",{className:tt()("bm-toolbar-item",rn("redo"),{"bm-toolbar-item-disabled":!i}),onClick:n}))}}]),n}(r.a.PureComponent),Il=(n(869),h()("app"),[_i(),function(){var e=new Map([["default",be],["random-color-square",Ii],["theme1",Mi],["theme2",Ai],["theme3",Li],["theme4",zi]]);return{getAllThemes:function(t){return e},setTheme:function(e){var t=e.model,n=e.controller,o=e.themeKey,r=n.run("getAllThemes",e);if(!r.has(o))throw new Error("setTheme: the theme key is not correct!");var i=r.get(o),a=ye.setTheme({model:t,theme:i});n.change(a)}}}(),function(){var e=new Set;function t(t){var n=t.model,o=t.topicKey,r=n.getExtDataItem("TOPIC_REFERENCE",La);return e=new Set(r.getReferenceKeys(o)),n=ye.focusTopic({model:n,topicKey:o,focusMode:"FOCUS_MODE_SET_REFERENCE_TOPICS"})}return{customizeTopicContextMenu:function(e,t){var n=e.controller;return Object(o.createElement)(o.Fragment,null,t(),Object(o.createElement)(m.o,null),Object(o.createElement)(m.p,{key:"EXT_KEY_TOPIC_REFERENCE",icon:an("reference"),text:"Set Reference Topics",onClick:function(t){n.run("operation",Sa(Sa({},e),{opType:"OP_TYPE_START_SET_REFERENCE_TOPICS"})),n.run("disableOperation",Sa(Sa({},e),{whiteList:[U]}))}}))},getOpMap:function(e,n){var o=n();return o.set("OP_TYPE_START_SET_REFERENCE_TOPICS",t),o.set("OP_TYPE_SET_REFERENCE_TOPICS",za),o},beforeOpFunction:function(e,t){var n=t(),o=e.opType,r=e.topicKey;if(o===Q&&r!==n.editorRootTopicKey){var i=de(n,r);i.push(r);var a=n.getExtDataItem("TOPIC_REFERENCE",La),l=a.reference;i.forEach((function(e){var t=a.getReferencedKeys(e);(l=l.withMutations((function(n){t.forEach((function(t){n.updateIn([t,"keyList"],(function(t){return t.delete(t.indexOf(e))}))}))}))).has(e)&&(l=l.delete(e))})),a=a.set("reference",l),n=n.setIn(["extData","TOPIC_REFERENCE"],a)}return n},renderDiagramCustomize:function(e,t){var n=e.model,r=e.controller.getValue(wn)+2,i=t();if("FOCUS_MODE_SET_REFERENCE_TOPICS"===n.focusMode){var a=Sa(Sa({},e),{zIndex:r,topicKey:n.focusKey,key:"AddReferenceTopicPanel"});i.push(Object(o.createElement)(Pa,Sa({},a)))}return i},renderTopicContentOthers:function(t,n){var r=t.model,i=t.topicKey,a=t.controller,l=n();if(l.push(a.run("renderTopicExtReference",Sa(Sa({},t),{key:"EXT_KEY_TOPIC_REFERENCE-icon"}))),"FOCUS_MODE_SET_REFERENCE_TOPICS"===r.focusMode&&r.focusKey!==i){var c=Sa(Sa({},t),{key:"checkbox",selectedTopicKeys:e}),s=Object(o.createElement)(il,Sa({},c));l.push(s)}return l},renderTopicExtReference:function(e,t){return Object(o.createElement)(rl,Sa({},e))},clearSelectedReferenceKeys:function(){e.clear()},getSelectedReferenceKeys:function(){return Array.from(e)},deserializeExtDataItem:function(e,t){var n=e.extDataKey,o=e.extDataItem;if("TOPIC_REFERENCE"===n){var r=new La,i=function(e){var t=o.reference[e],n=new Ma({keyList:Object(x.List)(t.keyList),dataMap:Object(x.Map)(t.dataMap)});r=r.update("reference",(function(t){return t.set(e,n)}))};for(var a in o.reference)i(a);return r}return t()}}}(),function(){var e=function(e){};return{customizeHotKeys:function(e,t){var n=e.controller,o=e.model,r=t();return r.globalHotKeys.set("DEFAULT_SEARCH",{label:"search",combo:"ctrl + f",onKeyDown:function(){n.run("operation",Sa(Sa({},e),{opType:$,topicKey:o.focusKey,focusMode:"FOCUS_MODE_SEARCH"}))}}),r},renderDiagramCustomize:function(t,n){var r=n();if("FOCUS_MODE_SEARCH"===t.model.focusMode){var i=Sa(Sa({key:"search-panel"},t),{setSearchWorld:e});r.push(Object(o.createElement)(bl,Sa({},i)))}return r}}}(),Oa(),{serializeModel:function(e,t){var n=t();if(null!=n)return n;var o=e.model,r=e.controller;return{rootTopicKey:o.rootTopicKey,editorRootTopicKey:o.editorRootTopicKey,focusKey:o.focusKey,extData:r.run("serializeExtData",Ni(Ni({},e),{extData:o.extData})),topics:o.topics.valueSeq().toArray().map((function(t){return r.run("serializeTopic",Ni(Ni({},e),{topic:t}))})),config:r.run("serializeConfig",Ni(Ni({},e),{config:o.config})),formatVersion:o.formatVersion}},deserializeModel:function(e,t){var n=t();if(null!=n)return n;var o=e.obj,r=e.controller;null==o.formatVersion&&(o.formatVersion="0.0");var i=o.rootTopicKey,a=o.editorRootTopicKey,l=o.focusKey,c=o.topics,s=o.config,p=o.extData,u=o.formatVersion,d=new we;return null==(d=d.merge({rootTopicKey:i,editorRootTopicKey:null==a?i:a,focusKey:l,extData:r.run("deserializeExtData",Ni(Ni({},e),{extData:p,formatVersion:u})),config:r.run("deserializeConfig",Ni(Ni({},e),{config:s,formatVersion:u})),topics:r.run("deserializeTopics",Ni(Ni({},e),{topics:c,formatVersion:u})),formatVersion:o.formatVersion})).focusKey&&(d=d.set("focusKey",d.rootTopicKey)),null==d.focusMode&&(d=d.set("focusMode",A)),Pi("deserializeModel",d),d},serializeExtData:function(e,t){var n=t();if(null!=n)return n;var o=e.extData,r=e.controller,i={};return o.forEach((function(t,n){i[n]=r.run("serializeExtDataItem",{props:e,extDataKey:n,extDataItem:t})})),i},deserializeExtData:function(e,t){var n=t();if(null!=n)return n;var o=e.extData,r=e.controller,i=Object(x.Map)();for(var a in o)i=i.set(a,r.run("deserializeExtDataItem",Ni(Ni({},e),{extDataKey:a,extDataItem:o[a]})));return i},serializeExtDataItem:function(e,t){var n=t();if(null!=n)return n;var o=e.extDataItem;return Object(x.isImmutable)(o)?o.toJS():o},deserializeExtDataItem:function(e,t){var n=t();return null!=n?n:e.extDataItem},serializeConfig:function(e,t){var n=t();return null!=n?n:e.config.toJS()},deserializeConfig:function(e,t){var n=t();if(null!=n)return n;var o=e.config;return new xe(o)},serializeTopic:function(e,t){var n=t();if(null!=n)return n;var o=e.topic,r=e.controller;return{key:o.key,parentKey:o.parentKey,subKeys:o.subKeys.toArray(),collapse:o.collapse,style:o.style,blocks:o.blocks.map((function(t){return r.run("serializeBlock",Ni(Ni({},e),{block:t}))}))}},deserializeTopic:function(e,t){var n=t();if(null!=n)return n;var o=e.topic,r=e.controller,i=o.key,a=o.parentKey,l=o.subKeys,c=o.blocks,s=o.style,p=o.collapse,u=new ue;return u=u.merge({key:i,parentKey:a,subKeys:Object(x.List)(l),style:s,collapse:p,blocks:r.run("deserializeBlocks",Ni(Ni({},e),{blocks:c}))})},deserializeTopics:function(e,t){var n=t();if(null!=n)return n;var o=e.topics,r=e.controller,i=Object(x.Map)();return i=i.withMutations((function(t){o.forEach((function(n){return t.set(n.key,r.run("deserializeTopic",Ni(Ni({},e),{topic:n})))}))}))},serializeBlock:function(e,t){var n=t();if(null!=n)return n;var o=e.block,r=e.controller;return{type:o.type,data:r.run("serializeBlockData",Ni({},e))}},serializeBlockData:function(e,t){var n=t();return null!=n?n:e.block.data},deserializeBlock:function(e,t){var n=t();if(null!=n)return n;var o=e.block,r=e.controller,i=o.type;return new pe({type:i,data:r.run("deserializeBlockData",Ni(Ni({},e),{block:o}))})},deserializeBlockData:function(e,t){var n=t();return null!=n?n:e.block.data},deserializeBlocks:function(e,t){var n=t();if(null!=n)return n;var o=e.blocks,r=e.controller,i=Object(x.List)();return i=i.withMutations((function(t){o.forEach((function(n){return t.push(r.run("deserializeBlock",Ni(Ni({},e),{block:n})))}))}))}}]),Ml=function(e){Object(s.a)(n,e);var t=Object(p.a)(n);function n(e){var o;return Object(l.a)(this,n),(o=t.call(this,e)).diagramRef=function(e){o.diagram=e,o.setState({})},o.onClickUndo=function(e){var t=o.diagram.getDiagramProps();t.controller.run("undo",t)},o.onClickRedo=function(e){var t=o.diagram.getDiagramProps();t.controller.run("redo",t)},o.onChange=function(e,t){o.setState({model:e},t)},o.initModel(),o}return Object(c.a)(n,[{key:"initModel",value:function(){var e=we.create({rootTopicKey:"a607e564-8513-4581-80a5-11153d20cd9b",editorRootTopicKey:"a607e564-8513-4581-80a5-11153d20cd9b",focusKey:"50f23764-5ff5-445e-b448-11f8277696c7",extData:{TOPIC_REFERENCE:{reference:{}}},topics:[{key:"1ae639a4-76e8-42e2-ac9f-0dc83446a970",parentKey:"5a04c9b0-6d2b-4c6b-830f-a4a370ea88b9",subKeys:["79e51c15-351e-4531-a722-194fab9dfc8b","8fb7e16a-9930-4f62-af35-2190251832a8"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Non Parametric Test"},{type:"DESC",data:"2 \\- Sample t\\-test are paramteric test. They will have to satisfy the Normality and the Variance\n assumptions, in order for the test to be performed.\n\n If the Normality or the Variance test fails we can use non\\-parametric alternatives to conduct the\n statistical test.\n\n There are two non\\-parametric alternative test for 2\\-Sample t\\-test:\n> MannWhitenyu test \\- The non\\-parametric alternative for 2\\-Sample Independent t\\-test\n> Wilcoxon test \\- The non\\-parametric alternative for 2\\-Sample Dependent test\n"}]},{key:"3ca143d4-b91e-4d61-9ebb-6cf0f967bf6f",parentKey:"5a04c9b0-6d2b-4c6b-830f-a4a370ea88b9",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Assumptions"},{type:"DESC",data:'Since **2 Sample t\\-test** is a parametric test, it will have to satisfy the Normality and Variance assumptions in\n order to perform the test.\n\n##  Normality Assumption:\n\n The normality assumption states that the numerical feature involved in the hypothesis is \n normally distributed.\n To test this assumption we can use the Shapiro test method from the stats module from scipy package.\n```python\nfrom scipy import stats\n\n# Here numerical data is a dataFrame of the numerical\n# feature involved in the hypothesis. Replace with \n# your own dataFrame\np_value = stats.shapiro(group1_data)[1]\nif p > 0.05:\n    print(p, "Data can be normally distributed")\nelse:\n    print(p, "Data is not normally distributed")\n\n```\n\n##  Variance Assumption:\n\n  The Variance assumption states that the varaince amoung the different groups involved in the \n  hypothesis is same.\n  To test this assumption we can use the **Levene test** method from the stats module from scipy package.\n```python\nfrom scipy import stats\n\n# Here numerical data is a dataFrame of the numerical\n# feature involved in the hypothesis. Replace with \n# your own dataFrame\np_value = stats.levene(group1_data, group2_data, ..., groupN_data)[1]\nif p > 0.05:\n    print(p_value, "Variance can be same")\nelse:\n    print(p_value, "Variance cannot be same")\n\n```\n'}]},{key:"c8b409a4-cbf5-4671-96f8-eb4fc3f773d9",parentKey:"81626f6c-5f13-4d7b-8077-cda871732628",subKeys:["515374f3-363a-460f-b981-5d21a419b20a","f19652fe-f68f-4284-bf47-d675e7fa8777"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"1 - Sample t-test"},{type:"DESC",data:"##  1 Sample t\\-test:\n\n The 1 Sample t\\-test is perfomed when we want to verify any claim made by the company / organisations.\n\n Whenever only a single numerical feature is involved in the hypothesis we will go with 1 Sample t\\-test.\n\n```none\nExample:\n\n1. A company claims that their medicine cures headached is less than 12 minutes.\n2. A food delivery company claims that all their delivery is done withing 30 minutes\n   of ordering\n3. A battery manufacturer company claims that the average life time for their \n   batteries are 40 hours.\n\n```\n\n In all the above cases we will be using the **1 Sample t\\-test to statistically validate** if the claim made by the\n company / organisations is valid or not"}]},{key:"064b8bea-d69a-4785-998b-1a390e3ba873",parentKey:"a607e564-8513-4581-80a5-11153d20cd9b",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"4 Steps of Hypothesis Testing "},{type:"DESC",data:"#  4 Steps of Hypothesis Testing:\n\n All hypotheses are tested using a four \\- step process :\n1. The first step is to define both the hypotheses so that only one hypotheses can be right\n1. The next step is to formulate an analysis plan, which outlines how the data will be evaluated\n1. The third step is to carry out the plan and physically analyze the sample data\n1. The fourth and final step is to analyze the results and either reject the null hypothesis, or state that the null hypothesis is plausible, based on the given the data\n\n"}]},{key:"bc7cf847-d335-49bd-9c86-9b16a148ddb4",parentKey:"a3a6d196-3f5f-4753-8585-3d4045f36ff7",subKeys:["0d803305-a283-47bf-8528-3b8bd13fa210","edd1862c-53fb-4fe8-806c-c62da4d15a55","bad7d35b-b741-482d-9597-16032dabcbcd","50f23764-5ff5-445e-b448-11f8277696c7"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Test of Proportions"},{type:"DESC",data:"**Test of Proportions** is used whenever there is a **categorical feature** and **no numerical feature** involved in\n the hypothesis creation.\n\n The Test of Proportions is used when we want to verify if there exist an equal proportion or not \n within each levels of the categeorical feature\n\n There are 4 tests associated with Test of Proportions:\n1. One Sample proportion test\n1. Two Sample proportion test\n1. Chi\\-Square test\n1. Chi\\-Square Contigency test\n\n"}]},{key:"515374f3-363a-460f-b981-5d21a419b20a",parentKey:"c8b409a4-cbf5-4671-96f8-eb4fc3f773d9",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:" 1 tail test"},{type:"DESC",data:"##  One Tail 1 \\- Sample t\\-test:\n\n The **One tail 1\\- Sample t\\-test** is used whenever the Alternative hypothesis value lies in either side\n of the tail and not on both the sides.\n\n> Example:\n> A drug manufactuering company claims that their drug on an average takes less than 12 minutes\n> to cure headache. Verify that the company's claim is valid\n> \n> Ha:= Average time taken to cure is less than 12 minutes \\(< 12 minutes\\) \\-\\> Alternative hypotheis\n> H0:= Average time taken to cure is greater than or equal to 12 minutes \\(\\>= 12 minutes\\) \\- Null hypothesis\n Here we are checking if the average time taken is greater than 12 and we want to see if the value lies\n on the right hand side tail alone. \n\n##  Python function to perform One tail 1 Sample t\\-test:\n\n Below is the code snippet used to perform One tail 1 Sample t\\-test for the above example. We will be using\n the **ttest\\_1samp **from scipy.stats package.\n```python\nfrom scipy.stats import ttest_1samp\n\nstat,p_value = ttest_1samp(a=sample_data, popmean=12, alternative='two-sided')\n\nif (p_value/2) > 0.05:\n    print(p_value, \"We fail to reject the Null Hypothesis\")\nelse:\n    print(p_value, \"We will reject the Null Hypothesis\")\n\n```\n\n The ttest\\_1samp by default will give the **p\\_value for the two\\-tail test**. \n So when performing one tail t\\-test, we either have to divide the p\\_value by 2 before \n coming to a conclusion or in the latest python version we can specify 'greater' or 'less' in the \n alternative param. In that case we need not divide p\\_value by 2."}]},{key:"b222b8f4-ecba-46fa-91fc-1223a04160fe",parentKey:"5a04c9b0-6d2b-4c6b-830f-a4a370ea88b9",subKeys:["14213589-8fe9-4e25-b7ff-2305e9a93318","1459bf1d-2a6e-44ff-a486-950f36a902fd"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Parametric Test"}]},{key:"eb2cbc73-61df-498d-b5a0-fc22981eafa7",parentKey:"a607e564-8513-4581-80a5-11153d20cd9b",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Definition"},{type:"DESC",data:"##  Definition:\n\n** Hypothesis testing** is an act in statistics whereby an analyst tests an assumption regarding a \n population parameter. The methodology employed by the analyst depends on the nature of the data \n used and the reason for the analysis.\n\n Hypothesis testing is used to assess the plausibility of a hypothesis by using sample data. Such data \n may come from a larger population, or from a data\\-generating process."}]},{key:"79e51c15-351e-4531-a722-194fab9dfc8b",parentKey:"1ae639a4-76e8-42e2-ac9f-0dc83446a970",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"MannWhitenyu Test"},{type:"DESC",data:'When the observations in the sample space does not satisfy the Normality and Variance assumptions\n we cannot use the Independent t\\-test on those observation\n In those cases we will use the **MannWhitneyu** test from the **scipy\\.stats** package, which is the \n non \\- parametric alternative for Independent t\\-test.\n\n##  MannWhitneyu Test Assumptions:\n\n Before we can conduct a MannWhitneyu test, we need to make sure the \n following assumptions are satisfied:\n> \n>    1. Ordinal or Continuos Response Variable \\- The numerical feature involved in the hypothesis should be a Ordinal or Continuous variable. Eg: The time taken to deliver package in different region. Here the time taken is a continuous variable.\n>    1. Independence \\- The observations in each group need to be independent of each other.\n>    1. Distribution have similar shapes \\- The distibution in each group need to have the same shape\n\n##  MannWhitneyu Hypothesis:\n\n In most cases, a Mann\\-Whitney U test is performed as a two\\-sided test. \n The null and alternative hypotheses  are written as:\n H0:= The two populations are equal\n Ha:= The two populations are not equal\n\n> Example:\n> A professor teaches batch1 students using a specific method and collects the test scores of the batch.\n> Then he changes the teaching method for batch2 students and collects the test score of the new batch.\n> Now the professor wants to check if the new teaching method was effective.\n> \n> Ha:= Test scores of batch2 is not equal to the test scores of batch1 \\-\\> Alternative hypothesis\n> H0:= Test scores of batch2 is equal to the test scores of batch1 \\-\\> Null hypothesis\n\n **Code snippet for the above example:**\n```python\nfrom scipy.stats import mannwhitneyu\n\np_value = mannwhitneyu(x=sample1data,y=sample2data,alternative=None)\nif p_value > 0.05:\n    print(p_value, "We fail to reject the Null Hypothesis")\nelse:\n    print(p_value, "We will reject the Null Hypothesis")\n\n```\n'}]},{key:"9ba129e7-4aa1-4cdc-9471-4bd331d94b84",parentKey:"61d82248-611b-4f06-824c-6589d605dd9e",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Assumptions"},{type:"DESC",data:'Since ANOVA is a parametric test, it will have to satisfy the Normality and Variance assumptions in\n order to perform the test.\n\n##  \n\n\n## Normality Assumption:\n\n The normality assumption states that the numerical feature involved in the hypothesis is \n normally distributed.\n To test this assumption we can use the Shapiro test method from the stats module from scipy package.\n```python\nfrom scipy import stats\n\n# Here numerical data is a dataFrame of the numerical\n# feature involved in the hypothesis. Replace with \n# your own dataFrame\np_value = stats.shapiro(group1_data)[1]\nif p > 0.05:\n    print(p, "Data can be normally distributed")\nelse:\n    print(p, "Data is not normally distributed")\n\n```\n\n##  Variance Assumption:\n\n  The Variance assumption states that the varaince amoung the different groups involved in the \n  hypothesis is same.\n  To test this assumption we can use the **Levene test** method from the stats module from scipy package.\n```python\nfrom scipy import stats\n\n# Here numerical data is a dataFrame of the numerical\n# feature involved in the hypothesis. Replace with \n# your own dataFrame\np_value = stats.levene(group1_data, group2_data, ..., groupN_data)[1]\nif p > 0.05:\n    print(p_value, "Variance can be same")\nelse:\n    print(p_value, "Variance cannot be same")\n\n```\n'}]},{key:"50f23764-5ff5-445e-b448-11f8277696c7",parentKey:"bc7cf847-d335-49bd-9c86-9b16a148ddb4",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Chi-Square Contigency"},{type:"DESC",data:'## Chi\\-Square Contigency test:\n\n Chi\\-Square Contigency test is used when there are two categorical feature involved and there are more \n than 2 levels in atleast on of the feature.\n> Analysing if the people affected with covid accross different age group in two different country \n> are similar\n\n## Python function to perform Chi\\-Square Contigency test\n\n We will be using the **chi2\\_contingency** from the **scipy\\.stats** package\\.\n> Example:\n> The Health officials want to analyse if the covid spread amoung different age category in India \n> and Europe are similar or different. They data collected is presented in the below table\n>                   India    Europe\n> Seniors       1100     800\n> Y&M            500     450\n> Childrens     400     300\n\n  Here there are two categorical feature namely Age and Country. Here we have 3 levels in the Age\n  feature; hence we will be using the Chi\\-Square Contigency proportion test.\n\n For the above example, below is the hypothesis statement\n> Ha:= Spread of covid across different age category is not same for both India and Europe\n> H0:= Spread of covid across different age category is same for both India and Europe\n\nCode snippet for performing the Chi \\- Square Contigency proportion test\n```python\nfrom scipy.stats import chi2_contingency\n# => observed = the dataframe containing the age and country category\nchi_stat, pvalue, degOfFreedom, expected = chi2_contingency(observed=df)\nif p_value > 0.05:\n    print(p_value, "We fail to reject the Null Hypothesis")\nelse:\n    print(p_value, "We will reject the Null Hypothesis")\n\n```\n'}]},{key:"7a595fd7-0c49-45a0-b631-165395cdf614",parentKey:"0c3353c8-4e57-4425-968f-5a5b78c847fe",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Post HOC Analysis"},{type:"DESC",data:"The ANOVA test function, will let us know if there is a difference in the mean of the groups,\n but will not say which groups differ from each other.\n In order to know which are the groups that differ from others we will have to perform the\n Post HOC analysis on the data to know about it.\n\n##  Post HOC Analysis for ANOVA:\n\n We can use the **MultiComparison** function from the **statsmodels\\.stats** module to perform the Post HOC\n Analysis\\.\n The MulitComparison function takes two main params:\n **data **= we will have to pass the numerical feature ndarray used in the hypothesis\n **group** = we will have to pass the categorical feature ndarray used in the hypothesis\n\n```python\nfrom statsmodels.stats.multicomp import MultiComparison\n\nmc = MultiComparison(data=num_feature, groups=cat_feature, group_order=None)\n\nprint(mc.tukeyhsd(0.05))\n\n```\n Tukey's range test compares means accross all pairs of groups and list out the groups which are\n different from each other.\n tukeyhsd function will return a TukeyHSDResults instance which includes meandiff, p\\-adj, lower,\n upper and reject columns.\n\n **True in the reject column** mean that we can reject the null hypothesis, which in turn refers to \n that there is a difference in the mean value between the two groups.\n\n **False is the reject column** mean that we fail to reject the null hypothesis and the two groups tend\n to have the same mean value"}]},{key:"a3a6d196-3f5f-4753-8585-3d4045f36ff7",parentKey:"a607e564-8513-4581-80a5-11153d20cd9b",subKeys:["81626f6c-5f13-4d7b-8077-cda871732628","bc7cf847-d335-49bd-9c86-9b16a148ddb4"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Testing types"}]},{key:"5a04c9b0-6d2b-4c6b-830f-a4a370ea88b9",parentKey:"81626f6c-5f13-4d7b-8077-cda871732628",subKeys:["3ca143d4-b91e-4d61-9ebb-6cf0f967bf6f","b222b8f4-ecba-46fa-91fc-1223a04160fe","1ae639a4-76e8-42e2-ac9f-0dc83446a970"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"2 - Sample t-test"},{type:"DESC",data:"##  2 Sample t\\-test\n\n  **2 Sample t\\-test** is performed when there is one numerical feature and one categorical feature involved \n  in the hypothesis provided the **categorical feature has only two levels**.\n\n  2 Sample t\\-test is a parametric test and will have to satisfy the Normality and Variance assumptions.\n\n> Examples:\n> \n>    1. Verify that there is no discrimination in wages \\(numerical feature\\) provided by a company based on gender \\(categorical\\)\n>    1. Validate if the gender \\(categorical\\) has any effect in the weight \\(numerical\\) loss program\n\n  In the above examples, the categorical feature gender has only two levels namely Male and Female. \n  When we want to see if there is a pattern in the numerical feature based on the categorical feature\n  we will use 2 Sample t\\-test\n\n> 2 Sample t\\-test, performs the hypothesis by checking if the numerical feature mean of the two different levels are same or different.\n"}]},{key:"edd1862c-53fb-4fe8-806c-c62da4d15a55",parentKey:"bc7cf847-d335-49bd-9c86-9b16a148ddb4",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"2 Sample Proportion test"},{type:"DESC",data:"## 2 Sample Proportion test:\n\n The 2 Sample Proportion test is used when we want to verify if the proportion of two groups is similar\n to the proportion made in the claim\n\n In the 2 Sample Proportion test there are two categorical feature involved and there are exactly two\n levels within each group.\n> Example:\n> Analysing the proportion of male and female voting for Joe Biden and Trump in the US presidential\n> election\\. Here the analysis is done on the gender and the election participants. Both are\n> categorical data and both have only two levels in both of them\n\n## Python function to perform 2 Sample Proportion test\n\n Both 1 Sample Proportion test and 2 Sample Proportion test use the same python function with slight \n difference in the way we pass the params:\n> \n>    1. In 1 Sample Proportion test we pass a single integer value for the count and nobs param, where as in the 2 Sample Proportion test we will pass a list for the count and nobs param.2. In 1 Sample Proportion test we will pass the claim value for the value param, but in 2 Sample proportion test we will not be passing the value param or we can pass the value as None.\n\n We will be using the **proportions\\_ztest** from the **statsmodels\\.stats.proportion** package\\.\n\n> Example:\n> The government officials want to check if the impact of covid equal between the Rural and Urban area\n> Below is the sample collected:\n>                   Rural    Urban\n> Negative     867        500   \n> Positive       490        550   \n> Total         1357      1050 \n\n For the above example, below is the hypothesis statement\n> Ha:= covid spread in Rural area is not equal to the spread in Urban area\n> H0:= covid spread in Rural area is equal to the spread in Urban area\n\n Code snippet for performing the 2 Sample Proportion test\n```python\nfrom statsmodels.stats.proportion import proportions_ztest\n\n# count => a list including the count of Positive patients in Rural and Urban\n# nobs => a list including total count of people in Rural and Urban\np_value = proportions_ztest(count=[490, 550], nobs=[1357, 1050],alternative='two-sided')[1]\nif p_value > 0.05:\n    print(p_value, \"We fail to reject the Null Hypothesis\")\nelse:\n    print(p_value, \"We will reject the Null Hypothesis\")\n\n```\n\n Based on the claim statment made, the 2 Sample proportion test can be either One tailed or Two tailed test\n> \n>    * People affected by covid in Urban is greater than that of Rural \\-\\> 1 tail 2 Sample proportion test\n>    * Poeple affecteb by covid is equal in both Urban and Rural \\-\\> 2 tail 2 Sample proportion test\n\n We can tweak the alternative param in the proportion\\_ztest, to make it as a one tailed test. \n The alternative param can take either of the values **'two\\-sided', 'smaller', 'larger'**\n By default the p\\_value given by the proportions\\_ztest is for two tailed test."}]},{key:"0d803305-a283-47bf-8528-3b8bd13fa210",parentKey:"bc7cf847-d335-49bd-9c86-9b16a148ddb4",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"1 Sample Proportion test"},{type:"DESC",data:"##  1 Sample Proportion test:\n\n The 1 Sample Proportion test is used when we want to verify if the proportion of levels within a\n categorical feature is similar to the claim made.\n\n In the 1 Sample Proportion test only one categorical data is involved and there are exactly two\n levels within the feature.\n> Gender is a categorical feature with only two levels Male or Female\n\n##  Python function to perform 1 Sample Proportion test\n\n We will be using the **proportions\\_ztest** from the **statsmodels\\.stats.proportion** package\\.\n> Example:\n> Health officials of India is expecting Covid\\-19 is affecting more men than women, they are expecting 65% of affected case \n> in India are Men. To verify this hypothesis, random samples \\(n=1500\\) across India were collected,the samples are as follows:\n> Men:900, Women:600\n\n For the above example, below is the hypothesis statement\n> We will be using 1 sample proportion test, as the hypothesis revolves around gender alone and gender has only two levels\n> Ha:= The proportion of Male affected by covid is not equal to 65%\n> H0:= The proportion of Male affected by covid is equal to 65% \n\n Code snippet for performing the 1 Sample Proportion test\n```python\nfrom statsmodels.stats.proportion import proportions_ztest\n\n# count => Total count of male in the given data set\n# nobs => Total count of the sample space\n# value => The claim percentage in decimal value\np_value = proportions_ztest(count=900, nobs=1500, value=0.65,alternative='two-sided')[1]\nif p_value > 0.05:\n    print(p_value, \"We fail to reject the Null Hypothesis\")\nelse:\n    print(p_value, \"We will reject the Null Hypothesis\")\n\n```\n\n Based on the claim statment made, the 1 Sample proportion test can either be One tailed or Two tailed test\n> \n>    * More than 65% of covid patients are male \\-\\> 1 tail 1 Sample proportion test\n>    * 65% of covid patients are male \\-\\> 2 tail 1 Sample proportion test\n\n We can tweak the alternative param in the proportion\\_ztest, to make it as a one tailed test. \n The alternative param can take either of the values **'two\\-sided', 'smaller', 'larger'**\n By default the p\\_value given by the proportions\\_ztest is for two tailed test."}]},{key:"dbf17b96-10b9-4254-9641-2a186646c719",parentKey:"61d82248-611b-4f06-824c-6589d605dd9e",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Non Parametric Test"},{type:"DESC",data:'##  Non \\- Parametric Test for ANOVA:\n\n We cannot perform the ANOVA test, when the data does not satisfy the Normality and the \n Equal Variance amoung the group test. In this case we will be going with a Non \\- Parametric test.\n\n A Kruskal\\-Wallis test is used to determine whether or not there is a statistically significant \n difference  between the medians of three or more independent groups. \n This test is the non\\-parametric equivalent of the one\\-way ANOVA and is typically used when the \n normality assumption is violated.\n\n The Kruskal\\-Wallis test does not assume normality in the data and is much less sensitive to outliers \n than the one\\-way ANOVA.\n\n The Kruskal test compares the Median value amoung the groups, instead of considering their\n mean value. \n> Hypothesis Statements:\n> H0:= The median value accross the different groups are same\n> Ha:= Atleast one of the median value is different from other groups\n\n##  Kruskal \\- Wallis Test Assumptions:\n\n Before we can conduct a Kruskal \\- Wallis test, we need to make sure the \n following assumptions are met:\n> \n>    1. Ordinal or Continuos Response Variable \\- The numerical feature involved in the hypothesis should be a Ordinal or Continuous variable. Eg: The time taken to deliver package in different region. Here the timetaken is a continuous variable.\n>    1. Independence \\- The observations in each group need to be independent of each other.\n>    1. Distribution have similar shapes \\- The distibution in each group need to have the same shape\n\n##  Kruskal \\- Wallis Test code:\n\n```python\nfrom scipy import stats\n\n# We will need to pass all the individual group dataframes\np_value = stats.kruskal(sample1, sample2,...,sampleN, nan_policy=\'propogate\')[1]\nif p_value > 0.05\n    print(p_value, "We fail to reject the Null Hypothesis")\nelse:\n    print(p_value, "We will reject the Null Hypothesis")\n\n```\n\n We will have to perform Post HOC analysis to figure out which groups differ from each other.'}]},{key:"bad7d35b-b741-482d-9597-16032dabcbcd",parentKey:"bc7cf847-d335-49bd-9c86-9b16a148ddb4",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Chi-Square test"},{type:"DESC",data:'## Chi\\-Square test:\n\n In the Chi\\-Square test only one categorical feature is involved and there are more than 2 \n levels in the feature.\n> A population when divided as children, young and middle age, senior citizen is an example\n> of a categorical feature with more than 2 levels\n\n## Python function to perform Chi\\-Square test\n\n We will be using the **chisquare** from the **scipy\\.stats** package\\.\n> Example:\n> Health officials of India is expecting that Covid\\-19 are expecting 60% Senior Citizens, 30% Young & Middle aged and 10% Children in India. To verify this hypothesis, A random samples \\(n=2000\\) collected \n> across India and found to be Senior citizens:1100, Y&M:500, C:400\n  Here even though there is only one categorical feature \\(age category\\) when there are more than \n  2 levels in the feature we use Chi\\-Square test\n  For the above example, below is the hypothesis statement\n> We will be using chisquare test, as the hypothesis revolves around population alone and population\n> has are more than 2 levels\n> Ha:= The proportion of affected people is not equal to the claim made\n> H0:= The proportion of affected people is 60% Senior Citizens, 30% Young & Middle aged and 10% Children\n\n Code snippet for performing the Chi \\- Square test\n```python\nfrom scipy.stats import chisquare\n\n# f_obs => The count for each age category from the sample space\n# f_exp => The expected count for each age category based on the claim %\n\nexp_senior, exp_y_m , exp_child = (0.6 * 2000), (0.3 * 2000), (0.1 * 2000)\npvalue = chisquare(f_obs=[1100, 500, 400],f_exp=[exp_senior,exp_y_m,exp_child],ddof=0, axis=0)[1]\nif p_value > 0.05:\n    print(p_value, "We fail to reject the Null Hypothesis")\nelse:\n    print(p_value, "We will reject the Null Hypothesis")\n\n```\n'}]},{key:"f19652fe-f68f-4284-bf47-d675e7fa8777",parentKey:"c8b409a4-cbf5-4671-96f8-eb4fc3f773d9",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"2 tail test"},{type:"DESC",data:'##  Two Tail 1 \\- Sample t\\-test:\n\n The **Two tail t\\-test** is used whenever the Alternative hypothesis value can lie on either side of\n the tail and does not necessarily be concentrated only on one side.\n\n> Example:\n> A soda company wants to analyse if their can filling machine fills the can with exactly 150ml of content and not more or less than it. \n> Ha:= Average content filled in the can is not equal to 150ml \\(\\!= 150 ml\\)\\-\\> Alternative hypotheis\n> H0:= Average content filled in the can is equal to 150ml \\(= 150 ml\\) \\-\\> Null hypothesis\n \n Here we are checking if the machine fills the can exactly with 150 ml of content. There is a possibility\n that the machine can fill the can with more than 150ml content or less than 150ml of content.\n Here the alternative hypothesis range lies on both the tails and we will have to use\n Two tail 1\\-Sample t\\-test\n\n##  Python function to perform Two tail 1 Sample t\\-test:\n\n Below is the code snippet used to perform two tail 1 Sample t\\-test for the above example. \n We will be using the **ttest\\_1samp **from **scipy\\.stats** package\\.\n```python\nfrom scipy.stats import ttest_1samp\n\nstat, p_value = ttest_1samp(a=sample_data,popmean=12,alternative=\'two-sided\')\n\nif p_value > 0.05:\n    print(p_value, "We fail to reject the Null Hypothesis")\nelse:\n    print(p_value, "We will reject the Null Hypothesis")\n\n```\n\n Since by default the ttest\\_1samp gives the p\\_value for two\\-sided, we can directly infer the hypothesis\n based on the p\\_value.'}]},{key:"a607e564-8513-4581-80a5-11153d20cd9b",parentKey:null,subKeys:["a3a6d196-3f5f-4753-8585-3d4045f36ff7","eb2cbc73-61df-498d-b5a0-fc22981eafa7","333a9d61-c218-471d-8e88-250ea77c9982","064b8bea-d69a-4785-998b-1a390e3ba873"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Hypothesis Testing"}]},{key:"61d82248-611b-4f06-824c-6589d605dd9e",parentKey:"81626f6c-5f13-4d7b-8077-cda871732628",subKeys:["9ba129e7-4aa1-4cdc-9471-4bd331d94b84","0c3353c8-4e57-4425-968f-5a5b78c847fe","dbf17b96-10b9-4254-9641-2a186646c719"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Analysis of Variance (ANOVA)"},{type:"DESC",data:"##  Analysis of Variance \\(ANOVA\\):\n\n ANOVA statistical test is performed when there is one numerical feature and one categorical feature\n involved in the hypothesis, where there are more than 2 levels in the categorical feature.\n\n Similar to 2 Sample t\\-test, ANOVA is also a parametric test and will have to satisfy the\n Normality and Variance assumptions as well.\n ANOVA statistical test is performed to verify if the mean accross all the levels in the categorical\n feature is same or not.\n\n> Example:\n> \n>    1. Verify if the the time take\\(numerical\\) to deliver the package accross different region is same, where the regions are A, B, C \\(categorical\\)\n\n\n###  ANOVA Hypothesis statments:\n\n Below is the Alternative and Null hypothesis for the above example:\n> Ha:= The time taken to deliver the package across all the three regions are not same\n> H0:= The time taken to deliver the package across all the three regions are same\n"}]},{key:"81626f6c-5f13-4d7b-8077-cda871732628",parentKey:"a3a6d196-3f5f-4753-8585-3d4045f36ff7",subKeys:["c8b409a4-cbf5-4671-96f8-eb4fc3f773d9","5a04c9b0-6d2b-4c6b-830f-a4a370ea88b9","61d82248-611b-4f06-824c-6589d605dd9e"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Test of Mean"},{type:"DESC",data:"**Test of Means** methods are used whenever a numerical category is involved in the hypothesis testing.\n\n The methods available in the Test of Means are done for below scenarios:\n1. We want to see if the single feature numerical mean differs from the population mean\n1. We want to see if the mean value of two or more groups in a feature are same or different\n\n\n There are 3 methods associated with Test of Means:\n1. One sample t\\-test\n1. Two sample t\\-test\n1. Analysis of Variance \\(ANOVA\\)\n\n"}]},{key:"8fb7e16a-9930-4f62-af35-2190251832a8",parentKey:"1ae639a4-76e8-42e2-ac9f-0dc83446a970",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Wilcoxon Test"},{type:"DESC",data:'When the observations for the dependent t\\-test fails to satifsy the Normality and Variance \n assumptions, we will use the **Wilcoxon test** from the **scipy\\.stats** package, which is the non \\- parametric\n alternative for dependent t\\-test.\n\n##  Wilcoxon Test Assumptions:\n\n Before we can conduct a Wilcoxon test, we need to make sure the \n following assumptions are satisfied:\n> \n>    1. Ordinal or Continuos Response Variable \\- The numerical feature involved in the hypothesis should be a Ordinal or Continuous variable. Eg: The time taken to deliver package in different region. Here the time taken is a continuous variable.\n>    1. Independence \\- The test assumes independence, meaning that the paired observations are randomly and independently drawn.\n>    1. Distribution have similar shapes \\- The distibution in each group need to have the same shape\n\n##  Wilcoxon Hypothesis:\n\n In most cases, a Wilcoxon test is performed as a two\\-sided test. \n The null and alternative hypotheses  are written as:\n H0:= The median difference between the two groups are symmetric around 0\n Ha:= The median difference between the two groups are not symmetric around 0\n\n> Example:\n> A professor teaches batch1 students using a specific method and collects the test scores of the batch.\n> Then he changes the teaching method for batch2 students and collects the test score of the new batch.\n> Now the professor wants to check if the new teaching method was effective.\n> Ha:= The median test score difference between the two groups is not equal to 0 \\-\\> Alternative hypothesis\n> H0:= The median test score difference between the two groups is 0 \\-\\> Null hypothesis\n\n **Code snippet for the above example:**\n```python\nfrom scipy.stats import wilcoxon\n\np_value = wilcoxon(x=sample1data,y=sample2data,alternative="two-sided")\nif p_value > 0.05:\n    print(p_value, "We fail to reject the Null Hypothesis")\nelse:\n    print(p_value, "We will reject the Null Hypothesis")\n\n```\n'}]},{key:"14213589-8fe9-4e25-b7ff-2305e9a93318",parentKey:"b222b8f4-ecba-46fa-91fc-1223a04160fe",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Dependent t-test"},{type:"DESC",data:'##  2 \\- Sample Dependent t\\-test:\n\n 2 \\- Sample Dependent t\\-test is used when we want to analyse the relationship between two groups\n based on a numerical feature and the sample space in the two groups are dependent of each\n other or belong to the same sample space.\n\n> Example:\n> A professor teaches a batch of students using a specific method and collects the test scores of the batch.\n> Then he uses a different teaching method for the same batch of students and collects the test \n> score of the batch again.\n> Now the professor wants to check if the new teaching method was effective.\n> \n> Ha:= Average test scores is not equal between the two teaching methods \\-\\> Alternative hypothesis\n> H0:= Average test scores is equal between the two teaching methods \\-\\> Null hypothesis\n\n Here we will be using the 2 sample Dependent t\\-test, as there is only change in the teaching method\n but the observation includes the same set of students , and there are only two groups involved in \n the hypothesis.\n\n##  Python function to perform Independent 2\\- Sample t\\-test:\n\n We will be using the **ttest\\_ind **from the **scipy\\.stats** package\\. \n Below is the code snippet for the above example question\n```python\nfrom scipy.stats import ttest_rel\n\np_value = ttest_rel(a=oldMethodScore,b=newMethodScore,\n           alternative=\'two-sided\')[1]\n\nif p_value > 0.05:\n    print(p_value, "We fail to reject the Null Hypothesis")\nelse:\n    print(p_value, "We will reject the Null Hypothesis")\n\n```\n'}]},{key:"333a9d61-c218-471d-8e88-250ea77c9982",parentKey:"a607e564-8513-4581-80a5-11153d20cd9b",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Type of Hypothesis"},{type:"DESC",data:"#  Type of Hypothesis:\n\n\n##  Alternative Hypothesis:\n\n An **Alternative hypothesis** usually refers to the claim made by the organization or an already known fact. \n The analysts generally creates their null hypothesis based on the alternative hypothesis and try to \n see if the claim/fact is true or false.\n\n Alternative Hypothesis is also referred to as the effect statement. \n In a **One tail scenario**, the Alternative Hypothesis will mostly take the statement of the claim made.\n In a **Two tail scenario**, the Alternative Hypothesis will take the not equal to condition.\n\n##  Null Hypothesis:\n\n A **Null hypothesis** is a statement formulated by the analysts in order to verify if there exists a \n relationship between the variables in the given data.\n\n The Null hypothesis statement is usually the opposite of the **Alternative hypothesis. **The main purpose \n of the research is to either reject or accept \\(fail to reject\\) the Null hypothesis.\n\n Null Hypothesis is also referred to as the non \\- effect statement. \n In a **One tail scenario**, the Null Hypothesis will mostly take the statement opposite of the claim made.\n In a **Two tail scenario**, the Null Hypothesis will take the equal to condition.\n\n```none\n- Reject the Null hypothesis: This refers to the scenario where we \nwill accept the Alternative hypothesis ie, there exist a \nrelationship between the variables in the data or the claim made \nis true\n\n- Fail to reject the Null hypothesis: This refers to the scenario \nwhere we state that there does not exist a relationship between \nthe variables in the data or the claim made is false\n\n```\n\n> Example Hypothesis statements:\n> Ha:= Drinking tea or coffee before classes increases student's performances\n> H0:= There is no significant difference in student's performances if they drink tea of coffee before classes\n"}]},{key:"1459bf1d-2a6e-44ff-a486-950f36a902fd",parentKey:"b222b8f4-ecba-46fa-91fc-1223a04160fe",subKeys:[],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"Independent t-test"},{type:"DESC",data:'##  2 \\- Sample Independent t\\-test:\n\n 2 \\- Sample Independent t\\-test is used when we want to analyse the relationship between two groups\n based on a numerical feature and the sample space of the two groups are independent of each\n other\\.\n> Example:\n> A professor teaches batch1 students using a specific method and collects the test scores of the batch.\n> Then he changes the teaching method for batch2 students and collects the test score of the new batch.\n> Now the professor wants to check if the new teaching method was effective.\n> Ha:= Average test scores of batch2 is not equal to the average test scores of batch1\\-\\> Alternative hypothesis\n> H0:= Average test scores of batch2 is equal to the average test scores of batch1\\-\\> Null hypothesis\n\n Here we will be using the 2 sample Independent t\\-test, as the batch1 students are independent\n from the batch2 students, and there are only two levels in the categorical column.\n\n##  Python function to perform 2\\- Sample Independent t\\-test:\n\n We will be using the **ttest\\_ind **from the scipy.stats package.\n Below is the code snippet for the above example question\n```python\nfrom scipy.stats import ttest_ind\n\np_value = ttest_ind(a=batch2Score,b=batch1Score,alternative=\'two-sided\')[1]\n\nif p_value > 0.05:\n    print(p_value, "We fail to reject the Null Hypothesis")\nelse:\n    print(p_value, "We will reject the Null Hypothesis")\n\n```\n'}]},{key:"0c3353c8-4e57-4425-968f-5a5b78c847fe",parentKey:"61d82248-611b-4f06-824c-6589d605dd9e",subKeys:["7a595fd7-0c49-45a0-b631-165395cdf614"],collapse:!1,style:null,blocks:[{type:"CONTENT",data:"ANOVA Testing methods"},{type:"DESC",data:'There are two possible ways in which we can perform the ANOVA testing.\n\n##  Statistical Approach:\n\n We can use the **f\\_oneway** function from scipy stats module to perform the ANOVA testing.\n\n The one\\-way ANOVA tests the null hypothesis, that two or more groups have\n the same population mean.  The test is applied to samples from two or \n more groups, possibly with differing sizes.\n\n The ideal scenario to use the f\\_oneway is when we have only a single categorical feature\n used in the Hypothesis\n```python\nfrom scipy import stats\n\np_value = stats.f_oneway(sample1, sample2, ... ,sampleN, axis = 0)\nif p_value > 0.05:\n    print(p_value, "We fail to reject the Null Hypothesis")\nelse:\n    print(p_value, "We will reject the Null Hypothesis")\n\n```\n\n##  Regression model Approach:\n\n The second way is that we can use the **"ols" and "anova\\_lm"** models for ANOVA testing.\n This approach can be used when there are more number of groups to be compared or\n when we want to compare the mean accross two categorical features.\n```python\nfrom statsmodels.formula.api import ols\nfrom statsmodels.stats.anova import anova_lm\n\n# Here Minutes is the numerical feature and \n# Region is the categorical feature\nan = ols(\'Minutes~Region\', data=df).fit()\nanova_lm(an)\n\n```\n The anova\\_lm will give a table output with the F \\- Statistics and P\\_value for the data. Based on the\n P\\_value we can decide whether we can reject the null hypothesis or we fail to reject the null hypothesis.'}]}],config:{readOnly:!1,allowUndo:!0,layoutDir:2,theme:{name:"default",randomColor:!0,background:"rgb(57,60,65)",highlightColor:"#50C9CE",marginH:60,marginV:20,contentStyle:{lineHeight:"1.5"},linkStyle:{lineRadius:5,lineType:"curve",lineWidth:"3px"},rootTopic:{contentStyle:{fontSize:"34px",borderRadius:"35px",padding:"16px 18px 16px 18px"},subLinkStyle:{lineType:"curve",lineWidth:"3px",lineColor:"rgb(113, 203, 45)"}},primaryTopic:{contentStyle:{borderWidth:"1px",borderStyle:"solid",borderRadius:"20px",fontSize:"17px",padding:"10px 15px 10px 15px"},subLinkStyle:{lineType:"curve",lineWidth:"3px",lineColor:"rgb(113, 203, 45)"}},normalTopic:{contentStyle:{border:"1px solid #e8eaec",borderRadius:"20px",fontSize:"17px",padding:"4px 10px"},subLinkStyle:{lineType:"curve",lineWidth:"3px",lineColor:"white"}}}},formatVersion:"0.0"});this.state={model:e}}},{key:"renderDiagram",value:function(){return r.a.createElement(vi,{ref:this.diagramRef,model:this.state.model,onChange:this.onChange,plugins:Il})}},{key:"renderToolbar",value:function(){var e=this.diagram.getDiagramProps(),t=e.controller,n=t.run("canUndo",e),o=t.run("canRedo",e),i={diagram:this.diagram,onClickUndo:this.onClickUndo,onClickRedo:this.onClickRedo,canUndo:n,canRedo:o};return r.a.createElement(Pl,i)}},{key:"render",value:function(){return r.a.createElement("div",{className:"mindmap"},this.diagram&&this.renderToolbar(),this.renderDiagram())}}]),n}(r.a.Component);n(870);var Al=function(){return r.a.createElement(Ml,null)};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));localStorage.debug=["app","plugin:layout"].join(","),a.a.render(r.a.createElement(Al,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}}]);
  //# sourceMappingURL=chunk-blinkmind.d868303c.chunk.js.map