balkan-orgchart-react 9.1.85 → 9.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.es.js +1 -1
- package/index.umd.js +1 -1
- package/package.json +2 -2
- package/readme.md +16 -11
package/index.es.js
CHANGED
|
@@ -849,7 +849,7 @@ i.prototype.init = function(e, t) {
|
|
|
849
849
|
t._menuClickHandler.apply(t, [this, e]);
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
|
-
}, i === void 0 && (i = {}), i.VERSION = "9.1.
|
|
852
|
+
}, i === void 0 && (i = {}), i.VERSION = "9.1.86", i.orientation = {}, i.orientation.top = 0, i.orientation.bottom = 1, i.orientation.right = 2, i.orientation.left = 3, i.orientation.top_left = 4, i.orientation.bottom_left = 5, i.orientation.right_top = 6, i.orientation.left_top = 7, i.anchor = {
|
|
853
853
|
top_right: "top_right",
|
|
854
854
|
right_top: "right_top",
|
|
855
855
|
bottom_right: "bottom_right",
|
package/index.umd.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<rect style="display: ${C}" data-treelist-scroll="${p.id}" class="boc-scroll" x="${p.x+p.w-p.padding[1]-u.TREELIST_SCROLLBAR_WIDTH}" y="${p.y+p.padding[0]}" width="${u.TREELIST_SCROLLBAR_WIDTH}" height="${p.h-p.padding[2]-p.padding[0]}"></rect>
|
|
22
22
|
<rect style="display: ${C}" data-treelist-thumb="${p.id}" class="boc-scroll-thumb" x="${p.x+p.w-p.padding[1]-u.TREELIST_SCROLLBAR_WIDTH}" y="${S}" width="${u.TREELIST_SCROLLBAR_WIDTH}" height="${x}"></rect>
|
|
23
23
|
|
|
24
|
-
</g>`}}for(var f=0;f<e.visibleNodeIds.length;f++){var p=e.nodes[e.visibleNodeIds[f]],m=i._get(p.id);p.isTreeListItem||(u.RENDER_LINKS_BEFORE_NODES||(o+=i.ui.link(p,i,s,e.bordersByRootIdAndLevel,e.nodes,t)),o+=i.ui.expandCollapseBtn(i,p,m,i.config,i._layoutConfigs,t,s))}var a={content:o,res:e};if(u.events.publish(`render`,[i,a]),o=a.content,e=a.res,o+=i.ui.lonely(i.config),t===u.action.exporting){var w=e.boundary,T=w.maxX-w.minX,E=w.maxY-w.minY,D=i.ui.svg(T,E,[w.minX,w.minY,T,E],i.config,o,s);r.call(i,D,e);return}(t===u.action.centernode||t===u.action.insert||t===u.action.expand||t===u.action.collapse||t===u.action.update)&&(l=c),t===u.action.init&&c!=null&&(l=c),t===u.action.centerNode&&c!=null&&(l=c),i.response=e,i._lastSize={width:i.width(),height:i.height()};var D=i.ui.svg(`100%`,`100%`,l,i.config,o);if(!i._initialized)i.element.innerHTML=i.ui.css()+D+i.ui.menuButton(i.config)+i.ui.aiButton(i.config),i._attachEventHandlers(),i.xScrollUI.create(i.width(),i.config.padding),i.xScrollUI.setPosition(),i.xScrollUI.addListener(i.getSvg()),i.yScrollUI.create(i.height(),i.config.padding),i.yScrollUI.setPosition(),i.yScrollUI.addListener(i.getSvg()),i.config.enableSearch&&i.searchUI.init(i),i.aiUI.init(i),i.orgScribeUI.init(i),i.powerPointPreviewUI.init(i),i.pdfPreviewUI.init(i),i.svgPreviewUI.init(i),i.pngPreviewUI.init(i),i.toolbarUI.init(i,i.config.toolbar),i.undoRedoUI.init(i),i.controlsUI.init(i);else{var O=i.getSvg(),k=O.parentNode;k.removeChild(O),k.insertAdjacentHTML(`afterbegin`,D),i._attachEventHandlers(),i.xScrollUI.addListener(i.getSvg()),i.yScrollUI.addListener(i.getSvg()),i.xScrollUI.setPosition(),i.yScrollUI.setPosition()}var A=!1,j=i.response.animations;if(j[0].length>0){i._hideBeforeAnimation(j[0].length);for(var f=0;f<j[0].length;f++)j[0][f]=i.getNodeElement(j[0][f]);u.animate(j[0],j[1],j[2],i.config.anim.duration,i.config.anim.func,function(){A||=(r&&r.call(i),u.events.publish(`redraw`,[i]),i._showAfterAnimation(),!0)})}t===u.action.centerNode?u.animate(i.getSvg(),{viewbox:c},{viewbox:i.response.viewBox},i.config.anim.duration,i.config.anim.func,function(){i.ripple(n.options.rippleId),A||=(r&&r.call(i),u.events.publish(`redraw`,[i]),i._showAfterAnimation(),!0)},function(){i.xScrollUI.setPosition(),i.yScrollUI.setPosition()}):c&&i.response&&(c[0]!=i.response.viewBox[0]||c[1]!=i.response.viewBox[1]||c[2]!=i.response.viewBox[2]||c[3]!=i.response.viewBox[3])&&(t===u.action.insert||t===u.action.expand||t===u.action.collapse||t===u.action.update||t===u.action.init)?u.animate(i.getSvg(),{viewbox:c},{viewbox:i.response.viewBox},i.config.anim.duration*2,i.config.anim.func,function(){i.xScrollUI.setPosition(),i.yScrollUI.setPosition(),A||=(r&&r.call(i),u.events.publish(`redraw`,[i]),!0)}):j[0].length==0&&(A||=(r&&r.call(i),u.events.publish(`redraw`,[i]),!0)),i._initialized||(i._initialized=!0,i.filterUI.update(),i._ai.setContext(),u.events.publish(`init`,[i])),!i._loaded&&e&&e.nodes&&Object.keys(e.nodes).length&&(i._loaded=!0)}},function(e){u.events.publish(`ready`,[i,e])})}},u.prototype._setInitialSizeIfNotSet=function(){this.mainElement.style.overflow=`hidden`,this.mainElement.style.position=`relative`,this.mainElement.offsetHeight==0&&(this.mainElement.style.height=`100%`,this.mainElement.offsetHeight==0&&(this.mainElement.style.height=`700px`)),this.mainElement.offsetWidth==0&&(this.mainElement.style.width=`100%`,this.mainElement.offsetWidth==0&&(this.mainElement.style.width=`700px`))},u.prototype.width=function(){return this.element.offsetWidth},u.prototype.height=function(){return this.element.offsetHeight},u.prototype.getViewBox=function(){var e=this.getSvg();return u._getViewBox(e)},u.prototype.setViewBox=function(e){this.getSvg().setAttribute(`viewBox`,e.toString())},u.prototype.getScale=function(e){return e||=this.getViewBox(),u.getScale(e,this.width(),this.height(),this.config.scaleInitial,this.config.scaleMax,this.config.scaleMin)},u.prototype.setScale=function(e){e>this.config.scaleMax&&(e=this.config.scaleMax),e<this.config.scaleMin&&(e=this.config.scaleMin);var t=this.getViewBox().slice(0),n=this.width(),r=this.height(),i=n/t[2],a=r/t[3],o=i>a?a:i,s=t,c=t[2],l=t[3];return t[2]/=e/o,t[3]/=e/o,t[0]=s[0]-(t[2]-c)/2,t[1]=s[1]-(t[3]-l)/2,this.setViewBox(t),u.events.publish(`redraw`,[this]),e},u.prototype.ripple=function(e,t,n){var r=this.getNode(e);if(r!=null){var i=this.getNodeElement(e);if(i!=null){var a=this.getScale(),o=r.w/2,s=r.h/2;if(t!==void 0&&n!==void 0){var c=i.getBoundingClientRect();o=t/a-c.left/a,s=n/a-c.top/a}var l=r.w,d=r.h,f=l-o>o?l-o:o,p=d-s>s?d-s:s;f=f,p=p;var m=f>p?f:p,h=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),g=document.createElementNS(`http://www.w3.org/2000/svg`,`clipPath`),_=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),v=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),y=u.randomId();g.setAttribute(`id`,y);var b={ripple:u.t(r.templateName,r.min,this.getScale()).ripple,node:r};u.events.publish(`ripple`,[this,b]),_.setAttribute(`x`,b.ripple.rect?b.ripple.rect.x:0),_.setAttribute(`y`,b.ripple.rect?b.ripple.rect.y:0),_.setAttribute(`width`,b.ripple.rect?b.ripple.rect.width:r.w),_.setAttribute(`height`,b.ripple.rect?b.ripple.rect.height:r.h),_.setAttribute(`rx`,b.ripple.radius),_.setAttribute(`ry`,b.ripple.radius),v.setAttribute(`clip-path`,`url(#`+y+`)`),v.setAttribute(`cx`,o),v.setAttribute(`cy`,s),v.setAttribute(`r`,0),v.setAttribute(`fill`,b.ripple.color),v.setAttribute(`class`,`boc-ripple`),g.appendChild(_),h.appendChild(g),h.appendChild(v),i.appendChild(h),u.animate(v,{r:0,opacity:1},{r:m,opacity:0},500,u.anim.outPow,function(){i.removeChild(h)})}}},u.prototype.centerOutNodes=function(e){if(this._centerInNodes){var t=JSON.parse(this._centerInNodes);this._centerInNodes=null;var n=this;this._centerInNodesTimeout=u.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:t},300,this.config.anim.func,function(){n.draw(u.action.update,null,function(){e&&e.call(n)})})}},u.prototype.centerInNodes=function(e,t){var n=this.getViewBox();this._centerInNodes||=JSON.stringify(n);var r=2**53-1,i=-(2**53-1),a=2**53-1,o=-(2**53-1);for(var s of e)s.y<r&&(r=s.y),s.y+s.h>i&&(i=s.y+s.h),s.x<a&&(a=s.x),s.x+s.w>o&&(o=s.x+s.w);var c=o-a,l=i-r,d=c/(c+this.config.padding*2),f=l/(l+this.config.padding*2),p=d>f?f:d;p>this.config.scaleMax&&(p=this.config.scaleMax),p<this.config.scaleMin&&(p=this.config.scaleMin);var m=[50,50],h=this.width(),g=this.height(),d=h/n[2],f=g/n[3],_=d>f?f:d,v=n,y=n[2],b=n[3];n[2]/=p/_,n[3]/=p/_,n[0]=v[0]-(n[2]-y)/(100/m[0]),n[1]=v[1]-(n[3]-b)/(100/m[1]),n[0]=a-(h/p-c)/2,n[1]=r-(g/p-l)/2;var x=this;this._centerInNodesTimeout&&=(clearTimeout(this._centerInNodesTimeout),null),this._centerInNodesTimeout=u.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:n},300,this.config.anim.func,function(){x.draw(u.action.update,null,function(){t&&t.call(x)})})},u.prototype.center=function(e,t,n){var r,i,a=e,o=!0,s=!0;t&&t.parentState!=null&&(r=t.parentState),t&&t.childrenState!=null&&(i=t.childrenState),t&&t.rippleId!=null&&(a=t.rippleId),t&&t.vertical!=null&&(o=t.vertical),t&&t.horizontal!=null&&(s=t.horizontal);var c={parentState:r,childrenState:i,rippleId:a,vertical:o,horizontal:s};this._draw(!1,u.action.centerNode,{id:e,options:c},n)},u.prototype.fit=function(e){this.config.scaleInitial=u.match.boundary,this._draw(!0,u.action.init,{method:`fit`},e)},u.prototype.fitIfOutside=function(e){this.config.scaleInitial=u.match.boundaryIfOutside,this._draw(!0,u.action.init,{method:`fit`},e)},u.prototype.toggleFullScreen=function(){var e=document.querySelector(`[`+u.attr.tlbr+`r='fullScreen']`);document.fullscreenElement==this.element||document.webkitFullscreenElement==this.element||document.mozFullScreenElement==this.element||document.msFullscreenElement==this.element?(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),e&&(e.innerHTML=u.toolbarUI.openFullScreenIcon)):(this.element.requestFullscreen?this.element.requestFullscreen():this.element.mozRequestFullScreen?this.element.mozRequestFullScreen():this.element.webkitRequestFullscreen?this.element.webkitRequestFullscreen():this.element.msRequestFullscreen&&this.element.msRequestFullscreen(),e&&(e.innerHTML=u.toolbarUI.closeFullScreenIcon))},u.prototype.getNode=function(e){return this.nodes[e]},u.prototype.setLayout=function(e,t){t||=`base`,this._layoutConfigs[t].layout=e,t==`base`&&(this.config.layout=e),this._draw(!1,u.action.update)},u.prototype.setOrientation=function(e,t,n){var r=this;t||=`base`,this._layoutConfigs[t].orientation=e,t==`base`&&(this.config.orientation=e),this._draw(!1,u.action.update,void 0,function(){r.getScale(),u._moveToBoundaryArea(r.getSvg(),r.getViewBox(),r.response.boundary,function(){r._draw(!0,u.action.pan),n&&n()})})},u.prototype.search=function(e,t,n){return u.isNEU(t)&&(t=this.searchUI._searchFields),u.isNEU(n)&&(n=t),u._search.search(this.config.nodes,e,t,n,this.config.searchDisplayField,this.config.searchFieldsWeight,this.searchUI._searchFieldsAbbreviation)},u.prototype._hideBeforeAnimation=function(e){if(this._hideBeforeAnimationCompleted!=1&&!(e&&e<u.ANIM_THRESHOLD)){var t=this.element.getElementsByTagName(`text`);if(t.length>u.TEXT_THRESHOLD)for(var n=0;n<t.length;n++)t[n].style.display=`none`;var r=this.element.getElementsByTagName(`image`);if(r.length>u.IMAGES_THRESHOLD)for(var n=0;n<r.length;n++)r[n].style.display=`none`;var i=this.element.querySelectorAll(`[`+u.attr.link_id+`]`);if(i.length>u.LINKS_THRESHOLD)for(var n=0;n<i.length;n++)i[n].style.display=`none`;var a=this.element.querySelectorAll(`[`+u.attr.control_expcoll_id+`]`);if(a.length>u.BUTTONS_THRESHOLD)for(var n=0;n<a.length;n++)a[n].style.display=`none`;var o=this.element.querySelectorAll(`[`+u.attr.control_up_id+`]`);if(o.length>u.BUTTONS_THRESHOLD)for(var n=0;n<o.length;n++)o[n].style.display=`none`;this._hideBeforeAnimationCompleted=!0}},u.prototype._showAfterAnimation=function(){for(var e=this.element.getElementsByTagName(`text`),t=0;t<e.length;t++)e[t].style.display=``;for(var n=this.element.getElementsByTagName(`image`),t=0;t<n.length;t++)n[t].style.display=``;for(var r=this.element.querySelectorAll(`[`+u.attr.link_id+`]`),t=0;t<r.length;t++)r[t].style.display=``;for(var i=this.element.querySelectorAll(`[`+u.attr.control_expcoll_id+`]`),t=0;t<i.length;t++)i[t].style.display=``;for(var a=this.element.querySelectorAll(`[`+u.attr.control_up_id+`]`),t=0;t<a.length;t++)a[t].style.display=``;this._hideBeforeAnimationCompleted=!1},u.prototype.isChild=function(e,t){for(var n=this.getNode(t);n;){if(n.id==e)return!0;n=n.parent?n.parent:n.stParent}return!1},u.prototype.getCollapsedIds=function(e){for(var t=[],n=0;n<e.childrenIds.length;n++){var r=this.getNode(e.childrenIds[n]);r.collapsed==1&&t.push(r.id)}return t},u.prototype.stateToUrl=function(){if(this.manager.state){var e={};return e.exp=this.manager.state.exp.join(`*`),e.min=this.manager.state.min.join(`*`),e.adjustify=this.manager.state.adjustify.x+`*`+this.manager.state.adjustify.y,e.scale=this.manager.state.scale,e.y=this.manager.state.x,e.x=this.manager.state.y,new URLSearchParams(e).toString()}return``},u.prototype.generateId=function(){for(;;){var e=`_`+(`0000`+(Math.random()*36**4|0).toString(36)).slice(-4);if(this.nodes==null||!this.nodes.hasOwnProperty(e))return e}},u.prototype.moveNodesToVisibleArea=function(e,t){for(var n=this,r=this.roots[0],i=this.getSvg(),a=this.getViewBox(),o=null,s=null,c=null,l=null,d=0;d<e.length;d++){var f=this.nodes[e[d]];f.x!=null&&f.y!=null&&((o===null||o<f.x+f.w)&&(o=f.x+f.w),(s===null||s<f.y+f.h)&&(s=f.y+f.h),(c===null||c>f.x)&&(c=f.x),(l===null||l>f.y)&&(l=f.y))}if(!(o==null||s==null||c==null||l==null)){var p=this.width(),m=this.height(),h=o-c+this.config.padding*2,g=s-l+this.config.padding*2,_=p/h,v=m/g,y=_>v?v:_,b=Math.ceil(p/y),x=Math.ceil(m/y),h=0,g=0;if(b-this.config.padding*2>=o-c)h=(o+c)/2-b/2;else switch(h=r.x-b/2+u.manager._getNodeWidth(r,this.config)/2,this.config.orientation){case u.orientation.right:case u.orientation.right_top:h=-(b/2-(c-o)/2),h<this.config.padding-b&&(h=this.config.padding-b);break;case u.orientation.left:case u.orientation.bottom_left:case u.orientation.top_left:case u.orientation.left_top:h=-(b/2-(o-c)/2),h>-this.config.padding&&(h=-this.config.padding);break}if(x-this.config.padding*2>=s-l)g=(s+l)/2-x/2;else switch(g=-(x/2-(s-l)/2),g>-this.config.padding&&(g=-this.config.padding),this.config.orientation){case u.orientation.bottom:case u.orientation.bottom_left:g=-(x/2-(l-s)/2),g<this.config.padding-x&&(g=this.config.padding-x);break;case u.orientation.left:case u.orientation.right:g=r.y-x/2+u.manager._getNodeWidth(r,this.config)/2;break}var S=[h,g,b,x];a[0]!==S[0]||a[1]!==S[1]?u.animate(i,{viewBox:a},{viewBox:S},this.config.anim.duration,this.config.anim.func,function(){n.draw(u.action.update,void 0,t)}):t&&t()}},u.prototype._nodeHasHiddenParent=function(e){return!e.parent&&!u.isNEU(e.pid)&&this.getNode(e.pid)},u.prototype.destroy=function(){this._initCalled=!1,this._resizeObserver.unobserve(this.element),u.events.removeForEventId(this._event_id),this.element.innerHTML=null},u._defaultConfig=function(e){return{interactive:!0,mode:`light`,lazyLoading:`auto`,enableDragDrop:!1,enableSearch:!0,enableAI:!1,enablePan:!0,keyNavigation:!1,miniMap:!1,controls:null,nodeMenu:null,nodeCircleMenu:null,nodeContextMenu:null,menu:null,toolbar:!1,nodeMouseClick:u.action.details,nodeMouseDbClick:u.none,mouseScrool:u.action.ctrlZoom,showXScroll:!1,showYScroll:!1,template:`ana`,tags:{},min:!1,nodeBinding:{},linkBinding:{},searchFields:null,searchDisplayField:null,searchFieldsWeight:null,searchFieldsAbbreviation:null,nodes:[],clinks:[],slinks:[],backdrops:[],groupDottedLines:[],dottedLines:[],undoRedoStorageName:null,levelSeparation:60,siblingSeparation:20,subtreeSeparation:40,backdropSeparation:15,mixedHierarchyNodesSeparation:15,assistantSeparation:100,minPartnerSeparation:50,partnerChildrenSplitSeparation:20,partnerNodeSeparation:15,columns:10,padding:30,orientation:u.orientation.top,layout:u.layout.normal,layoutGridColumns:`dynamic`,scaleInitial:u.match.boundaryIfOutside,movable:null,scaleMin:.1,scaleMax:5,orderBy:null,editUI:null,aiUI:null,orgScribeUI:null,powerPointPreviewUI:null,pdfPreviewUI:null,svgPreviewUI:null,pngPreviewUI:null,filterUI:null,searchUI:null,xScrollUI:null,yScrollUI:null,nodeMenuUI:null,controlsUI:null,nodeCircleMenuUI:null,nodeContextMenuUI:null,toolbarUI:null,notifierUI:null,menuUI:null,undoRedoUI:null,exportUrl:`https://balkan.app/export`,serverUrl:`https://serverjs.balkan.app`,aiChatTools:[],collapse:{},expand:{},align:u.CENTER,UI:null,anim:{func:u.anim.outPow,duration:200},zoom:{speed:120,smooth:12},roots:null,state:null,editForm:{readOnly:!1,titleBinding:`name`,photoBinding:`img`,addMore:`Add more fields`,addMoreBtn:`Add`,addMoreFieldName:`Field name`,saveAndCloseBtn:`Save and close`,generateElementsFromFields:!0,focusBinding:null,buttons:{edit:{icon:u.icon.edit(24,24,`#fff`),text:`Edit`,hideIfEditMode:!0,hideIfDetailsMode:!1},share:{icon:u.icon.share(24,24,`#fff`),text:`Share`},pdf:{icon:u.icon.pdf(24,24,`#fff`),text:`Save as PDF`},remove:{icon:u.icon.remove(24,24,`#fff`),text:`Remove`,hideIfDetailsMode:!0}},elements:[]}}},u.localStorage={},u.localStorage.getItem=function(e){var t=localStorage.getItem(`to_date`);if(!t)t=new Date,t.setDate(t.getDate()+5),t=t.toISOString(),localStorage.setItem(`to_date`,t);else if(t=new Date(t),t<new Date){for(var n=0,r=localStorage.length;n<r;++n){var i=localStorage.key(n);i&&i.startsWith&&i.startsWith(`{"n"`)&&localStorage.removeItem(i)}localStorage.removeItem(`to_date`)}return localStorage.getItem(e)},u.localStorage.setItem=function(e,t){try{localStorage.setItem(e,t)}catch(e){e.code==e.QUOTA_EXCEEDED_ERR?(console.warn(`Local storage quota exceeded`),localStorage.clear()):(console.error(`Local storage error code:`+e.code),console.error(e))}},u.prototype.canUpdateLink=function(e,t){if(t==null||t==null||e==null||e==null||e==t)return!1;var n=this.getNode(t),r=this.getNode(e);return n&&r&&(n.isPartner||n.hasPartners&&r.isAssistant||n.hasAssistants&&r.isPartner)?!1:!this.isChild(e,t)},u.prototype._canUpdateLink=u.prototype.canUpdateLink,u.prototype.updateNode=function(e,t,n,r){if(e){var i=this,a=this.get(e.id);if(n===!0&&u.events.publish(`update`,[this,a,e])===!1)return!1;this.update(e),this._ai.setContext(),u.events.publish(`updated`,[this]),this.filterUI.update();var o=this.getNode(e.id),s=o.pid;s??=o.stpid,this._draw(!1,u.action.update,{id:s},function(){r||i.ripple(e.id),t&&t()})}},u.prototype.update=function(e){for(var t=0;t<this.config.nodes.length;t++)if(this.config.nodes[t].id==e.id){this._putInUndoStack(),this.clearRedo(),this.config.nodes[t]=e;break}return this},u.prototype.removeNode=function(e,t,n){if(!this.canRemove(e))return!1;var r=this._getNewPidsAndStpidsForIds(e);return n===!0&&u.events.publish(`remove`,[this,e,r])===!1?!1:(this.remove(e),this._ai.setContext(),u.events.publish(`updated`,[this]),this.filterUI.update(),this._draw(!1,u.action.update,null,function(){t&&t()}),!0)},u.prototype.remove=function(e){var t=this.get(e);if(t){this._putInUndoStack(),this.clearRedo();for(var n=this.config.nodes.length-1;n>=0;n--)(this.config.nodes[n].pid==e||this.config.nodes[n].stpid==e)&&(this.config.nodes[n].pid=t.pid,this.config.nodes[n].stpid=t.stpid),this.config.nodes[n].id==e&&this.config.nodes.splice(n,1)}return this},u.prototype._getNewPidsAndStpidsForIds=function(e){var t=this.get(e),n={},r={};if(t)for(var i=this.config.nodes.length-1;i>=0;i--)this.config.nodes[i].pid==e?n[this.config.nodes[i].id]=t.pid:this.config.nodes[i].stpid==e&&(r[this.config.nodes[i].id]=t.stpid);return{newPidsForIds:n,newStpidsForIds:r}},u.prototype.addNode=function(e,t,n){var r=this;if(n===!0&&u.events.publish(`add`,[this,e])===!1)return!1;this.add(e),this._ai.setContext(),u.events.publish(`updated`,[this]),this.filterUI.update(),r._draw(!1,u.action.insert,{id:e.pid,insertedNodeId:e.id},function(){r.ripple(e.id),t&&t()})},u.prototype.add=function(e){if(e.id??console.error(`Call addNode without id`),this._putInUndoStack(),this.clearRedo(),this.config.movable&&!u.isNEU(e.pid)){var t=this._get(e.pid);t&&(t.movex!=null&&(e.movex=t.movex),t.movey!=null&&(e.movey=t.movey))}return this.config.nodes.push(e),this},u.prototype.replaceIds=function(e,t){this._replaceIds(e),this._draw(!1,u.action.update,void 0,t)},u.prototype._replaceIds=function(e){for(var t=function(t){for(var n=0;n<t.length;n++){var r=t[n];for(var i in e){var a=e[i];r.from==i&&(r.from=a),r.to==i&&(r.to=a)}}},n=0;n<this.config.nodes.length;n++){var r=this.config.nodes[n];for(var i in e){var a=e[i];r.id==i&&(r.id=a),r.pid==i&&(r.pid=a),r.stpid==i&&(r.stpid=a),r.ppid==i&&(r.ppid=a)}}if(Array.isArray(this.config.roots))for(var n=0;n<this.config.roots.length;n++)u.isNEU(e[this.config.roots[n]])||(this.config.roots[n]=e[this.config.roots[n]]);if(this.nodes){for(var o in this.nodes)if(!u.isNEU(e[o])){var a=e[o],s=this.nodes[o];s.id=a,this.nodes[a]=s}}if(this.manager.oldNodes){for(var o in this.manager.oldNodes)if(!u.isNEU(e[o])){var a=e[o],s=this.manager.oldNodes[o];s.id=a,this.manager.oldNodes[a]=s}}if(this.roots){for(var o in this.roots)if(!u.isNEU(e[o])){var a=e[o],s=this.roots[o];s.id=a,this.roots[a]=s}}t(this.config.clinks),t(this.config.slinks),t(this.config.groupDottedLines),t(this.config.dottedLines)},u.prototype._get=function(e){var t=this.__get(e);if(t)return t;if((this.config.groupDottedLines.length||this.config.dottedLines.length)&&!u.isNEU(e)&&typeof e==`string`&&(e.indexOf(`balkan_group_dotted_`)!=-1||e.indexOf(`balkan_dotted_`)!=-1)){e=e.replace(`balkan_group_dotted_`,``),e=e.replace(`balkan_dotted_`,``);var n=e.indexOf(`_balkan_id_`);if(e=e.substring(n+11),t=this.__get(e),t)return t}return null},u.prototype.__get=function(e){for(var t=0;t<this.config.nodes.length;t++)if(this.config.nodes[t].id==e)return this.config.nodes[t];return null},u.prototype.get=function(e){var t=this._get(e);return t==null?null:JSON.parse(JSON.stringify(t))},u.prototype.canRemove=function(e){var t=this.getNode(e);return!(!t||t.hasPartners||t.hasAssistants)},u===void 0&&(u={}),u._ajax=function(e,t,n,r,i){r??=`arraybuffer`;var a=new XMLHttpRequest;for(var o in a.onload=function(e){a.readyState==4&&this.status===200&&(e.target==null?i(this.response):i(e.target.response))},a.onerror=function(e){i({error:e})},a.open(t,e),a.responseType=r,a.setRequestHeader(`Content-Type`,`application/json`),u.REQUEST_CUSTOM_HEADERS)a.setRequestHeader(o,u.REQUEST_CUSTOM_HEADERS[o]);n==null?a.send():a.send(n)},u===void 0&&(u={}),u.animate=function(e,t,n,r,i,a,o){var s=10,c=1,l=1,d=r/s+1,f;document.getElementsByTagName(`g`),Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);function p(){for(var p=0;p<e.length;p++)for(var m in n[p]){var h=u._arrayContains([`top`,`left`,`right`,`bottom`,`width`,`height`],m.toLowerCase())?`px`:``;switch(m.toLowerCase()){case`d`:var g=i((l*s-s)/r)*(n[p][m][0]-t[p][m][0])+t[p][m][0],_=i((l*s-s)/r)*(n[p][m][1]-t[p][m][1])+t[p][m][1];e[p].setAttribute(`d`,e[p].getAttribute(`d`)+` L`+g+` `+_);break;case`r`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`r`,v);break;case`x1`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`x1`,v);break;case`x2`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`x2`,v);break;case`y1`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`y1`,v);break;case`y2`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`y2`,v);break;case`scrolltop`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].scrollTop=v;break;case`rotate3d`:if(n[p][m]){var y=t[p][m],b=n[p][m],x=[0,0,0,0];for(var S in y)x[S]=i((l*s-s)/r)*(b[S]-y[S])+y[S];e[p].style.transform=`rotate3d(`+x.toString()+`deg)`}break;case`transform`:if(n[p][m]){var y=t[p][m],b=n[p][m],x=[0,0,0,0,0,0];for(var S in y)x[S]=i((l*s-s)/r)*(b[S]-y[S])+y[S];e[p].hasAttribute(`transform`)?e[p].setAttribute(`transform`,`matrix(`+x.toString()+`)`):e[p].style.transform=`matrix(`+x.toString()+`)`}break;case`viewbox`:if(n[p][m]){var y=t[p][m],b=n[p][m],x=[0,0,0,0];for(var S in y)x[S]=i((l*s-s)/r)*(b[S]-y[S])+y[S];e[p].setAttribute(`viewBox`,x.toString())}break;case`margin`:if(n[p][m]){var y=t[p][m],b=n[p][m],x=[0,0,0,0];for(var S in y)x[S]=i((l*s-s)/r)*(b[S]-y[S])+y[S];for(var C=``,S=0;S<x.length;S++)C+=parseInt(x[S])+`px `;e[p]&&e[p].style&&(e[p].style[m]=C)}break;case`scrolly`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].scrollTo(0,v);break;default:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p]&&e[p].style&&(e[p].style[m]=v+h);break}}if(o){var v=i((l*s-s)/r);o(v)}l+=c,l>d+1&&(clearInterval(f),a&&a(e))}return f=setInterval(p,s),f},u.anim={},u.anim.inPow=function(e){return e<0?0:e>1?1:e**2},u.anim.outPow=function(e){var t=2;if(e<0)return 0;if(e>1)return 1;var n=t%2==0?-1:1;return n*((e-1)**t+n)},u.anim.inOutPow=function(e){var t=2;if(e<0)return 0;if(e>1)return 1;if(e*=2,e<1)return u.anim.inPow(e,t)/2;var n=t%2==0?-1:1;return n/2*((e-2)**t+n*2)},u.anim.inSin=function(e){return e<0?0:e>1?1:-Math.cos(Math.PI/2*e)+1},u.anim.outSin=function(e){return e<0?0:e>1?1:Math.sin(Math.PI/2*e)},u.anim.inOutSin=function(e){return e<0?0:e>1?1:-.5*(Math.cos(Math.PI*e)-1)},u.anim.inExp=function(e){return e<0?0:e>1?1:2**(10*(e-1))},u.anim.outExp=function(e){return e<0?0:e>1?1:-(2**(-10*e))+1},u.anim.inOutExp=function(e){return e<0?0:e>1?1:e<.5?.5*2**(10*(2*e-1)):.5*(-(2**(10*(-2*e+1)))+2)},u.anim.inCirc=function(e){return e<0?0:e>1?1:-(Math.sqrt(1-e*e)-1)},u.anim.outCirc=function(e){return e<0?0:e>1?1:Math.sqrt(1-(e-1)*(e-1))},u.anim.inOutCirc=function(e){return e<0?0:e>1?1:e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(2*e-2)*(2*e-2))+1)},u.anim.rebound=function(e){return e<0?0:e>1?1:e<1/2.75?1-7.5625*e*e:e<2/2.75?1-(7.5625*(e-1.5/2.75)*(e-1.5/2.75)+.75):e<2.5/2.75?1-(7.5625*(e-2.25/2.75)*(e-2.25/2.75)+.9375):1-(7.5625*(e-2.625/2.75)*(e-2.625/2.75)+.984375)},u.anim.inBack=function(e){return e<0?0:e>1?1:e*e*(2.70158*e-1.70158)},u.anim.outBack=function(e){return e<0?0:e>1?1:(e-1)*(e-1)*(2.70158*(e-1)+1.70158)+1},u.anim.inOutBack=function(e){return e<0?0:e>1?1:e<.5?.5*(4*e*e*(3.5949*2*e-2.5949)):.5*((2*e-2)*(2*e-2)*(3.5949*(2*e-2)+2.5949)+2)},u.anim.impulse=function(e){var t=2*e;return t*Math.exp(1-t)},u.anim.expPulse=function(e){return Math.exp(-2*e**2)},u===void 0&&(u={}),u.prototype._attachEventHandlers=function(e){if(this.config.interactive){var e=this.getSvg(),t=this;e.addEventListener(`touchstart`,function(e){e.preventDefault(),t._globalMouseDownHandler.apply(t,[this,e])},{passive:!1}),e.addEventListener(`mousedown`,function(e){t._globalMouseDownHandler.apply(t,[this,e])},{passive:!0}),e.addEventListener(`contextmenu`,function(e){t._globalContextHandler.apply(t,[this,e])},{passive:!1}),e.addEventListener(`dblclick`,function(e){t._globalDbClickHandler.apply(t,[this,e])},{passive:!0}),this.config.mouseScrool!=u.action.none&&e.addEventListener(`wheel`,function(e){t._mouseScrollHandler.apply(t,[this,e])},{passive:!1});var n=this.getMenuButton();n&&n.addEventListener(`click`,function(e){t._menuClickHandler.apply(t,[this,e])})}},u===void 0&&(u={}),u.VERSION=`9.1.82`,u.orientation={},u.orientation.top=0,u.orientation.bottom=1,u.orientation.right=2,u.orientation.left=3,u.orientation.top_left=4,u.orientation.bottom_left=5,u.orientation.right_top=6,u.orientation.left_top=7,u.anchor={top_right:`top_right`,right_top:`right_top`,bottom_right:`bottom_right`,right_bottom:`right_bottom`,top_left:`top_left`,left_top:`left_top`,bottom_left:`bottom_left`,left_bottom:`left_bottom`,top:`top`,bottom:`bottom`,left:`left`,right:`right`},u.align={},u.align.center=u.CENTER=8,u.align.orientation=u.ORIENTATION=9,u.attr={},u.attr.l=`data-l`,u.attr.id=`data-id`,u.attr.sl=`data-sl`,u.attr.lbl=`data-lbl`,u.attr.val=`data-val`,u.attr.tlbr=`data-tlbr`,u.attr.item=`data-item`,u.attr.layout=`data-layout`,u.attr.node_id=`data-n-id`,u.attr.link_id=`data-l-id`,u.attr.field_name=`data-f-name`,u.attr.c_link_to=`data-c-l-to`,u.attr.c_link_from=`data-c-l-from`,u.attr.s_link_to=`data-s-l-to`,u.attr.s_link_from=`data-s-l-from`,u.attr.control_add=`data-ctrl-add`,u.attr.control_expcoll_id=`data-ctrl-ec-id`,u.attr.control_up_id=`data-ctrl-up-id`,u.attr.control_export_menu=`data-ctrl-menu`,u.attr.control_node_menu_id=`data-ctrl-n-menu-id`,u.attr.control_node_circle_menu_id=`data-ctrl-n-c-menu-id`,u.attr.control_node_circle_menu_name=`data-ctrl-n-c-menu-name`,u.attr.control_node_circle_menu_wrraper_id=`data-ctrl-n-c-menu-wrapper-id`,u.attr.width=`data-width`,u.attr.text_overflow=`data-text-overflow`,u.ID=`id`,u.PID=`pid`,u.STPID=`stpid`,u.TAGS=`tags`,u.NODES=`nodes`,u.ELASTIC=`elastic`,u.ASSISTANT=`Assistant`,u.action={},u.action.expand=0,u.action.collapse=1,u.action.maximize=101,u.action.minimize=102,u.action.expandCollapse=501,u.action.edit=1,u.action.zoom=2,u.action.ctrlZoom=22,u.action.scroll=41,u.action.xScroll=3,u.action.yScroll=4,u.action.none=5,u.action.init=6,u.action.update=7,u.action.move=70,u.action.pan=8,u.action.centerNode=9,u.action.resize=10,u.action.insert=11,u.action.insertfirst=12,u.action.details=13,u.action.exporting=14,u.none=400001,u.scroll={},u.scroll.visible=!0,u.scroll.smooth=12,u.scroll.speed=120,u.scroll.safari={smooth:12,speed:250},u.match={},u.match.height=100001,u.match.width=100002,u.match.boundary=100003,u.match.boundaryIfOutside=100004,u.match.none=1,u.movable={},u.movable.node=`node`,u.movable.tree=`tree`,u.movable.detachTree=`detachTree`,u.layout={},u.layout.normal=u.normal=0,u.layout.mixed=u.mixed=1,u.layout.tree=u.tree=2,u.layout.treeLeftOffset=u.treeLeftOffset=3,u.layout.treeRightOffset=u.treeRightOffset=4,u.layout.treeLeft=5,u.layout.treeRight=6,u.layout.grid=-1,u.layout.treeList=-2,u.nodeOpenTag=`<g `+u.attr.node_id+`="{id}" style="opacity: {opacity}" transform="matrix(1,0,0,1,{x},{y})" class="{class}" `+u.attr.sl+`="{sl}" `+u.attr.l+`="{level}" {lcn}>`,u.linkOpenTag=`<g `+u.attr.link_id+`="[{id}][{child-id}]" class="{class}">`,u.expcollOpenTag=`<g `+u.attr.control_expcoll_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,u.upOpenTag=`<g `+u.attr.control_up_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,u.linkFieldsOpenTag=`<g transform="matrix(1,0,0,1,{x},{y}) rotate({rotate})">`,u.grCloseTag=`</g>`,u.A5={width:420,height:595},u.A4={width:595,height:842},u.A3={width:842,height:1191},u.A2={width:1191,height:1684},u.A1={width:1684,height:2384},u.Letter={width:612,height:791},u.Legal={width:612,height:1009},u.Legal={width:612,height:1009},u.Widescreen={width:720,height:1280},u.Standard={width:720,height:960},u.COLLAPSE_PARENT_NEIGHBORS=1,u.COLLAPSE_SUB_CHILDRENS=2,u.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED=3,u.TEXT_THRESHOLD=4e3,u.IMAGES_THRESHOLD=1e3,u.LINKS_THRESHOLD=2e3,u.BUTTONS_THRESHOLD=700,u.ANIM_THRESHOLD=500,u.IT_IS_LONELY_HERE=`<g transform="translate(-100, 0)" style="cursor:pointer;" `+u.attr.control_add+`="control-add"><text fill="#039be5">{link}</text></g>`,u.RES={},u.IT_IS_LONELY_HERE_LINK=u.RES.IT_IS_LONELY_HERE_LINK=`It's lonely here, add your first node`,u.FIRE_DRAG_NOT_CLICK_IF_MOVE=3,u.STRING_TAGS=!1,u.MAX_NODES_MESS=`The trial has expired or 200 nodes limit was reached! <br /><a style='color: #039BE5;' target='_blank' href='https://balkan.app/OrgChartJS/Docs/Evaluation'>See more</a>`,u.OFFLINE_MESS=`The evaluation version requires internet connection! <br /><a style='color: #039BE5;' target='_blank' href='https://balkan.app/OrgChartJS/Docs/Evaluation'>See more</a>`,u.SEARCH_PLACEHOLDER=`Search... type ? to get help.`,u.SEARCH_HELP_SYMBOL=`?`,u.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE=!1,u.SEARCH_RESULT_LIMIT=10,u.IMPORT_MESSAGE=`Choose the columns (fields) in your data file that contain the required information.`,u.FIXED_POSITION_ON_CLICK=!1,u.RENDER_LINKS_BEFORE_NODES=!1,u.RENDER_CLINKS_BEFORE_NODES=!1,u.MIXED_LAYOUT_ALL_NODES=!1,u.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN=!1,u.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN=1,u.LINK_ROUNDED_CORNERS=5,u.MOVE_STEP=5,u.CLINK_CURVE=1,u.MAX_DEPTH=200,u.SCALE_FACTOR=1.44,u.LAZY_LOADING_FACTOR=`auto`,u.LAZY_LOADING=!0,u.ARRAY_FIELDS=[`tags`],u.CSV_DELIMITER=`,`,u.EDITFORM_CLOSE_BTN=`<svg data-edit-from-close class="boc-edit-form-close"><path style="fill:#ffffff;" d="M21.205,5.007c-0.429-0.444-1.143-0.444-1.587,0c-0.429,0.429-0.429,1.143,0,1.571l8.047,8.047H1.111 C0.492,14.626,0,15.118,0,15.737c0,0.619,0.492,1.127,1.111,1.127h26.554l-8.047,8.032c-0.429,0.444-0.429,1.159,0,1.587 c0.444,0.444,1.159,0.444,1.587,0l9.952-9.952c0.444-0.429,0.444-1.143,0-1.571L21.205,5.007z"></path></svg>`,u.ESCAPE_HTML=!1,u.VERTICAL_CHILDREN_ASSISTANT=!1,u.EXPORT_PAGES_CUT_NODES=!1,u.RESET_MOVABLE_ONEXPANDCOLLAPSE=!1,u.FILTER_ALPHABETICALLY=!0,u.SERVER_PREFIX=`.azurewebsites.net/api/you-see-this-request-because-it-is-trial-version-of-orgchartjs`,u.FUNC_URL_NAME=`func-url-orgchartjs`,u.MINIMUM_SYMBOLS_IN_SEARCH_INPUT=1,u.AI_SYSTEM_MESSAGES=[],u.ORGSCRIBE_OFFSET=` `,u.TREELIST_WHEEL_STEP=`auto`,u.TREELIST_SCROLLBAR_WIDTH=10,u.CONVERT_IMAGES_TO_BASE64_BEFORE_EXPORT=!1,u.REQUEST_CUSTOM_HEADERS={},u.SLINK_GAP=7,u._intersects=function(e,t,n){var r=e.x-n.siblingSeparation/4,i=e.y,a=e.x+e.w+n.siblingSeparation/4,o=e.y;switch(n.orientation){case u.orientation.right:case u.orientation.right_top:case u.orientation.left:case u.orientation.left_top:r=e.x,i=e.y-n.siblingSeparation/4,a=e.x,o=e.y+e.h+n.siblingSeparation/4;break}var s=t.p,c=t.q,l=t.r,d=t.s,f=(a-r)*(d-c)-(l-s)*(o-i),p,m;return f===0?!1:(m=((d-c)*(l-r)+(s-l)*(d-i))/f,p=((i-o)*(l-r)+(a-r)*(d-i))/f,0<m&&m<1&&0<p&&p<1)},u._addPoint=function(e,t,n,r,i){switch(n.orientation){case u.orientation.top:case u.orientation.top_left:return u._addPointTop(e,t,n,r,i);case u.orientation.bottom:case u.orientation.bottom_left:return u._addPointBottom(e,t,n,r,i);case u.orientation.left:case u.orientation.left_top:return u._addPointLeft(e,t,n,r,i);case u.orientation.right:case u.orientation.right_top:return u._addPointRight(e,t,n,r,i)}},u._addPointTop=function(e,t,n,r,i){var a,o,s;return i==`left`?a=e.leftNeighbor?e.x+(e.leftNeighbor.x+e.leftNeighbor.w-e.x)/2:e.x-n.siblingSeparation/2:i==`right`&&(a=e.rightNeighbor?e.x+e.w+(e.rightNeighbor.x-(e.x+e.w))/2:e.x+e.w+n.siblingSeparation/2),t.push([a,t[t.length-1][1]]),t.push([a,e.y-n.levelSeparation/3]),o=t[t.length-1][1],s=a,r.p=a,r.q=o,r.r=s,r},u._addPointBottom=function(e,t,n,r,i){var a,o,s;return i==`left`?a=e.leftNeighbor?e.x+(e.leftNeighbor.x+e.leftNeighbor.w-e.x)/2:e.x-n.siblingSeparation/2:i==`right`&&(a=e.rightNeighbor?e.x+e.w+(e.rightNeighbor.x-(e.x+e.w))/2:e.x+e.w+n.siblingSeparation/2),t.push([a,t[t.length-1][1]]),t.push([a,e.y+e.h+n.levelSeparation/3]),o=t[t.length-1][1],s=a,r.p=a,r.q=o,r.r=s,r},u._addPointLeft=function(e,t,n,r,i){var a=t[t.length-1][0],o;i==`bottom`?o=e.rightNeighbor?e.y+e.h+(e.rightNeighbor.y-(e.y+e.h))/2:e.y+e.h+n.siblingSeparation/2:i==`top`&&(o=e.leftNeighbor?e.y+(e.leftNeighbor.y+e.leftNeighbor.h-e.y)/2:e.y-n.siblingSeparation/2),t.push([t[t.length-1][0],o]),t.push([e.x-n.levelSeparation/3,o]),a=t[t.length-1][0];var s=o;return r.p=a,r.q=o,r.s=s,r},u._addPointRight=function(e,t,n,r,i){var a=t[t.length-1][0],o;i==`bottom`?o=e.rightNeighbor?e.y+e.h+(e.rightNeighbor.y-(e.y+e.h))/2:e.y+e.h+n.siblingSeparation/2:i==`top`&&(o=e.leftNeighbor?e.y+(e.leftNeighbor.y+e.leftNeighbor.h-e.y)/2:e.y-n.siblingSeparation/2),t.push([t[t.length-1][0],o]),t.push([e.x+e.w+n.levelSeparation/3,o]),a=t[t.length-1][0];var s=o;return r.p=a,r.q=o,r.s=s,r},u._addConnectorLines=function(e,t){u._addConnectorLine(e,{x1:t.xa,y1:t.ya,x2:t.xb,y2:t.yb}),u._addConnectorLine(e,{x1:t.xb,y1:t.yb,x2:t.xc,y2:t.yc}),u._addConnectorLine(e,{x1:t.xc,y1:t.yc,x2:t.xd,y2:t.yd})},u._addConnectorLine=function(e,t){if(t.x1==t.x2){if(e.x[t.x1]||(e.x[t.x1]=[]),t.y1>t.y2){var n=t.y1;t.y1=t.y2,t.y2=n}e.x[t.x1].push({y1:t.y1,y2:t.y2})}if(t.y1==t.y2){if(e.y[t.y1]||(e.y[t.y1]=[]),t.x1>t.x2){var r=t.x1;t.x1=t.x2,t.x2=r}e.y[t.y1].push({x1:t.x1,x2:t.x2})}},u._addLineToPath=function(e,t,n){return u._avoidOverlapping(t,n),e.push([n.x1,n.y1]),e.push([n.x2,n.y2]),u._addConnectorLine(t,n),n},u._slinkRemoveUnusedPoints=function(e){for(var t=e.length-2;t>=1;t--){var n=e[t-1],r=e[t],i=e[t+1];(r[0]==n[0]&&r[0]==i[0]||r[1]==n[1]&&r[1]==i[1])&&e.splice(t,1)}},u._slinkAvoidOverlaping=function(e,t,n,r){for(var i=1;i<t.length;i++){var a=t[i-1],o=t[i];if(a[0]==o[0]){for(var s=e.x[o[0]];s;){var c=!0;for(var l of s)if(l.y1<=a[1]&&l.y2>=a[1]||l.y1<=o[1]&&l.y2>=o[1]){r==u.orientation.top||r==u.orientation.top_left?n==`left`?o[0]-=u.SLINK_GAP:n==`right`&&(o[0]+=u.SLINK_GAP):(r==u.orientation.bottom||r==u.orientation.bottom_left)&&(n==`right`?o[0]+=u.SLINK_GAP:n==`left`&&(o[0]-=u.SLINK_GAP)),c=!1;break}if(c)break;s=e.x[o[0]]}a[0]=o[0]}var d=!0;if(a[1]==o[1]&&a[0]>=o[0]&&(d=!1),d&&a[1]==o[1]){for(var s=e.y[o[1]];s;){var c=!0;for(var l of s)if(l.x1<=a[0]&&l.x2>=a[0]||l.x1<=o[0]&&l.x2>=o[0]){a[0]>=o[0]||(r==u.orientation.top||r==u.orientation.top_left?o[1]-=u.SLINK_GAP:(r==u.orientation.bottom||r==u.orientation.bottom_left)&&(o[1]+=u.SLINK_GAP),c=!1);break}if(c)break;s=e.y[o[1]]}a[1]=o[1]}d&&u._addConnectorLine(e,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},u._slinkAvoidOverlapingSecond=function(e,t,n){for(var r=1;r<t.length;r++){var i=t[r-1],a=t[r],o=!1;if(i[1]==a[1]){for(var s=e.y[a[1]];s;){var c=!0;for(var l of s)if(l.x1<=i[0]&&l.x2>=i[0]||l.x1<=a[0]&&l.x2>=a[0]){i[0]>=a[0]?(n==u.orientation.top||n==u.orientation.top_left?a[1]-=u.SLINK_GAP:(n==u.orientation.bottom||n==u.orientation.bottom_left)&&(a[1]+=u.SLINK_GAP),c=!1):o=!0;break}if(c)break;s=e.y[a[1]]}i[1]=a[1]}o||u._addConnectorLine(e,{x1:i[0],y1:i[1],x2:a[0],y2:a[1]})}},u._slinkAvoidOverlaping2=function(e,t,n,r){for(var i=1;i<t.length;i++){var a=t[i-1],o=t[i];if(a[1]==o[1]){for(var s=e.y[o[1]];s;){var c=!0;for(var l of s)if(l.x1<=a[0]&&l.x2>=a[0]||l.x1<=o[0]&&l.x2>=o[0]){r==u.orientation.left||r==u.orientation.left_top?n==`top`?o[1]-=u.SLINK_GAP:n==`bottom`&&(o[1]+=u.SLINK_GAP):(r==u.orientation.right||r==u.orientation.right_top)&&(n==`bottom`?o[1]+=u.SLINK_GAP:n==`top`&&(o[1]-=u.SLINK_GAP)),c=!1;break}if(c)break;s=e.y[o[1]]}a[1]=o[1]}var d=!0;if(a[0]==o[0]&&a[1]>=o[1]&&(d=!1),d&&a[0]==o[0]){for(var s=e.x[o[0]];s;){var c=!0;for(var l of s)if(l.y1<=a[1]&&l.y2>=a[1]||l.y1<=o[1]&&l.y2>=o[1]){a[1]>=o[1]||(r==u.orientation.left||r==u.orientation.left_top?o[0]-=u.SLINK_GAP:(r==u.orientation.right||r==u.orientation.right_top)&&(o[0]+=u.SLINK_GAP),c=!1);break}if(c)break;s=e.x[o[0]]}a[0]=o[0]}d&&u._addConnectorLine(e,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},u._slinkAvoidOverlapingSecond2=function(e,t,n){for(var r=1;r<t.length;r++){var i=t[r-1],a=t[r],o=!1;if(i[0]==a[0]){for(var s=e.x[a[0]];s;){var c=!0;for(var l of s)if(l.y1<=i[1]&&l.y2>=i[1]||l.y1<=a[1]&&l.y2>=a[1]){i[1]>=a[1]?(n==u.orientation.left||n==u.orientation.left_top?a[0]-=u.SLINK_GAP:(n==u.orientation.right||n==u.orientation.right_top)&&(a[0]+=u.SLINK_GAP),c=!1):o=!0;break}if(c)break;s=e.x[a[0]]}i[0]=a[0]}o||u._addConnectorLine(e,{x1:i[0],y1:i[1],x2:a[0],y2:a[1]})}},u.editUI=function(){},u.editUI.prototype.init=function(e){this.obj=e,this.fields=null,this.nodeId=null,this.detailsMode=null,this._event_id=u._guid()},u.editUI.prototype.on=function(e,t){return u.events.on(e,t,this._event_id),this},u.editUI.prototype.show=function(e,t,n){if(this.hide(!0)){if(this.nodeId=e,this.detailsMode=t,u.events.publish(`show`,[this,e])===!1)return!1;var r=this,i=this.content(e,t,n);this.obj.element.appendChild(i.element),u.input.init(this.obj.element),u.events.publish(`shown`,[this,{nodeId:e}]),n?t||this._focusElement(i.focusId):this.interval=u.animate(i.element,{right:-20,opacity:0},{right:0,opacity:1},300,u.anim.outSin,function(){t||r._focusElement(i.focusId)}),this.obj.element.querySelector(`[data-edit-from-close]`).addEventListener(`click`,function(t){t.preventDefault(),u.events.publish(`cancel`,[r,{id:e}])!==!1&&r.hide()}),this.obj.element.querySelector(`[data-edit-from-save]`).addEventListener(`click`,function(e){e.preventDefault(),r.hide()});for(var a=this.obj.element.querySelectorAll(`[data-input-btn]`),o=0;o<a.length;o++)a[o].addEventListener(`click`,function(t){t.preventDefault(),u.events.publish(`element-btn-click`,[r,{input:this.parentNode.querySelector(`input`),nodeId:e,event:t}])});this.obj.element.querySelector(`[data-add-more-fields-btn]`).addEventListener(`click`,function(e){e.stopPropagation(),e.preventDefault();var t=this,n=u.elements.textbox({},{type:`textbox`,label:r.obj.config.editForm.addMoreFieldName,btn:r.obj.config.editForm.addMoreBtn},`280px`);t.parentNode.insertAdjacentHTML(`beforebegin`,n.html),t.style.display=`none`,u.input.init(t.parentNode.previousSibling);var i=document.getElementById(n.id);i.focus(),i.nextElementSibling.addEventListener(`click`,function(e){e.stopPropagation(),e.preventDefault();var n=i.value,a=r.obj.element.querySelector(`[data-binding="`+u._escapeDoubleQuotes(i.value)+`"]`);if(!u.isNEU(n)&&!a){var o=u.elements.textbox({},{type:`textbox`,label:n,binding:n},`280px`);i.parentNode.parentNode.parentNode.removeChild(i.parentNode.parentNode),t.parentNode.insertAdjacentHTML(`beforebegin`,o.html),t.style.display=``,u.input.init(t.parentNode.previousSibling);var s=document.getElementById(o.id);s.focus(),s.addEventListener(`input`,function(){r._drawCurrentNodeElement()})}else i.focus()})}),this.obj.element.querySelector(`[data-boc-edit-from-btns]`).addEventListener(`click`,function(t){for(var n=t.target;n&&n.hasAttribute&&!n.hasAttribute(`data-edit-from-btn`);)n=n.parentNode;if(n&&n.hasAttribute){var i=n.getAttribute(`data-edit-from-btn`),a={button:r.obj.config.editForm.buttons[i],name:i,nodeId:e,event:t};if(u.events.publish(`button-click`,[r,a])===!1)return!1;switch(i){case`edit`:r.obj.editUI.show(e,!1,!0);break;case`pdf`:r.obj.exportToPDFProfile(e),r.hide();break;case`share`:r.obj.shareProfile(e);break;case`remove`:r.obj.removeNode(e,null,!0),r.hide();break}}});for(var s=this.obj.element.querySelectorAll(`[data-boc-edit-form] [data-binding]`),o=0;o<s.length;o++){var c=s[o];c.getAttribute(`data-binding`)&&c.addEventListener(`input`,function(){r._drawCurrentNodeElement()})}}},u.editUI.prototype._drawCurrentNodeElement=function(){var e=this.obj.element.querySelector(`[data-boc-edit-form]`),t=u.input.getData(e),n=this.obj.get(this.nodeId),r=this.obj.getNode(this.nodeId),i=u.mergeDeep(n,t),a=this.obj.ui.node(r,i,[],this.obj.config,void 0,void 0,void 0,void 0,this.obj.getScale(),this.obj);this._replaceNodeWith(a)},u.editUI.prototype._replaceNodeWith=function(e){var t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);t.innerHTML=e;var n=t.firstElementChild;this.obj.getNodeElement(this.nodeId).replaceWith(n)},u.editUI.prototype.setAvatar=function(e){var t=this.obj.element.querySelector(`[id="boc-avatar"]`),n=this.obj.element.querySelector(`[id="boc-avatar"] img`),r=this.obj.element.querySelector(`[id="boc-avatar"] svg`);if(t)n?n.setAttribute(`src`,e):r&&(t.innerHTML=`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${e}">`);else return;this._drawCurrentNodeElement()},u.editUI.prototype.save=function(e){var t=this.obj.element.querySelector(`[data-boc-edit-form]`),n=u.input.validateAndGetData(t);if(n!==!1){var r=this.obj.get(this.nodeId),i={data:u.mergeDeep(r,n)};return u.events.publish(`save`,[this,i])===!1?void 0:(this.obj.updateNode(i.data,null,!0,e),!0)}return!1},u.editUI.prototype._focusElement=function(e){var t=null;u.isNEU(this.obj.config.editForm.focusBinding)?u.isNEU(e)||(t=document.getElementById(e)):t=this.obj.element.querySelector(`[data-binding="`+this.obj.config.editForm.focusBinding+`"]`),t&&(t.value&&t.value.length&&t.setSelectionRange(t.value.length,t.value.length),t.focus())},u.editUI.prototype.content=function(e,t,n,r,i){var a=this.obj.config.editForm.readOnly,o=JSON.parse(JSON.stringify(this.obj.config.editForm.elements)),s=this.obj.config.editForm.addMore,c=this.obj.config.editForm.saveAndCloseBtn,l=this.obj.config.editForm.buttons,d=this.obj.config.editForm.titleBinding,f=this.obj.config.editForm.photoBinding,p=this.obj.getNode(e),m=this.obj._get(e),h=u.t(p.templateName,p.min,this.obj.getScale()),g=m[d],_=m[f];if(this.obj.config.editForm.generateElementsFromFields)for(var v=0;v<this.fields.length;v++){var y=this.fields[v];if(y!=`tags`){for(var b=!1,x=0;x<o.length;x++){if(Array.isArray(o[x])){for(var S=0;S<o[x].length;S++)if(y==o[x][S].binding){b=!0;break}}else if(y==o[x].binding){b=!0;break}if(b)break}b||o.push({type:`textbox`,label:y,binding:y})}}u.isNEU(g)&&(g=``),_=u.isNEU(_)?u.icon.user(150,150,`#8C8C8C`,0,0):`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${_}"></img>`;var C,w=!t,T=t?`display:none;`:``,E=t||!s?`display:none;`:``,D=h.editFormHeaderColor?`style="background-color:${h.editFormHeaderColor};"`:``,O=document.createElement(`form`);if(O.setAttribute(`data-boc-edit-form`,``),O.classList.add(`boc-edit-form`),O.classList.add(this.obj.config.mode),O.classList.add(p.templateName.replaceAll(` `,``)),O.classList.add(u.ui._defsIds[p.templateName]),Array.isArray(p.tags)&&p.tags.length)for(var v=0;v<p.tags.length;v++)O.classList.add(p.tags[v].replaceAll(` `,``));O.style.display=`flex`,O.style.opacity=n?1:0,O.style.right=n?0:`-20px`,r&&(O.style.width=r);var k=[];return O.innerHTML=`<div>
|
|
24
|
+
</g>`}}for(var f=0;f<e.visibleNodeIds.length;f++){var p=e.nodes[e.visibleNodeIds[f]],m=i._get(p.id);p.isTreeListItem||(u.RENDER_LINKS_BEFORE_NODES||(o+=i.ui.link(p,i,s,e.bordersByRootIdAndLevel,e.nodes,t)),o+=i.ui.expandCollapseBtn(i,p,m,i.config,i._layoutConfigs,t,s))}var a={content:o,res:e};if(u.events.publish(`render`,[i,a]),o=a.content,e=a.res,o+=i.ui.lonely(i.config),t===u.action.exporting){var w=e.boundary,T=w.maxX-w.minX,E=w.maxY-w.minY,D=i.ui.svg(T,E,[w.minX,w.minY,T,E],i.config,o,s);r.call(i,D,e);return}(t===u.action.centernode||t===u.action.insert||t===u.action.expand||t===u.action.collapse||t===u.action.update)&&(l=c),t===u.action.init&&c!=null&&(l=c),t===u.action.centerNode&&c!=null&&(l=c),i.response=e,i._lastSize={width:i.width(),height:i.height()};var D=i.ui.svg(`100%`,`100%`,l,i.config,o);if(!i._initialized)i.element.innerHTML=i.ui.css()+D+i.ui.menuButton(i.config)+i.ui.aiButton(i.config),i._attachEventHandlers(),i.xScrollUI.create(i.width(),i.config.padding),i.xScrollUI.setPosition(),i.xScrollUI.addListener(i.getSvg()),i.yScrollUI.create(i.height(),i.config.padding),i.yScrollUI.setPosition(),i.yScrollUI.addListener(i.getSvg()),i.config.enableSearch&&i.searchUI.init(i),i.aiUI.init(i),i.orgScribeUI.init(i),i.powerPointPreviewUI.init(i),i.pdfPreviewUI.init(i),i.svgPreviewUI.init(i),i.pngPreviewUI.init(i),i.toolbarUI.init(i,i.config.toolbar),i.undoRedoUI.init(i),i.controlsUI.init(i);else{var O=i.getSvg(),k=O.parentNode;k.removeChild(O),k.insertAdjacentHTML(`afterbegin`,D),i._attachEventHandlers(),i.xScrollUI.addListener(i.getSvg()),i.yScrollUI.addListener(i.getSvg()),i.xScrollUI.setPosition(),i.yScrollUI.setPosition()}var A=!1,j=i.response.animations;if(j[0].length>0){i._hideBeforeAnimation(j[0].length);for(var f=0;f<j[0].length;f++)j[0][f]=i.getNodeElement(j[0][f]);u.animate(j[0],j[1],j[2],i.config.anim.duration,i.config.anim.func,function(){A||=(r&&r.call(i),u.events.publish(`redraw`,[i]),i._showAfterAnimation(),!0)})}t===u.action.centerNode?u.animate(i.getSvg(),{viewbox:c},{viewbox:i.response.viewBox},i.config.anim.duration,i.config.anim.func,function(){i.ripple(n.options.rippleId),A||=(r&&r.call(i),u.events.publish(`redraw`,[i]),i._showAfterAnimation(),!0)},function(){i.xScrollUI.setPosition(),i.yScrollUI.setPosition()}):c&&i.response&&(c[0]!=i.response.viewBox[0]||c[1]!=i.response.viewBox[1]||c[2]!=i.response.viewBox[2]||c[3]!=i.response.viewBox[3])&&(t===u.action.insert||t===u.action.expand||t===u.action.collapse||t===u.action.update||t===u.action.init)?u.animate(i.getSvg(),{viewbox:c},{viewbox:i.response.viewBox},i.config.anim.duration*2,i.config.anim.func,function(){i.xScrollUI.setPosition(),i.yScrollUI.setPosition(),A||=(r&&r.call(i),u.events.publish(`redraw`,[i]),!0)}):j[0].length==0&&(A||=(r&&r.call(i),u.events.publish(`redraw`,[i]),!0)),i._initialized||(i._initialized=!0,i.filterUI.update(),i._ai.setContext(),u.events.publish(`init`,[i])),!i._loaded&&e&&e.nodes&&Object.keys(e.nodes).length&&(i._loaded=!0)}},function(e){u.events.publish(`ready`,[i,e])})}},u.prototype._setInitialSizeIfNotSet=function(){this.mainElement.style.overflow=`hidden`,this.mainElement.style.position=`relative`,this.mainElement.offsetHeight==0&&(this.mainElement.style.height=`100%`,this.mainElement.offsetHeight==0&&(this.mainElement.style.height=`700px`)),this.mainElement.offsetWidth==0&&(this.mainElement.style.width=`100%`,this.mainElement.offsetWidth==0&&(this.mainElement.style.width=`700px`))},u.prototype.width=function(){return this.element.offsetWidth},u.prototype.height=function(){return this.element.offsetHeight},u.prototype.getViewBox=function(){var e=this.getSvg();return u._getViewBox(e)},u.prototype.setViewBox=function(e){this.getSvg().setAttribute(`viewBox`,e.toString())},u.prototype.getScale=function(e){return e||=this.getViewBox(),u.getScale(e,this.width(),this.height(),this.config.scaleInitial,this.config.scaleMax,this.config.scaleMin)},u.prototype.setScale=function(e){e>this.config.scaleMax&&(e=this.config.scaleMax),e<this.config.scaleMin&&(e=this.config.scaleMin);var t=this.getViewBox().slice(0),n=this.width(),r=this.height(),i=n/t[2],a=r/t[3],o=i>a?a:i,s=t,c=t[2],l=t[3];return t[2]/=e/o,t[3]/=e/o,t[0]=s[0]-(t[2]-c)/2,t[1]=s[1]-(t[3]-l)/2,this.setViewBox(t),u.events.publish(`redraw`,[this]),e},u.prototype.ripple=function(e,t,n){var r=this.getNode(e);if(r!=null){var i=this.getNodeElement(e);if(i!=null){var a=this.getScale(),o=r.w/2,s=r.h/2;if(t!==void 0&&n!==void 0){var c=i.getBoundingClientRect();o=t/a-c.left/a,s=n/a-c.top/a}var l=r.w,d=r.h,f=l-o>o?l-o:o,p=d-s>s?d-s:s;f=f,p=p;var m=f>p?f:p,h=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),g=document.createElementNS(`http://www.w3.org/2000/svg`,`clipPath`),_=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),v=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),y=u.randomId();g.setAttribute(`id`,y);var b={ripple:u.t(r.templateName,r.min,this.getScale()).ripple,node:r};u.events.publish(`ripple`,[this,b]),_.setAttribute(`x`,b.ripple.rect?b.ripple.rect.x:0),_.setAttribute(`y`,b.ripple.rect?b.ripple.rect.y:0),_.setAttribute(`width`,b.ripple.rect?b.ripple.rect.width:r.w),_.setAttribute(`height`,b.ripple.rect?b.ripple.rect.height:r.h),_.setAttribute(`rx`,b.ripple.radius),_.setAttribute(`ry`,b.ripple.radius),v.setAttribute(`clip-path`,`url(#`+y+`)`),v.setAttribute(`cx`,o),v.setAttribute(`cy`,s),v.setAttribute(`r`,0),v.setAttribute(`fill`,b.ripple.color),v.setAttribute(`class`,`boc-ripple`),g.appendChild(_),h.appendChild(g),h.appendChild(v),i.appendChild(h),u.animate(v,{r:0,opacity:1},{r:m,opacity:0},500,u.anim.outPow,function(){i.removeChild(h)})}}},u.prototype.centerOutNodes=function(e){if(this._centerInNodes){var t=JSON.parse(this._centerInNodes);this._centerInNodes=null;var n=this;this._centerInNodesTimeout=u.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:t},300,this.config.anim.func,function(){n.draw(u.action.update,null,function(){e&&e.call(n)})})}},u.prototype.centerInNodes=function(e,t){var n=this.getViewBox();this._centerInNodes||=JSON.stringify(n);var r=2**53-1,i=-(2**53-1),a=2**53-1,o=-(2**53-1);for(var s of e)s.y<r&&(r=s.y),s.y+s.h>i&&(i=s.y+s.h),s.x<a&&(a=s.x),s.x+s.w>o&&(o=s.x+s.w);var c=o-a,l=i-r,d=c/(c+this.config.padding*2),f=l/(l+this.config.padding*2),p=d>f?f:d;p>this.config.scaleMax&&(p=this.config.scaleMax),p<this.config.scaleMin&&(p=this.config.scaleMin);var m=[50,50],h=this.width(),g=this.height(),d=h/n[2],f=g/n[3],_=d>f?f:d,v=n,y=n[2],b=n[3];n[2]/=p/_,n[3]/=p/_,n[0]=v[0]-(n[2]-y)/(100/m[0]),n[1]=v[1]-(n[3]-b)/(100/m[1]),n[0]=a-(h/p-c)/2,n[1]=r-(g/p-l)/2;var x=this;this._centerInNodesTimeout&&=(clearTimeout(this._centerInNodesTimeout),null),this._centerInNodesTimeout=u.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:n},300,this.config.anim.func,function(){x.draw(u.action.update,null,function(){t&&t.call(x)})})},u.prototype.center=function(e,t,n){var r,i,a=e,o=!0,s=!0;t&&t.parentState!=null&&(r=t.parentState),t&&t.childrenState!=null&&(i=t.childrenState),t&&t.rippleId!=null&&(a=t.rippleId),t&&t.vertical!=null&&(o=t.vertical),t&&t.horizontal!=null&&(s=t.horizontal);var c={parentState:r,childrenState:i,rippleId:a,vertical:o,horizontal:s};this._draw(!1,u.action.centerNode,{id:e,options:c},n)},u.prototype.fit=function(e){this.config.scaleInitial=u.match.boundary,this._draw(!0,u.action.init,{method:`fit`},e)},u.prototype.fitIfOutside=function(e){this.config.scaleInitial=u.match.boundaryIfOutside,this._draw(!0,u.action.init,{method:`fit`},e)},u.prototype.toggleFullScreen=function(){var e=document.querySelector(`[`+u.attr.tlbr+`r='fullScreen']`);document.fullscreenElement==this.element||document.webkitFullscreenElement==this.element||document.mozFullScreenElement==this.element||document.msFullscreenElement==this.element?(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen(),e&&(e.innerHTML=u.toolbarUI.openFullScreenIcon)):(this.element.requestFullscreen?this.element.requestFullscreen():this.element.mozRequestFullScreen?this.element.mozRequestFullScreen():this.element.webkitRequestFullscreen?this.element.webkitRequestFullscreen():this.element.msRequestFullscreen&&this.element.msRequestFullscreen(),e&&(e.innerHTML=u.toolbarUI.closeFullScreenIcon))},u.prototype.getNode=function(e){return this.nodes[e]},u.prototype.setLayout=function(e,t){t||=`base`,this._layoutConfigs[t].layout=e,t==`base`&&(this.config.layout=e),this._draw(!1,u.action.update)},u.prototype.setOrientation=function(e,t,n){var r=this;t||=`base`,this._layoutConfigs[t].orientation=e,t==`base`&&(this.config.orientation=e),this._draw(!1,u.action.update,void 0,function(){r.getScale(),u._moveToBoundaryArea(r.getSvg(),r.getViewBox(),r.response.boundary,function(){r._draw(!0,u.action.pan),n&&n()})})},u.prototype.search=function(e,t,n){return u.isNEU(t)&&(t=this.searchUI._searchFields),u.isNEU(n)&&(n=t),u._search.search(this.config.nodes,e,t,n,this.config.searchDisplayField,this.config.searchFieldsWeight,this.searchUI._searchFieldsAbbreviation)},u.prototype._hideBeforeAnimation=function(e){if(this._hideBeforeAnimationCompleted!=1&&!(e&&e<u.ANIM_THRESHOLD)){var t=this.element.getElementsByTagName(`text`);if(t.length>u.TEXT_THRESHOLD)for(var n=0;n<t.length;n++)t[n].style.display=`none`;var r=this.element.getElementsByTagName(`image`);if(r.length>u.IMAGES_THRESHOLD)for(var n=0;n<r.length;n++)r[n].style.display=`none`;var i=this.element.querySelectorAll(`[`+u.attr.link_id+`]`);if(i.length>u.LINKS_THRESHOLD)for(var n=0;n<i.length;n++)i[n].style.display=`none`;var a=this.element.querySelectorAll(`[`+u.attr.control_expcoll_id+`]`);if(a.length>u.BUTTONS_THRESHOLD)for(var n=0;n<a.length;n++)a[n].style.display=`none`;var o=this.element.querySelectorAll(`[`+u.attr.control_up_id+`]`);if(o.length>u.BUTTONS_THRESHOLD)for(var n=0;n<o.length;n++)o[n].style.display=`none`;this._hideBeforeAnimationCompleted=!0}},u.prototype._showAfterAnimation=function(){for(var e=this.element.getElementsByTagName(`text`),t=0;t<e.length;t++)e[t].style.display=``;for(var n=this.element.getElementsByTagName(`image`),t=0;t<n.length;t++)n[t].style.display=``;for(var r=this.element.querySelectorAll(`[`+u.attr.link_id+`]`),t=0;t<r.length;t++)r[t].style.display=``;for(var i=this.element.querySelectorAll(`[`+u.attr.control_expcoll_id+`]`),t=0;t<i.length;t++)i[t].style.display=``;for(var a=this.element.querySelectorAll(`[`+u.attr.control_up_id+`]`),t=0;t<a.length;t++)a[t].style.display=``;this._hideBeforeAnimationCompleted=!1},u.prototype.isChild=function(e,t){for(var n=this.getNode(t);n;){if(n.id==e)return!0;n=n.parent?n.parent:n.stParent}return!1},u.prototype.getCollapsedIds=function(e){for(var t=[],n=0;n<e.childrenIds.length;n++){var r=this.getNode(e.childrenIds[n]);r.collapsed==1&&t.push(r.id)}return t},u.prototype.stateToUrl=function(){if(this.manager.state){var e={};return e.exp=this.manager.state.exp.join(`*`),e.min=this.manager.state.min.join(`*`),e.adjustify=this.manager.state.adjustify.x+`*`+this.manager.state.adjustify.y,e.scale=this.manager.state.scale,e.y=this.manager.state.x,e.x=this.manager.state.y,new URLSearchParams(e).toString()}return``},u.prototype.generateId=function(){for(;;){var e=`_`+(`0000`+(Math.random()*36**4|0).toString(36)).slice(-4);if(this.nodes==null||!this.nodes.hasOwnProperty(e))return e}},u.prototype.moveNodesToVisibleArea=function(e,t){for(var n=this,r=this.roots[0],i=this.getSvg(),a=this.getViewBox(),o=null,s=null,c=null,l=null,d=0;d<e.length;d++){var f=this.nodes[e[d]];f.x!=null&&f.y!=null&&((o===null||o<f.x+f.w)&&(o=f.x+f.w),(s===null||s<f.y+f.h)&&(s=f.y+f.h),(c===null||c>f.x)&&(c=f.x),(l===null||l>f.y)&&(l=f.y))}if(!(o==null||s==null||c==null||l==null)){var p=this.width(),m=this.height(),h=o-c+this.config.padding*2,g=s-l+this.config.padding*2,_=p/h,v=m/g,y=_>v?v:_,b=Math.ceil(p/y),x=Math.ceil(m/y),h=0,g=0;if(b-this.config.padding*2>=o-c)h=(o+c)/2-b/2;else switch(h=r.x-b/2+u.manager._getNodeWidth(r,this.config)/2,this.config.orientation){case u.orientation.right:case u.orientation.right_top:h=-(b/2-(c-o)/2),h<this.config.padding-b&&(h=this.config.padding-b);break;case u.orientation.left:case u.orientation.bottom_left:case u.orientation.top_left:case u.orientation.left_top:h=-(b/2-(o-c)/2),h>-this.config.padding&&(h=-this.config.padding);break}if(x-this.config.padding*2>=s-l)g=(s+l)/2-x/2;else switch(g=-(x/2-(s-l)/2),g>-this.config.padding&&(g=-this.config.padding),this.config.orientation){case u.orientation.bottom:case u.orientation.bottom_left:g=-(x/2-(l-s)/2),g<this.config.padding-x&&(g=this.config.padding-x);break;case u.orientation.left:case u.orientation.right:g=r.y-x/2+u.manager._getNodeWidth(r,this.config)/2;break}var S=[h,g,b,x];a[0]!==S[0]||a[1]!==S[1]?u.animate(i,{viewBox:a},{viewBox:S},this.config.anim.duration,this.config.anim.func,function(){n.draw(u.action.update,void 0,t)}):t&&t()}},u.prototype._nodeHasHiddenParent=function(e){return!e.parent&&!u.isNEU(e.pid)&&this.getNode(e.pid)},u.prototype.destroy=function(){this._initCalled=!1,this._resizeObserver.unobserve(this.element),u.events.removeForEventId(this._event_id),this.element.innerHTML=null},u._defaultConfig=function(e){return{interactive:!0,mode:`light`,lazyLoading:`auto`,enableDragDrop:!1,enableSearch:!0,enableAI:!1,enablePan:!0,keyNavigation:!1,miniMap:!1,controls:null,nodeMenu:null,nodeCircleMenu:null,nodeContextMenu:null,menu:null,toolbar:!1,nodeMouseClick:u.action.details,nodeMouseDbClick:u.none,mouseScrool:u.action.ctrlZoom,showXScroll:!1,showYScroll:!1,template:`ana`,tags:{},min:!1,nodeBinding:{},linkBinding:{},searchFields:null,searchDisplayField:null,searchFieldsWeight:null,searchFieldsAbbreviation:null,nodes:[],clinks:[],slinks:[],backdrops:[],groupDottedLines:[],dottedLines:[],undoRedoStorageName:null,levelSeparation:60,siblingSeparation:20,subtreeSeparation:40,backdropSeparation:15,mixedHierarchyNodesSeparation:15,assistantSeparation:100,minPartnerSeparation:50,partnerChildrenSplitSeparation:20,partnerNodeSeparation:15,columns:10,padding:30,orientation:u.orientation.top,layout:u.layout.normal,layoutGridColumns:`dynamic`,scaleInitial:u.match.boundaryIfOutside,movable:null,scaleMin:.1,scaleMax:5,orderBy:null,editUI:null,aiUI:null,orgScribeUI:null,powerPointPreviewUI:null,pdfPreviewUI:null,svgPreviewUI:null,pngPreviewUI:null,filterUI:null,searchUI:null,xScrollUI:null,yScrollUI:null,nodeMenuUI:null,controlsUI:null,nodeCircleMenuUI:null,nodeContextMenuUI:null,toolbarUI:null,notifierUI:null,menuUI:null,undoRedoUI:null,exportUrl:`https://balkan.app/export`,serverUrl:`https://serverjs.balkan.app`,aiChatTools:[],collapse:{},expand:{},align:u.CENTER,UI:null,anim:{func:u.anim.outPow,duration:200},zoom:{speed:120,smooth:12},roots:null,state:null,editForm:{readOnly:!1,titleBinding:`name`,photoBinding:`img`,addMore:`Add more fields`,addMoreBtn:`Add`,addMoreFieldName:`Field name`,saveAndCloseBtn:`Save and close`,generateElementsFromFields:!0,focusBinding:null,buttons:{edit:{icon:u.icon.edit(24,24,`#fff`),text:`Edit`,hideIfEditMode:!0,hideIfDetailsMode:!1},share:{icon:u.icon.share(24,24,`#fff`),text:`Share`},pdf:{icon:u.icon.pdf(24,24,`#fff`),text:`Save as PDF`},remove:{icon:u.icon.remove(24,24,`#fff`),text:`Remove`,hideIfDetailsMode:!0}},elements:[]}}},u.localStorage={},u.localStorage.getItem=function(e){var t=localStorage.getItem(`to_date`);if(!t)t=new Date,t.setDate(t.getDate()+5),t=t.toISOString(),localStorage.setItem(`to_date`,t);else if(t=new Date(t),t<new Date){for(var n=0,r=localStorage.length;n<r;++n){var i=localStorage.key(n);i&&i.startsWith&&i.startsWith(`{"n"`)&&localStorage.removeItem(i)}localStorage.removeItem(`to_date`)}return localStorage.getItem(e)},u.localStorage.setItem=function(e,t){try{localStorage.setItem(e,t)}catch(e){e.code==e.QUOTA_EXCEEDED_ERR?(console.warn(`Local storage quota exceeded`),localStorage.clear()):(console.error(`Local storage error code:`+e.code),console.error(e))}},u.prototype.canUpdateLink=function(e,t){if(t==null||t==null||e==null||e==null||e==t)return!1;var n=this.getNode(t),r=this.getNode(e);return n&&r&&(n.isPartner||n.hasPartners&&r.isAssistant||n.hasAssistants&&r.isPartner)?!1:!this.isChild(e,t)},u.prototype._canUpdateLink=u.prototype.canUpdateLink,u.prototype.updateNode=function(e,t,n,r){if(e){var i=this,a=this.get(e.id);if(n===!0&&u.events.publish(`update`,[this,a,e])===!1)return!1;this.update(e),this._ai.setContext(),u.events.publish(`updated`,[this]),this.filterUI.update();var o=this.getNode(e.id),s=o.pid;s??=o.stpid,this._draw(!1,u.action.update,{id:s},function(){r||i.ripple(e.id),t&&t()})}},u.prototype.update=function(e){for(var t=0;t<this.config.nodes.length;t++)if(this.config.nodes[t].id==e.id){this._putInUndoStack(),this.clearRedo(),this.config.nodes[t]=e;break}return this},u.prototype.removeNode=function(e,t,n){if(!this.canRemove(e))return!1;var r=this._getNewPidsAndStpidsForIds(e);return n===!0&&u.events.publish(`remove`,[this,e,r])===!1?!1:(this.remove(e),this._ai.setContext(),u.events.publish(`updated`,[this]),this.filterUI.update(),this._draw(!1,u.action.update,null,function(){t&&t()}),!0)},u.prototype.remove=function(e){var t=this.get(e);if(t){this._putInUndoStack(),this.clearRedo();for(var n=this.config.nodes.length-1;n>=0;n--)(this.config.nodes[n].pid==e||this.config.nodes[n].stpid==e)&&(this.config.nodes[n].pid=t.pid,this.config.nodes[n].stpid=t.stpid),this.config.nodes[n].id==e&&this.config.nodes.splice(n,1)}return this},u.prototype._getNewPidsAndStpidsForIds=function(e){var t=this.get(e),n={},r={};if(t)for(var i=this.config.nodes.length-1;i>=0;i--)this.config.nodes[i].pid==e?n[this.config.nodes[i].id]=t.pid:this.config.nodes[i].stpid==e&&(r[this.config.nodes[i].id]=t.stpid);return{newPidsForIds:n,newStpidsForIds:r}},u.prototype.addNode=function(e,t,n){var r=this;if(n===!0&&u.events.publish(`add`,[this,e])===!1)return!1;this.add(e),this._ai.setContext(),u.events.publish(`updated`,[this]),this.filterUI.update(),r._draw(!1,u.action.insert,{id:e.pid,insertedNodeId:e.id},function(){r.ripple(e.id),t&&t()})},u.prototype.add=function(e){if(e.id??console.error(`Call addNode without id`),this._putInUndoStack(),this.clearRedo(),this.config.movable&&!u.isNEU(e.pid)){var t=this._get(e.pid);t&&(t.movex!=null&&(e.movex=t.movex),t.movey!=null&&(e.movey=t.movey))}return this.config.nodes.push(e),this},u.prototype.replaceIds=function(e,t){this._replaceIds(e),this._draw(!1,u.action.update,void 0,t)},u.prototype._replaceIds=function(e){for(var t=function(t){for(var n=0;n<t.length;n++){var r=t[n];for(var i in e){var a=e[i];r.from==i&&(r.from=a),r.to==i&&(r.to=a)}}},n=0;n<this.config.nodes.length;n++){var r=this.config.nodes[n];for(var i in e){var a=e[i];r.id==i&&(r.id=a),r.pid==i&&(r.pid=a),r.stpid==i&&(r.stpid=a),r.ppid==i&&(r.ppid=a)}}if(Array.isArray(this.config.roots))for(var n=0;n<this.config.roots.length;n++)u.isNEU(e[this.config.roots[n]])||(this.config.roots[n]=e[this.config.roots[n]]);if(this.nodes){for(var o in this.nodes)if(!u.isNEU(e[o])){var a=e[o],s=this.nodes[o];s.id=a,this.nodes[a]=s}}if(this.manager.oldNodes){for(var o in this.manager.oldNodes)if(!u.isNEU(e[o])){var a=e[o],s=this.manager.oldNodes[o];s.id=a,this.manager.oldNodes[a]=s}}if(this.roots){for(var o in this.roots)if(!u.isNEU(e[o])){var a=e[o],s=this.roots[o];s.id=a,this.roots[a]=s}}t(this.config.clinks),t(this.config.slinks),t(this.config.groupDottedLines),t(this.config.dottedLines)},u.prototype._get=function(e){var t=this.__get(e);if(t)return t;if((this.config.groupDottedLines.length||this.config.dottedLines.length)&&!u.isNEU(e)&&typeof e==`string`&&(e.indexOf(`balkan_group_dotted_`)!=-1||e.indexOf(`balkan_dotted_`)!=-1)){e=e.replace(`balkan_group_dotted_`,``),e=e.replace(`balkan_dotted_`,``);var n=e.indexOf(`_balkan_id_`);if(e=e.substring(n+11),t=this.__get(e),t)return t}return null},u.prototype.__get=function(e){for(var t=0;t<this.config.nodes.length;t++)if(this.config.nodes[t].id==e)return this.config.nodes[t];return null},u.prototype.get=function(e){var t=this._get(e);return t==null?null:JSON.parse(JSON.stringify(t))},u.prototype.canRemove=function(e){var t=this.getNode(e);return!(!t||t.hasPartners||t.hasAssistants)},u===void 0&&(u={}),u._ajax=function(e,t,n,r,i){r??=`arraybuffer`;var a=new XMLHttpRequest;for(var o in a.onload=function(e){a.readyState==4&&this.status===200&&(e.target==null?i(this.response):i(e.target.response))},a.onerror=function(e){i({error:e})},a.open(t,e),a.responseType=r,a.setRequestHeader(`Content-Type`,`application/json`),u.REQUEST_CUSTOM_HEADERS)a.setRequestHeader(o,u.REQUEST_CUSTOM_HEADERS[o]);n==null?a.send():a.send(n)},u===void 0&&(u={}),u.animate=function(e,t,n,r,i,a,o){var s=10,c=1,l=1,d=r/s+1,f;document.getElementsByTagName(`g`),Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);function p(){for(var p=0;p<e.length;p++)for(var m in n[p]){var h=u._arrayContains([`top`,`left`,`right`,`bottom`,`width`,`height`],m.toLowerCase())?`px`:``;switch(m.toLowerCase()){case`d`:var g=i((l*s-s)/r)*(n[p][m][0]-t[p][m][0])+t[p][m][0],_=i((l*s-s)/r)*(n[p][m][1]-t[p][m][1])+t[p][m][1];e[p].setAttribute(`d`,e[p].getAttribute(`d`)+` L`+g+` `+_);break;case`r`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`r`,v);break;case`x1`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`x1`,v);break;case`x2`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`x2`,v);break;case`y1`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`y1`,v);break;case`y2`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].setAttribute(`y2`,v);break;case`scrolltop`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].scrollTop=v;break;case`rotate3d`:if(n[p][m]){var y=t[p][m],b=n[p][m],x=[0,0,0,0];for(var S in y)x[S]=i((l*s-s)/r)*(b[S]-y[S])+y[S];e[p].style.transform=`rotate3d(`+x.toString()+`deg)`}break;case`transform`:if(n[p][m]){var y=t[p][m],b=n[p][m],x=[0,0,0,0,0,0];for(var S in y)x[S]=i((l*s-s)/r)*(b[S]-y[S])+y[S];e[p].hasAttribute(`transform`)?e[p].setAttribute(`transform`,`matrix(`+x.toString()+`)`):e[p].style.transform=`matrix(`+x.toString()+`)`}break;case`viewbox`:if(n[p][m]){var y=t[p][m],b=n[p][m],x=[0,0,0,0];for(var S in y)x[S]=i((l*s-s)/r)*(b[S]-y[S])+y[S];e[p].setAttribute(`viewBox`,x.toString())}break;case`margin`:if(n[p][m]){var y=t[p][m],b=n[p][m],x=[0,0,0,0];for(var S in y)x[S]=i((l*s-s)/r)*(b[S]-y[S])+y[S];for(var C=``,S=0;S<x.length;S++)C+=parseInt(x[S])+`px `;e[p]&&e[p].style&&(e[p].style[m]=C)}break;case`scrolly`:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p].scrollTo(0,v);break;default:var v=i((l*s-s)/r)*(n[p][m]-t[p][m])+t[p][m];e[p]&&e[p].style&&(e[p].style[m]=v+h);break}}if(o){var v=i((l*s-s)/r);o(v)}l+=c,l>d+1&&(clearInterval(f),a&&a(e))}return f=setInterval(p,s),f},u.anim={},u.anim.inPow=function(e){return e<0?0:e>1?1:e**2},u.anim.outPow=function(e){var t=2;if(e<0)return 0;if(e>1)return 1;var n=t%2==0?-1:1;return n*((e-1)**t+n)},u.anim.inOutPow=function(e){var t=2;if(e<0)return 0;if(e>1)return 1;if(e*=2,e<1)return u.anim.inPow(e,t)/2;var n=t%2==0?-1:1;return n/2*((e-2)**t+n*2)},u.anim.inSin=function(e){return e<0?0:e>1?1:-Math.cos(Math.PI/2*e)+1},u.anim.outSin=function(e){return e<0?0:e>1?1:Math.sin(Math.PI/2*e)},u.anim.inOutSin=function(e){return e<0?0:e>1?1:-.5*(Math.cos(Math.PI*e)-1)},u.anim.inExp=function(e){return e<0?0:e>1?1:2**(10*(e-1))},u.anim.outExp=function(e){return e<0?0:e>1?1:-(2**(-10*e))+1},u.anim.inOutExp=function(e){return e<0?0:e>1?1:e<.5?.5*2**(10*(2*e-1)):.5*(-(2**(10*(-2*e+1)))+2)},u.anim.inCirc=function(e){return e<0?0:e>1?1:-(Math.sqrt(1-e*e)-1)},u.anim.outCirc=function(e){return e<0?0:e>1?1:Math.sqrt(1-(e-1)*(e-1))},u.anim.inOutCirc=function(e){return e<0?0:e>1?1:e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(2*e-2)*(2*e-2))+1)},u.anim.rebound=function(e){return e<0?0:e>1?1:e<1/2.75?1-7.5625*e*e:e<2/2.75?1-(7.5625*(e-1.5/2.75)*(e-1.5/2.75)+.75):e<2.5/2.75?1-(7.5625*(e-2.25/2.75)*(e-2.25/2.75)+.9375):1-(7.5625*(e-2.625/2.75)*(e-2.625/2.75)+.984375)},u.anim.inBack=function(e){return e<0?0:e>1?1:e*e*(2.70158*e-1.70158)},u.anim.outBack=function(e){return e<0?0:e>1?1:(e-1)*(e-1)*(2.70158*(e-1)+1.70158)+1},u.anim.inOutBack=function(e){return e<0?0:e>1?1:e<.5?.5*(4*e*e*(3.5949*2*e-2.5949)):.5*((2*e-2)*(2*e-2)*(3.5949*(2*e-2)+2.5949)+2)},u.anim.impulse=function(e){var t=2*e;return t*Math.exp(1-t)},u.anim.expPulse=function(e){return Math.exp(-2*e**2)},u===void 0&&(u={}),u.prototype._attachEventHandlers=function(e){if(this.config.interactive){var e=this.getSvg(),t=this;e.addEventListener(`touchstart`,function(e){e.preventDefault(),t._globalMouseDownHandler.apply(t,[this,e])},{passive:!1}),e.addEventListener(`mousedown`,function(e){t._globalMouseDownHandler.apply(t,[this,e])},{passive:!0}),e.addEventListener(`contextmenu`,function(e){t._globalContextHandler.apply(t,[this,e])},{passive:!1}),e.addEventListener(`dblclick`,function(e){t._globalDbClickHandler.apply(t,[this,e])},{passive:!0}),this.config.mouseScrool!=u.action.none&&e.addEventListener(`wheel`,function(e){t._mouseScrollHandler.apply(t,[this,e])},{passive:!1});var n=this.getMenuButton();n&&n.addEventListener(`click`,function(e){t._menuClickHandler.apply(t,[this,e])})}},u===void 0&&(u={}),u.VERSION=`9.1.86`,u.orientation={},u.orientation.top=0,u.orientation.bottom=1,u.orientation.right=2,u.orientation.left=3,u.orientation.top_left=4,u.orientation.bottom_left=5,u.orientation.right_top=6,u.orientation.left_top=7,u.anchor={top_right:`top_right`,right_top:`right_top`,bottom_right:`bottom_right`,right_bottom:`right_bottom`,top_left:`top_left`,left_top:`left_top`,bottom_left:`bottom_left`,left_bottom:`left_bottom`,top:`top`,bottom:`bottom`,left:`left`,right:`right`},u.align={},u.align.center=u.CENTER=8,u.align.orientation=u.ORIENTATION=9,u.attr={},u.attr.l=`data-l`,u.attr.id=`data-id`,u.attr.sl=`data-sl`,u.attr.lbl=`data-lbl`,u.attr.val=`data-val`,u.attr.tlbr=`data-tlbr`,u.attr.item=`data-item`,u.attr.layout=`data-layout`,u.attr.node_id=`data-n-id`,u.attr.link_id=`data-l-id`,u.attr.field_name=`data-f-name`,u.attr.c_link_to=`data-c-l-to`,u.attr.c_link_from=`data-c-l-from`,u.attr.s_link_to=`data-s-l-to`,u.attr.s_link_from=`data-s-l-from`,u.attr.control_add=`data-ctrl-add`,u.attr.control_expcoll_id=`data-ctrl-ec-id`,u.attr.control_up_id=`data-ctrl-up-id`,u.attr.control_export_menu=`data-ctrl-menu`,u.attr.control_node_menu_id=`data-ctrl-n-menu-id`,u.attr.control_node_circle_menu_id=`data-ctrl-n-c-menu-id`,u.attr.control_node_circle_menu_name=`data-ctrl-n-c-menu-name`,u.attr.control_node_circle_menu_wrraper_id=`data-ctrl-n-c-menu-wrapper-id`,u.attr.width=`data-width`,u.attr.text_overflow=`data-text-overflow`,u.ID=`id`,u.PID=`pid`,u.STPID=`stpid`,u.TAGS=`tags`,u.NODES=`nodes`,u.ELASTIC=`elastic`,u.ASSISTANT=`Assistant`,u.action={},u.action.expand=0,u.action.collapse=1,u.action.maximize=101,u.action.minimize=102,u.action.expandCollapse=501,u.action.edit=1,u.action.zoom=2,u.action.ctrlZoom=22,u.action.scroll=41,u.action.xScroll=3,u.action.yScroll=4,u.action.none=5,u.action.init=6,u.action.update=7,u.action.move=70,u.action.pan=8,u.action.centerNode=9,u.action.resize=10,u.action.insert=11,u.action.insertfirst=12,u.action.details=13,u.action.exporting=14,u.none=400001,u.scroll={},u.scroll.visible=!0,u.scroll.smooth=12,u.scroll.speed=120,u.scroll.safari={smooth:12,speed:250},u.match={},u.match.height=100001,u.match.width=100002,u.match.boundary=100003,u.match.boundaryIfOutside=100004,u.match.none=1,u.movable={},u.movable.node=`node`,u.movable.tree=`tree`,u.movable.detachTree=`detachTree`,u.layout={},u.layout.normal=u.normal=0,u.layout.mixed=u.mixed=1,u.layout.tree=u.tree=2,u.layout.treeLeftOffset=u.treeLeftOffset=3,u.layout.treeRightOffset=u.treeRightOffset=4,u.layout.treeLeft=5,u.layout.treeRight=6,u.layout.grid=-1,u.layout.treeList=-2,u.nodeOpenTag=`<g `+u.attr.node_id+`="{id}" style="opacity: {opacity}" transform="matrix(1,0,0,1,{x},{y})" class="{class}" `+u.attr.sl+`="{sl}" `+u.attr.l+`="{level}" {lcn}>`,u.linkOpenTag=`<g `+u.attr.link_id+`="[{id}][{child-id}]" class="{class}">`,u.expcollOpenTag=`<g `+u.attr.control_expcoll_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,u.upOpenTag=`<g `+u.attr.control_up_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,u.linkFieldsOpenTag=`<g transform="matrix(1,0,0,1,{x},{y}) rotate({rotate})">`,u.grCloseTag=`</g>`,u.A5={width:420,height:595},u.A4={width:595,height:842},u.A3={width:842,height:1191},u.A2={width:1191,height:1684},u.A1={width:1684,height:2384},u.Letter={width:612,height:791},u.Legal={width:612,height:1009},u.Legal={width:612,height:1009},u.Widescreen={width:720,height:1280},u.Standard={width:720,height:960},u.COLLAPSE_PARENT_NEIGHBORS=1,u.COLLAPSE_SUB_CHILDRENS=2,u.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED=3,u.TEXT_THRESHOLD=4e3,u.IMAGES_THRESHOLD=1e3,u.LINKS_THRESHOLD=2e3,u.BUTTONS_THRESHOLD=700,u.ANIM_THRESHOLD=500,u.IT_IS_LONELY_HERE=`<g transform="translate(-100, 0)" style="cursor:pointer;" `+u.attr.control_add+`="control-add"><text fill="#039be5">{link}</text></g>`,u.RES={},u.IT_IS_LONELY_HERE_LINK=u.RES.IT_IS_LONELY_HERE_LINK=`It's lonely here, add your first node`,u.FIRE_DRAG_NOT_CLICK_IF_MOVE=3,u.STRING_TAGS=!1,u.MAX_NODES_MESS=`The trial has expired or 200 nodes limit was reached! <br /><a style='color: #039BE5;' target='_blank' href='https://balkan.app/OrgChartJS/Docs/Evaluation'>See more</a>`,u.OFFLINE_MESS=`The evaluation version requires internet connection! <br /><a style='color: #039BE5;' target='_blank' href='https://balkan.app/OrgChartJS/Docs/Evaluation'>See more</a>`,u.SEARCH_PLACEHOLDER=`Search... type ? to get help.`,u.SEARCH_HELP_SYMBOL=`?`,u.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE=!1,u.SEARCH_RESULT_LIMIT=10,u.IMPORT_MESSAGE=`Choose the columns (fields) in your data file that contain the required information.`,u.FIXED_POSITION_ON_CLICK=!1,u.RENDER_LINKS_BEFORE_NODES=!1,u.RENDER_CLINKS_BEFORE_NODES=!1,u.MIXED_LAYOUT_ALL_NODES=!1,u.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN=!1,u.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN=1,u.LINK_ROUNDED_CORNERS=5,u.MOVE_STEP=5,u.CLINK_CURVE=1,u.MAX_DEPTH=200,u.SCALE_FACTOR=1.44,u.LAZY_LOADING_FACTOR=`auto`,u.LAZY_LOADING=!0,u.ARRAY_FIELDS=[`tags`],u.CSV_DELIMITER=`,`,u.EDITFORM_CLOSE_BTN=`<svg data-edit-from-close class="boc-edit-form-close"><path style="fill:#ffffff;" d="M21.205,5.007c-0.429-0.444-1.143-0.444-1.587,0c-0.429,0.429-0.429,1.143,0,1.571l8.047,8.047H1.111 C0.492,14.626,0,15.118,0,15.737c0,0.619,0.492,1.127,1.111,1.127h26.554l-8.047,8.032c-0.429,0.444-0.429,1.159,0,1.587 c0.444,0.444,1.159,0.444,1.587,0l9.952-9.952c0.444-0.429,0.444-1.143,0-1.571L21.205,5.007z"></path></svg>`,u.ESCAPE_HTML=!1,u.VERTICAL_CHILDREN_ASSISTANT=!1,u.EXPORT_PAGES_CUT_NODES=!1,u.RESET_MOVABLE_ONEXPANDCOLLAPSE=!1,u.FILTER_ALPHABETICALLY=!0,u.SERVER_PREFIX=`.azurewebsites.net/api/you-see-this-request-because-it-is-trial-version-of-orgchartjs`,u.FUNC_URL_NAME=`func-url-orgchartjs`,u.MINIMUM_SYMBOLS_IN_SEARCH_INPUT=1,u.AI_SYSTEM_MESSAGES=[],u.ORGSCRIBE_OFFSET=` `,u.TREELIST_WHEEL_STEP=`auto`,u.TREELIST_SCROLLBAR_WIDTH=10,u.CONVERT_IMAGES_TO_BASE64_BEFORE_EXPORT=!1,u.REQUEST_CUSTOM_HEADERS={},u.SLINK_GAP=7,u._intersects=function(e,t,n){var r=e.x-n.siblingSeparation/4,i=e.y,a=e.x+e.w+n.siblingSeparation/4,o=e.y;switch(n.orientation){case u.orientation.right:case u.orientation.right_top:case u.orientation.left:case u.orientation.left_top:r=e.x,i=e.y-n.siblingSeparation/4,a=e.x,o=e.y+e.h+n.siblingSeparation/4;break}var s=t.p,c=t.q,l=t.r,d=t.s,f=(a-r)*(d-c)-(l-s)*(o-i),p,m;return f===0?!1:(m=((d-c)*(l-r)+(s-l)*(d-i))/f,p=((i-o)*(l-r)+(a-r)*(d-i))/f,0<m&&m<1&&0<p&&p<1)},u._addPoint=function(e,t,n,r,i){switch(n.orientation){case u.orientation.top:case u.orientation.top_left:return u._addPointTop(e,t,n,r,i);case u.orientation.bottom:case u.orientation.bottom_left:return u._addPointBottom(e,t,n,r,i);case u.orientation.left:case u.orientation.left_top:return u._addPointLeft(e,t,n,r,i);case u.orientation.right:case u.orientation.right_top:return u._addPointRight(e,t,n,r,i)}},u._addPointTop=function(e,t,n,r,i){var a,o,s;return i==`left`?a=e.leftNeighbor?e.x+(e.leftNeighbor.x+e.leftNeighbor.w-e.x)/2:e.x-n.siblingSeparation/2:i==`right`&&(a=e.rightNeighbor?e.x+e.w+(e.rightNeighbor.x-(e.x+e.w))/2:e.x+e.w+n.siblingSeparation/2),t.push([a,t[t.length-1][1]]),t.push([a,e.y-n.levelSeparation/3]),o=t[t.length-1][1],s=a,r.p=a,r.q=o,r.r=s,r},u._addPointBottom=function(e,t,n,r,i){var a,o,s;return i==`left`?a=e.leftNeighbor?e.x+(e.leftNeighbor.x+e.leftNeighbor.w-e.x)/2:e.x-n.siblingSeparation/2:i==`right`&&(a=e.rightNeighbor?e.x+e.w+(e.rightNeighbor.x-(e.x+e.w))/2:e.x+e.w+n.siblingSeparation/2),t.push([a,t[t.length-1][1]]),t.push([a,e.y+e.h+n.levelSeparation/3]),o=t[t.length-1][1],s=a,r.p=a,r.q=o,r.r=s,r},u._addPointLeft=function(e,t,n,r,i){var a=t[t.length-1][0],o;i==`bottom`?o=e.rightNeighbor?e.y+e.h+(e.rightNeighbor.y-(e.y+e.h))/2:e.y+e.h+n.siblingSeparation/2:i==`top`&&(o=e.leftNeighbor?e.y+(e.leftNeighbor.y+e.leftNeighbor.h-e.y)/2:e.y-n.siblingSeparation/2),t.push([t[t.length-1][0],o]),t.push([e.x-n.levelSeparation/3,o]),a=t[t.length-1][0];var s=o;return r.p=a,r.q=o,r.s=s,r},u._addPointRight=function(e,t,n,r,i){var a=t[t.length-1][0],o;i==`bottom`?o=e.rightNeighbor?e.y+e.h+(e.rightNeighbor.y-(e.y+e.h))/2:e.y+e.h+n.siblingSeparation/2:i==`top`&&(o=e.leftNeighbor?e.y+(e.leftNeighbor.y+e.leftNeighbor.h-e.y)/2:e.y-n.siblingSeparation/2),t.push([t[t.length-1][0],o]),t.push([e.x+e.w+n.levelSeparation/3,o]),a=t[t.length-1][0];var s=o;return r.p=a,r.q=o,r.s=s,r},u._addConnectorLines=function(e,t){u._addConnectorLine(e,{x1:t.xa,y1:t.ya,x2:t.xb,y2:t.yb}),u._addConnectorLine(e,{x1:t.xb,y1:t.yb,x2:t.xc,y2:t.yc}),u._addConnectorLine(e,{x1:t.xc,y1:t.yc,x2:t.xd,y2:t.yd})},u._addConnectorLine=function(e,t){if(t.x1==t.x2){if(e.x[t.x1]||(e.x[t.x1]=[]),t.y1>t.y2){var n=t.y1;t.y1=t.y2,t.y2=n}e.x[t.x1].push({y1:t.y1,y2:t.y2})}if(t.y1==t.y2){if(e.y[t.y1]||(e.y[t.y1]=[]),t.x1>t.x2){var r=t.x1;t.x1=t.x2,t.x2=r}e.y[t.y1].push({x1:t.x1,x2:t.x2})}},u._addLineToPath=function(e,t,n){return u._avoidOverlapping(t,n),e.push([n.x1,n.y1]),e.push([n.x2,n.y2]),u._addConnectorLine(t,n),n},u._slinkRemoveUnusedPoints=function(e){for(var t=e.length-2;t>=1;t--){var n=e[t-1],r=e[t],i=e[t+1];(r[0]==n[0]&&r[0]==i[0]||r[1]==n[1]&&r[1]==i[1])&&e.splice(t,1)}},u._slinkAvoidOverlaping=function(e,t,n,r){for(var i=1;i<t.length;i++){var a=t[i-1],o=t[i];if(a[0]==o[0]){for(var s=e.x[o[0]];s;){var c=!0;for(var l of s)if(l.y1<=a[1]&&l.y2>=a[1]||l.y1<=o[1]&&l.y2>=o[1]){r==u.orientation.top||r==u.orientation.top_left?n==`left`?o[0]-=u.SLINK_GAP:n==`right`&&(o[0]+=u.SLINK_GAP):(r==u.orientation.bottom||r==u.orientation.bottom_left)&&(n==`right`?o[0]+=u.SLINK_GAP:n==`left`&&(o[0]-=u.SLINK_GAP)),c=!1;break}if(c)break;s=e.x[o[0]]}a[0]=o[0]}var d=!0;if(a[1]==o[1]&&a[0]>=o[0]&&(d=!1),d&&a[1]==o[1]){for(var s=e.y[o[1]];s;){var c=!0;for(var l of s)if(l.x1<=a[0]&&l.x2>=a[0]||l.x1<=o[0]&&l.x2>=o[0]){a[0]>=o[0]||(r==u.orientation.top||r==u.orientation.top_left?o[1]-=u.SLINK_GAP:(r==u.orientation.bottom||r==u.orientation.bottom_left)&&(o[1]+=u.SLINK_GAP),c=!1);break}if(c)break;s=e.y[o[1]]}a[1]=o[1]}d&&u._addConnectorLine(e,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},u._slinkAvoidOverlapingSecond=function(e,t,n){for(var r=1;r<t.length;r++){var i=t[r-1],a=t[r],o=!1;if(i[1]==a[1]){for(var s=e.y[a[1]];s;){var c=!0;for(var l of s)if(l.x1<=i[0]&&l.x2>=i[0]||l.x1<=a[0]&&l.x2>=a[0]){i[0]>=a[0]?(n==u.orientation.top||n==u.orientation.top_left?a[1]-=u.SLINK_GAP:(n==u.orientation.bottom||n==u.orientation.bottom_left)&&(a[1]+=u.SLINK_GAP),c=!1):o=!0;break}if(c)break;s=e.y[a[1]]}i[1]=a[1]}o||u._addConnectorLine(e,{x1:i[0],y1:i[1],x2:a[0],y2:a[1]})}},u._slinkAvoidOverlaping2=function(e,t,n,r){for(var i=1;i<t.length;i++){var a=t[i-1],o=t[i];if(a[1]==o[1]){for(var s=e.y[o[1]];s;){var c=!0;for(var l of s)if(l.x1<=a[0]&&l.x2>=a[0]||l.x1<=o[0]&&l.x2>=o[0]){r==u.orientation.left||r==u.orientation.left_top?n==`top`?o[1]-=u.SLINK_GAP:n==`bottom`&&(o[1]+=u.SLINK_GAP):(r==u.orientation.right||r==u.orientation.right_top)&&(n==`bottom`?o[1]+=u.SLINK_GAP:n==`top`&&(o[1]-=u.SLINK_GAP)),c=!1;break}if(c)break;s=e.y[o[1]]}a[1]=o[1]}var d=!0;if(a[0]==o[0]&&a[1]>=o[1]&&(d=!1),d&&a[0]==o[0]){for(var s=e.x[o[0]];s;){var c=!0;for(var l of s)if(l.y1<=a[1]&&l.y2>=a[1]||l.y1<=o[1]&&l.y2>=o[1]){a[1]>=o[1]||(r==u.orientation.left||r==u.orientation.left_top?o[0]-=u.SLINK_GAP:(r==u.orientation.right||r==u.orientation.right_top)&&(o[0]+=u.SLINK_GAP),c=!1);break}if(c)break;s=e.x[o[0]]}a[0]=o[0]}d&&u._addConnectorLine(e,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},u._slinkAvoidOverlapingSecond2=function(e,t,n){for(var r=1;r<t.length;r++){var i=t[r-1],a=t[r],o=!1;if(i[0]==a[0]){for(var s=e.x[a[0]];s;){var c=!0;for(var l of s)if(l.y1<=i[1]&&l.y2>=i[1]||l.y1<=a[1]&&l.y2>=a[1]){i[1]>=a[1]?(n==u.orientation.left||n==u.orientation.left_top?a[0]-=u.SLINK_GAP:(n==u.orientation.right||n==u.orientation.right_top)&&(a[0]+=u.SLINK_GAP),c=!1):o=!0;break}if(c)break;s=e.x[a[0]]}i[0]=a[0]}o||u._addConnectorLine(e,{x1:i[0],y1:i[1],x2:a[0],y2:a[1]})}},u.editUI=function(){},u.editUI.prototype.init=function(e){this.obj=e,this.fields=null,this.nodeId=null,this.detailsMode=null,this._event_id=u._guid()},u.editUI.prototype.on=function(e,t){return u.events.on(e,t,this._event_id),this},u.editUI.prototype.show=function(e,t,n){if(this.hide(!0)){if(this.nodeId=e,this.detailsMode=t,u.events.publish(`show`,[this,e])===!1)return!1;var r=this,i=this.content(e,t,n);this.obj.element.appendChild(i.element),u.input.init(this.obj.element),u.events.publish(`shown`,[this,{nodeId:e}]),n?t||this._focusElement(i.focusId):this.interval=u.animate(i.element,{right:-20,opacity:0},{right:0,opacity:1},300,u.anim.outSin,function(){t||r._focusElement(i.focusId)}),this.obj.element.querySelector(`[data-edit-from-close]`).addEventListener(`click`,function(t){t.preventDefault(),u.events.publish(`cancel`,[r,{id:e}])!==!1&&r.hide()}),this.obj.element.querySelector(`[data-edit-from-save]`).addEventListener(`click`,function(e){e.preventDefault(),r.hide()});for(var a=this.obj.element.querySelectorAll(`[data-input-btn]`),o=0;o<a.length;o++)a[o].addEventListener(`click`,function(t){t.preventDefault(),u.events.publish(`element-btn-click`,[r,{input:this.parentNode.querySelector(`input`),nodeId:e,event:t}])});this.obj.element.querySelector(`[data-add-more-fields-btn]`).addEventListener(`click`,function(e){e.stopPropagation(),e.preventDefault();var t=this,n=u.elements.textbox({},{type:`textbox`,label:r.obj.config.editForm.addMoreFieldName,btn:r.obj.config.editForm.addMoreBtn},`280px`);t.parentNode.insertAdjacentHTML(`beforebegin`,n.html),t.style.display=`none`,u.input.init(t.parentNode.previousSibling);var i=document.getElementById(n.id);i.focus(),i.nextElementSibling.addEventListener(`click`,function(e){e.stopPropagation(),e.preventDefault();var n=i.value,a=r.obj.element.querySelector(`[data-binding="`+u._escapeDoubleQuotes(i.value)+`"]`);if(!u.isNEU(n)&&!a){var o=u.elements.textbox({},{type:`textbox`,label:n,binding:n},`280px`);i.parentNode.parentNode.parentNode.removeChild(i.parentNode.parentNode),t.parentNode.insertAdjacentHTML(`beforebegin`,o.html),t.style.display=``,u.input.init(t.parentNode.previousSibling);var s=document.getElementById(o.id);s.focus(),s.addEventListener(`input`,function(){r._drawCurrentNodeElement()})}else i.focus()})}),this.obj.element.querySelector(`[data-boc-edit-from-btns]`).addEventListener(`click`,function(t){for(var n=t.target;n&&n.hasAttribute&&!n.hasAttribute(`data-edit-from-btn`);)n=n.parentNode;if(n&&n.hasAttribute){var i=n.getAttribute(`data-edit-from-btn`),a={button:r.obj.config.editForm.buttons[i],name:i,nodeId:e,event:t};if(u.events.publish(`button-click`,[r,a])===!1)return!1;switch(i){case`edit`:r.obj.editUI.show(e,!1,!0);break;case`pdf`:r.obj.exportToPDFProfile(e),r.hide();break;case`share`:r.obj.shareProfile(e);break;case`remove`:r.obj.removeNode(e,null,!0),r.hide();break}}});for(var s=this.obj.element.querySelectorAll(`[data-boc-edit-form] [data-binding]`),o=0;o<s.length;o++){var c=s[o];c.getAttribute(`data-binding`)&&c.addEventListener(`input`,function(){r._drawCurrentNodeElement()})}}},u.editUI.prototype._drawCurrentNodeElement=function(){var e=this.obj.element.querySelector(`[data-boc-edit-form]`),t=u.input.getData(e),n=this.obj.get(this.nodeId),r=this.obj.getNode(this.nodeId),i=u.mergeDeep(n,t),a=this.obj.ui.node(r,i,[],this.obj.config,void 0,void 0,void 0,void 0,this.obj.getScale(),this.obj);this._replaceNodeWith(a)},u.editUI.prototype._replaceNodeWith=function(e){var t=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);t.innerHTML=e;var n=t.firstElementChild;this.obj.getNodeElement(this.nodeId).replaceWith(n)},u.editUI.prototype.setAvatar=function(e){var t=this.obj.element.querySelector(`[id="boc-avatar"]`),n=this.obj.element.querySelector(`[id="boc-avatar"] img`),r=this.obj.element.querySelector(`[id="boc-avatar"] svg`);if(t)n?n.setAttribute(`src`,e):r&&(t.innerHTML=`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${e}">`);else return;this._drawCurrentNodeElement()},u.editUI.prototype.save=function(e){var t=this.obj.element.querySelector(`[data-boc-edit-form]`),n=u.input.validateAndGetData(t);if(n!==!1){var r=this.obj.get(this.nodeId),i={data:u.mergeDeep(r,n)};return u.events.publish(`save`,[this,i])===!1?void 0:(this.obj.updateNode(i.data,null,!0,e),!0)}return!1},u.editUI.prototype._focusElement=function(e){var t=null;u.isNEU(this.obj.config.editForm.focusBinding)?u.isNEU(e)||(t=document.getElementById(e)):t=this.obj.element.querySelector(`[data-binding="`+this.obj.config.editForm.focusBinding+`"]`),t&&(t.value&&t.value.length&&t.setSelectionRange(t.value.length,t.value.length),t.focus())},u.editUI.prototype.content=function(e,t,n,r,i){var a=this.obj.config.editForm.readOnly,o=JSON.parse(JSON.stringify(this.obj.config.editForm.elements)),s=this.obj.config.editForm.addMore,c=this.obj.config.editForm.saveAndCloseBtn,l=this.obj.config.editForm.buttons,d=this.obj.config.editForm.titleBinding,f=this.obj.config.editForm.photoBinding,p=this.obj.getNode(e),m=this.obj._get(e),h=u.t(p.templateName,p.min,this.obj.getScale()),g=m[d],_=m[f];if(this.obj.config.editForm.generateElementsFromFields)for(var v=0;v<this.fields.length;v++){var y=this.fields[v];if(y!=`tags`){for(var b=!1,x=0;x<o.length;x++){if(Array.isArray(o[x])){for(var S=0;S<o[x].length;S++)if(y==o[x][S].binding){b=!0;break}}else if(y==o[x].binding){b=!0;break}if(b)break}b||o.push({type:`textbox`,label:y,binding:y})}}u.isNEU(g)&&(g=``),_=u.isNEU(_)?u.icon.user(150,150,`#8C8C8C`,0,0):`<img style="width: 100%;height:100%;border-radius: 50%;object-fit:cover;" src="${_}"></img>`;var C,w=!t,T=t?`display:none;`:``,E=t||!s?`display:none;`:``,D=h.editFormHeaderColor?`style="background-color:${h.editFormHeaderColor};"`:``,O=document.createElement(`form`);if(O.setAttribute(`data-boc-edit-form`,``),O.classList.add(`boc-edit-form`),O.classList.add(this.obj.config.mode),O.classList.add(p.templateName.replaceAll(` `,``)),O.classList.add(u.ui._defsIds[p.templateName]),Array.isArray(p.tags)&&p.tags.length)for(var v=0;v<p.tags.length;v++)O.classList.add(p.tags[v].replaceAll(` `,``));O.style.display=`flex`,O.style.opacity=n?1:0,O.style.right=n?0:`-20px`,r&&(O.style.width=r);var k=[];return O.innerHTML=`<div>
|
|
25
25
|
<div class="boc-edit-form-header" ${D}>
|
|
26
26
|
${i?``:u.EDITFORM_CLOSE_BTN}
|
|
27
27
|
${u.editUI.renderHeaderContent(g,_,p,m)}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -38,18 +38,19 @@ yarn add balkan-orgchart-react
|
|
|
38
38
|
```js
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
import {
|
|
41
|
+
import { OrgChartReact, Employee } from 'balkan-orgchart-react';
|
|
42
42
|
|
|
43
43
|
export const ChartExample = () => {
|
|
44
|
-
return <
|
|
44
|
+
return <OrgChartReact nodeBinding={{ field_0: 'name', field_1: 'title' }} style={{width: '100%', height: '100%'}} enableSearch={false}>
|
|
45
45
|
<Employee name='Denny Curtis' title='CEO'>
|
|
46
46
|
<Employee name='Lexie Cole' title='QA Lead'></Employee>
|
|
47
47
|
<Employee name='Janae Barrett' title='Technical Director'></Employee>
|
|
48
48
|
<Employee name='Aaliyah Webb' title='Assistant' assistant={true}></Employee>
|
|
49
49
|
</Employee>
|
|
50
|
-
</
|
|
50
|
+
</OrgChartReact>
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
|
|
53
54
|
```
|
|
54
55
|
|
|
55
56
|
|
|
@@ -57,7 +58,7 @@ export const ChartExample = () => {
|
|
|
57
58
|
|
|
58
59
|
```js
|
|
59
60
|
|
|
60
|
-
import {
|
|
61
|
+
import {OrgChartReact} from 'balkan-orgchart-react';
|
|
61
62
|
|
|
62
63
|
export const ChartExample = () => {
|
|
63
64
|
const [jsonData, setJsonData] = useState([]);
|
|
@@ -73,9 +74,11 @@ export const ChartExample = () => {
|
|
|
73
74
|
})
|
|
74
75
|
}, []);
|
|
75
76
|
|
|
76
|
-
return <
|
|
77
|
+
return <OrgChartReact style={{width: '100%', height: '100%'}} data={jsonData} nodeBinding={{ field_0: 'name', field_1: 'title' }} enableSearch={false}></OrgChartReact>
|
|
77
78
|
}
|
|
78
79
|
|
|
80
|
+
|
|
81
|
+
|
|
79
82
|
```
|
|
80
83
|
|
|
81
84
|
|
|
@@ -86,26 +89,28 @@ export const ChartExample = () => {
|
|
|
86
89
|
|
|
87
90
|
```js
|
|
88
91
|
|
|
89
|
-
import {
|
|
92
|
+
import { OrgChartReact, Employee } from 'balkan-orgchart-react';
|
|
90
93
|
|
|
91
94
|
export const ChartExample = () => {
|
|
92
|
-
const chartRef = useRef<
|
|
95
|
+
const chartRef = useRef<OrgChartJS>(null);
|
|
93
96
|
|
|
94
|
-
const handleExport = () => {
|
|
95
|
-
chartRef.current
|
|
97
|
+
const handleExport = () => {
|
|
98
|
+
if (chartRef.current) {
|
|
99
|
+
chartRef.current.exportToPDF();
|
|
100
|
+
}
|
|
96
101
|
};
|
|
97
102
|
|
|
98
103
|
return (
|
|
99
104
|
<>
|
|
100
105
|
<button onClick={handleExport} style={{ fontSize: "24px"}}>Export PDF</button>
|
|
101
106
|
|
|
102
|
-
<
|
|
107
|
+
<OrgChartReact ref={chartRef} nodeBinding={{ field_0: "name", field_1: "title" }} style={{width: '100%', height: '100%'}} enableSearch={false}>
|
|
103
108
|
<Employee name="Denny Curtis" title="CEO">
|
|
104
109
|
<Employee name="Lexie Cole" title="QA Lead" />
|
|
105
110
|
<Employee name="Janae Barrett" title="Technical Director" />
|
|
106
111
|
<Employee name="Aaliyah Webb" title="Assistant" assistant />
|
|
107
112
|
</Employee>
|
|
108
|
-
</
|
|
113
|
+
</OrgChartReact>
|
|
109
114
|
</>
|
|
110
115
|
);
|
|
111
116
|
};
|