balkan-orgchart-js-community 9.2.42 → 9.2.43

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/orgchart.d.mts CHANGED
@@ -5378,6 +5378,7 @@ declare namespace OrgChart {
5378
5378
  * - diva
5379
5379
  * - base
5380
5380
  * - isla
5381
+ * - emily
5381
5382
  * - deborah
5382
5383
  *
5383
5384
  * Default value - *ana*.
@@ -5388,7 +5389,7 @@ declare namespace OrgChart {
5388
5389
  * ```
5389
5390
  * {@link https://balkan.app/OrgChartJS/Docs/PredefinedTemplates | See doc...}
5390
5391
  */
5391
- template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {}),
5392
+ template?: "ana" | "ula" | "olivia" | "emily" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {}),
5392
5393
  /**
5393
5394
  * With tags option you can:
5394
5395
  * - Set a specific template for tagged node/s {@link https://balkan.app/OrgChartJS/Docs/MultipleTemplates | See doc...}
@@ -5410,7 +5411,7 @@ declare namespace OrgChart {
5410
5411
  */
5411
5412
  tags?: {
5412
5413
  [key: string]: {
5413
- template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {}),
5414
+ template?: "ana" | "ula" | "olivia" | "emily" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {}),
5414
5415
  subLevels?: number,
5415
5416
  nodeMenu?: OrgChart.menu,
5416
5417
  nodeCircleMenu?: OrgChart.circleMenu,
@@ -5428,7 +5429,7 @@ declare namespace OrgChart {
5428
5429
  level?: number,
5429
5430
  allChildren?: boolean
5430
5431
  },
5431
- template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {})
5432
+ template?: "ana" | "ula" | "olivia" | "emily" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {})
5432
5433
  }
5433
5434
  };
5434
5435
  },
package/orgchart.d.ts CHANGED
@@ -5378,6 +5378,7 @@ declare namespace OrgChart {
5378
5378
  * - diva
5379
5379
  * - base
5380
5380
  * - isla
5381
+ * - emily
5381
5382
  * - deborah
5382
5383
  *
5383
5384
  * Default value - *ana*.
@@ -5388,7 +5389,7 @@ declare namespace OrgChart {
5388
5389
  * ```
5389
5390
  * {@link https://balkan.app/OrgChartJS/Docs/PredefinedTemplates | See doc...}
5390
5391
  */
5391
- template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {}),
5392
+ template?: "ana" | "ula" | "olivia" | "emily" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {}),
5392
5393
  /**
5393
5394
  * With tags option you can:
5394
5395
  * - Set a specific template for tagged node/s {@link https://balkan.app/OrgChartJS/Docs/MultipleTemplates | See doc...}
@@ -5410,7 +5411,7 @@ declare namespace OrgChart {
5410
5411
  */
5411
5412
  tags?: {
5412
5413
  [key: string]: {
5413
- template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {}),
5414
+ template?: "ana" | "ula" | "olivia" | "emily" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {}),
5414
5415
  subLevels?: number,
5415
5416
  nodeMenu?: OrgChart.menu,
5416
5417
  nodeCircleMenu?: OrgChart.circleMenu,
@@ -5428,7 +5429,7 @@ declare namespace OrgChart {
5428
5429
  level?: number,
5429
5430
  allChildren?: boolean
5430
5431
  },
5431
- template?: "ana" | "ula" | "olivia" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {})
5432
+ template?: "ana" | "ula" | "olivia" | "emily" | "belinda" | "rony" | "mery" | "polina" | "mila" | "diva" | "luba" | "isla" | "deborah" | "base" | "group" | "invisibleGroup" | "treeListItem" | "clara" | (string & {})
5432
5433
  }
5433
5434
  };
5434
5435
  },
package/orgchart.js CHANGED
@@ -13,7 +13,7 @@ var e=function(e,t){var n=this;Object.defineProperty(this,`element`,{get(){retur
13
13
  <div data-boc-left></div>
14
14
  <div data-boc-right>
15
15
  <div data-boc-content></div>
16
- </div>`)}}),Object.defineProperty(this,`leftElement`,{get(){return e.querySelector(`[data-boc-left]`)}}),n.init(e,t)};e.prototype.init=function(t,n){if(t&&!this._initCalled){this._initCalled=!0,(typeof t==`string`||t instanceof String)&&(t=document.querySelector(t)),this.element=t;var r=this;if(this.config=e.mergeDeep(e._defaultConfig(n),n),this._layoutConfigs={base:{orientation:this.config.orientation,levelSeparation:this.config.levelSeparation,mixedHierarchyNodesSeparation:this.config.mixedHierarchyNodesSeparation,assistantSeparation:this.config.assistantSeparation,subtreeSeparation:this.config.subtreeSeparation,siblingSeparation:this.config.siblingSeparation,layout:this.config.layout,columns:this.config.columns,collapse:this.config.collapse,partnerNodeSeparation:this.config.partnerNodeSeparation}},this.config.tags)for(var i in this.config.tags){var a=this.config.tags[i];a.subTreeConfig!=null&&(this._layoutConfigs[i]={orientation:a.subTreeConfig.orientation==null?this.config.orientation:a.subTreeConfig.orientation,levelSeparation:a.subTreeConfig.levelSeparation==null?this.config.levelSeparation:a.subTreeConfig.levelSeparation,mixedHierarchyNodesSeparation:a.subTreeConfig.mixedHierarchyNodesSeparation==null?this.config.mixedHierarchyNodesSeparation:a.subTreeConfig.mixedHierarchyNodesSeparation,assistantSeparation:a.subTreeConfig.assistantSeparation==null?this.config.assistantSeparation:a.subTreeConfig.assistantSeparation,subtreeSeparation:a.subTreeConfig.subtreeSeparation==null?this.config.subtreeSeparation:a.subTreeConfig.subtreeSeparation,siblingSeparation:a.subTreeConfig.siblingSeparation==null?this.config.siblingSeparation:a.subTreeConfig.siblingSeparation,layout:a.subTreeConfig.layout==null?this.config.layout:a.subTreeConfig.layout,columns:a.subTreeConfig.columns==null?this.config.columns:a.subTreeConfig.columns,collapse:a.subTreeConfig.collapse==null?this.config.collapse:a.subTreeConfig.collapse,partnerNodeSeparation:a.subTreeConfig.partnerNodeSeparation==null?this.config.partnerNodeSeparation:a.subTreeConfig.partnerNodeSeparation,template:a.subTreeConfig.template})}this._event_id=e._guid(),e._validateConfig(this.config)&&(this._vScroll={},this.config.ui||(this.ui=e.ui),this.config.editUI?this.editUI=this.config.editUI:this.editUI=new e.editUI,this.editUI.init(this),this.config.filterUI?this.filterUI=this.config.filterUI:this.filterUI=new e.filterUI,this.filterUI.init(this),this.manager=new e.manager(this),this._ai=new e._ai(this),this.config.searchUI?this.searchUI=this.config.searchUI:this.searchUI=new e.searchUI,this.config.aiUI?this.aiUI=this.config.aiUI:this.aiUI=new e.aiUI,this.config.orgScribeUI?this.orgScribeUI=this.config.orgScribeUI:this.orgScribeUI=new e.orgScribeUI,this.config.powerPointPreviewUI?this.powerPointPreviewUI=this.config.powerPointPreviewUI:this.powerPointPreviewUI=new e.exportUI(`pptx`),this.config.pdfPreviewUI?this.pdfPreviewUI=this.config.pdfPreviewUI:this.pdfPreviewUI=new e.exportUI(`pdf`),this.config.svgPreviewUI?this.svgPreviewUI=this.config.svgPreviewUI:this.svgPreviewUI=new e.exportUI(`svg`),this.config.pngPreviewUI?this.pngPreviewUI=this.config.pngPreviewUI:this.pngPreviewUI=new e.exportUI(`png`),this.config.nodeMenuUI?this.nodeMenuUI=this.config.nodeMenuUI:this.nodeMenuUI=new e.menuUI,this.nodeMenuUI.init(this,this.config.nodeMenu),this.config.nodeCircleMenuUI?this.nodeCircleMenuUI=this.config.nodeCircleMenuUI:this.nodeCircleMenuUI=new e.circleMenuUI,this.nodeCircleMenuUI.init(this,this.config.nodeCircleMenu),this.config.nodeContextMenuUI?this.nodeContextMenuUI=this.config.nodeContextMenuUI:this.nodeContextMenuUI=new e.menuUI,this.nodeContextMenuUI.init(this,this.config.nodeContextMenu),this.config.controlsUI?this.controlsUI=this.config.controlsUI:this.controlsUI=new e.controlsUI,this.config.toolbarUI?this.toolbarUI=this.config.toolbarUI:this.toolbarUI=new e.toolbarUI,this.config.notifierUI?this.notifierUI=this.config.notifierUI:this.notifierUI=new e.notifierUI,this.notifierUI.init(this),this.config.menuUI?this.menuUI=this.config.menuUI:this.menuUI=new e.menuUI,this.menuUI.init(this,this.config.menu),this.config.xScrollUI||(this.xScrollUI=new e.xScrollUI(this.element,this.config,function(){return{boundary:r.response.boundary,scale:r.getScale(),viewBox:r.getViewBox(),padding:r.config.padding}},function(e){r.setViewBox(e)},function(){r._draw(!0,e.action.xScroll)})),this.config.yScrollUI||(this.yScrollUI=new e.yScrollUI(this.element,this.config,function(){return{boundary:r.response.boundary,scale:r.getScale(),viewBox:r.getViewBox(),padding:r.config.padding}},function(e){r.setViewBox(e)},function(){r._draw(!0,e.action.xScroll)})),this.config.undoRedoUI?this.undoRedoUI=this.config.undoRedoUI:this.undoRedoUI=new e.undoRedoUI,this.mainElement.classList.add(`boc-`+this.config.mode),this._gragStartedId=null,this._timeout=null,this._touch=null,this._initialized=!1,this._loaded=!1,this._moveInterval=null,this._movePosition=null,this.response=null,this.nodes=null,this.isVisible=null,this._connectorLines={x:{},y:{}},e._intersectionObserver(this.element,function(t){r.isVisible=t,e.events.publish(`visibility-change`,[r])!==!1&&e.LAZY_LOADING&&r.isVisible&&(r._loaded?r._draw(!1,e.action.update):(r._setInitialSizeIfNotSet(),r._draw(!1,e.action.init)))}),this._resizeObserver=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;r._resizeHandler(e,n)}}),this._resizeObserver.observe(this.element))}},e.prototype.load=function(t,n){var r=this;return this.config.nodes=t,this._draw(!1,e.action.init,void 0,function(){r.filterUI.update(),n&&n()}),this},e.prototype.loadXML=function(t,n){var r=e._xml2json(t);return this.load(r,n)},e.prototype.getXML=function(){return e._json2xml(this.config.nodes)},e.prototype.on=function(t,n){return e.events.on(t,n,this._event_id),this},e.prototype.removeListener=function(t,n){return e.events.remove(t,n,this._event_id)},e.prototype.draw=function(t,n,r){t??=e.action.update,this._draw(!1,t,n,r)},e.prototype._draw=function(t,n,r,i){var a=this;if(!(e.LAZY_LOADING&&!this.isVisible)){if(!e.LAZY_LOADING&&!this._initialized&&(this._setInitialSizeIfNotSet(),this.width()==0||this.height()==0)){console.error(`Cannot load the chart with size 0! If you are using the OrgChart within tabs set OrgChart.LAZY_LOADING to true! `);return}this._hideBeforeAnimationCompleted=!1;var o=n==e.action.init?null:this.getViewBox();this.manager.read(t,this.width(),this.height(),o,n,r,function(t){if(!a.notifierUI.show(t.notif)){n!=e.action.exporting&&(a.nodes=t.nodes,a.visibleNodeIds=t.visibleNodeIds,a.roots=t.roots),a._connectorLines={x:{},y:{}},a.editUI.fields=t.allFields;var o={defs:``};e.events.publish(`renderdefs`,[a,o]);var s=a.ui.defs(o.defs),c=a.getScale(t.viewBox);s+=a.ui.pointer(a.config,n,c);var l=a.getViewBox(),u=t.viewBox,o={content:s,res:t};e.events.publish(`prerender`,[a,o]),s=o.content;var d=[];if(e.RENDER_LINKS_BEFORE_NODES)for(var f=0;f<t.visibleNodeIds.length;f++){var p=t.nodes[t.visibleNodeIds[f]];e.getRootOf(p).stParent?d.push(p.id):s+=a.ui.link(p,a,c,t.bordersByRootIdAndLevel,t.nodes,n)}for(var f=0;f<t.visibleNodeIds.length;f++){var p=t.nodes[t.visibleNodeIds[f]],m=a._get(p.id);if(e.RENDER_LINKS_BEFORE_NODES&&d.includes(p.id)&&(s+=a.ui.link(p,a,c,t.bordersByRootIdAndLevel,t.nodes,n)),p.isTreeListItem||(s+=a.ui.node(p,m,t.animations,a.config,void 0,void 0,void 0,n,c,a)),!p.min&&p.treeList){var h=function(e){if(!p.treeList.pinnedIds.includes(e.id)){var r=a._get(e.id);s+=a.ui.node(e,r,t.animations,a.config,void 0,void 0,void 0,n,c,a),s+=a.ui.expandCollapseBtn(a,e,r,a.config,a._layoutConfigs,n,c)}for(var i of e.children)h(i)},g=e.randomId();s+=`<clipPath id="treelist_${g}">
16
+ </div>`)}}),Object.defineProperty(this,`leftElement`,{get(){return e.querySelector(`[data-boc-left]`)}}),n.init(e,t)};e.prototype.init=function(t,n){if(t&&!this._initCalled){this._initCalled=!0,(typeof t==`string`||t instanceof String)&&(t=document.querySelector(t)),this.element=t;var r=this;if(e._reorderNodeBinding(n),this.config=e.mergeDeep(e._defaultConfig(n),n),this._layoutConfigs={base:{orientation:this.config.orientation,levelSeparation:this.config.levelSeparation,mixedHierarchyNodesSeparation:this.config.mixedHierarchyNodesSeparation,assistantSeparation:this.config.assistantSeparation,subtreeSeparation:this.config.subtreeSeparation,siblingSeparation:this.config.siblingSeparation,layout:this.config.layout,columns:this.config.columns,collapse:this.config.collapse,partnerNodeSeparation:this.config.partnerNodeSeparation}},this.config.tags)for(var i in this.config.tags){var a=this.config.tags[i];a.subTreeConfig!=null&&(this._layoutConfigs[i]={orientation:a.subTreeConfig.orientation==null?this.config.orientation:a.subTreeConfig.orientation,levelSeparation:a.subTreeConfig.levelSeparation==null?this.config.levelSeparation:a.subTreeConfig.levelSeparation,mixedHierarchyNodesSeparation:a.subTreeConfig.mixedHierarchyNodesSeparation==null?this.config.mixedHierarchyNodesSeparation:a.subTreeConfig.mixedHierarchyNodesSeparation,assistantSeparation:a.subTreeConfig.assistantSeparation==null?this.config.assistantSeparation:a.subTreeConfig.assistantSeparation,subtreeSeparation:a.subTreeConfig.subtreeSeparation==null?this.config.subtreeSeparation:a.subTreeConfig.subtreeSeparation,siblingSeparation:a.subTreeConfig.siblingSeparation==null?this.config.siblingSeparation:a.subTreeConfig.siblingSeparation,layout:a.subTreeConfig.layout==null?this.config.layout:a.subTreeConfig.layout,columns:a.subTreeConfig.columns==null?this.config.columns:a.subTreeConfig.columns,collapse:a.subTreeConfig.collapse==null?this.config.collapse:a.subTreeConfig.collapse,partnerNodeSeparation:a.subTreeConfig.partnerNodeSeparation==null?this.config.partnerNodeSeparation:a.subTreeConfig.partnerNodeSeparation,template:a.subTreeConfig.template})}this._event_id=e._guid(),e._validateConfig(this.config)&&(this._vScroll={},this.config.ui||(this.ui=e.ui),this.config.editUI?this.editUI=this.config.editUI:this.editUI=new e.editUI,this.editUI.init(this),this.config.filterUI?this.filterUI=this.config.filterUI:this.filterUI=new e.filterUI,this.filterUI.init(this),this.manager=new e.manager(this),this._ai=new e._ai(this),this.config.searchUI?this.searchUI=this.config.searchUI:this.searchUI=new e.searchUI,this.config.aiUI?this.aiUI=this.config.aiUI:this.aiUI=new e.aiUI,this.config.orgScribeUI?this.orgScribeUI=this.config.orgScribeUI:this.orgScribeUI=new e.orgScribeUI,this.config.powerPointPreviewUI?this.powerPointPreviewUI=this.config.powerPointPreviewUI:this.powerPointPreviewUI=new e.exportUI(`pptx`),this.config.pdfPreviewUI?this.pdfPreviewUI=this.config.pdfPreviewUI:this.pdfPreviewUI=new e.exportUI(`pdf`),this.config.svgPreviewUI?this.svgPreviewUI=this.config.svgPreviewUI:this.svgPreviewUI=new e.exportUI(`svg`),this.config.pngPreviewUI?this.pngPreviewUI=this.config.pngPreviewUI:this.pngPreviewUI=new e.exportUI(`png`),this.config.nodeMenuUI?this.nodeMenuUI=this.config.nodeMenuUI:this.nodeMenuUI=new e.menuUI,this.nodeMenuUI.init(this,this.config.nodeMenu),this.config.nodeCircleMenuUI?this.nodeCircleMenuUI=this.config.nodeCircleMenuUI:this.nodeCircleMenuUI=new e.circleMenuUI,this.nodeCircleMenuUI.init(this,this.config.nodeCircleMenu),this.config.nodeContextMenuUI?this.nodeContextMenuUI=this.config.nodeContextMenuUI:this.nodeContextMenuUI=new e.menuUI,this.nodeContextMenuUI.init(this,this.config.nodeContextMenu),this.config.controlsUI?this.controlsUI=this.config.controlsUI:this.controlsUI=new e.controlsUI,this.config.toolbarUI?this.toolbarUI=this.config.toolbarUI:this.toolbarUI=new e.toolbarUI,this.config.notifierUI?this.notifierUI=this.config.notifierUI:this.notifierUI=new e.notifierUI,this.notifierUI.init(this),this.config.menuUI?this.menuUI=this.config.menuUI:this.menuUI=new e.menuUI,this.menuUI.init(this,this.config.menu),this.config.xScrollUI||(this.xScrollUI=new e.xScrollUI(this.element,this.config,function(){return{boundary:r.response.boundary,scale:r.getScale(),viewBox:r.getViewBox(),padding:r.config.padding}},function(e){r.setViewBox(e)},function(){r._draw(!0,e.action.xScroll)})),this.config.yScrollUI||(this.yScrollUI=new e.yScrollUI(this.element,this.config,function(){return{boundary:r.response.boundary,scale:r.getScale(),viewBox:r.getViewBox(),padding:r.config.padding}},function(e){r.setViewBox(e)},function(){r._draw(!0,e.action.xScroll)})),this.config.undoRedoUI?this.undoRedoUI=this.config.undoRedoUI:this.undoRedoUI=new e.undoRedoUI,this.mainElement.classList.add(`boc-`+this.config.mode),this._gragStartedId=null,this._timeout=null,this._touch=null,this._initialized=!1,this._loaded=!1,this._moveInterval=null,this._movePosition=null,this.response=null,this.nodes=null,this.isVisible=null,this._connectorLines={x:{},y:{}},e._intersectionObserver(this.element,function(t){r.isVisible=t,e.events.publish(`visibility-change`,[r])!==!1&&e.LAZY_LOADING&&r.isVisible&&(r._loaded?r._draw(!1,e.action.update):(r._setInitialSizeIfNotSet(),r._draw(!1,e.action.init)))}),this._resizeObserver=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;r._resizeHandler(e,n)}}),this._resizeObserver.observe(this.element))}},e.prototype.load=function(t,n){var r=this;return this.config.nodes=t,this._draw(!1,e.action.init,void 0,function(){r.filterUI.update(),n&&n()}),this},e.prototype.loadXML=function(t,n){var r=e._xml2json(t);return this.load(r,n)},e.prototype.getXML=function(){return e._json2xml(this.config.nodes)},e.prototype.on=function(t,n){return e.events.on(t,n,this._event_id),this},e.prototype.removeListener=function(t,n){return e.events.remove(t,n,this._event_id)},e.prototype.draw=function(t,n,r){t??=e.action.update,this._draw(!1,t,n,r)},e.prototype._draw=function(t,n,r,i){var a=this;if(!(e.LAZY_LOADING&&!this.isVisible)){if(!e.LAZY_LOADING&&!this._initialized&&(this._setInitialSizeIfNotSet(),this.width()==0||this.height()==0)){console.error(`Cannot load the chart with size 0! If you are using the OrgChart within tabs set OrgChart.LAZY_LOADING to true! `);return}this._hideBeforeAnimationCompleted=!1;var o=n==e.action.init?null:this.getViewBox();this.manager.read(t,this.width(),this.height(),o,n,r,function(t){if(!a.notifierUI.show(t.notif)){n!=e.action.exporting&&(a.nodes=t.nodes,a.visibleNodeIds=t.visibleNodeIds,a.roots=t.roots),a._connectorLines={x:{},y:{}},a.editUI.fields=t.allFields;var o={defs:``};e.events.publish(`renderdefs`,[a,o]);var s=a.ui.defs(o.defs),c=a.getScale(t.viewBox);s+=a.ui.pointer(a.config,n,c);var l=a.getViewBox(),u=t.viewBox,o={content:s,res:t};e.events.publish(`prerender`,[a,o]),s=o.content;var d=[];if(e.RENDER_LINKS_BEFORE_NODES)for(var f=0;f<t.visibleNodeIds.length;f++){var p=t.nodes[t.visibleNodeIds[f]];e.getRootOf(p).stParent?d.push(p.id):s+=a.ui.link(p,a,c,t.bordersByRootIdAndLevel,t.nodes,n)}for(var f=0;f<t.visibleNodeIds.length;f++){var p=t.nodes[t.visibleNodeIds[f]],m=a._get(p.id);if(e.RENDER_LINKS_BEFORE_NODES&&d.includes(p.id)&&(s+=a.ui.link(p,a,c,t.bordersByRootIdAndLevel,t.nodes,n)),p.isTreeListItem||(s+=a.ui.node(p,m,t.animations,a.config,void 0,void 0,void 0,n,c,a)),!p.min&&p.treeList){var h=function(e){if(!p.treeList.pinnedIds.includes(e.id)){var r=a._get(e.id);s+=a.ui.node(e,r,t.animations,a.config,void 0,void 0,void 0,n,c,a),s+=a.ui.expandCollapseBtn(a,e,r,a.config,a._layoutConfigs,n,c)}for(var i of e.children)h(i)},g=e.randomId();s+=`<clipPath id="treelist_${g}">
17
17
  <rect rx="10" ry="10" x="${p.x+p.padding[3]}" y="${p.y+p.padding[0]}" width="${p.w-p.padding[1]-p.padding[3]}" height="${p.h-p.padding[2]-p.padding[0]}">
18
18
  </clipPath><g clip-path="url(#treelist_${g})"><g data-treelist-content="${p.id}" transform="matrix(1,0,0,1,0,-${p.treeList.scrollTop})">`;for(var _ of p.stChildren)h(_);for(var v of p.treeList.pinnedIds){var y=a.getNode(v),b=a._get(v);s+=a.ui.node(y,b,t.animations,a.config,void 0,void 0,void 0,n,c,a,!0),s+=a.ui.expandCollapseBtn(a,y,b,a.config,a._layoutConfigs,n,c)}var{thumbHeight:x,thumbPosition:S,scrollBarDisplay:C}=e._treeListGetTumbPositionFromScrollTop(p);s+=`</g>
19
19
 
@@ -21,7 +21,7 @@ var e=function(e,t){var n=this;Object.defineProperty(this,`element`,{get(){retur
21
21
  <rect style="display: ${C}" data-treelist-scroll="${p.id}" class="boc-scroll" x="${p.x+p.w-p.padding[1]-e.TREELIST_SCROLLBAR_WIDTH}" y="${p.y+p.padding[0]}" width="${e.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]-e.TREELIST_SCROLLBAR_WIDTH}" y="${S}" width="${e.TREELIST_SCROLLBAR_WIDTH}" height="${x}"></rect>
23
23
 
24
- </g>`}}for(var f=0;f<t.visibleNodeIds.length;f++){var p=t.nodes[t.visibleNodeIds[f]],m=a._get(p.id);p.isTreeListItem||(e.RENDER_LINKS_BEFORE_NODES||(s+=a.ui.link(p,a,c,t.bordersByRootIdAndLevel,t.nodes,n)),s+=a.ui.expandCollapseBtn(a,p,m,a.config,a._layoutConfigs,n,c))}var o={content:s,res:t};if(e.events.publish(`render`,[a,o]),s=o.content,t=o.res,s+=a.ui.lonely(a.config),n===e.action.exporting){var w=t.boundary,T=w.maxX-w.minX,E=w.maxY-w.minY,D=a.ui.svg(T,E,[w.minX,w.minY,T,E],a.config,s,c);i.call(a,D,t);return}(n===e.action.centernode||n===e.action.insert||n===e.action.expand||n===e.action.collapse||n===e.action.update)&&(u=l),n===e.action.init&&l!=null&&(u=l),n===e.action.centerNode&&l!=null&&(u=l),a.response=t,a._lastSize={width:a.width(),height:a.height()};var D=a.ui.svg(`100%`,`100%`,u,a.config,s);if(!a._initialized)a.element.innerHTML=a.ui.css()+D+a.ui.menuButton(a.config)+a.ui.aiButton(a.config),a._attachEventHandlers(),a.xScrollUI.create(a.width(),a.config.padding),a.xScrollUI.setPosition(),a.xScrollUI.addListener(a.getSvg()),a.yScrollUI.create(a.height(),a.config.padding),a.yScrollUI.setPosition(),a.yScrollUI.addListener(a.getSvg()),a.config.enableSearch&&a.searchUI.init(a),a.aiUI.init(a),a.orgScribeUI.init(a),a.powerPointPreviewUI.init(a),a.pdfPreviewUI.init(a),a.svgPreviewUI.init(a),a.pngPreviewUI.init(a),a.toolbarUI.init(a,a.config.toolbar),a.undoRedoUI.init(a),a.controlsUI.init(a);else{var O=a.getSvg(),k=O.parentNode;k.removeChild(O),k.insertAdjacentHTML(`afterbegin`,D),a._attachEventHandlers(),a.xScrollUI.addListener(a.getSvg()),a.yScrollUI.addListener(a.getSvg()),a.xScrollUI.setPosition(),a.yScrollUI.setPosition()}var A=!1,j=a.response.animations;if(j[0].length>0){a._hideBeforeAnimation(j[0].length);for(var f=0;f<j[0].length;f++)j[0][f]=a.getNodeElement(j[0][f]);e.animate(j[0],j[1],j[2],a.config.anim.duration,a.config.anim.func,function(){A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),a._showAfterAnimation(),!0)})}n===e.action.centerNode?e.animate(a.getSvg(),{viewbox:l},{viewbox:a.response.viewBox},a.config.anim.duration,a.config.anim.func,function(){a.ripple(r.options.rippleId),A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),a._showAfterAnimation(),!0)},function(){a.xScrollUI.setPosition(),a.yScrollUI.setPosition()}):l&&a.response&&(l[0]!=a.response.viewBox[0]||l[1]!=a.response.viewBox[1]||l[2]!=a.response.viewBox[2]||l[3]!=a.response.viewBox[3])&&(n===e.action.insert||n===e.action.expand||n===e.action.collapse||n===e.action.update||n===e.action.init)?e.animate(a.getSvg(),{viewbox:l},{viewbox:a.response.viewBox},a.config.anim.duration*2,a.config.anim.func,function(){a.xScrollUI.setPosition(),a.yScrollUI.setPosition(),A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),!0)}):j[0].length==0&&(A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),!0)),a._initialized||(a._initialized=!0,a.filterUI.update(),a._ai.setContext(),e.events.publish(`init`,[a])),!a._loaded&&t&&t.nodes&&Object.keys(t.nodes).length&&(a._loaded=!0)}},function(t){e.events.publish(`ready`,[a,t])})}},e.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`))},e.prototype.width=function(){return this.element.offsetWidth},e.prototype.height=function(){return this.element.offsetHeight},e.prototype.getViewBox=function(){var t=this.getSvg();return e._getViewBox(t)},e.prototype.setViewBox=function(e){this.getSvg().setAttribute(`viewBox`,e.toString())},e.prototype.getScale=function(t){return t||=this.getViewBox(),e.getScale(t,this.width(),this.height(),this.config.scaleInitial,this.config.scaleMax,this.config.scaleMin)},e.prototype.setScale=function(t){t>this.config.scaleMax&&(t=this.config.scaleMax),t<this.config.scaleMin&&(t=this.config.scaleMin);var n=this.getViewBox().slice(0),r=this.width(),i=this.height(),a=r/n[2],o=i/n[3],s=a>o?o:a,c=n,l=n[2],u=n[3];return n[2]/=t/s,n[3]/=t/s,n[0]=c[0]-(n[2]-l)/2,n[1]=c[1]-(n[3]-u)/2,this.setViewBox(n),e.events.publish(`redraw`,[this]),t},e.prototype.ripple=function(t,n,r){var i=this.getNode(t);if(i!=null){var a=this.getNodeElement(t);if(a!=null){var o=this.getScale(),s=i.w/2,c=i.h/2;if(n!==void 0&&r!==void 0){var l=a.getBoundingClientRect();s=n/o-l.left/o,c=r/o-l.top/o}var u=i.w,d=i.h,f=u-s>s?u-s:s,p=d-c>c?d-c:c;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=e.randomId();g.setAttribute(`id`,y);var b={ripple:e.t(i.templateName,i.min,this.getScale()).ripple,node:i};e.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:i.w),_.setAttribute(`height`,b.ripple.rect?b.ripple.rect.height:i.h),_.setAttribute(`rx`,b.ripple.radius),_.setAttribute(`ry`,b.ripple.radius),v.setAttribute(`clip-path`,`url(#`+y+`)`),v.setAttribute(`cx`,s),v.setAttribute(`cy`,c),v.setAttribute(`r`,0),v.setAttribute(`fill`,b.ripple.color),v.setAttribute(`class`,`boc-ripple`),g.appendChild(_),h.appendChild(g),h.appendChild(v),a.appendChild(h),e.animate(v,{r:0,opacity:1},{r:m,opacity:0},500,e.anim.outPow,function(){a.removeChild(h)})}}},e.prototype.centerOutNodes=function(t){if(this._centerInNodes){var n=JSON.parse(this._centerInNodes);this._centerInNodes=null;var r=this;this._centerInNodesTimeout=e.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:n},300,this.config.anim.func,function(){r.draw(e.action.update,null,function(){t&&t.call(r)})})}},e.prototype.centerInNodes=function(t,n){var r=this.getViewBox();this._centerInNodes||=JSON.stringify(r);var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1);for(var c of t)c.y<i&&(i=c.y),c.y+c.h>a&&(a=c.y+c.h),c.x<o&&(o=c.x),c.x+c.w>s&&(s=c.x+c.w);var l=s-o,u=a-i,d=l/(l+this.config.padding*2),f=u/(u+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/r[2],f=g/r[3],_=d>f?f:d,v=r,y=r[2],b=r[3];r[2]/=p/_,r[3]/=p/_,r[0]=v[0]-(r[2]-y)/(100/m[0]),r[1]=v[1]-(r[3]-b)/(100/m[1]),r[0]=o-(h/p-l)/2,r[1]=i-(g/p-u)/2;var x=this;this._centerInNodesTimeout&&=(clearTimeout(this._centerInNodesTimeout),null),this._centerInNodesTimeout=e.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:r},300,this.config.anim.func,function(){x.draw(e.action.update,null,function(){n&&n.call(x)})})},e.prototype.center=function(t,n,r){var i,a,o=t,s=!0,c=!0;n&&n.parentState!=null&&(i=n.parentState),n&&n.childrenState!=null&&(a=n.childrenState),n&&n.rippleId!=null&&(o=n.rippleId),n&&n.vertical!=null&&(s=n.vertical),n&&n.horizontal!=null&&(c=n.horizontal);var l={parentState:i,childrenState:a,rippleId:o,vertical:s,horizontal:c};this._draw(!1,e.action.centerNode,{id:t,options:l},r)},e.prototype.fit=function(t){this.config.scaleInitial=e.match.boundary,this._draw(!0,e.action.init,{method:`fit`},t)},e.prototype.fitIfOutside=function(t){this.config.scaleInitial=e.match.boundaryIfOutside,this._draw(!0,e.action.init,{method:`fit`},t)},e.prototype.toggleFullScreen=function(){var t=document.querySelector(`[`+e.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(),t&&(t.innerHTML=e.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(),t&&(t.innerHTML=e.toolbarUI.closeFullScreenIcon))},e.prototype.getNode=function(e){return this.nodes[e]},e.prototype.setLayout=function(t,n){n||=`base`,this._layoutConfigs[n].layout=t,n==`base`&&(this.config.layout=t),this._draw(!1,e.action.update)},e.prototype.setOrientation=function(t,n,r){var i=this;n||=`base`,this._layoutConfigs[n].orientation=t,n==`base`&&(this.config.orientation=t),this._draw(!1,e.action.update,void 0,function(){i.getScale(),e._moveToBoundaryArea(i.getSvg(),i.getViewBox(),i.response.boundary,function(){i._draw(!0,e.action.pan),r&&r()})})},e.prototype.search=function(t,n,r){return e.isNEU(n)&&(n=this.searchUI._searchFields),e.isNEU(r)&&(r=n),e._search.search(this.config.nodes,t,n,r,this.config.searchDisplayField,this.config.searchFieldsWeight,this.searchUI._searchFieldsAbbreviation)},e.prototype._hideBeforeAnimation=function(t){if(this._hideBeforeAnimationCompleted!=1&&!(t&&t<e.ANIM_THRESHOLD)){var n=this.element.getElementsByTagName(`text`);if(n.length>e.TEXT_THRESHOLD)for(var r=0;r<n.length;r++)n[r].style.display=`none`;var i=this.element.getElementsByTagName(`image`);if(i.length>e.IMAGES_THRESHOLD)for(var r=0;r<i.length;r++)i[r].style.display=`none`;var a=this.element.querySelectorAll(`[`+e.attr.link_id+`]`);if(a.length>e.LINKS_THRESHOLD)for(var r=0;r<a.length;r++)a[r].style.display=`none`;var o=this.element.querySelectorAll(`[`+e.attr.control_expcoll_id+`]`);if(o.length>e.BUTTONS_THRESHOLD)for(var r=0;r<o.length;r++)o[r].style.display=`none`;var s=this.element.querySelectorAll(`[`+e.attr.control_up_id+`]`);if(s.length>e.BUTTONS_THRESHOLD)for(var r=0;r<s.length;r++)s[r].style.display=`none`;this._hideBeforeAnimationCompleted=!0}},e.prototype._showAfterAnimation=function(){for(var t=this.element.getElementsByTagName(`text`),n=0;n<t.length;n++)t[n].style.display=``;for(var r=this.element.getElementsByTagName(`image`),n=0;n<r.length;n++)r[n].style.display=``;for(var i=this.element.querySelectorAll(`[`+e.attr.link_id+`]`),n=0;n<i.length;n++)i[n].style.display=``;for(var a=this.element.querySelectorAll(`[`+e.attr.control_expcoll_id+`]`),n=0;n<a.length;n++)a[n].style.display=``;for(var o=this.element.querySelectorAll(`[`+e.attr.control_up_id+`]`),n=0;n<o.length;n++)o[n].style.display=``;this._hideBeforeAnimationCompleted=!1},e.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},e.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},e.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``},e.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}},e.prototype.moveNodesToVisibleArea=function(t,n){for(var r=this,i=this.roots[0],a=this.getSvg(),o=this.getViewBox(),s=null,c=null,l=null,u=null,d=0;d<t.length;d++){var f=this.nodes[t[d]];f.x!=null&&f.y!=null&&((s===null||s<f.x+f.w)&&(s=f.x+f.w),(c===null||c<f.y+f.h)&&(c=f.y+f.h),(l===null||l>f.x)&&(l=f.x),(u===null||u>f.y)&&(u=f.y))}if(!(s==null||c==null||l==null||u==null)){var p=this.width(),m=this.height(),h=s-l+this.config.padding*2,g=c-u+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>=s-l)h=(s+l)/2-b/2;else switch(h=i.x-b/2+e.manager._getNodeWidth(i,this.config)/2,this.config.orientation){case e.orientation.right:case e.orientation.right_top:h=-(b/2-(l-s)/2),h<this.config.padding-b&&(h=this.config.padding-b);break;case e.orientation.left:case e.orientation.bottom_left:case e.orientation.top_left:case e.orientation.left_top:h=-(b/2-(s-l)/2),h>-this.config.padding&&(h=-this.config.padding);break}if(x-this.config.padding*2>=c-u)g=(c+u)/2-x/2;else switch(g=-(x/2-(c-u)/2),g>-this.config.padding&&(g=-this.config.padding),this.config.orientation){case e.orientation.bottom:case e.orientation.bottom_left:g=-(x/2-(u-c)/2),g<this.config.padding-x&&(g=this.config.padding-x);break;case e.orientation.left:case e.orientation.right:g=i.y-x/2+e.manager._getNodeWidth(i,this.config)/2;break}var S=[h,g,b,x];o[0]!==S[0]||o[1]!==S[1]?e.animate(a,{viewBox:o},{viewBox:S},this.config.anim.duration,this.config.anim.func,function(){r.draw(e.action.update,void 0,n)}):n&&n()}},e.prototype._nodeHasHiddenParent=function(t){return!t.parent&&!e.isNEU(t.pid)&&this.getNode(t.pid)},e.prototype.destroy=function(){this._initCalled=!1,this._resizeObserver.unobserve(this.element),e.events.removeForEventId(this._event_id),this.element.innerHTML=null},e.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)},e.prototype._canUpdateLink=e.prototype.canUpdateLink,e.prototype.updateNode=function(t,n,r,i){if(t){var a=this,o=this.get(t.id);if(r===!0&&e.events.publish(`update`,[this,o,t])===!1)return!1;this.update(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update();var s=this.getNode(t.id),c=s.pid;c??=s.stpid,this._draw(!1,e.action.update,{id:c},function(){i||a.ripple(t.id),n&&n()})}},e.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},e.prototype.removeNode=function(t,n,r){if(!this.canRemove(t))return!1;var i=this._getNewPidsAndStpidsForIds(t);return r===!0&&e.events.publish(`remove`,[this,t,i])===!1?!1:(this.remove(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update(),this._draw(!1,e.action.update,null,function(){n&&n()}),!0)},e.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},e.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}},e.prototype.addNode=function(t,n,r){var i=this;if(r===!0&&e.events.publish(`add`,[this,t])===!1)return!1;this.add(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update(),i._draw(!1,e.action.insert,{id:t.pid,insertedNodeId:t.id},function(){i.ripple(t.id),n&&n()})},e.prototype.add=function(t){if(t.id??console.error(`Call addNode without id`),this._putInUndoStack(),this.clearRedo(),this.config.movable&&!e.isNEU(t.pid)){var n=this._get(t.pid);n&&(n.movex!=null&&(t.movex=n.movex),n.movey!=null&&(t.movey=n.movey))}return this.config.nodes.push(t),this},e.prototype.replaceIds=function(t,n){this._replaceIds(t),this._draw(!1,e.action.update,void 0,n)},e.prototype._replaceIds=function(t){for(var n=function(e){for(var n=0;n<e.length;n++){var r=e[n];for(var i in t){var a=t[i];r.from==i&&(r.from=a),r.to==i&&(r.to=a)}}},r=0;r<this.config.nodes.length;r++){var i=this.config.nodes[r];for(var a in t){var o=t[a];i.id==a&&(i.id=o),i.pid==a&&(i.pid=o),i.stpid==a&&(i.stpid=o),i.ppid==a&&(i.ppid=o)}}if(Array.isArray(this.config.roots))for(var r=0;r<this.config.roots.length;r++)e.isNEU(t[this.config.roots[r]])||(this.config.roots[r]=t[this.config.roots[r]]);if(this.nodes){for(var s in this.nodes)if(!e.isNEU(t[s])){var o=t[s],c=this.nodes[s];c.id=o,this.nodes[o]=c}}if(this.manager.oldNodes){for(var s in this.manager.oldNodes)if(!e.isNEU(t[s])){var o=t[s],c=this.manager.oldNodes[s];c.id=o,this.manager.oldNodes[o]=c}}if(this.roots){for(var s in this.roots)if(!e.isNEU(t[s])){var o=t[s],c=this.roots[s];c.id=o,this.roots[o]=c}}n(this.config.clinks),n(this.config.slinks),n(this.config.groupDottedLines),n(this.config.dottedLines)},e.prototype._get=function(t){var n=this.__get(t);if(n)return n;if((this.config.groupDottedLines.length||this.config.dottedLines.length)&&!e.isNEU(t)&&typeof t==`string`&&(t.indexOf(`balkan_group_dotted_`)!=-1||t.indexOf(`balkan_dotted_`)!=-1)){t=t.replace(`balkan_group_dotted_`,``),t=t.replace(`balkan_dotted_`,``);var r=t.indexOf(`_balkan_id_`);if(t=t.substring(r+11),n=this.__get(t),n)return n}return null},e.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},e.prototype.get=function(e){var t=this._get(e);return t==null?null:JSON.parse(JSON.stringify(t))},e.prototype.canRemove=function(e){var t=this.getNode(e);return!(!t||t.hasPartners||t.hasAssistants)},e===void 0&&(e={}),e.animate=function(t,n,r,i,a,o,s){var c=10,l=1,u=1,d=i/c+1,f;document.getElementsByTagName(`g`),Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);function p(){for(var p=0;p<t.length;p++)for(var m in r[p]){var h=e._arrayContains([`top`,`left`,`right`,`bottom`,`width`,`height`],m.toLowerCase())?`px`:``;switch(m.toLowerCase()){case`d`:var g=a((u*c-c)/i)*(r[p][m][0]-n[p][m][0])+n[p][m][0],_=a((u*c-c)/i)*(r[p][m][1]-n[p][m][1])+n[p][m][1];t[p].setAttribute(`d`,t[p].getAttribute(`d`)+` L`+g+` `+_);break;case`r`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`r`,v);break;case`x1`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`x1`,v);break;case`x2`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`x2`,v);break;case`y1`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`y1`,v);break;case`y2`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`y2`,v);break;case`scrolltop`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].scrollTop=v;break;case`rotate3d`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].style.transform=`rotate3d(`+x.toString()+`deg)`}break;case`transform`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].hasAttribute(`transform`)?t[p].setAttribute(`transform`,`matrix(`+x.toString()+`)`):t[p].style.transform=`matrix(`+x.toString()+`)`}break;case`viewbox`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].setAttribute(`viewBox`,x.toString())}break;case`margin`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];for(var C=``,S=0;S<x.length;S++)C+=parseInt(x[S])+`px `;t[p]&&t[p].style&&(t[p].style[m]=C)}break;case`scrolly`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].scrollTo(0,v);break;default:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p]&&t[p].style&&(t[p].style[m]=v+h);break}}if(s){var v=a((u*c-c)/i);s(v)}u+=l,u>d+1&&(clearInterval(f),o&&o(t))}return f=setInterval(p,c),f},e.anim={},e.anim.inPow=function(e){return e<0?0:e>1?1:e**2},e.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)},e.anim.inOutPow=function(t){var n=2;if(t<0)return 0;if(t>1)return 1;if(t*=2,t<1)return e.anim.inPow(t,n)/2;var r=n%2==0?-1:1;return r/2*((t-2)**n+r*2)},e.anim.inSin=function(e){return e<0?0:e>1?1:-Math.cos(Math.PI/2*e)+1},e.anim.outSin=function(e){return e<0?0:e>1?1:Math.sin(Math.PI/2*e)},e.anim.inOutSin=function(e){return e<0?0:e>1?1:-.5*(Math.cos(Math.PI*e)-1)},e.anim.inExp=function(e){return e<0?0:e>1?1:2**(10*(e-1))},e.anim.outExp=function(e){return e<0?0:e>1?1:-(2**(-10*e))+1},e.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)},e.anim.inCirc=function(e){return e<0?0:e>1?1:-(Math.sqrt(1-e*e)-1)},e.anim.outCirc=function(e){return e<0?0:e>1?1:Math.sqrt(1-(e-1)*(e-1))},e.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)},e.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)},e.anim.inBack=function(e){return e<0?0:e>1?1:e*e*(2.70158*e-1.70158)},e.anim.outBack=function(e){return e<0?0:e>1?1:(e-1)*(e-1)*(2.70158*(e-1)+1.70158)+1},e.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)},e.anim.impulse=function(e){var t=2*e;return t*Math.exp(1-t)},e.anim.expPulse=function(e){return Math.exp(-2*e**2)},e===void 0&&(e={}),e.prototype._attachEventHandlers=function(t){if(this.config.interactive){var t=this.getSvg(),n=this;t.addEventListener(`touchstart`,function(e){e.preventDefault(),n._globalMouseDownHandler.apply(n,[this,e])},{passive:!1}),t.addEventListener(`mousedown`,function(e){n._globalMouseDownHandler.apply(n,[this,e])},{passive:!0}),t.addEventListener(`contextmenu`,function(e){n._globalContextHandler.apply(n,[this,e])},{passive:!1}),t.addEventListener(`dblclick`,function(e){n._globalDbClickHandler.apply(n,[this,e])},{passive:!0}),this.config.mouseScrool!=e.action.none&&t.addEventListener(`wheel`,function(e){n._mouseScrollHandler.apply(n,[this,e])},{passive:!1});var r=this.getMenuButton();r&&r.addEventListener(`click`,function(e){n._menuClickHandler.apply(n,[this,e])})}},e===void 0&&(e={}),e.VERSION=`9.2.42`,e.orientation={},e.orientation.top=0,e.orientation.bottom=1,e.orientation.right=2,e.orientation.left=3,e.orientation.top_left=4,e.orientation.bottom_left=5,e.orientation.right_top=6,e.orientation.left_top=7,e.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`},e.align={},e.align.center=e.CENTER=8,e.align.orientation=e.ORIENTATION=9,e.attr={},e.attr.l=`data-l`,e.attr.id=`data-id`,e.attr.sl=`data-sl`,e.attr.lbl=`data-lbl`,e.attr.val=`data-val`,e.attr.tlbr=`data-tlbr`,e.attr.item=`data-item`,e.attr.layout=`data-layout`,e.attr.node_id=`data-n-id`,e.attr.link_id=`data-l-id`,e.attr.field_name=`data-f-name`,e.attr.c_link_to=`data-c-l-to`,e.attr.c_link_from=`data-c-l-from`,e.attr.s_link_to=`data-s-l-to`,e.attr.s_link_from=`data-s-l-from`,e.attr.control_add=`data-ctrl-add`,e.attr.control_expcoll_id=`data-ctrl-ec-id`,e.attr.control_up_id=`data-ctrl-up-id`,e.attr.control_export_menu=`data-ctrl-menu`,e.attr.control_node_menu_id=`data-ctrl-n-menu-id`,e.attr.control_node_circle_menu_id=`data-ctrl-n-c-menu-id`,e.attr.control_node_circle_menu_name=`data-ctrl-n-c-menu-name`,e.attr.control_node_circle_menu_wrraper_id=`data-ctrl-n-c-menu-wrapper-id`,e.attr.width=`data-width`,e.attr.text_overflow=`data-text-overflow`,e.ID=`id`,e.PID=`pid`,e.STPID=`stpid`,e.TAGS=`tags`,e.NODES=`nodes`,e.ELASTIC=`elastic`,e.ASSISTANT=`Assistant`,e.action={},e.action.expand=0,e.action.collapse=1,e.action.maximize=101,e.action.minimize=102,e.action.expandCollapse=501,e.action.edit=1,e.action.zoom=2,e.action.ctrlZoom=22,e.action.scroll=41,e.action.xScroll=3,e.action.yScroll=4,e.action.none=5,e.action.init=6,e.action.update=7,e.action.move=70,e.action.pan=8,e.action.centerNode=9,e.action.resize=10,e.action.insert=11,e.action.insertfirst=12,e.action.details=13,e.action.exporting=14,e.none=400001,e.scroll={},e.scroll.visible=!0,e.scroll.smooth=12,e.scroll.speed=120,e.scroll.safari={smooth:12,speed:250},e.match={},e.match.height=100001,e.match.width=100002,e.match.boundary=100003,e.match.boundaryIfOutside=100004,e.match.none=1,e.movable={},e.movable.node=`node`,e.movable.tree=`tree`,e.movable.detachTree=`detachTree`,e.layout={},e.layout.normal=e.normal=0,e.layout.mixed=e.mixed=1,e.layout.tree=e.tree=2,e.layout.treeLeftOffset=e.treeLeftOffset=3,e.layout.treeRightOffset=e.treeRightOffset=4,e.layout.treeLeft=5,e.layout.treeRight=6,e.layout.grid=-1,e.layout.treeList=-2,e.nodeOpenTag=`<g `+e.attr.node_id+`="{id}" style="opacity: {opacity}" transform="matrix(1,0,0,1,{x},{y})" class="{class}" `+e.attr.sl+`="{sl}" `+e.attr.l+`="{level}" {lcn}>`,e.linkOpenTag=`<g `+e.attr.link_id+`="[{id}][{child-id}]" class="{class}">`,e.expcollOpenTag=`<g `+e.attr.control_expcoll_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,e.upOpenTag=`<g `+e.attr.control_up_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,e.linkFieldsOpenTag=`<g transform="matrix(1,0,0,1,{x},{y}) rotate({rotate})">`,e.grCloseTag=`</g>`,e.A5={width:420,height:595},e.A4={width:595,height:842},e.A3={width:842,height:1191},e.A2={width:1191,height:1684},e.A1={width:1684,height:2384},e.Letter={width:612,height:791},e.Legal={width:612,height:1009},e.Legal={width:612,height:1009},e.Widescreen={width:720,height:1280},e.Standard={width:720,height:960},e.COLLAPSE_PARENT_NEIGHBORS=1,e.COLLAPSE_SUB_CHILDRENS=2,e.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED=3,e.TEXT_THRESHOLD=4e3,e.IMAGES_THRESHOLD=1e3,e.LINKS_THRESHOLD=2e3,e.BUTTONS_THRESHOLD=700,e.ANIM_THRESHOLD=500,e.IT_IS_LONELY_HERE=`<g transform="translate(-100, 0)" style="cursor:pointer;" `+e.attr.control_add+`="control-add"><text fill="#039be5">{link}</text></g>`,e.RES={},e.IT_IS_LONELY_HERE_LINK=e.RES.IT_IS_LONELY_HERE_LINK=`It's lonely here, add your first node`,e.FIRE_DRAG_NOT_CLICK_IF_MOVE=3,e.STRING_TAGS=!1,e.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>`,e.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>`,e.SEARCH_PLACEHOLDER=`Search... type ? to get help.`,e.SEARCH_HELP_SYMBOL=`?`,e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE=!1,e.SEARCH_RESULT_LIMIT=10,e.IMPORT_MESSAGE=`Choose the columns (fields) in your data file that contain the required information.`,e.FIXED_POSITION_ON_CLICK=!1,e.RENDER_LINKS_BEFORE_NODES=!1,e.RENDER_CLINKS_BEFORE_NODES=!1,e.MIXED_LAYOUT_ALL_NODES=!1,e.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN=!1,e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN=1,e.LINK_ROUNDED_CORNERS=5,e.MOVE_STEP=5,e.CLINK_CURVE=1,e.MAX_DEPTH=200,e.SCALE_FACTOR=1.44,e.LAZY_LOADING_FACTOR=`auto`,e.LAZY_LOADING=!0,e.ARRAY_FIELDS=[`tags`],e.CSV_DELIMITER=`,`,e.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>`,e.ESCAPE_HTML=!1,e.VERTICAL_CHILDREN_ASSISTANT=!1,e.EXPORT_PAGES_CUT_NODES=!1,e.RESET_MOVABLE_ONEXPANDCOLLAPSE=!1,e.FILTER_ALPHABETICALLY=!0,e.SERVER_PREFIX=`.azurewebsites.net/api/you-see-this-request-because-it-is-trial-version-of-orgchartjs`,e.FUNC_URL_NAME=`func-url-orgchartjs`,e.MINIMUM_SYMBOLS_IN_SEARCH_INPUT=1,e.AI_SYSTEM_MESSAGES=[],e.ORGSCRIBE_OFFSET=` `,e.TREELIST_WHEEL_STEP=`auto`,e.TREELIST_SCROLLBAR_WIDTH=10,e.CONVERT_IMAGES_TO_BASE64_BEFORE_EXPORT=!1,e.REQUEST_CUSTOM_HEADERS={},e.SLINK_GAP=7,e._intersects=function(t,n,r){var i=t.x-r.siblingSeparation/4,a=t.y,o=t.x+t.w+r.siblingSeparation/4,s=t.y;switch(r.orientation){case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:i=t.x,a=t.y-r.siblingSeparation/4,o=t.x,s=t.y+t.h+r.siblingSeparation/4;break}var c=n.p,l=n.q,u=n.r,d=n.s,f=(o-i)*(d-l)-(u-c)*(s-a),p,m;return f===0?!1:(m=((d-l)*(u-i)+(c-u)*(d-a))/f,p=((a-s)*(u-i)+(o-i)*(d-a))/f,0<m&&m<1&&0<p&&p<1)},e._addPoint=function(t,n,r,i,a){switch(r.orientation){case e.orientation.top:case e.orientation.top_left:return e._addPointTop(t,n,r,i,a);case e.orientation.bottom:case e.orientation.bottom_left:return e._addPointBottom(t,n,r,i,a);case e.orientation.left:case e.orientation.left_top:return e._addPointLeft(t,n,r,i,a);case e.orientation.right:case e.orientation.right_top:return e._addPointRight(t,n,r,i,a)}},e._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},e._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},e._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},e._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},e._addConnectorLines=function(t,n){e._addConnectorLine(t,{x1:n.xa,y1:n.ya,x2:n.xb,y2:n.yb}),e._addConnectorLine(t,{x1:n.xb,y1:n.yb,x2:n.xc,y2:n.yc}),e._addConnectorLine(t,{x1:n.xc,y1:n.yc,x2:n.xd,y2:n.yd})},e._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})}},e._addLineToPath=function(t,n,r){return e._avoidOverlapping(n,r),t.push([r.x1,r.y1]),t.push([r.x2,r.y2]),e._addConnectorLine(n,r),r},e._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)}},e._slinkAvoidOverlaping=function(t,n,r,i){for(var a=1;a<n.length;a++){var o=n[a-1],s=n[a];if(o[0]==s[0]){for(var c=t.x[s[0]];c;){var l=!0;for(var u of c)if(u.y1<=o[1]&&u.y2>=o[1]||u.y1<=s[1]&&u.y2>=s[1]){i==e.orientation.top||i==e.orientation.top_left?r==`left`?s[0]-=e.SLINK_GAP:r==`right`&&(s[0]+=e.SLINK_GAP):(i==e.orientation.bottom||i==e.orientation.bottom_left)&&(r==`right`?s[0]+=e.SLINK_GAP:r==`left`&&(s[0]-=e.SLINK_GAP)),l=!1;break}if(l)break;c=t.x[s[0]]}o[0]=s[0]}var d=!0;if(o[1]==s[1]&&o[0]>=s[0]&&(d=!1),d&&o[1]==s[1]){for(var c=t.y[s[1]];c;){var l=!0;for(var u of c)if(u.x1<=o[0]&&u.x2>=o[0]||u.x1<=s[0]&&u.x2>=s[0]){o[0]>=s[0]||(i==e.orientation.top||i==e.orientation.top_left?s[1]-=e.SLINK_GAP:(i==e.orientation.bottom||i==e.orientation.bottom_left)&&(s[1]+=e.SLINK_GAP),l=!1);break}if(l)break;c=t.y[s[1]]}o[1]=s[1]}d&&e._addConnectorLine(t,{x1:o[0],y1:o[1],x2:s[0],y2:s[1]})}},e._slinkAvoidOverlapingSecond=function(t,n,r){for(var i=1;i<n.length;i++){var a=n[i-1],o=n[i],s=!1;if(a[1]==o[1]){for(var c=t.y[o[1]];c;){var l=!0;for(var u of c)if(u.x1<=a[0]&&u.x2>=a[0]||u.x1<=o[0]&&u.x2>=o[0]){a[0]>=o[0]?(r==e.orientation.top||r==e.orientation.top_left?o[1]-=e.SLINK_GAP:(r==e.orientation.bottom||r==e.orientation.bottom_left)&&(o[1]+=e.SLINK_GAP),l=!1):s=!0;break}if(l)break;c=t.y[o[1]]}a[1]=o[1]}s||e._addConnectorLine(t,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},e._slinkAvoidOverlaping2=function(t,n,r,i){for(var a=1;a<n.length;a++){var o=n[a-1],s=n[a];if(o[1]==s[1]){for(var c=t.y[s[1]];c;){var l=!0;for(var u of c)if(u.x1<=o[0]&&u.x2>=o[0]||u.x1<=s[0]&&u.x2>=s[0]){i==e.orientation.left||i==e.orientation.left_top?r==`top`?s[1]-=e.SLINK_GAP:r==`bottom`&&(s[1]+=e.SLINK_GAP):(i==e.orientation.right||i==e.orientation.right_top)&&(r==`bottom`?s[1]+=e.SLINK_GAP:r==`top`&&(s[1]-=e.SLINK_GAP)),l=!1;break}if(l)break;c=t.y[s[1]]}o[1]=s[1]}var d=!0;if(o[0]==s[0]&&o[1]>=s[1]&&(d=!1),d&&o[0]==s[0]){for(var c=t.x[s[0]];c;){var l=!0;for(var u of c)if(u.y1<=o[1]&&u.y2>=o[1]||u.y1<=s[1]&&u.y2>=s[1]){o[1]>=s[1]||(i==e.orientation.left||i==e.orientation.left_top?s[0]-=e.SLINK_GAP:(i==e.orientation.right||i==e.orientation.right_top)&&(s[0]+=e.SLINK_GAP),l=!1);break}if(l)break;c=t.x[s[0]]}o[0]=s[0]}d&&e._addConnectorLine(t,{x1:o[0],y1:o[1],x2:s[0],y2:s[1]})}},e._slinkAvoidOverlapingSecond2=function(t,n,r){for(var i=1;i<n.length;i++){var a=n[i-1],o=n[i],s=!1;if(a[0]==o[0]){for(var c=t.x[o[0]];c;){var l=!0;for(var u of c)if(u.y1<=a[1]&&u.y2>=a[1]||u.y1<=o[1]&&u.y2>=o[1]){a[1]>=o[1]?(r==e.orientation.left||r==e.orientation.left_top?o[0]-=e.SLINK_GAP:(r==e.orientation.right||r==e.orientation.right_top)&&(o[0]+=e.SLINK_GAP),l=!1):s=!0;break}if(l)break;c=t.x[o[0]]}a[0]=o[0]}s||e._addConnectorLine(t,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},e.prototype.getSvg=function(){return this.element.querySelector(`svg`)},e.prototype.getPointerElement=function(){return this.element.querySelector(`g[data-pointer]`)},e.prototype.getNodeElement=function(t){return this.element.querySelector(`[`+e.attr.node_id+`='`+t+`']`)},e.prototype.getMenuButton=function(){return this.element.querySelector(`[`+e.attr.control_export_menu+`]`)},e.notifierUI=function(){},e.notifierUI.prototype.init=function(e){this.obj=e},e.notifierUI.prototype.show=function(t,n){if(t==null)return!1;t==1&&(t=e.MAX_NODES_MESS,n=`#FFCA28`),t==2&&(t=e.OFFLINE_MESS,n=`#FFCA28`);var r=document.createElement(`div`);r.innerHTML=t,Object.assign(r.style,{position:`absolute`,"background-color":n,color:`#ffffff`,padding:`15px`,"border-radius":`40px`,opacity:0,overflow:`hidden`,"white-space":`nowrap`,"text-align":`center`}),this.obj.element.appendChild(r);var i=this.obj.width()/2-r.offsetWidth/2,a=this.obj.height()/2-r.offsetHeight/2;r.style.left=i+`px`,r.style.top=a+`px`;var o=r.offsetWidth;return r.style.width=`20px`,e.animate(r,{opacity:0,width:10},{opacity:1,width:o},this.obj.config.anim.duration,this.obj.config.anim.func),!0},e===void 0&&(e={}),e.icon={},e.icon.png_export=e.icon.png_preview=e.icon.pngpreview=e.icon.png=function(e,t,n,r,i){return r??=0,i??=0,`<svg width="${e}" height="${t}" viewBox="0 0 550.801 550.801" x="${r}" y="${i}">
24
+ </g>`}}for(var f=0;f<t.visibleNodeIds.length;f++){var p=t.nodes[t.visibleNodeIds[f]],m=a._get(p.id);p.isTreeListItem||(e.RENDER_LINKS_BEFORE_NODES||(s+=a.ui.link(p,a,c,t.bordersByRootIdAndLevel,t.nodes,n)),s+=a.ui.expandCollapseBtn(a,p,m,a.config,a._layoutConfigs,n,c))}var o={content:s,res:t};if(e.events.publish(`render`,[a,o]),s=o.content,t=o.res,s+=a.ui.lonely(a.config),n===e.action.exporting){var w=t.boundary,T=w.maxX-w.minX,E=w.maxY-w.minY,D=a.ui.svg(T,E,[w.minX,w.minY,T,E],a.config,s,c);i.call(a,D,t);return}(n===e.action.centernode||n===e.action.insert||n===e.action.expand||n===e.action.collapse||n===e.action.update)&&(u=l),n===e.action.init&&l!=null&&(u=l),n===e.action.centerNode&&l!=null&&(u=l),a.response=t,a._lastSize={width:a.width(),height:a.height()};var D=a.ui.svg(`100%`,`100%`,u,a.config,s);if(!a._initialized)a.element.innerHTML=a.ui.css()+D+a.ui.menuButton(a.config)+a.ui.aiButton(a.config),a._attachEventHandlers(),a.xScrollUI.create(a.width(),a.config.padding),a.xScrollUI.setPosition(),a.xScrollUI.addListener(a.getSvg()),a.yScrollUI.create(a.height(),a.config.padding),a.yScrollUI.setPosition(),a.yScrollUI.addListener(a.getSvg()),a.config.enableSearch&&a.searchUI.init(a),a.aiUI.init(a),a.orgScribeUI.init(a),a.powerPointPreviewUI.init(a),a.pdfPreviewUI.init(a),a.svgPreviewUI.init(a),a.pngPreviewUI.init(a),a.toolbarUI.init(a,a.config.toolbar),a.undoRedoUI.init(a),a.controlsUI.init(a);else{var O=a.getSvg(),k=O.parentNode;k.removeChild(O),k.insertAdjacentHTML(`afterbegin`,D),a._attachEventHandlers(),a.xScrollUI.addListener(a.getSvg()),a.yScrollUI.addListener(a.getSvg()),a.xScrollUI.setPosition(),a.yScrollUI.setPosition()}var A=!1,j=a.response.animations;if(j[0].length>0){a._hideBeforeAnimation(j[0].length);for(var f=0;f<j[0].length;f++)j[0][f]=a.getNodeElement(j[0][f]);e.animate(j[0],j[1],j[2],a.config.anim.duration,a.config.anim.func,function(){A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),a._showAfterAnimation(),!0)})}n===e.action.centerNode?e.animate(a.getSvg(),{viewbox:l},{viewbox:a.response.viewBox},a.config.anim.duration,a.config.anim.func,function(){a.ripple(r.options.rippleId),A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),a._showAfterAnimation(),!0)},function(){a.xScrollUI.setPosition(),a.yScrollUI.setPosition()}):l&&a.response&&(l[0]!=a.response.viewBox[0]||l[1]!=a.response.viewBox[1]||l[2]!=a.response.viewBox[2]||l[3]!=a.response.viewBox[3])&&(n===e.action.insert||n===e.action.expand||n===e.action.collapse||n===e.action.update||n===e.action.init)?e.animate(a.getSvg(),{viewbox:l},{viewbox:a.response.viewBox},a.config.anim.duration*2,a.config.anim.func,function(){a.xScrollUI.setPosition(),a.yScrollUI.setPosition(),A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),!0)}):j[0].length==0&&(A||=(i&&i.call(a),e.events.publish(`redraw`,[a]),!0)),a._initialized||(a._initialized=!0,a.filterUI.update(),a._ai.setContext(),e.events.publish(`init`,[a])),!a._loaded&&t&&t.nodes&&Object.keys(t.nodes).length&&(a._loaded=!0)}},function(t){e.events.publish(`ready`,[a,t])})}},e.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`))},e.prototype.width=function(){return this.element.offsetWidth},e.prototype.height=function(){return this.element.offsetHeight},e.prototype.getViewBox=function(){var t=this.getSvg();return e._getViewBox(t)},e.prototype.setViewBox=function(e){this.getSvg().setAttribute(`viewBox`,e.toString())},e.prototype.getScale=function(t){return t||=this.getViewBox(),e.getScale(t,this.width(),this.height(),this.config.scaleInitial,this.config.scaleMax,this.config.scaleMin)},e.prototype.setScale=function(t){t>this.config.scaleMax&&(t=this.config.scaleMax),t<this.config.scaleMin&&(t=this.config.scaleMin);var n=this.getViewBox().slice(0),r=this.width(),i=this.height(),a=r/n[2],o=i/n[3],s=a>o?o:a,c=n,l=n[2],u=n[3];return n[2]/=t/s,n[3]/=t/s,n[0]=c[0]-(n[2]-l)/2,n[1]=c[1]-(n[3]-u)/2,this.setViewBox(n),e.events.publish(`redraw`,[this]),t},e.prototype.ripple=function(t,n,r){var i=this.getNode(t);if(i!=null){var a=this.getNodeElement(t);if(a!=null){var o=this.getScale(),s=i.w/2,c=i.h/2;if(n!==void 0&&r!==void 0){var l=a.getBoundingClientRect();s=n/o-l.left/o,c=r/o-l.top/o}var u=i.w,d=i.h,f=u-s>s?u-s:s,p=d-c>c?d-c:c;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=e.randomId();g.setAttribute(`id`,y);var b={ripple:e.t(i.templateName,i.min,this.getScale()).ripple,node:i};e.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:i.w),_.setAttribute(`height`,b.ripple.rect?b.ripple.rect.height:i.h),_.setAttribute(`rx`,b.ripple.radius),_.setAttribute(`ry`,b.ripple.radius),v.setAttribute(`clip-path`,`url(#`+y+`)`),v.setAttribute(`cx`,s),v.setAttribute(`cy`,c),v.setAttribute(`r`,0),v.setAttribute(`fill`,b.ripple.color),v.setAttribute(`class`,`boc-ripple`),g.appendChild(_),h.appendChild(g),h.appendChild(v),a.appendChild(h),e.animate(v,{r:0,opacity:1},{r:m,opacity:0},500,e.anim.outPow,function(){a.removeChild(h)})}}},e.prototype.centerOutNodes=function(t){if(this._centerInNodes){var n=JSON.parse(this._centerInNodes);this._centerInNodes=null;var r=this;this._centerInNodesTimeout=e.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:n},300,this.config.anim.func,function(){r.draw(e.action.update,null,function(){t&&t.call(r)})})}},e.prototype.centerInNodes=function(t,n){var r=this.getViewBox();this._centerInNodes||=JSON.stringify(r);var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1);for(var c of t)c.y<i&&(i=c.y),c.y+c.h>a&&(a=c.y+c.h),c.x<o&&(o=c.x),c.x+c.w>s&&(s=c.x+c.w);var l=s-o,u=a-i,d=l/(l+this.config.padding*2),f=u/(u+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/r[2],f=g/r[3],_=d>f?f:d,v=r,y=r[2],b=r[3];r[2]/=p/_,r[3]/=p/_,r[0]=v[0]-(r[2]-y)/(100/m[0]),r[1]=v[1]-(r[3]-b)/(100/m[1]),r[0]=o-(h/p-l)/2,r[1]=i-(g/p-u)/2;var x=this;this._centerInNodesTimeout&&=(clearTimeout(this._centerInNodesTimeout),null),this._centerInNodesTimeout=e.animate(this.getSvg(),{viewBox:this.getViewBox()},{viewBox:r},300,this.config.anim.func,function(){x.draw(e.action.update,null,function(){n&&n.call(x)})})},e.prototype.center=function(t,n,r){var i,a,o=t,s=!0,c=!0;n&&n.parentState!=null&&(i=n.parentState),n&&n.childrenState!=null&&(a=n.childrenState),n&&n.rippleId!=null&&(o=n.rippleId),n&&n.vertical!=null&&(s=n.vertical),n&&n.horizontal!=null&&(c=n.horizontal);var l={parentState:i,childrenState:a,rippleId:o,vertical:s,horizontal:c};this._draw(!1,e.action.centerNode,{id:t,options:l},r)},e.prototype.fit=function(t){this.config.scaleInitial=e.match.boundary,this._draw(!0,e.action.init,{method:`fit`},t)},e.prototype.fitIfOutside=function(t){this.config.scaleInitial=e.match.boundaryIfOutside,this._draw(!0,e.action.init,{method:`fit`},t)},e.prototype.toggleFullScreen=function(){var t=document.querySelector(`[`+e.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(),t&&(t.innerHTML=e.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(),t&&(t.innerHTML=e.toolbarUI.closeFullScreenIcon))},e.prototype.getNode=function(e){return this.nodes[e]},e.prototype.setLayout=function(t,n){n||=`base`,this._layoutConfigs[n].layout=t,n==`base`&&(this.config.layout=t),this._draw(!1,e.action.update)},e.prototype.setOrientation=function(t,n,r){var i=this;n||=`base`,this._layoutConfigs[n].orientation=t,n==`base`&&(this.config.orientation=t),this._draw(!1,e.action.update,void 0,function(){i.getScale(),e._moveToBoundaryArea(i.getSvg(),i.getViewBox(),i.response.boundary,function(){i._draw(!0,e.action.pan),r&&r()})})},e.prototype.search=function(t,n,r){return e.isNEU(n)&&(n=this.searchUI._searchFields),e.isNEU(r)&&(r=n),e._search.search(this.config.nodes,t,n,r,this.config.searchDisplayField,this.config.searchFieldsWeight,this.searchUI._searchFieldsAbbreviation)},e.prototype._hideBeforeAnimation=function(t){if(this._hideBeforeAnimationCompleted!=1&&!(t&&t<e.ANIM_THRESHOLD)){var n=this.element.getElementsByTagName(`text`);if(n.length>e.TEXT_THRESHOLD)for(var r=0;r<n.length;r++)n[r].style.display=`none`;var i=this.element.getElementsByTagName(`image`);if(i.length>e.IMAGES_THRESHOLD)for(var r=0;r<i.length;r++)i[r].style.display=`none`;var a=this.element.querySelectorAll(`[`+e.attr.link_id+`]`);if(a.length>e.LINKS_THRESHOLD)for(var r=0;r<a.length;r++)a[r].style.display=`none`;var o=this.element.querySelectorAll(`[`+e.attr.control_expcoll_id+`]`);if(o.length>e.BUTTONS_THRESHOLD)for(var r=0;r<o.length;r++)o[r].style.display=`none`;var s=this.element.querySelectorAll(`[`+e.attr.control_up_id+`]`);if(s.length>e.BUTTONS_THRESHOLD)for(var r=0;r<s.length;r++)s[r].style.display=`none`;this._hideBeforeAnimationCompleted=!0}},e.prototype._showAfterAnimation=function(){for(var t=this.element.getElementsByTagName(`text`),n=0;n<t.length;n++)t[n].style.display=``;for(var r=this.element.getElementsByTagName(`image`),n=0;n<r.length;n++)r[n].style.display=``;for(var i=this.element.querySelectorAll(`[`+e.attr.link_id+`]`),n=0;n<i.length;n++)i[n].style.display=``;for(var a=this.element.querySelectorAll(`[`+e.attr.control_expcoll_id+`]`),n=0;n<a.length;n++)a[n].style.display=``;for(var o=this.element.querySelectorAll(`[`+e.attr.control_up_id+`]`),n=0;n<o.length;n++)o[n].style.display=``;this._hideBeforeAnimationCompleted=!1},e.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},e.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},e.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``},e.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}},e.prototype.moveNodesToVisibleArea=function(t,n){for(var r=this,i=this.roots[0],a=this.getSvg(),o=this.getViewBox(),s=null,c=null,l=null,u=null,d=0;d<t.length;d++){var f=this.nodes[t[d]];f.x!=null&&f.y!=null&&((s===null||s<f.x+f.w)&&(s=f.x+f.w),(c===null||c<f.y+f.h)&&(c=f.y+f.h),(l===null||l>f.x)&&(l=f.x),(u===null||u>f.y)&&(u=f.y))}if(!(s==null||c==null||l==null||u==null)){var p=this.width(),m=this.height(),h=s-l+this.config.padding*2,g=c-u+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>=s-l)h=(s+l)/2-b/2;else switch(h=i.x-b/2+e.manager._getNodeWidth(i,this.config)/2,this.config.orientation){case e.orientation.right:case e.orientation.right_top:h=-(b/2-(l-s)/2),h<this.config.padding-b&&(h=this.config.padding-b);break;case e.orientation.left:case e.orientation.bottom_left:case e.orientation.top_left:case e.orientation.left_top:h=-(b/2-(s-l)/2),h>-this.config.padding&&(h=-this.config.padding);break}if(x-this.config.padding*2>=c-u)g=(c+u)/2-x/2;else switch(g=-(x/2-(c-u)/2),g>-this.config.padding&&(g=-this.config.padding),this.config.orientation){case e.orientation.bottom:case e.orientation.bottom_left:g=-(x/2-(u-c)/2),g<this.config.padding-x&&(g=this.config.padding-x);break;case e.orientation.left:case e.orientation.right:g=i.y-x/2+e.manager._getNodeWidth(i,this.config)/2;break}var S=[h,g,b,x];o[0]!==S[0]||o[1]!==S[1]?e.animate(a,{viewBox:o},{viewBox:S},this.config.anim.duration,this.config.anim.func,function(){r.draw(e.action.update,void 0,n)}):n&&n()}},e.prototype._nodeHasHiddenParent=function(t){return!t.parent&&!e.isNEU(t.pid)&&this.getNode(t.pid)},e.prototype.destroy=function(){this._initCalled=!1,this._resizeObserver.unobserve(this.element),e.events.removeForEventId(this._event_id),this.element.innerHTML=null},e.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)},e.prototype._canUpdateLink=e.prototype.canUpdateLink,e.prototype.updateNode=function(t,n,r,i){if(t){var a=this,o=this.get(t.id);if(r===!0&&e.events.publish(`update`,[this,o,t])===!1)return!1;this.update(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update();var s=this.getNode(t.id),c=s.pid;c??=s.stpid,this._draw(!1,e.action.update,{id:c},function(){i||a.ripple(t.id),n&&n()})}},e.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},e.prototype.removeNode=function(t,n,r){if(!this.canRemove(t))return!1;var i=this._getNewPidsAndStpidsForIds(t);return r===!0&&e.events.publish(`remove`,[this,t,i])===!1?!1:(this.remove(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update(),this._draw(!1,e.action.update,null,function(){n&&n()}),!0)},e.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},e.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}},e.prototype.addNode=function(t,n,r){var i=this;if(r===!0&&e.events.publish(`add`,[this,t])===!1)return!1;this.add(t),this._ai.setContext(),e.events.publish(`updated`,[this]),this.filterUI.update(),i._draw(!1,e.action.insert,{id:t.pid,insertedNodeId:t.id},function(){i.ripple(t.id),n&&n()})},e.prototype.add=function(t){if(t.id??console.error(`Call addNode without id`),this._putInUndoStack(),this.clearRedo(),this.config.movable&&!e.isNEU(t.pid)){var n=this._get(t.pid);n&&(n.movex!=null&&(t.movex=n.movex),n.movey!=null&&(t.movey=n.movey))}return this.config.nodes.push(t),this},e.prototype.replaceIds=function(t,n){this._replaceIds(t),this._draw(!1,e.action.update,void 0,n)},e.prototype._replaceIds=function(t){for(var n=function(e){for(var n=0;n<e.length;n++){var r=e[n];for(var i in t){var a=t[i];r.from==i&&(r.from=a),r.to==i&&(r.to=a)}}},r=0;r<this.config.nodes.length;r++){var i=this.config.nodes[r];for(var a in t){var o=t[a];i.id==a&&(i.id=o),i.pid==a&&(i.pid=o),i.stpid==a&&(i.stpid=o),i.ppid==a&&(i.ppid=o)}}if(Array.isArray(this.config.roots))for(var r=0;r<this.config.roots.length;r++)e.isNEU(t[this.config.roots[r]])||(this.config.roots[r]=t[this.config.roots[r]]);if(this.nodes){for(var s in this.nodes)if(!e.isNEU(t[s])){var o=t[s],c=this.nodes[s];c.id=o,this.nodes[o]=c}}if(this.manager.oldNodes){for(var s in this.manager.oldNodes)if(!e.isNEU(t[s])){var o=t[s],c=this.manager.oldNodes[s];c.id=o,this.manager.oldNodes[o]=c}}if(this.roots){for(var s in this.roots)if(!e.isNEU(t[s])){var o=t[s],c=this.roots[s];c.id=o,this.roots[o]=c}}n(this.config.clinks),n(this.config.slinks),n(this.config.groupDottedLines),n(this.config.dottedLines)},e.prototype._get=function(t){var n=this.__get(t);if(n)return n;if((this.config.groupDottedLines.length||this.config.dottedLines.length)&&!e.isNEU(t)&&typeof t==`string`&&(t.indexOf(`balkan_group_dotted_`)!=-1||t.indexOf(`balkan_dotted_`)!=-1)){t=t.replace(`balkan_group_dotted_`,``),t=t.replace(`balkan_dotted_`,``);var r=t.indexOf(`_balkan_id_`);if(t=t.substring(r+11),n=this.__get(t),n)return n}return null},e.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},e.prototype.get=function(e){var t=this._get(e);return t==null?null:JSON.parse(JSON.stringify(t))},e.prototype.canRemove=function(e){var t=this.getNode(e);return!(!t||t.hasPartners||t.hasAssistants)},e===void 0&&(e={}),e.animate=function(t,n,r,i,a,o,s){var c=10,l=1,u=1,d=i/c+1,f;document.getElementsByTagName(`g`),Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);function p(){for(var p=0;p<t.length;p++)for(var m in r[p]){var h=e._arrayContains([`top`,`left`,`right`,`bottom`,`width`,`height`],m.toLowerCase())?`px`:``;switch(m.toLowerCase()){case`d`:var g=a((u*c-c)/i)*(r[p][m][0]-n[p][m][0])+n[p][m][0],_=a((u*c-c)/i)*(r[p][m][1]-n[p][m][1])+n[p][m][1];t[p].setAttribute(`d`,t[p].getAttribute(`d`)+` L`+g+` `+_);break;case`r`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`r`,v);break;case`x1`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`x1`,v);break;case`x2`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`x2`,v);break;case`y1`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`y1`,v);break;case`y2`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].setAttribute(`y2`,v);break;case`scrolltop`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].scrollTop=v;break;case`rotate3d`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].style.transform=`rotate3d(`+x.toString()+`deg)`}break;case`transform`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].hasAttribute(`transform`)?t[p].setAttribute(`transform`,`matrix(`+x.toString()+`)`):t[p].style.transform=`matrix(`+x.toString()+`)`}break;case`viewbox`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];t[p].setAttribute(`viewBox`,x.toString())}break;case`margin`:if(r[p][m]){var y=n[p][m],b=r[p][m],x=[0,0,0,0];for(var S in y)x[S]=a((u*c-c)/i)*(b[S]-y[S])+y[S];for(var C=``,S=0;S<x.length;S++)C+=parseInt(x[S])+`px `;t[p]&&t[p].style&&(t[p].style[m]=C)}break;case`scrolly`:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p].scrollTo(0,v);break;default:var v=a((u*c-c)/i)*(r[p][m]-n[p][m])+n[p][m];t[p]&&t[p].style&&(t[p].style[m]=v+h);break}}if(s){var v=a((u*c-c)/i);s(v)}u+=l,u>d+1&&(clearInterval(f),o&&o(t))}return f=setInterval(p,c),f},e.anim={},e.anim.inPow=function(e){return e<0?0:e>1?1:e**2},e.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)},e.anim.inOutPow=function(t){var n=2;if(t<0)return 0;if(t>1)return 1;if(t*=2,t<1)return e.anim.inPow(t,n)/2;var r=n%2==0?-1:1;return r/2*((t-2)**n+r*2)},e.anim.inSin=function(e){return e<0?0:e>1?1:-Math.cos(Math.PI/2*e)+1},e.anim.outSin=function(e){return e<0?0:e>1?1:Math.sin(Math.PI/2*e)},e.anim.inOutSin=function(e){return e<0?0:e>1?1:-.5*(Math.cos(Math.PI*e)-1)},e.anim.inExp=function(e){return e<0?0:e>1?1:2**(10*(e-1))},e.anim.outExp=function(e){return e<0?0:e>1?1:-(2**(-10*e))+1},e.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)},e.anim.inCirc=function(e){return e<0?0:e>1?1:-(Math.sqrt(1-e*e)-1)},e.anim.outCirc=function(e){return e<0?0:e>1?1:Math.sqrt(1-(e-1)*(e-1))},e.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)},e.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)},e.anim.inBack=function(e){return e<0?0:e>1?1:e*e*(2.70158*e-1.70158)},e.anim.outBack=function(e){return e<0?0:e>1?1:(e-1)*(e-1)*(2.70158*(e-1)+1.70158)+1},e.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)},e.anim.impulse=function(e){var t=2*e;return t*Math.exp(1-t)},e.anim.expPulse=function(e){return Math.exp(-2*e**2)},e===void 0&&(e={}),e.prototype._attachEventHandlers=function(t){if(this.config.interactive){var t=this.getSvg(),n=this;t.addEventListener(`touchstart`,function(e){e.preventDefault(),n._globalMouseDownHandler.apply(n,[this,e])},{passive:!1}),t.addEventListener(`mousedown`,function(e){n._globalMouseDownHandler.apply(n,[this,e])},{passive:!0}),t.addEventListener(`contextmenu`,function(e){n._globalContextHandler.apply(n,[this,e])},{passive:!1}),t.addEventListener(`dblclick`,function(e){n._globalDbClickHandler.apply(n,[this,e])},{passive:!0}),this.config.mouseScrool!=e.action.none&&t.addEventListener(`wheel`,function(e){n._mouseScrollHandler.apply(n,[this,e])},{passive:!1});var r=this.getMenuButton();r&&r.addEventListener(`click`,function(e){n._menuClickHandler.apply(n,[this,e])})}},e===void 0&&(e={}),e.VERSION=`9.2.43`,e.orientation={},e.orientation.top=0,e.orientation.bottom=1,e.orientation.right=2,e.orientation.left=3,e.orientation.top_left=4,e.orientation.bottom_left=5,e.orientation.right_top=6,e.orientation.left_top=7,e.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`},e.align={},e.align.center=e.CENTER=8,e.align.orientation=e.ORIENTATION=9,e.attr={},e.attr.l=`data-l`,e.attr.id=`data-id`,e.attr.sl=`data-sl`,e.attr.lbl=`data-lbl`,e.attr.val=`data-val`,e.attr.tlbr=`data-tlbr`,e.attr.item=`data-item`,e.attr.layout=`data-layout`,e.attr.node_id=`data-n-id`,e.attr.link_id=`data-l-id`,e.attr.field_name=`data-f-name`,e.attr.c_link_to=`data-c-l-to`,e.attr.c_link_from=`data-c-l-from`,e.attr.s_link_to=`data-s-l-to`,e.attr.s_link_from=`data-s-l-from`,e.attr.control_add=`data-ctrl-add`,e.attr.control_expcoll_id=`data-ctrl-ec-id`,e.attr.control_up_id=`data-ctrl-up-id`,e.attr.control_export_menu=`data-ctrl-menu`,e.attr.control_node_menu_id=`data-ctrl-n-menu-id`,e.attr.control_node_btn=`data-ctrl-n-btn`,e.attr.control_node_circle_menu_id=`data-ctrl-n-c-menu-id`,e.attr.control_node_circle_menu_name=`data-ctrl-n-c-menu-name`,e.attr.control_node_circle_menu_wrraper_id=`data-ctrl-n-c-menu-wrapper-id`,e.attr.width=`data-width`,e.attr.text_overflow=`data-text-overflow`,e.ID=`id`,e.PID=`pid`,e.STPID=`stpid`,e.TAGS=`tags`,e.NODES=`nodes`,e.ELASTIC=`elastic`,e.ASSISTANT=`Assistant`,e.action={},e.action.expand=0,e.action.collapse=1,e.action.maximize=101,e.action.minimize=102,e.action.expandCollapse=501,e.action.edit=1,e.action.zoom=2,e.action.ctrlZoom=22,e.action.scroll=41,e.action.xScroll=3,e.action.yScroll=4,e.action.none=5,e.action.init=6,e.action.update=7,e.action.move=70,e.action.pan=8,e.action.centerNode=9,e.action.resize=10,e.action.insert=11,e.action.insertfirst=12,e.action.details=13,e.action.exporting=14,e.none=400001,e.scroll={},e.scroll.visible=!0,e.scroll.smooth=12,e.scroll.speed=120,e.scroll.safari={smooth:12,speed:250},e.match={},e.match.height=100001,e.match.width=100002,e.match.boundary=100003,e.match.boundaryIfOutside=100004,e.match.none=1,e.movable={},e.movable.node=`node`,e.movable.tree=`tree`,e.movable.detachTree=`detachTree`,e.layout={},e.layout.normal=e.normal=0,e.layout.mixed=e.mixed=1,e.layout.tree=e.tree=2,e.layout.treeLeftOffset=e.treeLeftOffset=3,e.layout.treeRightOffset=e.treeRightOffset=4,e.layout.treeLeft=5,e.layout.treeRight=6,e.layout.grid=-1,e.layout.treeList=-2,e.nodeOpenTag=`<g `+e.attr.node_id+`="{id}" style="opacity: {opacity}" transform="matrix(1,0,0,1,{x},{y})" class="{class}" `+e.attr.sl+`="{sl}" `+e.attr.l+`="{level}" {lcn}>`,e.linkOpenTag=`<g `+e.attr.link_id+`="[{id}][{child-id}]" class="{class}">`,e.expcollOpenTag=`<g `+e.attr.control_expcoll_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,e.upOpenTag=`<g `+e.attr.control_up_id+`="{id}" transform="matrix(1,0,0,1,{x},{y})" style="cursor:pointer;">`,e.linkFieldsOpenTag=`<g transform="matrix(1,0,0,1,{x},{y}) rotate({rotate})">`,e.grCloseTag=`</g>`,e.A5={width:420,height:595},e.A4={width:595,height:842},e.A3={width:842,height:1191},e.A2={width:1191,height:1684},e.A1={width:1684,height:2384},e.Letter={width:612,height:791},e.Legal={width:612,height:1009},e.Legal={width:612,height:1009},e.Widescreen={width:720,height:1280},e.Standard={width:720,height:960},e.COLLAPSE_PARENT_NEIGHBORS=1,e.COLLAPSE_SUB_CHILDRENS=2,e.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED=3,e.TEXT_THRESHOLD=4e3,e.IMAGES_THRESHOLD=1e3,e.LINKS_THRESHOLD=2e3,e.BUTTONS_THRESHOLD=700,e.ANIM_THRESHOLD=500,e.IT_IS_LONELY_HERE=`<g transform="translate(-100, 0)" style="cursor:pointer;" `+e.attr.control_add+`="control-add"><text fill="#039be5">{link}</text></g>`,e.RES={},e.IT_IS_LONELY_HERE_LINK=e.RES.IT_IS_LONELY_HERE_LINK=`It's lonely here, add your first node`,e.FIRE_DRAG_NOT_CLICK_IF_MOVE=3,e.STRING_TAGS=!1,e.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>`,e.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>`,e.SEARCH_PLACEHOLDER=`Search... type ? to get help.`,e.SEARCH_HELP_SYMBOL=`?`,e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE=!1,e.SEARCH_RESULT_LIMIT=10,e.IMPORT_MESSAGE=`Choose the columns (fields) in your data file that contain the required information.`,e.FIXED_POSITION_ON_CLICK=!1,e.RENDER_LINKS_BEFORE_NODES=!1,e.RENDER_CLINKS_BEFORE_NODES=!1,e.MIXED_LAYOUT_ALL_NODES=!1,e.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN=!1,e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN=1,e.LINK_ROUNDED_CORNERS=5,e.MOVE_STEP=5,e.CLINK_CURVE=1,e.MAX_DEPTH=200,e.SCALE_FACTOR=1.44,e.LAZY_LOADING_FACTOR=`auto`,e.LAZY_LOADING=!0,e.ARRAY_FIELDS=[`tags`],e.CSV_DELIMITER=`,`,e.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>`,e.ESCAPE_HTML=!1,e.VERTICAL_CHILDREN_ASSISTANT=!1,e.EXPORT_PAGES_CUT_NODES=!1,e.RESET_MOVABLE_ONEXPANDCOLLAPSE=!1,e.FILTER_ALPHABETICALLY=!0,e.SERVER_PREFIX=`.azurewebsites.net/api/you-see-this-request-because-it-is-trial-version-of-orgchartjs`,e.FUNC_URL_NAME=`func-url-orgchartjs`,e.MINIMUM_SYMBOLS_IN_SEARCH_INPUT=1,e.AI_SYSTEM_MESSAGES=[],e.ORGSCRIBE_OFFSET=` `,e.TREELIST_WHEEL_STEP=`auto`,e.TREELIST_SCROLLBAR_WIDTH=10,e.CONVERT_IMAGES_TO_BASE64_BEFORE_EXPORT=!1,e.REQUEST_CUSTOM_HEADERS={},e.SLINK_GAP=7,e._intersects=function(t,n,r){var i=t.x-r.siblingSeparation/4,a=t.y,o=t.x+t.w+r.siblingSeparation/4,s=t.y;switch(r.orientation){case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:i=t.x,a=t.y-r.siblingSeparation/4,o=t.x,s=t.y+t.h+r.siblingSeparation/4;break}var c=n.p,l=n.q,u=n.r,d=n.s,f=(o-i)*(d-l)-(u-c)*(s-a),p,m;return f===0?!1:(m=((d-l)*(u-i)+(c-u)*(d-a))/f,p=((a-s)*(u-i)+(o-i)*(d-a))/f,0<m&&m<1&&0<p&&p<1)},e._addPoint=function(t,n,r,i,a){switch(r.orientation){case e.orientation.top:case e.orientation.top_left:return e._addPointTop(t,n,r,i,a);case e.orientation.bottom:case e.orientation.bottom_left:return e._addPointBottom(t,n,r,i,a);case e.orientation.left:case e.orientation.left_top:return e._addPointLeft(t,n,r,i,a);case e.orientation.right:case e.orientation.right_top:return e._addPointRight(t,n,r,i,a)}},e._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},e._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},e._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},e._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},e._addConnectorLines=function(t,n){e._addConnectorLine(t,{x1:n.xa,y1:n.ya,x2:n.xb,y2:n.yb}),e._addConnectorLine(t,{x1:n.xb,y1:n.yb,x2:n.xc,y2:n.yc}),e._addConnectorLine(t,{x1:n.xc,y1:n.yc,x2:n.xd,y2:n.yd})},e._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})}},e._addLineToPath=function(t,n,r){return e._avoidOverlapping(n,r),t.push([r.x1,r.y1]),t.push([r.x2,r.y2]),e._addConnectorLine(n,r),r},e._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)}},e._slinkAvoidOverlaping=function(t,n,r,i){for(var a=1;a<n.length;a++){var o=n[a-1],s=n[a];if(o[0]==s[0]){for(var c=t.x[s[0]];c;){var l=!0;for(var u of c)if(u.y1<=o[1]&&u.y2>=o[1]||u.y1<=s[1]&&u.y2>=s[1]){i==e.orientation.top||i==e.orientation.top_left?r==`left`?s[0]-=e.SLINK_GAP:r==`right`&&(s[0]+=e.SLINK_GAP):(i==e.orientation.bottom||i==e.orientation.bottom_left)&&(r==`right`?s[0]+=e.SLINK_GAP:r==`left`&&(s[0]-=e.SLINK_GAP)),l=!1;break}if(l)break;c=t.x[s[0]]}o[0]=s[0]}var d=!0;if(o[1]==s[1]&&o[0]>=s[0]&&(d=!1),d&&o[1]==s[1]){for(var c=t.y[s[1]];c;){var l=!0;for(var u of c)if(u.x1<=o[0]&&u.x2>=o[0]||u.x1<=s[0]&&u.x2>=s[0]){o[0]>=s[0]||(i==e.orientation.top||i==e.orientation.top_left?s[1]-=e.SLINK_GAP:(i==e.orientation.bottom||i==e.orientation.bottom_left)&&(s[1]+=e.SLINK_GAP),l=!1);break}if(l)break;c=t.y[s[1]]}o[1]=s[1]}d&&e._addConnectorLine(t,{x1:o[0],y1:o[1],x2:s[0],y2:s[1]})}},e._slinkAvoidOverlapingSecond=function(t,n,r){for(var i=1;i<n.length;i++){var a=n[i-1],o=n[i],s=!1;if(a[1]==o[1]){for(var c=t.y[o[1]];c;){var l=!0;for(var u of c)if(u.x1<=a[0]&&u.x2>=a[0]||u.x1<=o[0]&&u.x2>=o[0]){a[0]>=o[0]?(r==e.orientation.top||r==e.orientation.top_left?o[1]-=e.SLINK_GAP:(r==e.orientation.bottom||r==e.orientation.bottom_left)&&(o[1]+=e.SLINK_GAP),l=!1):s=!0;break}if(l)break;c=t.y[o[1]]}a[1]=o[1]}s||e._addConnectorLine(t,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},e._slinkAvoidOverlaping2=function(t,n,r,i){for(var a=1;a<n.length;a++){var o=n[a-1],s=n[a];if(o[1]==s[1]){for(var c=t.y[s[1]];c;){var l=!0;for(var u of c)if(u.x1<=o[0]&&u.x2>=o[0]||u.x1<=s[0]&&u.x2>=s[0]){i==e.orientation.left||i==e.orientation.left_top?r==`top`?s[1]-=e.SLINK_GAP:r==`bottom`&&(s[1]+=e.SLINK_GAP):(i==e.orientation.right||i==e.orientation.right_top)&&(r==`bottom`?s[1]+=e.SLINK_GAP:r==`top`&&(s[1]-=e.SLINK_GAP)),l=!1;break}if(l)break;c=t.y[s[1]]}o[1]=s[1]}var d=!0;if(o[0]==s[0]&&o[1]>=s[1]&&(d=!1),d&&o[0]==s[0]){for(var c=t.x[s[0]];c;){var l=!0;for(var u of c)if(u.y1<=o[1]&&u.y2>=o[1]||u.y1<=s[1]&&u.y2>=s[1]){o[1]>=s[1]||(i==e.orientation.left||i==e.orientation.left_top?s[0]-=e.SLINK_GAP:(i==e.orientation.right||i==e.orientation.right_top)&&(s[0]+=e.SLINK_GAP),l=!1);break}if(l)break;c=t.x[s[0]]}o[0]=s[0]}d&&e._addConnectorLine(t,{x1:o[0],y1:o[1],x2:s[0],y2:s[1]})}},e._slinkAvoidOverlapingSecond2=function(t,n,r){for(var i=1;i<n.length;i++){var a=n[i-1],o=n[i],s=!1;if(a[0]==o[0]){for(var c=t.x[o[0]];c;){var l=!0;for(var u of c)if(u.y1<=a[1]&&u.y2>=a[1]||u.y1<=o[1]&&u.y2>=o[1]){a[1]>=o[1]?(r==e.orientation.left||r==e.orientation.left_top?o[0]-=e.SLINK_GAP:(r==e.orientation.right||r==e.orientation.right_top)&&(o[0]+=e.SLINK_GAP),l=!1):s=!0;break}if(l)break;c=t.x[o[0]]}a[0]=o[0]}s||e._addConnectorLine(t,{x1:a[0],y1:a[1],x2:o[0],y2:o[1]})}},e.prototype.getSvg=function(){return this.element.querySelector(`svg`)},e.prototype.getPointerElement=function(){return this.element.querySelector(`g[data-pointer]`)},e.prototype.getNodeElement=function(t){return this.element.querySelector(`[`+e.attr.node_id+`='`+t+`']`)},e.prototype.getMenuButton=function(){return this.element.querySelector(`[`+e.attr.control_export_menu+`]`)},e.notifierUI=function(){},e.notifierUI.prototype.init=function(e){this.obj=e},e.notifierUI.prototype.show=function(t,n){if(t==null)return!1;t==1&&(t=e.MAX_NODES_MESS,n=`#FFCA28`),t==2&&(t=e.OFFLINE_MESS,n=`#FFCA28`);var r=document.createElement(`div`);r.innerHTML=t,Object.assign(r.style,{position:`absolute`,"background-color":n,color:`#ffffff`,padding:`15px`,"border-radius":`40px`,opacity:0,overflow:`hidden`,"white-space":`nowrap`,"text-align":`center`}),this.obj.element.appendChild(r);var i=this.obj.width()/2-r.offsetWidth/2,a=this.obj.height()/2-r.offsetHeight/2;r.style.left=i+`px`,r.style.top=a+`px`;var o=r.offsetWidth;return r.style.width=`20px`,e.animate(r,{opacity:0,width:10},{opacity:1,width:o},this.obj.config.anim.duration,this.obj.config.anim.func),!0},e===void 0&&(e={}),e.icon={},e.icon.png_export=e.icon.png_preview=e.icon.pngpreview=e.icon.png=function(e,t,n,r,i){return r??=0,i??=0,`<svg width="${e}" height="${t}" viewBox="0 0 550.801 550.801" x="${r}" y="${i}">
25
25
  <path fill="${n}" d="M146.747,276.708c0-13.998-9.711-22.352-26.887-22.352c-6.99,0-11.726,0.675-14.204,1.355v44.927 c2.932,0.676,6.539,0.896,11.52,0.896C135.449,301.546,146.747,292.28,146.747,276.708z"/>
26
26
  <path fill="${n}" d="M488.426,197.019H475.2v-63.816c0-0.398-0.063-0.799-0.116-1.202c-0.021-2.534-0.827-5.023-2.562-6.995L366.325,3.694 c-0.032-0.031-0.063-0.042-0.085-0.076c-0.633-0.707-1.371-1.295-2.151-1.804c-0.231-0.155-0.464-0.285-0.706-0.419 c-0.676-0.369-1.393-0.675-2.131-0.896c-0.2-0.056-0.38-0.138-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.873v160.545 c0,17.043,13.824,30.87,30.873,30.87h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87v-160.54C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.513c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M234.344,335.86v45.831h-31.601V229.524h40.184 l31.611,55.759c9.025,16.031,18.064,34.983,24.825,52.154h0.675c-2.257-20.103-2.933-40.643-2.933-63.44v-44.473h31.614v152.167 h-36.117l-32.516-58.703c-9.049-16.253-18.971-35.892-26.438-53.727l-0.665,0.222C233.906,289.58,234.344,311.027,234.344,335.86z M71.556,381.691V231.56c10.613-1.804,25.516-3.159,46.506-3.159c21.215,0,36.353,4.061,46.509,12.192 c9.698,7.673,16.255,20.313,16.255,35.219c0,14.897-4.959,27.549-13.999,36.123c-11.738,11.063-29.123,16.031-49.441,16.031 c-4.522,0-8.593-0.231-11.736-0.675v54.411H71.556V381.691z M453.601,523.353H97.2V419.302h356.4V523.353z M485.652,374.688 c-10.61,3.607-30.713,8.585-50.805,8.585c-27.759,0-47.872-7.003-61.857-20.545c-13.995-13.1-21.684-32.97-21.452-55.318 c0.222-50.569,37.03-79.463,86.917-79.463c19.644,0,34.783,3.829,42.219,7.446l-7.214,27.543c-8.369-3.617-18.752-6.55-35.458-6.55 c-28.656,0-50.341,16.256-50.341,49.22c0,31.382,19.649,49.892,47.872,49.892c7.895,0,14.218-0.901,16.934-2.257v-31.835h-23.493 v-26.869h56.679V374.688z"/>
27
27
  </svg>`},e.icon.pdf_export=e.icon.pdf_preview=e.icon.pdfpreview=e.icon.pdf=function(e,t,n,r,i){return r??=0,i??=0,`<svg width="${e}" height="${t}" viewBox="0 0 550.801 550.801" x="${r}" y="${i}">
@@ -190,11 +190,46 @@ var e=function(e,t){var n=this;Object.defineProperty(this,`element`,{get(){retur
190
190
  <path d="M0.792893 2.20711L3.29289 4.70711L4.70711 3.29289L2.20711 0.792893L0.792893 2.20711Z" fill="${n}"/>
191
191
  <path d="M6 5L5 6.00001L8 15H10L10.7172 12.1314L14.2929 15.7071L15.7071 14.2929L12.1314 10.7172L15 10V8L6 5Z" fill="${n}"/>
192
192
  <path d="M0 6H3V8H0V6Z" fill="${n}"/>
193
- </svg>`},e===void 0&&(e={}),e.events=(function(){var t={};return{on:function(e,n,r){Array.isArray(t[e])||(t[e]=[]),t[e].push({listener:n,event_id:r})},removeAll:function(e){Array.isArray(t[e])||(t[e]=[]),t[e]=[]},remove:function(n,r,i){var a=!1;if(t[n]&&Array.isArray(t[n])&&t[n].length>0)for(var o=t[n].length-1;o>=0;o--)(!e.isNEU(i)&&!e.isNEU(r)&&t[n][o].event_id==i&&t[n][o].listener==r||!e.isNEU(i)&&e.isNEU(r)&&t[n][o].event_id==i||e.isNEU(i)&&!e.isNEU(r)&&t[n][o].listener==r||e.isNEU(i)&&e.isNEU(r))&&(t[n].splice(o,1),a=!0);return a},has:function(n,r){if(t[n]&&Array.isArray(t[n])&&t[n].length>0){if(e.isNEU(r))return!0;for(var i=0;i<t[n].length;i++)if(t[n][i].event_id==r)return!0}return!1},removeForEventId:function(e){for(var n in t)if(Array.isArray(t[n]))for(var r=t[n].length-1;r>=0;r--)t[n][r].event_id==e&&t[n].splice(r,1)},publish:function(e,n){if(t[e]){for(var r=[],i=0;i<t[e].length;i++){var a=t[e][i];(a.event_id==null||a.event_id==n[0]._event_id)&&r.push(a.listener)}if(r.length>0){for(var o=!0,i=0;i<r.length&&(n.length==1?o=r[i](n[0])&&o:n.length==2?o=r[i](n[0],n[1])&&o:n.length==3?o=r[i](n[0],n[1],n[2])&&o:n.length==4?o=r[i](n[0],n[1],n[2],n[3])&&o:n.length==5&&(o=r[i](n[0],n[1],n[2],n[3],n[4])&&o),o!==!1);i++);return o}}}}})(),e.prototype.expand=function(t,n,r){this._treeListExpandCollapseHandler(t),this._resetMovableNodes();var i={id:t,ids:n};this._draw(!1,e.action.expand,i,r)},e.prototype.collapse=function(t,n,r){this._treeListExpandCollapseHandler(t),this._resetMovableNodes();var i={id:t,ids:n};this._draw(!1,e.action.collapse,i,r)},e.prototype.expandCollapse=function(t,n,r,i){this._treeListExpandCollapseHandler(t),this._resetMovableNodes(),Array.isArray(n)||(n=[]),Array.isArray(r)||(r=[]);var a={id:t,expandIds:n,collapseIds:r,ids:n.concat(r)};this._draw(!1,e.action.collapse,a,i)},e.prototype.changeRoots=function(t,n,r){this.config.roots=n;var i={id:t,changeRoots:n};this._draw(!1,e.action.update,i,r)},e.prototype._resetMovableNodes=function(){if(e.RESET_MOVABLE_ONEXPANDCOLLAPSE&&this.config.movable!=null){for(var t=!1,n=0;n<this.config.nodes.length;n++){var r=this.config.nodes[n];r.movex!=null&&(r.movex=0,t=!0),r.movey!=null&&(r.movey=0,t=!0)}t&&(this._ai.setContext(),e.events.publish(`updated`,[this]))}},e.prototype.maximize=function(t,n,r,i){var a=this,o={id:t,options:{}};e.isNEU(o.id)&&(o.id=this.roots[0].id,o.all=!0),o.options.horizontal=!1,o.options.vertical=!1,n&&(o.options.horizontal=n),r&&(o.options.vertical=r),this._draw(!1,e.action.maximize,o,function(){a.ripple(t),i&&i()})},e.prototype.minimize=function(t,n){var r=this,i={id:t};e.isNEU(i.id)&&(i.id=this.roots[0].id,i.all=!0),this._draw(!1,e.action.minimize,i,function(){r.ripple(t),n&&n()})},e.prototype._expCollHandler=function(t){this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var n=this.getNode(t),r=this.getCollapsedIds(n);if(r.length){var i=e.events.publish(`expcollclick`,[this,!1,t,r]);if(i===!1)return!1;this.expand(t,r,!1)}else{var i=e.events.publish(`expcollclick`,[this,!0,t,n.childrenIds]);if(i===!1)return!1;this.collapse(t,n.childrenIds,!1)}},e.prototype._upHandler=function(t){this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var n=this._upHandlerCreateArgs(t);if(e.events.publish(`up-click`,[this,n])===!1)return!1;this.changeRoots(n.id,n.roots,!1)},e.prototype._upHandlerCreateArgs=function(e){var t=this.getNode(e),n=Object.assign([],this.config.roots),r=this.getNode(t.pid),i;if(r&&(i=r),i){if(Array.isArray(n)){var a=n.indexOf(t.id);a!=-1&&n.splice(a,1)}else n=[];n.push(i.id)}return{id:t.id,roots:n}},String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return this.replace(new RegExp(e,`g`),t)}),String.prototype.endsWith||(String.prototype.endsWith=function(e){return this.indexOf(e,this.length-e.length)!==-1}),String.prototype.splice||(String.prototype.splice=function(e,t,n){return this.slice(0,e)+n+this.slice(e+Math.abs(t))}),String.prototype.insert||(String.prototype.insert=function(e,t){return e>0?this.substring(0,e)+t+this.substr(e):t+this}),Array.prototype.unique||Object.defineProperty(Array.prototype,`unique`,{value:function(){for(var e=this.concat(),t=0;t<e.length;++t)for(var n=t+1;n<e.length;++n)e[t]===e[n]&&e.splice(n--,1);return e},writable:!0,configurable:!0,enumerable:!1}),Array.prototype.has||Object.defineProperty(Array.prototype,`has`,{value:function(e){for(var t=0;t<this.length;t++)if(this[t]==e)return!0;return!1},writable:!0,configurable:!0,enumerable:!1}),Array.prototype.compare||Object.defineProperty(Array.prototype,`compare`,{value:function(e){if(this.length!=e.length)return!1;for(var t=0;t<this.length;t++)if(!e.has(this[t]))return!1;return!0},writable:!0,configurable:!0,enumerable:!1}),Object.assign||Object.defineProperty(Object,`assign`,{value:function(e,t){"use strict";if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var n=Object(e),r=1;r<arguments.length;r++){var i=arguments[r];if(i!=null)for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])}return n},writable:!0,configurable:!0}),e.prototype._globalMouseDownHandler=function(t,n){var r={move:`mousemove`,up:`mouseup`,leave:`mouseleave`};n.type.indexOf(`touch`)!=-1&&(n.touches.length==1?this._touch={x:n.touches[0].clientX,y:n.touches[0].clientY}:this._touch=null,r={move:`touchmove`,up:`touchend`,touchstart:`touchstart`}),this._treeListUpdateInterval&&=(clearInterval(this._treeListUpdateInterval),null);for(var i=null,a=n.target;a!=t&&!a.hasAttribute(e.attr.control_node_menu_id)&&!a.hasAttribute(e.attr.control_node_circle_menu_id);){if(a.hasAttribute){var o=null;a.hasAttribute(e.attr.node_id)?o=this.getNode(a.getAttribute(e.attr.node_id)):a.hasAttribute(e.attr.control_expcoll_id)?o=this.getNode(a.getAttribute(e.attr.control_expcoll_id)):(a.hasAttribute(e.attr.control_node_menu_id)||a.hasAttribute(e.attr.control_node_menu_id))&&(o=this.getNode(a.getAttribute(e.attr.control_node_menu_id))),i||=e._getScrollableTreeListNodeInTouchEnabledDevice(o)}if(a.hasAttribute(e.attr.node_id)&&!i&&(this.config.enableDragDrop||this.config.movable)){if(n.touches==null||n.touches.length<=1){this._nodeMouseDownHandler(a,n,r);return}}else if(a.hasAttribute(e.attr.control_node_circle_menu_name)){if(n.stopPropagation(),n.touches==null||n.touches.length<=1){this._nodeCircleNodeMenuItemMouseDownHandler(t,a,n,r);return}}else if(a.hasAttribute(`data-treelist-thumb`)&&(n.stopPropagation(),n.touches==null||n.touches.length<=1)){this._treeListThumbMouseDownHandler(a,n,r);return}a=a.parentNode}n.stopPropagation(),this._mouseDownHandler(t,n,r,i)},e.prototype._globalContextHandler=function(t,n){for(var r=n.target;r!=t;){if(r.hasAttribute(e.attr.node_id)){var i=r.getAttribute(e.attr.node_id),a=this.getNode(i);this._nodeContextHandler(a.id,n);return}r=r.parentNode}},e.prototype._nodeContextHandler=function(t,n){n.preventDefault(),e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var r=this.get(t),i=null;if(r!=null&&Array.isArray(r.tags))for(var a=0;a<r.tags.length;a++){var o=r.tags[a];this.config.tags[o]&&this.config.tags[o].nodeContextMenu&&(i=this.config.tags[o].nodeContextMenu)}var s=this.element.getBoundingClientRect(),c=n.clientX-s.left,l=n.clientY-s.top;this.nodeContextMenuUI.show(c,l,t,null,i)},e.prototype._globalDbClickHandler=function(t,n){for(var r=n.target;r!=t;){if(r.hasAttribute(e.attr.node_id)){var i=r.getAttribute(e.attr.node_id),a=this.getNode(i);this._nodeDbClickHandler(a.id,n);return}r=r.parentNode}},e.prototype._mouseScrollHandler=function(e,t){for(var n=!1,r=t.target,i=null;r&&r.hasAttribute&&!r.hasAttribute(`data-n-id`)&&!r.hasAttribute(`data-ctrl-ec-id`);)r=r.parentNode;if(r.hasAttribute&&r.hasAttribute(`data-n-id`)){var a=r.getAttribute(`data-n-id`);i=this.getNode(a),i.isTreeListItem&&(n=!0)}if(r.hasAttribute&&r.hasAttribute(`data-ctrl-ec-id`)){var a=r.getAttribute(`data-ctrl-ec-id`);i=this.getNode(a),i.isTreeListItem&&(n=!0)}t.ctrlKey&&(n=!1),n?this.__mouseScrollHandlerTreeList(i,t):this.__mouseScrollHandler(this.getSvg(),t)},e.prototype.__mouseScrollHandler=function(t,n){if(n.ctrlKey){if(this.config.mouseScrool==e.action.zoom)return}else if(this.config.mouseScrool==e.action.ctrlZoom||this.config.mouseScrool!=e.action.zoom)return;if(n.preventDefault(),!navigator.hardwareConcurrency||navigator.hardwareConcurrency<9){let i=n.deltaY/1e3;i=Math.abs(i)<.1?.1*n.deltaY/Math.abs(n.deltaY):i;var r=e._centerPointInPercent(t,n.clientX,n.clientY);this.zoom(1-i,r)}else{var i=this,a=!1,o=this.config.zoom.speed,s=this.config.zoom.smooth,c=0,l=this.getScale(),r=e._centerPointInPercent(t,n.clientX,n.clientY);function f(){a=!0;var e=(c-l)/s;e>0?e++:e--,l+=e,i.zoom(1-e/12/50,r),parseInt(l)==parseInt(c)?a=!1:u(f)}var u=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,20)}}();n.preventDefault();var d=n.delta||n.wheelDelta;d===void 0&&(d=-n.detail),d=Math.max(-1,Math.min(1,d)),c+=-d*o,a||f()}},e.prototype._nodeCircleNodeMenuItemMouseDownHandler=function(t,n,r,i){var a=n.parentNode.getAttribute(e.attr.control_node_circle_menu_wrraper_id),o=n.getAttribute(e.attr.control_node_circle_menu_name),s=this.nodeCircleMenuUI._menu[o];if(!s.draggable){this._clickHandler(t,r);return}var c=this,l=e._getClientXY(r),u=this.getNode(a);n._dragEventFired=!1;var d=c.getScale(),f=null,p=null;document.body.style.mozUserSelect=document.body.style.webkitUserSelect=document.body.style.userSelect=`none`;var m=this.getSvg(),h={x:l.x,y:l.y},g=function(t){for(;t&&!t.hasAttribute(e.attr.control_node_circle_menu_wrraper_id);)t=t.parentNode;if(!t){console.error(`cannot find parent`+e.attr.control_node_circle_menu_wrraper_id);return}var n=e._getTransform(t);return{x:n[4],y:n[5]}},_=n.cloneNode(!0);m.insertBefore(_,m.firstChild);var v=e._getTransform(_),y=v[4],b=v[5],x=g(n);_.setAttribute(`transform`,`matrix(1,0,0,1,`+(y+x.x)+`,`+(b+x.y)+`)`),_.style.opacity=.7;var S=function(t,n){if(t!=null){n.classList.remove(`boc-drag-over`);for(var r=e.getStParentNodes(c.getNode(f)),i=0;i<r.length;i++){var a=c.getNodeElement(r[i].id);a&&(a.style.opacity=1)}}},C=function(t){if(h){var r=e._getClientXY(t),i=t.target;e.isMobile()&&(i=document.elementFromPoint(r.x,r.y)),r.x+=x.x*d,r.y+=x.y*d;var a=e._getOffsetXY(c.element,t),l={left:c.width()-(a.x+c.config.padding)<0,right:a.x-c.config.padding<0,up:c.height()-(a.y+c.config.padding)<0,down:a.y-c.config.padding<0};if(l.left||l.right||l.up||l.down){m.classList&&(m.classList.remove(`boc-cursor-grab`),m.classList.add(`boc-cursor-move`),m.classList.remove(`boc-cursor-nodrop`),m.classList.remove(`boc-cursor-copy`));var u=v[4],g=v[5],C=h.x,T=h.y,E=r.x,D=r.y;c.moveStart(l,function(e){v[4]=u+e.x,v[5]=g+e.y,h.x=C-e.xWithoutScale,h.y=T-e.yWithoutScale,r.x=E-e.xWithoutScale,r.y=D-e.yWithoutScale,_.setAttribute(`transform`,`matrix(`+v.toString()+`)`)})}else{for(c.moveEnd(),m.classList&&(m.classList.add(`boc-cursor-grab`),m.classList.remove(`boc-cursor-move`),m.classList.remove(`boc-cursor-nodrop`),m.classList.remove(`boc-cursor-copy`)),S(f,p),f=null,p=null;i!=null&&i!=m;){if(i.hasAttribute&&i.hasAttribute(e.attr.node_id)){var O=i.getAttribute(e.attr.node_id);f=O,p=i;break}i=i.parentNode}if(f!=null){p.classList.add(`boc-drag-over`);for(var k=c.getNode(f),A=e.getStParentNodes(k),j=0;j<A.length;j++){var M=c.getNodeElement(A[j].id);M&&(M.style.opacity=.1)}m.classList.remove(`boc-cursor-grab`),m.classList.remove(`boc-cursor-move`),m.classList.add(`boc-cursor-copy`),m.classList.remove(`boc-cursor-nodrop`)}var N=(r.x-h.x)/d,P=(r.y-h.y)/d;v[4]=y+N,v[5]=b+P,!n._dragEventFired&&(Math.abs(r.x-h.x)>e.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(r.y-h.y)>e.FIRE_DRAG_NOT_CLICK_IF_MOVE)&&(c._gragStartedId=n.parentNode.getAttribute(e.attr.control_node_circle_menu_wrraper_id),e.events.publish(`drag`,[c.nodeCircleMenuUI,{from:O,menuItem:s,menuItemName:o}])===!1&&w(),n._dragEventFired=!0),_.setAttribute(`transform`,`matrix(`+v.toString()+`)`)}}},w=function(t){if(c.moveEnd(),m.classList&&(m.classList.remove(`boc-cursor-grab`),m.classList.remove(`boc-cursor-move`),m.classList.remove(`boc-cursor-nodrop`),m.classList.remove(`boc-cursor-copy`)),m.removeEventListener(i.move,C),m.removeEventListener(i.up,w),i.leave&&m.removeEventListener(i.leave,w),u.id==f||f==null){m.removeChild(_),c._gragStartedId=null,n._dragEventFired&&e.events.publish(`drop`,[c.nodeCircleMenuUI,{from:u.id,menuItemName:o,menuItem:s,event:t}]);return}var r=c.getNode(f);e.events.publish(`drop`,[c.nodeCircleMenuUI,{from:u.id,to:r.id,menuItem:s,menuItemName:o,event:t}]),S(f,p),m.removeChild(_),c._gragStartedId=null};m.addEventListener(i.move,C),m.addEventListener(i.up,w),i.leave&&m.addEventListener(i.leave,w)},e.prototype._nodeMouseDownHandler=function(t,n,r){var i=t.getAttribute(e.attr.node_id),a=this.getNode(i);this.config.movable&&!e.getRootOf(a).stParent?this._movableHandler(t,n,r):this.config.enableDragDrop&&this._dragDropHandler(t,n,r)},e.prototype._resizeHandler=function(t,n){if(this.isVisible&&!(t==0||n==0)){var r=this.getViewBox();if(r){r=r.slice(0);var i=t/r[2],a=n/r[3];Math.abs(this._lastSize.width-t)>Math.abs(this._lastSize.height-n)?r[3]=n/i:r[2]=t/a,this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide(),this.setViewBox(r),this.xScrollUI.create(t),this.yScrollUI.create(n),this._draw(!0,e.action.resize)}}},e.prototype._nodeDbClickHandler=function(t,n){if(e.events.publish(`dbclick`,[this,this.get(t)])===!1)return!1;this._commonClickHandler(t,n,this.config.nodeMouseDbClick)},e.prototype._nodeClickHandler=function(t,n){if(e.events.publish(`click`,[this,{node:this.getNode(t),event:n}])===!1)return!1;if(this.powerPointPreviewUI.isVisible()&&this.powerPointPreviewUI.selectedPage!=null){this.powerPointPreviewUI.selectedPage.content=void 0,this.powerPointPreviewUI.selectedPage.nodeId=t,this.powerPointPreviewUI.refresh(t),this.ripple(t,n.clientX,n.clientY);return}if(this.pdfPreviewUI.isVisible()&&this.pdfPreviewUI.selectedPage!=null){this.pdfPreviewUI.selectedPage.content=void 0,this.pdfPreviewUI.selectedPage.nodeId=t,this.pdfPreviewUI.refresh(t),this.ripple(t,n.clientX,n.clientY);return}if(this.svgPreviewUI.isVisible()&&this.svgPreviewUI.selectedPage!=null){this.svgPreviewUI.selectedPage.content=void 0,this.svgPreviewUI.selectedPage.nodeId=t,this.svgPreviewUI.refresh(t),this.ripple(t,n.clientX,n.clientY);return}if(this.pngPreviewUI.isVisible()&&this.pngPreviewUI.selectedPage!=null){this.pngPreviewUI.selectedPage.content=void 0,this.pngPreviewUI.selectedPage.nodeId=t,this.pngPreviewUI.refresh(t),this.ripple(t,n.clientX,n.clientY);return}var r=this.getNodeElement(t);if(r&&r._dragEventFired){r._dragEventFired=!1;return}this._commonClickHandler(t,n,this.config.nodeMouseClick)},e.prototype._nodeCircleMenuItemClickHandler=function(t,n){var r=t.parentNode.getAttribute(e.attr.control_node_circle_menu_wrraper_id),i=t.getAttribute(e.attr.control_node_circle_menu_name),a=this.nodeCircleMenuUI._menu[i];e.events.publish(`click`,[this.nodeCircleMenuUI,{nodeId:r,menuItemName:i,menuItem:a,event:n}])},e.prototype._nodeCircleMenuClickHandler=function(t){if(e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.menuUI.hide(),this.nodeContextMenuUI.isVisible())this.nodeContextMenuUI.hide();else{var n=this.getNode(t),r=null;if(Array.isArray(n.tags))for(var i=0;i<n.tags.length;i++){var a=n.tags[i];this.config.tags[a]&&this.config.tags[a].nodeCircleMenu&&(r=this.config.tags[a].nodeCircleMenu)}this.nodeCircleMenuUI.show(t,r)}},e.prototype._commonClickHandler=function(t,n,r){if(e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide(),r==e.action.expandCollapse&&this.toggleExpandCollapse(t,n),r==e.action.edit){var i=this.getNode(t);i&&(this.editUI.show(i.id),this.ripple(i.id,n.clientX,n.clientY))}if(r==e.action.details){var i=this.getNode(t);i&&(this.editUI.show(i.id,!0),this.ripple(i.id,n.clientX,n.clientY))}},e.prototype._menuHandlerMouseDownHandler=function(e,t){t.stopPropagation(),t.preventDefault()},e.prototype._nodeMenuClickHandler=function(t,n,r){e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var i=this.getNode(t),a=null;if(Array.isArray(i.tags))for(var o=0;o<i.tags.length;o++){var s=i.tags[o];this.config.tags[s]&&this.config.tags[s].nodeMenu&&(a=this.config.tags[s].nodeMenu)}this.nodeMenuUI.showStickIn(n,t,null,a)},e.prototype._menuClickHandler=function(e,t){t.stopPropagation(),t.preventDefault(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.show(e.offsetLeft,e.offsetTop)},e.prototype._lonelyButtonHandler=function(){var e={id:this.generateId()};this.addNode(e,null,!0)!==!1&&this.center(e.id)},e.prototype.toggleExpandCollapse=function(t,n){var r=this.getNode(t),i=this.getCollapsedIds(r);if(i.length){var a=e.events.publish(`expcollclick`,[this,!1,t,i]);if(a===!1)return!1;this.expand(t,i,!1)}else{var a=e.events.publish(`expcollclick`,[this,!0,t,r.childrenIds]);if(a===!1)return!1;this.collapse(t,r.childrenIds,!1)}n&&this.ripple(r.id,n.clientX,n.clientY)},e.prototype._clickHandler=function(t,n){if(!(n.button>0)){for(var r=n.target;r!=t;){if(r.hasAttribute(e.attr.control_expcoll_id)){var i=r.getAttribute(e.attr.control_expcoll_id),a=this.getNode(i);this._expCollHandler(a.id);return}if(r.hasAttribute(e.attr.node_id)){var i=r.getAttribute(e.attr.node_id),a=this.getNode(i);this._nodeClickHandler(a.id,n);return}if(r.hasAttribute(e.attr.control_node_menu_id)){n.stopPropagation(),n.preventDefault();var i=r.getAttribute(e.attr.control_node_menu_id),a=this.getNode(i);this._nodeMenuClickHandler(a.id,r,n);return}if(r.hasAttribute(e.attr.control_node_circle_menu_id)){n.stopPropagation(),n.preventDefault();var i=r.getAttribute(e.attr.control_node_circle_menu_id);this._nodeCircleMenuClickHandler(i);return}if(r.hasAttribute(e.attr.control_node_circle_menu_name)){n.stopPropagation(),this._nodeCircleMenuItemClickHandler(r,n);return}if(r.hasAttribute(e.attr.control_add)){this._lonelyButtonHandler();return}if(r.hasAttribute(e.attr.control_up_id)){var i=r.getAttribute(e.attr.control_up_id);n.stopPropagation(),n.preventDefault(),this._upHandler(i);return}if(r.hasAttribute(e.attr.c_link_from)){e.events.publish(`clink-click`,[this,{from:r.getAttribute(e.attr.c_link_from),to:r.getAttribute(e.attr.c_link_to),event:n}]);return}if(r.hasAttribute(e.attr.s_link_from)){e.events.publish(`slink-click`,[this,{from:r.getAttribute(e.attr.s_link_from),to:r.getAttribute(e.attr.s_link_to),event:n}]);return}if(r.hasAttribute(`data-ctrl-n-dotted-close`)){var i=r.getAttribute(`data-ctrl-n-dotted-close`);this.minimize(i);return}if(r.hasAttribute(`data-ctrl-n-dotted-open`)){var i=r.getAttribute(`data-ctrl-n-dotted-open`);this.maximize(i);return}r=r.parentNode}e.events.publish(`canvas-click`,[this,{event:n}])}},e.prototype._mouseDownHandler=function(t,n,r,i){var a=this;e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide();var o=this.getViewBox(),s=this.getScale(),c=e._getClientTouchesXY(n,0),l=e._getClientTouchesXY(n,1),u={diffX:0,diffY:0,x0:c.x,y0:c.y,type:this.config.enablePan?`pan`:`pan-not-enabled`,viewBoxLeft:o[0],viewBoxTop:o[1],time:Date.now()};n.touches&&n.touches.length>1&&(u.type=`pinch`,u.dist=Math.sqrt((c.x-l.x)*(c.x-l.x)+(c.y-l.y)*(c.y-l.y)));var d=null;if(i){var f=i.stChildren[0].lcn?i.stChildren[0].lcn:`base`;d=a.manager.layoutConfigs[f],u.scrollTop=i.treeList.scrollTop}var p=0,m=function(t){var n=e._getClientTouchesXY(t,0);if(u&&u.type==`pan`){clearTimeout(a._timeout),u.diffX=n.x-u.x0,u.diffY=n.y-u.y0,p=Math.max(Math.abs(u.diffY),Math.abs(u.diffX));var r=-(u.diffY/s)+u.viewBoxTop,c=-(u.diffX/s)+u.viewBoxLeft;p>3&&(i?(i.treeList.scrollTop=u.scrollTop-u.diffY/s,a._treeListUpdateInterval&&=(clearInterval(a._treeListUpdateInterval),null),a._treeListUpdate(i,d)):(a._hideBeforeAnimation(),a._changeCursorOnPanStart(o,s,t),a._move(r,c,o)))}else if(u&&u.type==`pinch`){var l=e._getClientTouchesXY(t,1),f=Math.sqrt((n.x-l.x)*(n.x-l.x)+(n.y-l.y)*(n.y-l.y)),m=1+(f-u.dist)/(u.dist/100)/100;u.dist=f;var h=e._pinchMiddlePointInPercent(a.element,a.width(),a.height(),t);a.zoom(m,h)}},h=function(n){if(p<3&&u.type!=`pinch`&&(n.touches==null||n.touches.length<=1))a._clickHandler(t,n);else if(u.type==`pan`&&i){var o=Date.now()-u.time,s=Math.abs(p/o);if(s>.5){var c=i.treeList.scrollTop,l=c+s*400*(u.diffY>0?-1:1),f=i.stChildren[0].h;l=Math.round(l/f)*f,l!=c&&(a._treeListUpdateInterval&&=(clearInterval(a._treeListUpdateInterval),null),a._treeListUpdateInterval=e.animate(null,{},{},1500,e.anim.outExp,function(){},function(e){i.treeList.scrollTop=e*(l-c)+c,a._treeListUpdate(i,d.orientation)}))}else{var c=i.treeList.scrollTop,f=i.stChildren[0].h,l=Math.round(i.treeList.scrollTop/f)*f;l!=c&&(a._treeListUpdateInterval&&=(clearInterval(a._treeListUpdateInterval),null),a._treeListUpdateInterval=e.animate(null,{},{},200,e.anim.outSin,function(){},function(e){i.treeList.scrollTop=e*(l-c)+c,a._treeListUpdate(i,d.orientation)}))}}else u.type==`pan`&&!i&&p>10&&a._draw(!0,e.action.pan);u.type==`pan`&&!i&&a._changeCursorOnPanEnd(),u=null,t.removeEventListener(r.move,m),t.removeEventListener(r.up,h),r.leave&&t.removeEventListener(r.leave,h),r.touchstart&&t.removeEventListener(r.touchstart,h)};t.addEventListener(r.move,m,{passive:!0}),t.addEventListener(r.up,h),r.leave&&t.addEventListener(r.leave,h),r.touchstart&&t.addEventListener(r.touchstart,h,{passive:!0})},e.prototype._changeCursorOnPanStart=function(t,n,r){var i=this.getPointerElement();if(i){var a=e._getOffsetXY(this.element,r),o=a.x/n+t[0]-16/n,s=a.y/n+t[1]-16/n;i.style.display=`inherit`,i.setAttribute(`transform`,`matrix(0,0,0,0,`+o+`,`+s+`)`),e.animate(i,{transform:[0,0,0,0,o,s],opacity:0},{transform:[1/n,0,0,1/n,o,s],opacity:1},300,e.anim.outBack)}else this.element.style.cursor=`move`},e.prototype._changeCursorOnPanEnd=function(){var e=this.getPointerElement();e?e.style.display=`none`:this.element.style.cursor=`initial`},e.prototype._move=function(e,t,n){n[0]=t,n[1]=e,this.setViewBox(n),this.xScrollUI.setPosition(),this.yScrollUI.setPosition()},e.prototype.moveStart=function(t,n,r,i){if(!t){console.error(`movePosition parameter not defined`);return}if(this._moveInterval)return;var a=this,o=this.getViewBox().slice(0),s=this.getScale(),c=0,l=0,u=10,d=1,f=1;e.isNEU(r)&&(r=e.anim.inSin),e.isNEU(i)&&(i=3e3);function p(){var p={x:0,y:0,xWithoutScale:0,yWithoutScale:0};t.left?(c++,p.x=c*e.MOVE_STEP/s,p.xWithoutScale=c*e.MOVE_STEP):t.right&&(c++,p.x=-(c*e.MOVE_STEP)/s,p.xWithoutScale=-(c*e.MOVE_STEP)),t.up?(l++,p.y=l*e.MOVE_STEP/s,p.yWithoutScale=l*e.MOVE_STEP):t.down&&(l++,p.y=-(l*e.MOVE_STEP)/s,p.yWithoutScale=-(l*e.MOVE_STEP));var m=r((f*u-u)/i);p.x*=m,p.xWithoutScale*=m,p.y*=m,p.yWithoutScale*=m,a.setViewBox([o[0]+p.x,o[1]+p.y,o[2],o[3]]),n&&n(p),f+=d}this._moveInterval=setInterval(p,u)},e.prototype.moveEnd=function(){this._moveInterval&&=(clearInterval(this._moveInterval),null)},e===void 0&&(e={}),e.node=function(e,t,n,r){this.templateName=r,this.id=e,this.pid=t,this.children=[],this.childrenIds=[],this.parent=null,this.stpid=null,this.stParent=null,this.stChildren=[],this.stChildrenIds=[],this.tags=n,this.childCount=0,this.collapsedChildCount=0,this.deepCollapsedChildCount=0,this.deepChildCount=0,this.tags||=[]},e===void 0&&(e={}),e.idb={version:1,dbName:`BALKAN`,tableName:`orgchart-js`,keyPath:`id`},e.idb.db=null,e.idb._open=function(t){if(e._browser().msie){t&&t(!1);return}if((navigator.userAgent.toLowerCase().indexOf(`safari`)>0||navigator.userAgent.toLowerCase().indexOf(`firefox`)>0)&&window.location!==window.parent.location){t&&t(!1);return}if(!window.indexedDB){console.error(`Your browser doesn't support a stable version of IndexedDB.`),t&&t(!1);return}if(e.idb.db!=null){t&&t(!0);return}var n=indexedDB.open(e.idb.dbName,e.idb.version);n.onerror=function(e){console.error(`Cannot open database!`),t&&t(!1)},n.onsuccess=function(n){e.idb.db=n.target.result,t&&t(!0)},n.onupgradeneeded=function(t){var n=t.target.result;n.objectStoreNames.contains(e.idb.tableName)&&n.deleteObjectStore(e.idb.tableName),n.createObjectStore(e.idb.tableName,{keyPath:e.idb.keyPath})}},e.idb.read=function(t,n){e.idb._open(function(r){if(r){var i=e.idb.db.transaction([e.idb.tableName]).objectStore(e.idb.tableName).get(t);i.onerror=function(e){console.error(`Unable to retrieve data from database!`),n&&n(!1)},i.onsuccess=function(e){i.result?n&&n(!0,i.result):n&&n(null)}}else n&&n(!1)})},e.idb.write=function(t,n){e.idb.read(t.id,function(r){if(r==null){var i=e.idb.db.transaction([e.idb.tableName],`readwrite`).objectStore(e.idb.tableName).add(t);i.onerror=function(e){console.error(`Unable to add data to database!`),n&&n(!1)},i.onsuccess=function(e){n&&n(!0)}}else n&&n(r)})},e.idb.put=function(t,n){e.idb._open(function(r){if(r){var i=e.idb.db.transaction([e.idb.tableName],`readwrite`).objectStore(e.idb.tableName).put(t);i.onerror=function(e){console.error(`Unable to put data to database!`),n&&n(!1)},i.onsuccess=function(e){n&&n(!0)}}else n&&n(!1)})},e.idb.delete=function(t,n){e.idb._open(function(r){if(r){var i=e.idb.db.transaction([e.idb.tableName],`readwrite`).objectStore(e.idb.tableName).delete(t);i.onerror=function(e){console.error(`Unable to retrieve data from database!`),n&&n(!1)},i.onsuccess=function(e){i.error?n&&n(!1):n&&n(!0)}}else n&&n(!1)})},e===void 0&&(e={}),e.manager=function(e){this.config=e.config,this.layoutConfigs=e._layoutConfigs,this.visibleNodeIds=[],this.viewBox=null,this.action=null,this.actionParams=null,this.nodes={},this.oldNodes={},this.maxX=null,this.maxY=null,this.minX=null,this.minY=null,this.bordersByRootIdAndLevel=null,this.roots=null,this.state=null,this.vbIsInitializedFromState=!1,this.rootList=[],this.instance=e,this._fixAdjustForExport={x:0,y:0}},e.manager.prototype.read=function(t,n,r,i,a,o,s,c){var l=this;e.state._get(this.config.state,n,r,function(u){l.state=u,l.action=a,l.actionParams=o,a!=e.action.init||!l.state||o&&o.method&&o.method==`fit`?(l.viewBox=i,l.vbIsInitializedFromState=!1):(l.viewBox=l.state.vb,l.vbIsInitializedFromState=!0,Array.isArray(l.state.roots)&&(l.config.roots=l.state.roots));var d=l.maxX,f=l.maxY,p=l.minX,m=l.minY,h=l.bordersByRootIdAndLevel,g=l.roots,_=l.nodes;if(!t)_?l.oldNodes=_:l.oldNodes=null,l._read(function(t){d=t.maxX,f=t.maxY,p=t.minX,m=t.minY,h=t.bordersByRootIdAndLevel,g=t.roots,_=t.nodes;var i=e.manager._getResponse(n,r,l.visibleNodeIds,l.config,d,f,p,m,l.viewBox,g,l.action,l.actionParams,_,l.oldNodes,l.vbIsInitializedFromState);i.notif=t.limit,i.roots=g,i.bordersByRootIdAndLevel=h,i.adjustify=t.adjustify,a!=e.action.exporting&&(l.maxX=d,l.maxY=f,l.minX=p,l.minY=m,l.roots=g,l.nodes=_,l.visibleNodeIds=i.visibleNodeIds,l.bordersByRootIdAndLevel=h,l.rootList=t.rootList),s(i)},c);else{var v=e.manager._getResponse(n,r,l.visibleNodeIds,l.config,d,f,p,m,l.viewBox,g,l.action,l.actionParams,_,l.oldNodes,l.vbIsInitializedFromState);a!=e.action.exporting&&(l.maxX=d,l.maxY=f,l.minX=p,l.minY=m,l.roots=g,l.nodes=_,l.visibleNodeIds=v.visibleNodeIds),v.bordersByRootIdAndLevel=h,v.roots=g,v.adjustify={x:0,y:0},l.state&&(v.adjustify=l.state.adjustify),s(v)}})},e.manager.prototype._read=function(t,n){var r=this,i=e.manager._createNodes(this.instance);n(i);var a=i.nodes,o=i.roots,s=e.remote;s??=e.local,s._setPositions(o,r.layoutConfigs,function(n){var s=e.manager._doNotChangePositionOfClickedNodeIfAny(o,a,r.action,r.actionParams,r.oldNodes,r.config.orientation);r.state&&r.action==e.action.init&&(s=r.state.adjustify),r.action==e.action.exporting?s=r._fixAdjustForExport:r._fixAdjustForExport=s;for(var c={minX:null,minY:null,maxX:null,maxY:null},l={},u=[],d=0;d<o.length;d++)e.manager._setMinMaxXYAdjustifyIterate(o[d],o[d],c,0,l,s,r.config.orientation,u);for(var d=0;d<o.length;d++)e.manager._setChildCountPropsIterate(o[d],a);for(var f in u)for(var p in u[f]){var m=l[f][p],h=u[f][p];m.minX==null&&m.minY==null&&m.maxX==null&&m.maxY==null&&e._setMinMaxXY(h,m,!0)}t({minX:c.minX,minY:c.minY,maxX:c.maxX,maxY:c.maxY,bordersByRootIdAndLevel:l,nodes:a,roots:o,rootList:i.rootList,limit:n,adjustify:s})},a)},e===void 0&&(e={}),e.manager._initDinamicNode=function(t,n,r){n&&(t.lcn=n),r&&(t.isAssistant=!0);var i=e.t(t.templateName);t.w=i&&i.size?i.size[0]:0,t.h=i&&i.size?i.size[1]:0,t.isSplit=t.templateName==`split`,t.isMirror=t.templateName==`mirror`,t.isSubLevel=t.templateName==`subLevel`},e.manager._setCollpasedProperty=function(t,n,r,i,a,o,s,c){if(t.collapsed==null&&n.collapse&&n.collapse.allChildren?t.collapsed=!0:t.collapsed??=!1,a==e.action.expand&&r.ids.indexOf(t.id)!=-1&&(t.collapsed=!1),a==e.action.collapse&&(r.expandIds||r.collapseIds)?r.expandIds&&r.expandIds.indexOf(t.id)!=-1?t.collapsed=!1:r.collapseIds&&r.collapseIds.indexOf(t.id)!=-1&&(t.collapsed=!0):a==e.action.collapse&&r.ids.indexOf(t.id)!=-1&&(t.collapsed=!0),a==e.action.expand&&r.ids==`all`&&(t.collapsed=!1),a==e.action.exporting&&(!e.isNEU(r.parentLevels)||!e.isNEU(r.childLevels))&&r.id!=null){if(r.id!=null&&(!e.isNEU(r.parentLevels)||!e.isNEU(r.childLevels))){var l=c[r.id];if(l==t)t.collapsed=!1;else{for(var u=!1,d=-1,f=!1,p=-1;l;){if(d++,l==t){u=!0;break}l=c[l.pid]}l=c[r.id];for(var m=c[t.id];m;){if(p++,m==l){f=!0;break}m=c[m.pid]}r.parentLevels!=null&&u&&d<=r.parentLevels||r.childLevels!=null&&f&&p<=r.childLevels||f&&r.expandChildren?t.collapsed=!1:t.collapsed=!0}}}else a==e.action.exporting&&r.expandChildren&&(t.collapsed=!1);a==e.action.init&&s!=null?t.collapsed=!s.exp.has(t.id):a==e.action.init?t.tags.indexOf(`left-partner`)!=-1||t.tags.indexOf(`right-partner`)!=-1||t.tags.indexOf(`partner`)!=-1||t.parentPartner?t.collapsed=n.collapse&&o>=n.collapse.level&&i.indexOf(t.id)==-1:t.collapsed=n.collapse&&o>=n.collapse.level-1&&i.indexOf(t.id)==-1:a==e.action.centerNode||a==e.action.insert||a==e.action.expand||a==e.action.collapse?i.has(t.id)&&(t.collapsed=!1):a==e.action.update&&r&&r.changeRoots&&r.changeRoots.has(t.id)&&(t.collapsed=!1)},e.manager._initNode=function(t,n,r,i,a,o,s){var c=s.manager.config,l=s.manager.layoutConfigs,u=s.manager.action,d=s.manager.actionParams,f=s.manager.state,p=l[r||`base`];t.parent??e.manager._setCollpasedProperty(t,p,d,a,u,i-1,f,n);for(var m=0;m<t.childrenIds.length;m++){var h=n[t.childrenIds[m]];if(e.manager._setCollpasedProperty(h,p,d,a,u,i,f,n),h.collapsed)t.collapsedChildCount++;else{if(h.parent=t,h.ppid!=null){var g=n[h.ppid];g&&(h.parentPartner=g)}(h.tags.indexOf(`left-partner`)!=-1||h.tags.indexOf(`right-partner`)!=-1||h.tags.indexOf(`partner`)!=-1||h.parentPartner)&&o.indexOf(t.id)==-1&&o.push(t.id),t.children.push(h)}}if(u==e.action.minimize&&!t.min?(d.all||d.id==t.id)&&(t.min=!0):u==e.action.maximize&&t.min===!0?(d.all||d.id==t.id)&&(t.min=!1):u==e.action.exporting&&d.min===!1?t.min=!1:u==e.action.init&&f!=null&&(t.min=f.min.has(t.id)),!t.min&&(!t.tags||!t.tags.has(`filter`)))for(var m=0;m<t.stChildrenIds.length;m++){var h=n[t.stChildrenIds[m]];h.stParent=t,t.stChildren.push(h)}i!=null&&(t.level=i),r&&(t.lcn=r);var _=e._getSubLevels(t.tags,c.tags);_>0&&(t.subLevels=_),t.tags.indexOf(`assistant`)!=-1&&t.parent!=null&&(t.isAssistant=!0),p.layout==e.layout.treeList&&(t.isTreeListItem=!0),p.template&&c.template==t.templateName&&(t.templateName=p.template);var v=e.t(t.templateName,t.min);if(t.w=v&&v.size?v.size[0]:0,t.h=v&&v.size?v.size[1]:0,t.padding=v&&v.padding?v.padding:[0,0,0,0],t.isTreeListItem&&t.stParent&&t.stParent.treeList==null){var y=e.t(t.stParent.templateName,t.stParent.min);t.stParent.treeList={pinnedIds:[],scrollTop:0,scrollTopMax:0,maxHeight:y.treeListMaxHeight}}var b={node:t};e.events.publish(`node-initialized`,[s,b])},e.manager._iterate=function(t,n,r,i,a,o,s,c,l,u,d,f){var p=f.manager.layoutConfigs;if(e.manager._initNode(n,r,l,i,u,d,f),n.isAssistant&&(o[n.pid]||(o[n.pid]=[]),o[n.pid].push(n.id)),n.subLevels>0&&s.push(n.id),e.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN&&!n.isAssistant&&n.parent){if(n.parent&&n.parent.children.length&&n.parent.children[n.parent.children.length-1]==n){for(var m=[],h=0,g=0,_=0;_<n.parent.children.length;_++){var v=n.parent.children[_];v.tags.indexOf(`partner`)==-1&&v.tags.indexOf(`left-partner`)==-1&&v.tags.indexOf(`right-partner`)==-1&&v.tags.indexOf(`assistant`)==-1&&v.children.length==0?m.push(v.id):v.tags.indexOf(`assistant`)==-1?(v.tags.indexOf(`partner`)!=-1||v.tags.indexOf(`left-partner`)!=-1||v.tags.indexOf(`right-partner`)!=-1)&&g++:h++}(e.MIXED_LAYOUT_ALL_NODES&&m.length>1&&m.length==n.parent.children.length-h-g||!e.MIXED_LAYOUT_ALL_NODES&&m.length>1)&&(c[n.pid]=m)}}else if(!n.isAssistant&&n.childrenIds.length==0&&n.parent&&!c[n.pid]){for(var m=[],h=0,g=0,_=0;_<n.parent.children.length;_++){var v=n.parent.children[_];v.tags.indexOf(`partner`)==-1&&v.tags.indexOf(`left-partner`)==-1&&v.tags.indexOf(`right-partner`)==-1&&v.tags.indexOf(`assistant`)==-1&&v.childrenIds.length==0?m.push(v.id):v.tags.indexOf(`assistant`)==-1?(v.tags.indexOf(`partner`)!=-1||v.tags.indexOf(`left-partner`)!=-1||v.tags.indexOf(`right-partner`)!=-1)&&g++:h++}(e.MIXED_LAYOUT_ALL_NODES&&m.length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&m.length==n.parent.childrenIds.length-h-g||!e.MIXED_LAYOUT_ALL_NODES&&m.length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)&&(c[n.pid]=m)}n.stChildren.length&&(t.stContainerNodes||=[],t.stContainerNodes.push(n));for(var y=0;y<n.stChildren.length;y++){for(var b=``,_=0;_<n.tags.length;_++)if(p[n.tags[_]]){b=n.tags[_];break}a.push(n.stChildren[y].id),e.manager._iterate(t,n.stChildren[y],r,0,a,o,s,c,b,u,d,f)}i++;for(var y=0;y<n.children.length;y++)n.isTreeListItem&&(n.children[y].isTreeListItem=n.isTreeListItem),e.manager._iterate(t,n.children[y],r,i,a,o,s,c,l,u,d,f)},e.manager.__createNodes=function(t,n,r,i,a,o,s,c){for(var l=[],u=e._addDottedLines(r),d=0;d<u.length;d++){var f=u[d],p=e.STRING_TAGS?f.tags?f.tags.split(`,`):[]:Array.isArray(f.tags)?f.tags.slice(0):[];c.filterUI.addFilterTag(f)&&p.unshift(`filter`);var m=c.searchUI.addMatchTag(f.id);m===!0?p.unshift(`match`):m===!1&&p.unshift(`no-match`);var h=e._getTemplate(p,r.tags,r.template);f&&f.template&&(h=f.template);var g=new e.node(f.id,f.pid,p,h);e.isNEU(f.ppid)||(g.ppid=f.ppid),e.isNEU(f.stpid)||(g.stpid=f.stpid),f.movex!=null&&(g.movex=f.movex),f.movey!=null&&(g.movey=f.movey),t[f.id]=g,l.push(f.id)}if(r.orderBy!=null){var _=e.manager._getOrderSortArray(r.orderBy);l.sort(function(e,t){var n,r;for(var i of u)if(i.id==e&&(n=i),i.id==t&&(r=i),n&&r)break;for(var a=0;a<_.length;a++){var o=n[_[a].field],s=r[_[a].field],c=o,l=s;if(c??=``,l??=``,typeof c==`string`&&typeof l==`string`){var d=c.localeCompare(l);if(_[a].desc&&(d*=-1),d!==0)return d}else{var d=o<s?-1:o>s?1:0;if(_[a].desc&&(d*=-1),d!==0)return d}}})}for(var d=0;d<l.length;d++){var v=l[d],g=t[v],y=o?o[v]:null,b=t[g.stpid],x=t[g.pid];if(b||(g.stpid=null),x||(g.pid=null),b){var S=o?o[b.id]:null;S&&(b.min=S.min),b.stChildrenIds.push(g.id)}else x?(y&&(g.collapsed=y.collapsed,g.min=y.min,g.treeList=y.treeList),x.childrenIds.push(g.id)):(y&&(g.collapsed=y.collapsed,g.min=y.min,g.treeList=y.treeList),n.push(g),s.push(g.id));i==e.action.init&&(g.min=e._getMin(g,r))}},e.manager._createNodes=function(t){var n=t.manager.config,r=t.manager.layoutConfigs,i=t.manager.action,a=t.manager.actionParams,o=t.manager.oldNodes,s=t.manager.state,c={},l=[],u=[];if(e.manager.__createNodes(c,l,n,i,a,o,u,t),n.roots!=null){l=[];for(var d=0;d<n.roots.length;d++){var f=c[n.roots[d]];if(f&&i==e.action.centerNode){for(var p=f;p.pid!=null||p.stpid!=null;)p=p.pid==null&&p.stpid!=null?c[p.stpid]:c[p.pid];for(var m=c[a.id];(m.pid!=null||m.stpid!=null)&&m!=f;)m=m.pid==null&&m.stpid!=null?c[m.stpid]:c[m.pid];p==m&&(f=p)}if(f){for(var h=!1,g=0;g<l.length;g++)if(l[g].id==f.id){h=!0;break}if(!h){if(!e.isNEU(f.pid)){var _=c[f.pid],v=_.childrenIds.indexOf(f.id);v>-1&&_.childrenIds.splice(v,1)}l.push(f)}}}n.roots=[];for(var d=0;d<l.length;d++)n.roots.push(l[d].id)}if(i==e.action.exporting&&a.id!=null)if(a.parentLevels){for(var _=c[a.id],y=0;y<a.parentLevels&&c[_.pid];)y++,_=c[_.pid];_.pid=null,l=[_]}else{var b=c[a.id];b&&(b.pid=null,l=[b])}var x=[];if(i==e.action.init&&n.expand&&n.expand.nodes&&s==null)for(var d=0;d<n.expand.nodes.length;d++){var b=c[n.expand.nodes[d]];for(n.expand.allChildren===!0&&e.manager._addExpandedNodeIdsIterate(b,c,x);b;)x.push(b.id),b.pid==null&&b.stpid!=null?(b=c[b.stpid],b.min=!1):b=c[b.pid]}else if(i==e.action.expand&&a.ids&&a.ids!=`all`||i==e.action.collapse&&a&&a.expandIds)for(var S=i==e.action.expand?a.ids:a.expandIds,d=0;d<S.length;d++)for(var b=c[S[d]],_=c[b.pid];_;)x.push(_.id),_.pid==null&&_.stpid!=null?(_=c[_.stpid],_.min=!1):_=c[_.pid];else if(i==e.action.centerNode){for(var C=e._getCenterNodeFromParams(c,a);C;){if(x.push(C.id),a.options.parentState===e.COLLAPSE_PARENT_NEIGHBORS&&C)for(var d=0;d<C.childrenIds.length;d++){var w=c[C.childrenIds[d]];w.collapsed=!0}if(C.pid==null&&C.stpid!=null){if(C=c[C.stpid],C.min=!1,C.tags){var v=C.tags.indexOf(`filter`);v!=-1&&(C.tags.splice(v,1),t.filterUI._removeFilter(C.id))}}else C=c[C.pid]}if(C=e._getCenterNodeFromParams(c,a),a.options.childrenState===e.COLLAPSE_SUB_CHILDRENS)for(var d=0;d<C.childrenIds.length;d++){var T=c[C.childrenIds[d]];T.collapsed=!1;for(var E=0;E<T.childrenIds.length;E++){var D=c[T.childrenIds[E]];D.collapsed=!0}}if(a.options.parentState===e.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED){var _=c[C.pid];if(_)for(var d=0;d<_.childrenIds.length;d++){var T=c[_.childrenIds[d]];if(T!=C){T.collapsed=!1;for(var E=0;E<T.childrenIds.length;E++){var D=c[T.childrenIds[E]];D.collapsed=!0}}}}}else if(i==e.action.insert)for(var b=c[a.insertedNodeId];b;)x.push(b.id),b.pid==null&&b.stpid!=null?(b=c[b.stpid],b.min=!1):b=c[b.pid];for(var O=[],k={},A=[],j={},M=[],d=0;d<l.length;d++)e.manager._iterate(l[d],l[d],c,0,O,k,A,j,``,x,M,t);if(i==e.action.collapse&&a&&Array.isArray(a.expandIds)&&Array.isArray(a.collapseIds))for(var d=0;d<a.ids.length;d++)if(a.expandIds.has(a.collapseIds[d]))console.error(`id ${a.collapseIds[d]} exist in both collapseIds and expandIds`);else{var b=c[a.collapseIds[d]];b&&(b.collapsed=!0)}for(var d=l.length-1;d>=0;d--)l[d].collapsed&&l.splice(d,1);for(var d=0;d<M.length;d++){for(var b=c[M[d]],N=[],P=[],F=[],I={},ee=0,L=0,R=0,te=[],ne=[],E=0;E<b.children.length;E++){var w=b.children[E];w.isAssistant?N.push(w.id):w.tags.indexOf(`right-partner`)==-1?w.tags.indexOf(`left-partner`)==-1?w.tags.indexOf(`partner`)!=-1&&!(ee%2)?(w.isPartner=1,w.children=[],P.push(w.id),ee++):w.tags.indexOf(`partner`)!=-1&&ee%2?(w.isPartner=2,w.children=[],F.push(w.id),ee++):w.parentPartner?(I[w.parentPartner.id]||(I[w.parentPartner.id]=[]),I[w.parentPartner.id].push(w.id)):N.push(w.id):(w.isPartner=2,w.children=[],F.push(w.id)):(w.isPartner=1,w.children=[],P.push(w.id))}b.children=[];for(var re=[],E=0;E<P.length;E++){var w=c[P[E]];I[w.id]?b.children.push(w):b.children.splice(0,0,w);for(var ie=0;ie<w.childrenIds.length;ie++)re.push(w.childrenIds[ie])}for(var ae=[],E=0;E<F.length;E++){var w=c[F[E]];I[w.id]?b.children.push(w):b.children.splice(0,0,w);for(var ie=0;ie<w.childrenIds.length;ie++)ae.push(w.childrenIds[ie])}for(var E=0;E<ae.length;E++){var w=c[ae[E]];w.collapsed||(w.parentPartner=w.parent,w.parent=b,w.isChildOfPartner=!0,b.children.push(w))}for(var E=F.length-1;E>=0;E--)if(I[F[E]])for(var g=0;g<I[F[E]].length;g++)b.children.push(c[I[F[E]][g]]),L++,ne.indexOf(F[E])==-1&&ne.push(F[E]);for(var E=0;E<N.length;E++){var w=c[N[E]];b.children.push(w)}for(var E=0;E<P.length;E++)if(I[P[E]])for(var g=0;g<I[P[E]].length;g++)b.children.push(c[I[P[E]][g]]),R++,te.indexOf(P[E])==-1&&te.push(P[E]);for(var E=0;E<re.length;E++){var w=c[re[E]];w.collapsed||(w.parentPartner=w.parent,w.parent=b,w.isChildOfPartner=!0,b.children.push(w))}b.partnerSeparation=Math.max(ne.length,te.length)*n.partnerChildrenSplitSeparation+n.minPartnerSeparation,!N.length&&L&&!R?b.hasPartners=2:!N.length&&!L&&R?b.hasPartners=3:!N.length&&L==1&&R==1?b.hasPartners=4:!N.length&&!L&&!R?b.hasPartners=5:N.length&&!L&&!R?b.hasPartners=6:N.length&&(L||R)?b.hasPartners=7:b.hasPartners=1}for(var d=0;d<A.length;d++)for(var b=c[A[d]],oe=b.lcn?b.lcn:`base`,se=r[oe],E=0;E<b.subLevels;E++){var z=new e.node(b.id+`_sub_level_index_`+E,b.pid,[],`subLevel`);e.manager._initDinamicNode(z,b.lcn);var _=b.parent;if(_){b.movex!=null&&(z.movex=b.movex),b.movey!=null&&(z.movey=b.movey);var v=_.children.indexOf(b);v>-1&&(_.children.splice(v,1),_.children.splice(v,0,z)),z.children.push(b),z.parent=_,b.parent=z,c[z.id]=z}}for(var B in k){var _=c[B];_.hasAssistants=!0;var z=new e.node(_.id+`_split_assitant_0`,_.id,[`assistant`],`split`);_.movex!=null&&(z.movex=_.movex),_.movey!=null&&(z.movey=_.movey),e.manager._initDinamicNode(z,_.lcn,!0),c[z.id]=z;for(var V=[],E=_.children.length-1;E>=0;E--){var w=_.children[E];w.isAssistant?(w.parent=null,_.children.splice(E,1),V.splice(0,0,w.id)):w.isPartner||(w.parent&&j[w.parent.id]&&z&&w.parent.id!=z.id&&(Object.defineProperty(j,z.id,Object.getOwnPropertyDescriptor(j,w.parent.id)),delete j[w.parent.id]),w.parent=z,z.children.unshift(w),_.children.splice(E,1))}if(V.length%2){var ce=c[V[V.length-1]],H=new e.node(ce.id+`_mirror`,_.pid,[],`mirror`);e.manager._initDinamicNode(H,ce.lcn,!0),H.isAssistant=!0,H.w=ce.w,H.h=ce.h,c[H.id]=H,V.splice(V.length-1,0,H.id)}for(var le=1,E=V.length-1;E>=0;E--)if(E%2&&E!=V.length-1){var U=new e.node(_.id+`_split_assitant_`+le,_.pid,[],`split`);e.manager._initDinamicNode(U,_.lcn,!0),_.movex!=null&&(U.movex=_.movex),_.movey!=null&&(U.movey=_.movey),c[U.id]=U,V.splice(E,0,U.id),le++}else E%2&&V.splice(E,0,z.id);for(var E=0;E<V.length;E+=3){var W=null;W=E==0?_:c[V[E-2]];var ue=c[V[E]],de=c[V[E+1]],fe=c[V[E+2]];ue.parent=W,de.parent=W,fe.parent=W,W.children.push(ue),W.children.push(de),W.children.push(fe)}}var pe=!1;for(var me in r){var se=r[me];if(se.layout!=0){pe=!0;break}}var he=e.events.has(`node-layout`,t._event_id);if(pe||he){var G={nodes:c,config:n,action:i,actionParams:a};if(A.length){var ge=!1;for(var B in j){for(var S=j[B],d=0;d<S.length;d++){var b=c[S[d]];if(b.subLevels){ge=!0;break}}if(ge)break}if(ge){var _e={},ve={},ye={};for(var B in j)for(var S=j[B],be=!1,K=null,d=0;d<S.length;d++){var q=S[d];(K===null||A.has(q))&&(K=c[q].parent.id,!be&&!e.isNEU(c[q].subLevels)&&(be=c[q].subLevels>0)),_e[K]||(_e[K]=[]),_e[K].push(q),be&&(ye[K]=B,ve[K]||(ve[K]=[]),ve[K].push(q))}for(var B in j={},ve)if(ve[B].length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)for(var xe=ye[B],d=c[xe].children.length-1;d>=0;d--){var w=c[xe].children[d];ve[B].has(w.id)&&c[xe].children.splice(d,1)}for(var B in _e)_e[B].length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&(j[B]=_e[B])}}for(var B in j){for(var _=c[B],J=_;J.isSplit;)J=c[J.pid];for(;J.isSubLevel;)J=c[J.pid];var oe=_.lcn?_.lcn:`base`,se=r[oe];if(se.layout!=0||he){G.pnode=_,G.layout=se.layout,G.layoutGridColumns=n.layoutGridColumns,G.childrenIds=j[B],G.lastChildrenPidIds=j,G.subLevels=0,G.layouts=[],e.events.publish(`node-layout`,[t,G]),e.events.publish(`layout`,[G]),G.layouts.length||G.layouts.push({layout:G.layout,childrenIds:G.childrenIds,subLevels:G.subLevels,layoutGridColumns:G.layoutGridColumns});for(var Y=0;Y<G.layouts.length;Y++){var X=G.layouts[Y];for(e.isNEU(X.subLevels)&&(X.subLevels=0),e.isNEU(X.layout)&&(X.layout=se.layout),_=c[B],J=_;J.isSplit;)J=c[J.pid];for(;J.isSubLevel;)J=c[J.pid];for(var Z=_,E=0;E<X.subLevels;E++){var z=new e.node(Y+`_sublevel_layout_`+E,Z.id,[],`subLevel`);e.manager._initDinamicNode(z,Z.lcn),z.parent=Z,Z.children.push(z),c[z.id]=z,Z=z}if(X.subLevels){for(var E=0;E<X.childrenIds.length;E++){var w=c[X.childrenIds[E]],v=_.children.indexOf(w);v!=-1&&_.children.splice(v,1),w.parent=Z,Z.children.push(w)}_=Z}if(X.layout==e.layout.grid&&X.childrenIds.length>2){X.layoutGridColumns==`dynamic`&&(X.layoutGridColumns=e._getDynamicGridCoulumns(X.childrenIds.length));for(var Se=_.id,d=_.children.length-1;d>=0;d--)for(var E=0;E<X.childrenIds.length;E++){var q=X.childrenIds[E];if(_.children[d].id==q){_.children.splice(d,1);break}}var Q=X.layoutGridColumns;Q%2!=0&&Q>2&&Q--;for(var d=0;d<X.childrenIds.length;d+=Q)for(var Ce=null,E=0;E<Q;E++){var we=d+Q>=X.childrenIds.length;if(X.childrenIds.length-1<d+E)break;var q=X.childrenIds[d+E],w=c[q];w.parent=c[Se],c[Se].children.push(w),we||(Q/2-1==E&&(Ce=new e.node(X.childrenIds[d+E-1]+`_grid_pseudo_node_`+X.childrenIds[d+E+1],Se,[],`subLevel`),e.manager._initDinamicNode(Ce,_.lcn),Ce.parent=c[Se],c[Se].children.push(Ce),c[Ce.id]=Ce),Q-1==E&&(Se=Ce.id))}}if(X.layout==e.layout.mixed)for(var Te=X.childrenIds,d=Te.length-1;d>=0;d--){var w=c[Te[d]];_=w.parent,w.layout=e.layout.mixed;for(var E=_.children.length-1;E>=0;E--)if(w.id==_.children[E].id){_.children.splice(E,1);break}if(d>0){var Ee=c[Te[d-1]];w.parent=Ee,w.layout=e.layout.mixed,Ee.children.push(w)}else _.children.push(w)}else if(X.layout>1){var z=new e.node(Y+`_`+_.id+`_split_0`,J.id,[],`split`);_.movex!=null&&(z.movex=_.movex),_.movey!=null&&(z.movey=_.movey),e.manager._initDinamicNode(z,_.lcn),c[z.id]=z,z.layout=X.layout;for(var $=[],d=X.childrenIds.length-1;d>=0;d--){for(var w=c[X.childrenIds[d]],E=0;E<_.children.length;E++)_.children[E].id==w.id&&_.children.splice(E,1);if(w.parent=null,w.layout=X.layout,(X.layout==e.layout.treeRightOffset||X.layout==e.layout.treeRight)&&$.splice(0,0,w.id),X.layout>2){var De=new e.node(Y+`_`+w.id+`_mirror`,J.id,[],`mirror`);e.manager._initDinamicNode(De,w.lcn),De.layout=X.layout,c[De.id]=De,$.splice(0,0,De.id)}X.layout!=e.layout.treeRightOffset&&X.layout!=e.layout.treeRight&&$.splice(0,0,w.id)}for(var le=1,E=$.length-1;E>=0;E--)if(E%2&&E!=$.length-1){var U=new e.node(Y+`_`+_.id+`_split_`+le,J.id,[],`split`);e.manager._initDinamicNode(U,_.lcn),_.movex!=null&&(U.movex=_.movex),_.movey!=null&&(U.movey=_.movey),U.layout=X.layout,c[U.id]=U,$.splice(E,0,U.id),le++}else E%2&&$.splice(E,0,z.id);for(var E=0;E<$.length;E+=3){var W=null;E==0&&(W=_);var ue=c[$[E]],de=c[$[E+1]],fe=c[$[E+2]];E!=0&&(W=c[$[E-3]]),E!=0&&!de&&(W=c[$[E-2]]),ue.parent=W,W.children.push(ue),de&&(E!=0&&(W=c[$[E-2]]),de.parent=W,W.children.push(de)),fe&&(E!=0&&(W=c[$[E-1]]),fe.parent=W,W.children.push(fe))}}}}}}if(e.VERTICAL_CHILDREN_ASSISTANT)for(var d=0;d<l.length;d++)e.manager._verticalAssistantIterate(l[d],c);var G={nodes:c,roots:l};return e.events.publish(`nodes-initialized`,[t,G]),{nodes:G.nodes,roots:G.roots,rootList:u}},e.manager._getOrderSortArray=function(e){if(typeof e==`string`)return[{field:e,desc:!1}];if(Array.isArray(e)){var t=[];for(var n of e)typeof n==`string`?t.push({field:n,desc:!1}):e instanceof Object?t.push(n):console.error(`Unseported orderBy value!`);return t}else if(e instanceof Object)return[e];else console.error(`Unseported orderBy value!`)},e.manager._getNodeWidth=function(t,n){switch(n.orientation){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:return t.w;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:return t.h}return 0},e.manager._isVisible=function(t,n,r,i,a,o,s){var c=0;if(e.LAZY_LOADING_FACTOR==`auto`){var l=o/a*2,u=s/a*2;c=Math.ceil(l>u?l:u)}else c=e.LAZY_LOADING_FACTOR/a;if(!(t.x==null||t.y==null)){if(e._getLazyLoading(n)&&i!==e.action.exporting){function e(e,t){var n=e.x,r=e.y,i=e.w,a=e.h,o=t[0]-c,s=t[2]+c+t[0],l=t[1]-c,u=t[3]+c+t[1],d=n+i>o&&s>n;return d&&=r+a>l&&u>r,d}if(e(t,r))return!0;for(var d=0;d<t.children.length;d++)if(e(t.children[d],r))return!0;return!1}return!0}},e.manager.getAllFields=function(t){var n=[e.TAGS];for(var r in t.nodeBinding)n.push(t.nodeBinding[r]);for(var r=0;r<t.nodes.length;r++)for(var i in t.nodes[r])i!==e.ID&&i!==e.TAGS&&i!==e.NODES&&i!==e.PID&&i!==e.STPID&&i!==`movex`&&i!==`movey`&&(t.nodeBinding[i]||n.has(i)||n.push(i));return n},e.manager._getMostDeepChild=function(e){if(!e)return;var t=e;function n(e){e.sl>t.sl&&(t=e);for(var r=0;r<e.children.length;r++)n(e.children[r])}return n(e),t},e.manager._getResponse=function(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=u[0],_=[],v={top:null,left:null,bottom:null,right:null,minX:null,maxX:null,minY:null,maxY:null},y=[[],[],[]],b=a-s+i.padding*2,x=o-c+i.padding*2,S=e.getScale(l,t,n,i.scaleInitial,i.scaleMax,i.scaleMin,b,x);if(v.top=c-i.padding,v.left=s-i.padding,v.bottom=o+i.padding-n/S,v.right=a+i.padding-t/S,v.maxX=a,v.minX=s,v.maxY=o,v.minY=c,u.length==0||l==null&&!h&&i.align==e.CENTER){var C=Math.ceil(t/S),w=Math.ceil(n/S),T=0,E=0;if(C-i.padding*2>=a-s)switch(T=(a+s)/2-C/2,i.orientation){case e.orientation.right:case e.orientation.right_top:T=(s-a)/2-C/2;break}else switch(T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,i.orientation){case e.orientation.right:case e.orientation.right_top:T=-(C/2-(s-a)/2),T<i.padding-C&&(T=i.padding-C);break;case e.orientation.left:case e.orientation.bottom_left:case e.orientation.top_left:case e.orientation.left_top:T=-(C/2-(a-s)/2),T>-i.padding&&(T=-i.padding);break}if(w-i.padding*2>=o-c)switch(E=(o+c)/2-w/2,i.orientation){case e.orientation.bottom:case e.orientation.bottom_left:E=(c-o)/2-w/2;break}else switch(E=-(w/2-(o-c)/2),E>-i.padding&&(E=-i.padding),i.orientation){case e.orientation.bottom:case e.orientation.bottom_left:E=-(w/2-(c-o)/2),E<i.padding-w&&(E=i.padding-w);break;case e.orientation.left:case e.orientation.right:E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break}l=[T,E,C,w]}else if(l==null&&!h&&i.align==e.ORIENTATION){var C=Math.ceil(t/S),w=Math.ceil(n/S),T=0,E=0;switch(i.orientation){case e.orientation.top:T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,E=-i.padding;break;case e.orientation.bottom:T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,E=i.padding-w;break;case e.orientation.left:T=-i.padding,E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break;case e.orientation.right:T=i.padding-C,E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break;case e.orientation.top_left:T=-i.padding,E=-i.padding;break;case e.orientation.right_top:T=i.padding-C,E=-i.padding;break;case e.orientation.left_top:T=-i.padding,E=-i.padding;break;case e.orientation.bottom_left:T=-i.padding,E=i.padding-w;break}l=[T,E,C,w]}if(d==e.action.centerNode||d==e.action.maximize){var D=e._getCenterNodeFromParams(p,f);f.options.horizontal==1&&(l[0]=D.x+D.w/2-l[2]/2),f.options.vertical==1&&(l[1]=D.y+D.h/2-l[3]/2)}if(d==e.action.insert||d==e.action.expand||d==e.action.collapse||d==e.action.update||d==e.action.centerNode){var O=null;if(d==e.action.insert&&f&&f.insertedNodeId!=null&&f.insertedNodeId!=null)O=p[f.insertedNodeId];else if(d==e.action.update&&f&&f.visId!=null&&f.visId!=null)O=p[f.visId];else if((d==e.action.expand||d==e.action.collapse)&&f&&f.id!=null&&f.id!=null)O=p[f.id],O=e.manager._getMostDeepChild(O);else if(d==e.action.centerNode){switch(i.orientation){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:f.options.vertical||(O=p[f.id]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:f.options.horizontal||(O=p[f.id]);break}O&&=e.manager._getMostDeepChild(O)}if(!e.FIXED_POSITION_ON_CLICK&&O){if(O.isTreeListItem){for(;!O.stParent;)O=O.parent;O=O.stParent}switch(i.orientation){case e.orientation.top:case e.orientation.top_left:var k=O.y+O.h-l[3]+i.padding;l[1]<k&&(l[1]=k);break;case e.orientation.bottom:case e.orientation.bottom_left:var k=O.y-i.padding;l[1]>k&&(l[1]=k);break;case e.orientation.right:case e.orientation.right_top:var k=O.x-i.padding;l[0]>k&&(l[0]=k);break;case e.orientation.left:case e.orientation.left_top:var k=O.x+O.w-l[2]+i.padding;l[0]<k&&(l[0]=k);break}}}for(var A=0;A<u.length;A++)e.manager._iterate2(u[A],p,i,l,d,f,_,m,r,y,S,t,n);return{animations:y,boundary:v,viewBox:l,visibleNodeIds:_,nodes:p,allFields:e.manager.getAllFields(i)}},e.manager._iterate2=function(t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.manager._isVisible(t,r,i,a,d,f,p)){s.push(t.id);var m=null;if((a==e.action.expand||a==e.action.collapse||a==e.action.maximize)&&c&&c[t.id]&&o.method==`expandCollapseToLevel`){var h=c[t.id];if(m={x:h.x,y:h.y},h){m={x:h.x,y:h.y};for(var g=t,_=null;g!=null;)c[g.id]&&c[g.id].collapsed&&(_=g),g=g.parent;_&&_.parent&&(m={x:_.parent.x,y:_.parent.y})}var v=n[o.id];if(v){for(var g=t.parent;g!=null;)g=g.parent;g&&(m={x:v.x+v.w/2-t.w/2,y:v.y+v.h/2-t.h/2})}}else if((a==e.action.expand||a==e.action.collapse)&&c&&c[t.id]){var h=c[t.id];if(m={x:h.x,y:h.y},o.ids==`all`&&h){m={x:h.x,y:h.y};for(var g=t,_=null;g!=null;)c[g.id]&&c[g.id].collapsed&&(_=g),g=g.parent;_&&_.parent&&(m={x:_.parent.x,y:_.parent.y})}var v=n[o.id];if(v){for(var g=t.parent;g!=null&&o.ids.indexOf(t.id)==-1&&o.ids.indexOf(g.id)==-1;)g=g.parent;g&&(m={x:v.x+v.w/2-t.w/2,y:v.y+v.h/2-t.h/2})}}else if(a==e.action.centerNode&&c&&c[t.id]){var h=c[t.id];h.x!=null&&h.y!=null&&(m={x:h.x,y:h.y});var y=e._getCenterNodeFromParams(n,o);if(y&&y==t){var g=t.parent;g&&g.id==o.id&&(m={x:y.x+y.w/2-t.w/2,y:y.y+y.h/2-t.h/2})}}else if(a==e.action.maximize&&c&&c[t.id]){var h=c[t.id];h.x!=null&&h.y!=null&&(m={x:h.x,y:h.y});var y=e._getCenterNodeFromParams(n,o);if(y&&y==t){var g=t.parent;g&&g.id==o.id&&(m={x:y.x+y.w/2-t.w/2,y:y.y+y.h/2-t.h/2})}}else if(a==e.action.minimize&&c&&c[t.id]){var h=c[t.id];m={x:h.x,y:h.y}}else if(a==e.action.insert&&o&&o.insertedNodeId==t.id&&t.parent)m={x:t.parent.x,y:t.parent.y};else if((a==e.action.update||a==e.action.insert)&&c){var h=c[t.id];if((!h||e.isNEU(h.x)&&e.isNEU(h.y))&&o){var v=n[o.id];if(v){for(var g=v;g&&g.id==t.id;)g=g.parent;g&&(m={x:v.x,y:v.y})}}else h&&(m={x:h.x,y:h.y})}else a!==e.action.exporting&&a!==e.action.init&&l.indexOf(t.id)==-1&&(u[0].push(t.id),u[1].push({opacity:0}),u[2].push({opacity:1}));m!=null&&m.x!=null&&m.y!=null&&(m.x!=t.x||m.y!=t.y)&&!(o&&o.dragNodeIdList&&o.dragNodeIdList.indexOf(t.id)!=-1)&&!t.isSplit&&(u[0].push(t.id),u[1].push({transform:[1,0,0,1,m.x,m.y]}),u[2].push({transform:[1,0,0,1,t.x,t.y]}))}for(var b=0;b<t.stChildren.length;b++)e.manager._iterate2(t.stChildren[b],n,r,i,a,o,s,c,l,u,d,f,p);for(var b=0;b<t.children.length;b++)e.manager._iterate2(t.children[b],n,r,i,a,o,s,c,l,u,d,f,p)},e.manager._addExpandedNodeIdsIterate=function(t,n,r){for(var i=0;i<t.childrenIds.length;i++)r.push(t.childrenIds[i]),e.manager._addExpandedNodeIdsIterate(n[t.childrenIds[i]],n,r)},e.manager._setChildCountPropsIterate=function(t,n){t.w===void 0&&(t.collapsedChildCount=t.childrenIds.length),t.deepChildCount=t.childCount=t.childrenIds.length,t.deepCollapsedChildCount=t.collapsedChildCount;for(var r=n[t.pid];r;)r.deepCollapsedChildCount+=t.collapsedChildCount,r.deepChildCount+=t.childCount,r=n[r.pid];for(var i of t.stChildrenIds)e.manager._setChildCountPropsIterate(n[i],n);for(var i of t.childrenIds)e.manager._setChildCountPropsIterate(n[i],n)},e.manager._setMinMaxXYAdjustifyIterate=function(t,n,r,i,a,o,s,c){t.x+=o.x,t.y+=o.y;for(var l of t.stChildren)e.manager._setMinMaxXYAdjustifyIterate(l,l,r,0,a,o,s,c);t.isPartner?t.sl=i-1:t.sl=i,a[n.id]??(a[n.id]={}),a[n.id][t.sl]??(a[n.id][t.sl]={minX:null,minY:null,maxX:null,maxY:null}),t.layout?(c[n.id]??(c[n.id]={}),c[n.id][t.sl]??(c[n.id][t.sl]=t)):e._setMinMaxXY(t,a[n.id][t.sl],!0),t.movex!=null&&(t.x+=t.movex),t.movey!=null&&(t.y+=t.movey),e._setMinMaxXY(t,r,!0),i++;for(var l of t.children)e.manager._setMinMaxXYAdjustifyIterate(l,n,r,i,a,o,s,c)},e.manager._doNotChangePositionOfClickedNodeIfAny=function(t,n,r,i,a,o){if(r!=e.action.expand&&r!=e.action.collapse&&r!=e.action.minimize&&r!=e.action.maximize&&r!=e.action.centerNode&&r!=e.action.update&&r!=e.action.insert)return{x:0,y:0};if(r==e.action.update&&(!i||i.id==null)){if(!t||!t.length)return{x:0,y:0};i={id:t[0].id}}if(i.id==null)return{x:0,y:0};var s=i.id;(r==e.action.minimize&&n[s].parent||r==e.action.maximize&&n[s].parent)&&(s=n[s].pid);var c=n[s],l=a[s];if(!l)return{x:0,y:0};var u=l.movex==null?0:l.movex,d=l.movey==null?0:l.movey,f={x:(l.x?l.x-u:0)-c.x,y:(l.y?l.y-d:0)-c.y};return c&&c.isTreeListItem?{x:0,y:0}:f},e.manager._verticalAssistantIterate=function(t,n){for(var r=0;r<t.stChildren.length;r++)e.manager._verticalAssistantIterate(t.stChildren[r],n);if(t.children.length==3)e.manager._verticalAssistantIterate(t.children[0],n),e.manager._verticalAssistantIterate(t.children[2],n),e.manager._verticalAssistantIterate(t.children[1],n);else for(var r=0;r<t.children.length;r++)e.manager._verticalAssistantIterate(t.children[r],n);if(t.isAssistant&&t.isSplit&&t.children.length){for(var i=t.parent.children[0],a=t.parent.children[2],o=t.parent;!o.hasAssistants;)o=o.parent;var s={max:0},c={max:0};e.manager._verticalAssistantLevelCountIterate(i,0,s),e.manager._verticalAssistantLevelCountIterate(a,0,c);for(var l=Math.max(s.max,c.max),u=[],r=0;r<l;r++){var d=new e.node(t.parent.id+`_split_assitant_level_`+r,t.pid,[],`subLevel`);e.manager._initDinamicNode(d,t.lcn,!0),o.movex!=null&&(d.movex=o.movex),o.movey!=null&&(d.movey=o.movey),r>0&&(u[r-1].children.push(d),d.parent=u[r-1]),n[d.id]=d,u.push(d)}if(u.length){for(var f=u[u.length-1],p=u[0],m=t.children.length-1;m>=0;m--){var h=t.children[m];f.children.unshift(h),h.parent=f,t.children.splice(m,1)}t.children.push(p),p.parent=t}}},e.manager._verticalAssistantLevelCountIterate=function(t,n,r){r.max<n&&(r.max=n),n++;for(var i=0;i<t.children.length;i++)e.manager._verticalAssistantLevelCountIterate(t.children[i],n,r)},e._addDottedLines=function(e){var t=e.nodes;if((e.groupDottedLines.length||e.dottedLines.length)&&(t=JSON.parse(JSON.stringify(t))),e.groupDottedLines.length)for(var n=[],r=0;r<e.groupDottedLines.length;r++){var i=e.groupDottedLines[r];i.rootId??=i.to;var a=`balkan_group_dotted_${i.rootId}`;if(!n.has(a)){for(var o=0;o<t.length;o++)if(t[o].id==i.rootId){var s=JSON.parse(JSON.stringify(t[o]));s.id=`balkan_group_dotted_${i.rootId}_balkan_id_${t[o].id}`,s.pid=void 0,s.stpid=t[o].id,t.push(s),n.push(a),t[o].tags||(t[o].tags=[]),t[o].tags.push(`group-dotted-lines`),t[o].tags.push(`group-dotted-lines-`+a);break}}for(var o=0;o<t.length;o++)if(t[o].id==i.from){var s=JSON.parse(JSON.stringify(t[o]));if(s.id=`balkan_group_dotted_${i.rootId}_balkan_id_${t[o].id}`,s.pid=`balkan_group_dotted_${i.rootId}_balkan_id_${i.to}`,s.tags){var c=s.tags.indexOf(`group-dotted-lines`);c!=-1&&s.tags.splice(c,1)}if(s.tags||=[],s.tags.push(`boc-dotted-connector`),i.tags)for(var l=0;l<i.tags.length;l++)s.tags.push(i.tags[l]);t.push(s);break}}if(e.dottedLines.length)for(var r=0;r<e.dottedLines.length;r++){var u=e.dottedLines[r];u.rootId??=u.to;for(var o=0;o<t.length;o++)if(t[o].id==u.from){var s=JSON.parse(JSON.stringify(t[o]));if(s.id=`balkan_dotted_${u.rootId}_balkan_id_${t[o].id}`,u.rootId==u.to?s.pid=u.to:s.pid=`balkan_dotted_${u.rootId}_balkan_id_${u.to}`,s.tags||=[],s.tags.push(`boc-dotted-connector`),u.tags)for(var l=0;l<u.tags.length;l++)s.tags.push(u.tags[l]);t.push(s);break}}return t},e===void 0&&(e={}),e.templates={},e.templates.base={defs:``,size:[250,120],expandCollapseSize:30,linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:`#e6e6e6`,rect:null},svg:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>`,link:`<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} L{xd},{yd}"/>`,node:`<rect x="0" y="0" height="120" width="250" fill="none" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>`,plus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
193
+ </svg>`},e===void 0&&(e={}),e.events=(function(){var t={};return{on:function(e,n,r){Array.isArray(t[e])||(t[e]=[]),t[e].push({listener:n,event_id:r})},removeAll:function(e){Array.isArray(t[e])||(t[e]=[]),t[e]=[]},remove:function(n,r,i){var a=!1;if(t[n]&&Array.isArray(t[n])&&t[n].length>0)for(var o=t[n].length-1;o>=0;o--)(!e.isNEU(i)&&!e.isNEU(r)&&t[n][o].event_id==i&&t[n][o].listener==r||!e.isNEU(i)&&e.isNEU(r)&&t[n][o].event_id==i||e.isNEU(i)&&!e.isNEU(r)&&t[n][o].listener==r||e.isNEU(i)&&e.isNEU(r))&&(t[n].splice(o,1),a=!0);return a},has:function(n,r){if(t[n]&&Array.isArray(t[n])&&t[n].length>0){if(e.isNEU(r))return!0;for(var i=0;i<t[n].length;i++)if(t[n][i].event_id==r)return!0}return!1},removeForEventId:function(e){for(var n in t)if(Array.isArray(t[n]))for(var r=t[n].length-1;r>=0;r--)t[n][r].event_id==e&&t[n].splice(r,1)},publish:function(e,n){if(t[e]){for(var r=[],i=0;i<t[e].length;i++){var a=t[e][i];(a.event_id==null||a.event_id==n[0]._event_id)&&r.push(a.listener)}if(r.length>0){for(var o=!0,i=0;i<r.length&&(n.length==1?o=r[i](n[0])&&o:n.length==2?o=r[i](n[0],n[1])&&o:n.length==3?o=r[i](n[0],n[1],n[2])&&o:n.length==4?o=r[i](n[0],n[1],n[2],n[3])&&o:n.length==5&&(o=r[i](n[0],n[1],n[2],n[3],n[4])&&o),o!==!1);i++);return o}}}}})(),e.prototype.expand=function(t,n,r){this._treeListExpandCollapseHandler(t),this._resetMovableNodes();var i={id:t,ids:n};this._draw(!1,e.action.expand,i,r)},e.prototype.collapse=function(t,n,r){this._treeListExpandCollapseHandler(t),this._resetMovableNodes();var i={id:t,ids:n};this._draw(!1,e.action.collapse,i,r)},e.prototype.expandCollapse=function(t,n,r,i){this._treeListExpandCollapseHandler(t),this._resetMovableNodes(),Array.isArray(n)||(n=[]),Array.isArray(r)||(r=[]);var a={id:t,expandIds:n,collapseIds:r,ids:n.concat(r)};this._draw(!1,e.action.collapse,a,i)},e.prototype.changeRoots=function(t,n,r){this.config.roots=n;var i={id:t,changeRoots:n};this._draw(!1,e.action.update,i,r)},e.prototype._resetMovableNodes=function(){if(e.RESET_MOVABLE_ONEXPANDCOLLAPSE&&this.config.movable!=null){for(var t=!1,n=0;n<this.config.nodes.length;n++){var r=this.config.nodes[n];r.movex!=null&&(r.movex=0,t=!0),r.movey!=null&&(r.movey=0,t=!0)}t&&(this._ai.setContext(),e.events.publish(`updated`,[this]))}},e.prototype.maximize=function(t,n,r,i){var a=this,o={id:t,options:{}};e.isNEU(o.id)&&(o.id=this.roots[0].id,o.all=!0),o.options.horizontal=!1,o.options.vertical=!1,n&&(o.options.horizontal=n),r&&(o.options.vertical=r),this._draw(!1,e.action.maximize,o,function(){a.ripple(t),i&&i()})},e.prototype.minimize=function(t,n){var r=this,i={id:t};e.isNEU(i.id)&&(i.id=this.roots[0].id,i.all=!0),this._draw(!1,e.action.minimize,i,function(){r.ripple(t),n&&n()})},e.prototype._expCollHandler=function(t){this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var n=this.getNode(t),r=this.getCollapsedIds(n);if(r.length){var i=e.events.publish(`expcollclick`,[this,!1,t,r]);if(i===!1)return!1;this.expand(t,r,!1)}else{var i=e.events.publish(`expcollclick`,[this,!0,t,n.childrenIds]);if(i===!1)return!1;this.collapse(t,n.childrenIds,!1)}},e.prototype._upHandler=function(t){this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var n=this._upHandlerCreateArgs(t);if(e.events.publish(`up-click`,[this,n])===!1)return!1;this.changeRoots(n.id,n.roots,!1)},e.prototype._upHandlerCreateArgs=function(e){var t=this.getNode(e),n=Object.assign([],this.config.roots),r=this.getNode(t.pid),i;if(r&&(i=r),i){if(Array.isArray(n)){var a=n.indexOf(t.id);a!=-1&&n.splice(a,1)}else n=[];n.push(i.id)}return{id:t.id,roots:n}},String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return this.replace(new RegExp(e,`g`),t)}),String.prototype.endsWith||(String.prototype.endsWith=function(e){return this.indexOf(e,this.length-e.length)!==-1}),String.prototype.splice||(String.prototype.splice=function(e,t,n){return this.slice(0,e)+n+this.slice(e+Math.abs(t))}),String.prototype.insert||(String.prototype.insert=function(e,t){return e>0?this.substring(0,e)+t+this.substr(e):t+this}),Array.prototype.unique||Object.defineProperty(Array.prototype,`unique`,{value:function(){for(var e=this.concat(),t=0;t<e.length;++t)for(var n=t+1;n<e.length;++n)e[t]===e[n]&&e.splice(n--,1);return e},writable:!0,configurable:!0,enumerable:!1}),Array.prototype.has||Object.defineProperty(Array.prototype,`has`,{value:function(e){for(var t=0;t<this.length;t++)if(this[t]==e)return!0;return!1},writable:!0,configurable:!0,enumerable:!1}),Array.prototype.compare||Object.defineProperty(Array.prototype,`compare`,{value:function(e){if(this.length!=e.length)return!1;for(var t=0;t<this.length;t++)if(!e.has(this[t]))return!1;return!0},writable:!0,configurable:!0,enumerable:!1}),Object.assign||Object.defineProperty(Object,`assign`,{value:function(e,t){"use strict";if(e==null)throw TypeError(`Cannot convert undefined or null to object`);for(var n=Object(e),r=1;r<arguments.length;r++){var i=arguments[r];if(i!=null)for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])}return n},writable:!0,configurable:!0}),e.prototype._globalMouseDownHandler=function(t,n){var r={move:`mousemove`,up:`mouseup`,leave:`mouseleave`};n.type.indexOf(`touch`)!=-1&&(n.touches.length==1?this._touch={x:n.touches[0].clientX,y:n.touches[0].clientY}:this._touch=null,r={move:`touchmove`,up:`touchend`,touchstart:`touchstart`}),this._treeListUpdateInterval&&=(clearInterval(this._treeListUpdateInterval),null);for(var i=null,a=n.target;a!=t&&!a.hasAttribute(e.attr.control_node_menu_id)&&!a.hasAttribute(e.attr.control_node_btn)&&!a.hasAttribute(e.attr.control_node_circle_menu_id);){if(a.hasAttribute){var o=null;a.hasAttribute(e.attr.node_id)?o=this.getNode(a.getAttribute(e.attr.node_id)):a.hasAttribute(e.attr.control_expcoll_id)?o=this.getNode(a.getAttribute(e.attr.control_expcoll_id)):a.hasAttribute(e.attr.control_node_menu_id)?o=this.getNode(a.getAttribute(e.attr.control_node_menu_id)):a.hasAttribute(e.attr.control_node_btn)&&(o=this.getNode(a.getAttribute(e.attr.control_node_btn))),i||=e._getScrollableTreeListNodeInTouchEnabledDevice(o)}if(a.hasAttribute(e.attr.node_id)&&!i&&(this.config.enableDragDrop||this.config.movable)){if(n.touches==null||n.touches.length<=1){this._nodeMouseDownHandler(a,n,r);return}}else if(a.hasAttribute(e.attr.control_node_circle_menu_name)){if(n.stopPropagation(),n.touches==null||n.touches.length<=1){this._nodeCircleNodeMenuItemMouseDownHandler(t,a,n,r);return}}else if(a.hasAttribute(`data-treelist-thumb`)&&(n.stopPropagation(),n.touches==null||n.touches.length<=1)){this._treeListThumbMouseDownHandler(a,n,r);return}a=a.parentNode}n.stopPropagation(),this._mouseDownHandler(t,n,r,i)},e.prototype._globalContextHandler=function(t,n){for(var r=n.target;r!=t;){if(r.hasAttribute(e.attr.node_id)){var i=r.getAttribute(e.attr.node_id),a=this.getNode(i);this._nodeContextHandler(a.id,n);return}r=r.parentNode}},e.prototype._nodeContextHandler=function(t,n){n.preventDefault(),e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var r=this.get(t),i=null;if(r!=null&&Array.isArray(r.tags))for(var a=0;a<r.tags.length;a++){var o=r.tags[a];this.config.tags[o]&&this.config.tags[o].nodeContextMenu&&(i=this.config.tags[o].nodeContextMenu)}var s=this.element.getBoundingClientRect(),c=n.clientX-s.left,l=n.clientY-s.top;this.nodeContextMenuUI.show(c,l,t,null,i)},e.prototype._globalDbClickHandler=function(t,n){for(var r=n.target;r!=t;){if(r.hasAttribute(e.attr.node_id)){var i=r.getAttribute(e.attr.node_id),a=this.getNode(i);this._nodeDbClickHandler(a.id,n);return}r=r.parentNode}},e.prototype._mouseScrollHandler=function(e,t){for(var n=!1,r=t.target,i=null;r&&r.hasAttribute&&!r.hasAttribute(`data-n-id`)&&!r.hasAttribute(`data-ctrl-ec-id`);)r=r.parentNode;if(r.hasAttribute&&r.hasAttribute(`data-n-id`)){var a=r.getAttribute(`data-n-id`);i=this.getNode(a),i.isTreeListItem&&(n=!0)}if(r.hasAttribute&&r.hasAttribute(`data-ctrl-ec-id`)){var a=r.getAttribute(`data-ctrl-ec-id`);i=this.getNode(a),i.isTreeListItem&&(n=!0)}t.ctrlKey&&(n=!1),n?this.__mouseScrollHandlerTreeList(i,t):this.__mouseScrollHandler(this.getSvg(),t)},e.prototype.__mouseScrollHandler=function(t,n){if(n.ctrlKey){if(this.config.mouseScrool==e.action.zoom)return}else if(this.config.mouseScrool==e.action.ctrlZoom||this.config.mouseScrool!=e.action.zoom)return;if(n.preventDefault(),!navigator.hardwareConcurrency||navigator.hardwareConcurrency<9){let i=n.deltaY/1e3;i=Math.abs(i)<.1?.1*n.deltaY/Math.abs(n.deltaY):i;var r=e._centerPointInPercent(t,n.clientX,n.clientY);this.zoom(1-i,r)}else{var i=this,a=!1,o=this.config.zoom.speed,s=this.config.zoom.smooth,c=0,l=this.getScale(),r=e._centerPointInPercent(t,n.clientX,n.clientY);function f(){a=!0;var e=(c-l)/s;e>0?e++:e--,l+=e,i.zoom(1-e/12/50,r),parseInt(l)==parseInt(c)?a=!1:u(f)}var u=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,20)}}();n.preventDefault();var d=n.delta||n.wheelDelta;d===void 0&&(d=-n.detail),d=Math.max(-1,Math.min(1,d)),c+=-d*o,a||f()}},e.prototype._nodeCircleNodeMenuItemMouseDownHandler=function(t,n,r,i){var a=n.parentNode.getAttribute(e.attr.control_node_circle_menu_wrraper_id),o=n.getAttribute(e.attr.control_node_circle_menu_name),s=this.nodeCircleMenuUI._menu[o];if(!s.draggable){this._clickHandler(t,r);return}var c=this,l=e._getClientXY(r),u=this.getNode(a);n._dragEventFired=!1;var d=c.getScale(),f=null,p=null;document.body.style.mozUserSelect=document.body.style.webkitUserSelect=document.body.style.userSelect=`none`;var m=this.getSvg(),h={x:l.x,y:l.y},g=function(t){for(;t&&!t.hasAttribute(e.attr.control_node_circle_menu_wrraper_id);)t=t.parentNode;if(!t){console.error(`cannot find parent`+e.attr.control_node_circle_menu_wrraper_id);return}var n=e._getTransform(t);return{x:n[4],y:n[5]}},_=n.cloneNode(!0);m.insertBefore(_,m.firstChild);var v=e._getTransform(_),y=v[4],b=v[5],x=g(n);_.setAttribute(`transform`,`matrix(1,0,0,1,`+(y+x.x)+`,`+(b+x.y)+`)`),_.style.opacity=.7;var S=function(t,n){if(t!=null){n.classList.remove(`boc-drag-over`);for(var r=e.getStParentNodes(c.getNode(f)),i=0;i<r.length;i++){var a=c.getNodeElement(r[i].id);a&&(a.style.opacity=1)}}},C=function(t){if(h){var r=e._getClientXY(t),i=t.target;e.isMobile()&&(i=document.elementFromPoint(r.x,r.y)),r.x+=x.x*d,r.y+=x.y*d;var a=e._getOffsetXY(c.element,t),l={left:c.width()-(a.x+c.config.padding)<0,right:a.x-c.config.padding<0,up:c.height()-(a.y+c.config.padding)<0,down:a.y-c.config.padding<0};if(l.left||l.right||l.up||l.down){m.classList&&(m.classList.remove(`boc-cursor-grab`),m.classList.add(`boc-cursor-move`),m.classList.remove(`boc-cursor-nodrop`),m.classList.remove(`boc-cursor-copy`));var u=v[4],g=v[5],C=h.x,T=h.y,E=r.x,D=r.y;c.moveStart(l,function(e){v[4]=u+e.x,v[5]=g+e.y,h.x=C-e.xWithoutScale,h.y=T-e.yWithoutScale,r.x=E-e.xWithoutScale,r.y=D-e.yWithoutScale,_.setAttribute(`transform`,`matrix(`+v.toString()+`)`)})}else{for(c.moveEnd(),m.classList&&(m.classList.add(`boc-cursor-grab`),m.classList.remove(`boc-cursor-move`),m.classList.remove(`boc-cursor-nodrop`),m.classList.remove(`boc-cursor-copy`)),S(f,p),f=null,p=null;i!=null&&i!=m;){if(i.hasAttribute&&i.hasAttribute(e.attr.node_id)){var O=i.getAttribute(e.attr.node_id);f=O,p=i;break}i=i.parentNode}if(f!=null){p.classList.add(`boc-drag-over`);for(var k=c.getNode(f),A=e.getStParentNodes(k),j=0;j<A.length;j++){var M=c.getNodeElement(A[j].id);M&&(M.style.opacity=.1)}m.classList.remove(`boc-cursor-grab`),m.classList.remove(`boc-cursor-move`),m.classList.add(`boc-cursor-copy`),m.classList.remove(`boc-cursor-nodrop`)}var N=(r.x-h.x)/d,P=(r.y-h.y)/d;v[4]=y+N,v[5]=b+P,!n._dragEventFired&&(Math.abs(r.x-h.x)>e.FIRE_DRAG_NOT_CLICK_IF_MOVE||Math.abs(r.y-h.y)>e.FIRE_DRAG_NOT_CLICK_IF_MOVE)&&(c._gragStartedId=n.parentNode.getAttribute(e.attr.control_node_circle_menu_wrraper_id),e.events.publish(`drag`,[c.nodeCircleMenuUI,{from:O,menuItem:s,menuItemName:o}])===!1&&w(),n._dragEventFired=!0),_.setAttribute(`transform`,`matrix(`+v.toString()+`)`)}}},w=function(t){if(c.moveEnd(),m.classList&&(m.classList.remove(`boc-cursor-grab`),m.classList.remove(`boc-cursor-move`),m.classList.remove(`boc-cursor-nodrop`),m.classList.remove(`boc-cursor-copy`)),m.removeEventListener(i.move,C),m.removeEventListener(i.up,w),i.leave&&m.removeEventListener(i.leave,w),u.id==f||f==null){m.removeChild(_),c._gragStartedId=null,n._dragEventFired&&e.events.publish(`drop`,[c.nodeCircleMenuUI,{from:u.id,menuItemName:o,menuItem:s,event:t}]);return}var r=c.getNode(f);e.events.publish(`drop`,[c.nodeCircleMenuUI,{from:u.id,to:r.id,menuItem:s,menuItemName:o,event:t}]),S(f,p),m.removeChild(_),c._gragStartedId=null};m.addEventListener(i.move,C),m.addEventListener(i.up,w),i.leave&&m.addEventListener(i.leave,w)},e.prototype._nodeMouseDownHandler=function(t,n,r){var i=t.getAttribute(e.attr.node_id),a=this.getNode(i);this.config.movable&&!e.getRootOf(a).stParent?this._movableHandler(t,n,r):this.config.enableDragDrop&&this._dragDropHandler(t,n,r)},e.prototype._resizeHandler=function(t,n){if(this.isVisible&&!(t==0||n==0)){var r=this.getViewBox();if(r){r=r.slice(0);var i=t/r[2],a=n/r[3];Math.abs(this._lastSize.width-t)>Math.abs(this._lastSize.height-n)?r[3]=n/i:r[2]=t/a,this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide(),this.setViewBox(r),this.xScrollUI.create(t),this.yScrollUI.create(n),this._draw(!0,e.action.resize)}}},e.prototype._nodeDbClickHandler=function(t,n){if(e.events.publish(`dbclick`,[this,this.get(t)])===!1)return!1;this._commonClickHandler(t,n,this.config.nodeMouseDbClick)},e.prototype._nodeClickHandler=function(t,n){if(e.events.publish(`click`,[this,{node:this.getNode(t),event:n}])===!1)return!1;if(this.powerPointPreviewUI.isVisible()&&this.powerPointPreviewUI.selectedPage!=null){this.powerPointPreviewUI.selectedPage.content=void 0,this.powerPointPreviewUI.selectedPage.nodeId=t,this.powerPointPreviewUI.refresh(t),this.ripple(t,n.clientX,n.clientY);return}if(this.pdfPreviewUI.isVisible()&&this.pdfPreviewUI.selectedPage!=null){this.pdfPreviewUI.selectedPage.content=void 0,this.pdfPreviewUI.selectedPage.nodeId=t,this.pdfPreviewUI.refresh(t),this.ripple(t,n.clientX,n.clientY);return}if(this.svgPreviewUI.isVisible()&&this.svgPreviewUI.selectedPage!=null){this.svgPreviewUI.selectedPage.content=void 0,this.svgPreviewUI.selectedPage.nodeId=t,this.svgPreviewUI.refresh(t),this.ripple(t,n.clientX,n.clientY);return}if(this.pngPreviewUI.isVisible()&&this.pngPreviewUI.selectedPage!=null){this.pngPreviewUI.selectedPage.content=void 0,this.pngPreviewUI.selectedPage.nodeId=t,this.pngPreviewUI.refresh(t),this.ripple(t,n.clientX,n.clientY);return}var r=this.getNodeElement(t);if(r&&r._dragEventFired){r._dragEventFired=!1;return}this._commonClickHandler(t,n,this.config.nodeMouseClick)},e.prototype._nodeCircleMenuItemClickHandler=function(t,n){var r=t.parentNode.getAttribute(e.attr.control_node_circle_menu_wrraper_id),i=t.getAttribute(e.attr.control_node_circle_menu_name),a=this.nodeCircleMenuUI._menu[i];e.events.publish(`click`,[this.nodeCircleMenuUI,{nodeId:r,menuItemName:i,menuItem:a,event:n}])},e.prototype._nodeCircleMenuClickHandler=function(t){if(e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.menuUI.hide(),this.nodeContextMenuUI.isVisible())this.nodeContextMenuUI.hide();else{var n=this.getNode(t),r=null;if(Array.isArray(n.tags))for(var i=0;i<n.tags.length;i++){var a=n.tags[i];this.config.tags[a]&&this.config.tags[a].nodeCircleMenu&&(r=this.config.tags[a].nodeCircleMenu)}this.nodeCircleMenuUI.show(t,r)}},e.prototype._commonClickHandler=function(t,n,r){if(e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide(),r==e.action.expandCollapse&&this.toggleExpandCollapse(t,n),r==e.action.edit){var i=this.getNode(t);i&&(this.editUI.show(i.id),this.ripple(i.id,n.clientX,n.clientY))}if(r==e.action.details){var i=this.getNode(t);i&&(this.editUI.show(i.id,!0),this.ripple(i.id,n.clientX,n.clientY))}},e.prototype._menuHandlerMouseDownHandler=function(e,t){t.stopPropagation(),t.preventDefault()},e.prototype._nodeMenuClickHandler=function(t,n,r){e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide(),this.nodeCircleMenuUI.hide();var i=this.getNode(t),a=null;if(Array.isArray(i.tags))for(var o=0;o<i.tags.length;o++){var s=i.tags[o];this.config.tags[s]&&this.config.tags[s].nodeMenu&&(a=this.config.tags[s].nodeMenu)}this.nodeMenuUI.showStickIn(n,t,null,a)},e.prototype._menuClickHandler=function(e,t){t.stopPropagation(),t.preventDefault(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.show(e.offsetLeft,e.offsetTop)},e.prototype._lonelyButtonHandler=function(){var e={id:this.generateId()};this.addNode(e,null,!0)!==!1&&this.center(e.id)},e.prototype.toggleExpandCollapse=function(t,n){var r=this.getNode(t),i=this.getCollapsedIds(r);if(i.length){var a=e.events.publish(`expcollclick`,[this,!1,t,i]);if(a===!1)return!1;this.expand(t,i,!1)}else{var a=e.events.publish(`expcollclick`,[this,!0,t,r.childrenIds]);if(a===!1)return!1;this.collapse(t,r.childrenIds,!1)}n&&this.ripple(r.id,n.clientX,n.clientY)},e.prototype._clickHandler=function(t,n){if(!(n.button>0)){for(var r=n.target;r!=t;){if(r.hasAttribute(e.attr.control_expcoll_id)){var i=r.getAttribute(e.attr.control_expcoll_id),a=this.getNode(i);this._expCollHandler(a.id);return}if(r.hasAttribute(e.attr.node_id)){var i=r.getAttribute(e.attr.node_id),a=this.getNode(i);this._nodeClickHandler(a.id,n);return}if(r.hasAttribute(e.attr.control_node_menu_id)){n.stopPropagation(),n.preventDefault();var i=r.getAttribute(e.attr.control_node_menu_id),a=this.getNode(i);this._nodeMenuClickHandler(a.id,r,n);return}if(r.hasAttribute(e.attr.control_node_btn)){n.stopPropagation(),n.preventDefault();for(var o=r.getAttribute(e.attr.control_node_btn);!r.hasAttribute(e.attr.node_id);)r=r.parentNode;var i=r.getAttribute(e.attr.node_id);e._onClickHandler(this,o,void 0,i,void 0);return}if(r.hasAttribute(e.attr.control_node_circle_menu_id)){n.stopPropagation(),n.preventDefault();var i=r.getAttribute(e.attr.control_node_circle_menu_id);this._nodeCircleMenuClickHandler(i);return}if(r.hasAttribute(e.attr.control_node_circle_menu_name)){n.stopPropagation(),this._nodeCircleMenuItemClickHandler(r,n);return}if(r.hasAttribute(e.attr.control_add)){this._lonelyButtonHandler();return}if(r.hasAttribute(e.attr.control_up_id)){var i=r.getAttribute(e.attr.control_up_id);n.stopPropagation(),n.preventDefault(),this._upHandler(i);return}if(r.hasAttribute(e.attr.c_link_from)){e.events.publish(`clink-click`,[this,{from:r.getAttribute(e.attr.c_link_from),to:r.getAttribute(e.attr.c_link_to),event:n}]);return}if(r.hasAttribute(e.attr.s_link_from)){e.events.publish(`slink-click`,[this,{from:r.getAttribute(e.attr.s_link_from),to:r.getAttribute(e.attr.s_link_to),event:n}]);return}if(r.hasAttribute(`data-ctrl-n-dotted-close`)){var i=r.getAttribute(`data-ctrl-n-dotted-close`);this.minimize(i);return}if(r.hasAttribute(`data-ctrl-n-dotted-open`)){var i=r.getAttribute(`data-ctrl-n-dotted-open`);this.maximize(i);return}r=r.parentNode}e.events.publish(`canvas-click`,[this,{event:n}])}},e.prototype._mouseDownHandler=function(t,n,r,i){var a=this;e.SEARCH_CLOSE_RESULT_ON_ESCAPE_OR_CLICKOUTSIDE&&this.searchUI.hide(),this.nodeMenuUI.hide(),this.nodeContextMenuUI.hide(),this.menuUI.hide();var o=this.getViewBox(),s=this.getScale(),c=e._getClientTouchesXY(n,0),l=e._getClientTouchesXY(n,1),u={diffX:0,diffY:0,x0:c.x,y0:c.y,type:this.config.enablePan?`pan`:`pan-not-enabled`,viewBoxLeft:o[0],viewBoxTop:o[1],time:Date.now()};n.touches&&n.touches.length>1&&(u.type=`pinch`,u.dist=Math.sqrt((c.x-l.x)*(c.x-l.x)+(c.y-l.y)*(c.y-l.y)));var d=null;if(i){var f=i.stChildren[0].lcn?i.stChildren[0].lcn:`base`;d=a.manager.layoutConfigs[f],u.scrollTop=i.treeList.scrollTop}var p=0,m=function(t){var n=e._getClientTouchesXY(t,0);if(u&&u.type==`pan`){clearTimeout(a._timeout),u.diffX=n.x-u.x0,u.diffY=n.y-u.y0,p=Math.max(Math.abs(u.diffY),Math.abs(u.diffX));var r=-(u.diffY/s)+u.viewBoxTop,c=-(u.diffX/s)+u.viewBoxLeft;p>3&&(i?(i.treeList.scrollTop=u.scrollTop-u.diffY/s,a._treeListUpdateInterval&&=(clearInterval(a._treeListUpdateInterval),null),a._treeListUpdate(i,d)):(a._hideBeforeAnimation(),a._changeCursorOnPanStart(o,s,t),a._move(r,c,o)))}else if(u&&u.type==`pinch`){var l=e._getClientTouchesXY(t,1),f=Math.sqrt((n.x-l.x)*(n.x-l.x)+(n.y-l.y)*(n.y-l.y)),m=1+(f-u.dist)/(u.dist/100)/100;u.dist=f;var h=e._pinchMiddlePointInPercent(a.element,a.width(),a.height(),t);a.zoom(m,h)}},h=function(n){if(p<3&&u.type!=`pinch`&&(n.touches==null||n.touches.length<=1))a._clickHandler(t,n);else if(u.type==`pan`&&i){var o=Date.now()-u.time,s=Math.abs(p/o);if(s>.5){var c=i.treeList.scrollTop,l=c+s*400*(u.diffY>0?-1:1),f=i.stChildren[0].h;l=Math.round(l/f)*f,l!=c&&(a._treeListUpdateInterval&&=(clearInterval(a._treeListUpdateInterval),null),a._treeListUpdateInterval=e.animate(null,{},{},1500,e.anim.outExp,function(){},function(e){i.treeList.scrollTop=e*(l-c)+c,a._treeListUpdate(i,d.orientation)}))}else{var c=i.treeList.scrollTop,f=i.stChildren[0].h,l=Math.round(i.treeList.scrollTop/f)*f;l!=c&&(a._treeListUpdateInterval&&=(clearInterval(a._treeListUpdateInterval),null),a._treeListUpdateInterval=e.animate(null,{},{},200,e.anim.outSin,function(){},function(e){i.treeList.scrollTop=e*(l-c)+c,a._treeListUpdate(i,d.orientation)}))}}else u.type==`pan`&&!i&&p>10&&a._draw(!0,e.action.pan);u.type==`pan`&&!i&&a._changeCursorOnPanEnd(),u=null,t.removeEventListener(r.move,m),t.removeEventListener(r.up,h),r.leave&&t.removeEventListener(r.leave,h),r.touchstart&&t.removeEventListener(r.touchstart,h)};t.addEventListener(r.move,m,{passive:!0}),t.addEventListener(r.up,h),r.leave&&t.addEventListener(r.leave,h),r.touchstart&&t.addEventListener(r.touchstart,h,{passive:!0})},e.prototype._changeCursorOnPanStart=function(t,n,r){var i=this.getPointerElement();if(i){var a=e._getOffsetXY(this.element,r),o=a.x/n+t[0]-16/n,s=a.y/n+t[1]-16/n;i.style.display=`inherit`,i.setAttribute(`transform`,`matrix(0,0,0,0,`+o+`,`+s+`)`),e.animate(i,{transform:[0,0,0,0,o,s],opacity:0},{transform:[1/n,0,0,1/n,o,s],opacity:1},300,e.anim.outBack)}else this.element.style.cursor=`move`},e.prototype._changeCursorOnPanEnd=function(){var e=this.getPointerElement();e?e.style.display=`none`:this.element.style.cursor=`initial`},e.prototype._move=function(e,t,n){n[0]=t,n[1]=e,this.setViewBox(n),this.xScrollUI.setPosition(),this.yScrollUI.setPosition()},e.prototype.moveStart=function(t,n,r,i){if(!t){console.error(`movePosition parameter not defined`);return}if(this._moveInterval)return;var a=this,o=this.getViewBox().slice(0),s=this.getScale(),c=0,l=0,u=10,d=1,f=1;e.isNEU(r)&&(r=e.anim.inSin),e.isNEU(i)&&(i=3e3);function p(){var p={x:0,y:0,xWithoutScale:0,yWithoutScale:0};t.left?(c++,p.x=c*e.MOVE_STEP/s,p.xWithoutScale=c*e.MOVE_STEP):t.right&&(c++,p.x=-(c*e.MOVE_STEP)/s,p.xWithoutScale=-(c*e.MOVE_STEP)),t.up?(l++,p.y=l*e.MOVE_STEP/s,p.yWithoutScale=l*e.MOVE_STEP):t.down&&(l++,p.y=-(l*e.MOVE_STEP)/s,p.yWithoutScale=-(l*e.MOVE_STEP));var m=r((f*u-u)/i);p.x*=m,p.xWithoutScale*=m,p.y*=m,p.yWithoutScale*=m,a.setViewBox([o[0]+p.x,o[1]+p.y,o[2],o[3]]),n&&n(p),f+=d}this._moveInterval=setInterval(p,u)},e.prototype.moveEnd=function(){this._moveInterval&&=(clearInterval(this._moveInterval),null)},e===void 0&&(e={}),e.node=function(e,t,n,r){this.templateName=r,this.id=e,this.pid=t,this.children=[],this.childrenIds=[],this.parent=null,this.stpid=null,this.stParent=null,this.stChildren=[],this.stChildrenIds=[],this.tags=n,this.childCount=0,this.collapsedChildCount=0,this.deepCollapsedChildCount=0,this.deepChildCount=0,this.tags||=[]},e===void 0&&(e={}),e.idb={version:1,dbName:`BALKAN`,tableName:`orgchart-js`,keyPath:`id`},e.idb.db=null,e.idb._open=function(t){if(e._browser().msie){t&&t(!1);return}if((navigator.userAgent.toLowerCase().indexOf(`safari`)>0||navigator.userAgent.toLowerCase().indexOf(`firefox`)>0)&&window.location!==window.parent.location){t&&t(!1);return}if(!window.indexedDB){console.error(`Your browser doesn't support a stable version of IndexedDB.`),t&&t(!1);return}if(e.idb.db!=null){t&&t(!0);return}var n=indexedDB.open(e.idb.dbName,e.idb.version);n.onerror=function(e){console.error(`Cannot open database!`),t&&t(!1)},n.onsuccess=function(n){e.idb.db=n.target.result,t&&t(!0)},n.onupgradeneeded=function(t){var n=t.target.result;n.objectStoreNames.contains(e.idb.tableName)&&n.deleteObjectStore(e.idb.tableName),n.createObjectStore(e.idb.tableName,{keyPath:e.idb.keyPath})}},e.idb.read=function(t,n){e.idb._open(function(r){if(r){var i=e.idb.db.transaction([e.idb.tableName]).objectStore(e.idb.tableName).get(t);i.onerror=function(e){console.error(`Unable to retrieve data from database!`),n&&n(!1)},i.onsuccess=function(e){i.result?n&&n(!0,i.result):n&&n(null)}}else n&&n(!1)})},e.idb.write=function(t,n){e.idb.read(t.id,function(r){if(r==null){var i=e.idb.db.transaction([e.idb.tableName],`readwrite`).objectStore(e.idb.tableName).add(t);i.onerror=function(e){console.error(`Unable to add data to database!`),n&&n(!1)},i.onsuccess=function(e){n&&n(!0)}}else n&&n(r)})},e.idb.put=function(t,n){e.idb._open(function(r){if(r){var i=e.idb.db.transaction([e.idb.tableName],`readwrite`).objectStore(e.idb.tableName).put(t);i.onerror=function(e){console.error(`Unable to put data to database!`),n&&n(!1)},i.onsuccess=function(e){n&&n(!0)}}else n&&n(!1)})},e.idb.delete=function(t,n){e.idb._open(function(r){if(r){var i=e.idb.db.transaction([e.idb.tableName],`readwrite`).objectStore(e.idb.tableName).delete(t);i.onerror=function(e){console.error(`Unable to retrieve data from database!`),n&&n(!1)},i.onsuccess=function(e){i.error?n&&n(!1):n&&n(!0)}}else n&&n(!1)})},e===void 0&&(e={}),e.manager=function(e){this.config=e.config,this.layoutConfigs=e._layoutConfigs,this.visibleNodeIds=[],this.viewBox=null,this.action=null,this.actionParams=null,this.nodes={},this.oldNodes={},this.maxX=null,this.maxY=null,this.minX=null,this.minY=null,this.bordersByRootIdAndLevel=null,this.roots=null,this.state=null,this.vbIsInitializedFromState=!1,this.rootList=[],this.instance=e,this._fixAdjustForExport={x:0,y:0}},e.manager.prototype.read=function(t,n,r,i,a,o,s,c){var l=this;e.state._get(this.config.state,n,r,function(u){l.state=u,l.action=a,l.actionParams=o,a!=e.action.init||!l.state||o&&o.method&&o.method==`fit`?(l.viewBox=i,l.vbIsInitializedFromState=!1):(l.viewBox=l.state.vb,l.vbIsInitializedFromState=!0,Array.isArray(l.state.roots)&&(l.config.roots=l.state.roots));var d=l.maxX,f=l.maxY,p=l.minX,m=l.minY,h=l.bordersByRootIdAndLevel,g=l.roots,_=l.nodes;if(!t)_?l.oldNodes=_:l.oldNodes=null,l._read(function(t){d=t.maxX,f=t.maxY,p=t.minX,m=t.minY,h=t.bordersByRootIdAndLevel,g=t.roots,_=t.nodes;var i=e.manager._getResponse(n,r,l.visibleNodeIds,l.config,d,f,p,m,l.viewBox,g,l.action,l.actionParams,_,l.oldNodes,l.vbIsInitializedFromState);i.notif=t.limit,i.roots=g,i.bordersByRootIdAndLevel=h,i.adjustify=t.adjustify,a!=e.action.exporting&&(l.maxX=d,l.maxY=f,l.minX=p,l.minY=m,l.roots=g,l.nodes=_,l.visibleNodeIds=i.visibleNodeIds,l.bordersByRootIdAndLevel=h,l.rootList=t.rootList),s(i)},c);else{var v=e.manager._getResponse(n,r,l.visibleNodeIds,l.config,d,f,p,m,l.viewBox,g,l.action,l.actionParams,_,l.oldNodes,l.vbIsInitializedFromState);a!=e.action.exporting&&(l.maxX=d,l.maxY=f,l.minX=p,l.minY=m,l.roots=g,l.nodes=_,l.visibleNodeIds=v.visibleNodeIds),v.bordersByRootIdAndLevel=h,v.roots=g,v.adjustify={x:0,y:0},l.state&&(v.adjustify=l.state.adjustify),s(v)}})},e.manager.prototype._read=function(t,n){var r=this,i=e.manager._createNodes(this.instance);n(i);var a=i.nodes,o=i.roots,s=e.remote;s??=e.local,s._setPositions(o,r.layoutConfigs,function(n){var s=e.manager._doNotChangePositionOfClickedNodeIfAny(o,a,r.action,r.actionParams,r.oldNodes,r.config.orientation);r.state&&r.action==e.action.init&&(s=r.state.adjustify),r.action==e.action.exporting?s=r._fixAdjustForExport:r._fixAdjustForExport=s;for(var c={minX:null,minY:null,maxX:null,maxY:null},l={},u=[],d=0;d<o.length;d++)e.manager._setMinMaxXYAdjustifyIterate(o[d],o[d],c,0,l,s,r.config.orientation,u);for(var d=0;d<o.length;d++)e.manager._setChildCountPropsIterate(o[d],a);for(var f in u)for(var p in u[f]){var m=l[f][p],h=u[f][p];m.minX==null&&m.minY==null&&m.maxX==null&&m.maxY==null&&e._setMinMaxXY(h,m,!0)}t({minX:c.minX,minY:c.minY,maxX:c.maxX,maxY:c.maxY,bordersByRootIdAndLevel:l,nodes:a,roots:o,rootList:i.rootList,limit:n,adjustify:s})},a)},e===void 0&&(e={}),e.manager._initDinamicNode=function(t,n,r){n&&(t.lcn=n),r&&(t.isAssistant=!0);var i=e.t(t.templateName);t.w=i&&i.size?i.size[0]:0,t.h=i&&i.size?i.size[1]:0,t.isSplit=t.templateName==`split`,t.isMirror=t.templateName==`mirror`,t.isSubLevel=t.templateName==`subLevel`},e.manager._setCollpasedProperty=function(t,n,r,i,a,o,s,c){if(t.collapsed==null&&n.collapse&&n.collapse.allChildren?t.collapsed=!0:t.collapsed??=!1,a==e.action.expand&&r.ids.indexOf(t.id)!=-1&&(t.collapsed=!1),a==e.action.collapse&&(r.expandIds||r.collapseIds)?r.expandIds&&r.expandIds.indexOf(t.id)!=-1?t.collapsed=!1:r.collapseIds&&r.collapseIds.indexOf(t.id)!=-1&&(t.collapsed=!0):a==e.action.collapse&&r.ids.indexOf(t.id)!=-1&&(t.collapsed=!0),a==e.action.expand&&r.ids==`all`&&(t.collapsed=!1),a==e.action.exporting&&(!e.isNEU(r.parentLevels)||!e.isNEU(r.childLevels))&&r.id!=null){if(r.id!=null&&(!e.isNEU(r.parentLevels)||!e.isNEU(r.childLevels))){var l=c[r.id];if(l==t)t.collapsed=!1;else{for(var u=!1,d=-1,f=!1,p=-1;l;){if(d++,l==t){u=!0;break}l=c[l.pid]}l=c[r.id];for(var m=c[t.id];m;){if(p++,m==l){f=!0;break}m=c[m.pid]}r.parentLevels!=null&&u&&d<=r.parentLevels||r.childLevels!=null&&f&&p<=r.childLevels||f&&r.expandChildren?t.collapsed=!1:t.collapsed=!0}}}else a==e.action.exporting&&r.expandChildren&&(t.collapsed=!1);a==e.action.init&&s!=null?t.collapsed=!s.exp.has(t.id):a==e.action.init?t.tags.indexOf(`left-partner`)!=-1||t.tags.indexOf(`right-partner`)!=-1||t.tags.indexOf(`partner`)!=-1||t.parentPartner?t.collapsed=n.collapse&&o>=n.collapse.level&&i.indexOf(t.id)==-1:t.collapsed=n.collapse&&o>=n.collapse.level-1&&i.indexOf(t.id)==-1:a==e.action.centerNode||a==e.action.insert||a==e.action.expand||a==e.action.collapse?i.has(t.id)&&(t.collapsed=!1):a==e.action.update&&r&&r.changeRoots&&r.changeRoots.has(t.id)&&(t.collapsed=!1)},e.manager._initNode=function(t,n,r,i,a,o,s){var c=s.manager.config,l=s.manager.layoutConfigs,u=s.manager.action,d=s.manager.actionParams,f=s.manager.state,p=l[r||`base`];t.parent??e.manager._setCollpasedProperty(t,p,d,a,u,i-1,f,n);for(var m=0;m<t.childrenIds.length;m++){var h=n[t.childrenIds[m]];if(e.manager._setCollpasedProperty(h,p,d,a,u,i,f,n),h.collapsed)t.collapsedChildCount++;else{if(h.parent=t,h.ppid!=null){var g=n[h.ppid];g&&(h.parentPartner=g)}(h.tags.indexOf(`left-partner`)!=-1||h.tags.indexOf(`right-partner`)!=-1||h.tags.indexOf(`partner`)!=-1||h.parentPartner)&&o.indexOf(t.id)==-1&&o.push(t.id),t.children.push(h)}}if(u==e.action.minimize&&!t.min?(d.all||d.id==t.id)&&(t.min=!0):u==e.action.maximize&&t.min===!0?(d.all||d.id==t.id)&&(t.min=!1):u==e.action.exporting&&d.min===!1?t.min=!1:u==e.action.init&&f!=null&&(t.min=f.min.has(t.id)),!t.min&&(!t.tags||!t.tags.has(`filter`)))for(var m=0;m<t.stChildrenIds.length;m++){var h=n[t.stChildrenIds[m]];h.stParent=t,t.stChildren.push(h)}i!=null&&(t.level=i),r&&(t.lcn=r);var _=e._getSubLevels(t.tags,c.tags);_>0&&(t.subLevels=_),t.tags.indexOf(`assistant`)!=-1&&t.parent!=null&&(t.isAssistant=!0),p.layout==e.layout.treeList&&(t.isTreeListItem=!0),p.template&&c.template==t.templateName&&(t.templateName=p.template);var v=e.t(t.templateName,t.min);if(t.w=v&&v.size?v.size[0]:0,t.h=v&&v.size?v.size[1]:0,t.padding=v&&v.padding?v.padding:[0,0,0,0],t.isTreeListItem&&t.stParent&&t.stParent.treeList==null){var y=e.t(t.stParent.templateName,t.stParent.min);t.stParent.treeList={pinnedIds:[],scrollTop:0,scrollTopMax:0,maxHeight:y.treeListMaxHeight}}var b={node:t};e.events.publish(`node-initialized`,[s,b])},e.manager._iterate=function(t,n,r,i,a,o,s,c,l,u,d,f){var p=f.manager.layoutConfigs;if(e.manager._initNode(n,r,l,i,u,d,f),n.isAssistant&&(o[n.pid]||(o[n.pid]=[]),o[n.pid].push(n.id)),n.subLevels>0&&s.push(n.id),e.MIXED_LAYOUT_FOR_NODES_WITH_COLLAPSED_CHILDREN&&!n.isAssistant&&n.parent){if(n.parent&&n.parent.children.length&&n.parent.children[n.parent.children.length-1]==n){for(var m=[],h=0,g=0,_=0;_<n.parent.children.length;_++){var v=n.parent.children[_];v.tags.indexOf(`partner`)==-1&&v.tags.indexOf(`left-partner`)==-1&&v.tags.indexOf(`right-partner`)==-1&&v.tags.indexOf(`assistant`)==-1&&v.children.length==0?m.push(v.id):v.tags.indexOf(`assistant`)==-1?(v.tags.indexOf(`partner`)!=-1||v.tags.indexOf(`left-partner`)!=-1||v.tags.indexOf(`right-partner`)!=-1)&&g++:h++}(e.MIXED_LAYOUT_ALL_NODES&&m.length>1&&m.length==n.parent.children.length-h-g||!e.MIXED_LAYOUT_ALL_NODES&&m.length>1)&&(c[n.pid]=m)}}else if(!n.isAssistant&&n.childrenIds.length==0&&n.parent&&!c[n.pid]){for(var m=[],h=0,g=0,_=0;_<n.parent.children.length;_++){var v=n.parent.children[_];v.tags.indexOf(`partner`)==-1&&v.tags.indexOf(`left-partner`)==-1&&v.tags.indexOf(`right-partner`)==-1&&v.tags.indexOf(`assistant`)==-1&&v.childrenIds.length==0?m.push(v.id):v.tags.indexOf(`assistant`)==-1?(v.tags.indexOf(`partner`)!=-1||v.tags.indexOf(`left-partner`)!=-1||v.tags.indexOf(`right-partner`)!=-1)&&g++:h++}(e.MIXED_LAYOUT_ALL_NODES&&m.length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&m.length==n.parent.childrenIds.length-h-g||!e.MIXED_LAYOUT_ALL_NODES&&m.length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)&&(c[n.pid]=m)}n.stChildren.length&&(t.stContainerNodes||=[],t.stContainerNodes.push(n));for(var y=0;y<n.stChildren.length;y++){for(var b=``,_=0;_<n.tags.length;_++)if(p[n.tags[_]]){b=n.tags[_];break}a.push(n.stChildren[y].id),e.manager._iterate(t,n.stChildren[y],r,0,a,o,s,c,b,u,d,f)}i++;for(var y=0;y<n.children.length;y++)n.isTreeListItem&&(n.children[y].isTreeListItem=n.isTreeListItem),e.manager._iterate(t,n.children[y],r,i,a,o,s,c,l,u,d,f)},e.manager.__createNodes=function(t,n,r,i,a,o,s,c){for(var l=[],u=e._addDottedLines(r),d=0;d<u.length;d++){var f=u[d],p=e.STRING_TAGS?f.tags?f.tags.split(`,`):[]:Array.isArray(f.tags)?f.tags.slice(0):[];c.filterUI.addFilterTag(f)&&p.unshift(`filter`);var m=c.searchUI.addMatchTag(f.id);m===!0?p.unshift(`match`):m===!1&&p.unshift(`no-match`);var h=e._getTemplate(p,r.tags,r.template);f&&f.template&&(h=f.template);var g=new e.node(f.id,f.pid,p,h);e.isNEU(f.ppid)||(g.ppid=f.ppid),e.isNEU(f.stpid)||(g.stpid=f.stpid),f.movex!=null&&(g.movex=f.movex),f.movey!=null&&(g.movey=f.movey),t[f.id]=g,l.push(f.id)}if(r.orderBy!=null){var _=e.manager._getOrderSortArray(r.orderBy);l.sort(function(e,t){var n,r;for(var i of u)if(i.id==e&&(n=i),i.id==t&&(r=i),n&&r)break;for(var a=0;a<_.length;a++){var o=n[_[a].field],s=r[_[a].field],c=o,l=s;if(c??=``,l??=``,typeof c==`string`&&typeof l==`string`){var d=c.localeCompare(l);if(_[a].desc&&(d*=-1),d!==0)return d}else{var d=o<s?-1:o>s?1:0;if(_[a].desc&&(d*=-1),d!==0)return d}}})}for(var d=0;d<l.length;d++){var v=l[d],g=t[v],y=o?o[v]:null,b=t[g.stpid],x=t[g.pid];if(b||(g.stpid=null),x||(g.pid=null),b){var S=o?o[b.id]:null;S&&(b.min=S.min),b.stChildrenIds.push(g.id)}else x?(y&&(g.collapsed=y.collapsed,g.min=y.min,g.treeList=y.treeList),x.childrenIds.push(g.id)):(y&&(g.collapsed=y.collapsed,g.min=y.min,g.treeList=y.treeList),n.push(g),s.push(g.id));i==e.action.init&&(g.min=e._getMin(g,r))}},e.manager._createNodes=function(t){var n=t.manager.config,r=t.manager.layoutConfigs,i=t.manager.action,a=t.manager.actionParams,o=t.manager.oldNodes,s=t.manager.state,c={},l=[],u=[];if(e.manager.__createNodes(c,l,n,i,a,o,u,t),n.roots!=null){l=[];for(var d=0;d<n.roots.length;d++){var f=c[n.roots[d]];if(f&&i==e.action.centerNode){for(var p=f;p.pid!=null||p.stpid!=null;)p=p.pid==null&&p.stpid!=null?c[p.stpid]:c[p.pid];for(var m=c[a.id];(m.pid!=null||m.stpid!=null)&&m!=f;)m=m.pid==null&&m.stpid!=null?c[m.stpid]:c[m.pid];p==m&&(f=p)}if(f){for(var h=!1,g=0;g<l.length;g++)if(l[g].id==f.id){h=!0;break}if(!h){if(!e.isNEU(f.pid)){var _=c[f.pid],v=_.childrenIds.indexOf(f.id);v>-1&&_.childrenIds.splice(v,1)}l.push(f)}}}n.roots=[];for(var d=0;d<l.length;d++)n.roots.push(l[d].id)}if(i==e.action.exporting&&a.id!=null)if(a.parentLevels){for(var _=c[a.id],y=0;y<a.parentLevels&&c[_.pid];)y++,_=c[_.pid];_.pid=null,l=[_]}else{var b=c[a.id];b&&(b.pid=null,l=[b])}var x=[];if(i==e.action.init&&n.expand&&n.expand.nodes&&s==null)for(var d=0;d<n.expand.nodes.length;d++){var b=c[n.expand.nodes[d]];for(n.expand.allChildren===!0&&e.manager._addExpandedNodeIdsIterate(b,c,x);b;)x.push(b.id),b.pid==null&&b.stpid!=null?(b=c[b.stpid],b.min=!1):b=c[b.pid]}else if(i==e.action.expand&&a.ids&&a.ids!=`all`||i==e.action.collapse&&a&&a.expandIds)for(var S=i==e.action.expand?a.ids:a.expandIds,d=0;d<S.length;d++)for(var b=c[S[d]],_=c[b.pid];_;)x.push(_.id),_.pid==null&&_.stpid!=null?(_=c[_.stpid],_.min=!1):_=c[_.pid];else if(i==e.action.centerNode){for(var C=e._getCenterNodeFromParams(c,a);C;){if(x.push(C.id),a.options.parentState===e.COLLAPSE_PARENT_NEIGHBORS&&C)for(var d=0;d<C.childrenIds.length;d++){var w=c[C.childrenIds[d]];w.collapsed=!0}if(C.pid==null&&C.stpid!=null){if(C=c[C.stpid],C.min=!1,C.tags){var v=C.tags.indexOf(`filter`);v!=-1&&(C.tags.splice(v,1),t.filterUI._removeFilter(C.id))}}else C=c[C.pid]}if(C=e._getCenterNodeFromParams(c,a),a.options.childrenState===e.COLLAPSE_SUB_CHILDRENS)for(var d=0;d<C.childrenIds.length;d++){var T=c[C.childrenIds[d]];T.collapsed=!1;for(var E=0;E<T.childrenIds.length;E++){var D=c[T.childrenIds[E]];D.collapsed=!0}}if(a.options.parentState===e.COLLAPSE_PARENT_SUB_CHILDREN_EXCEPT_CLICKED){var _=c[C.pid];if(_)for(var d=0;d<_.childrenIds.length;d++){var T=c[_.childrenIds[d]];if(T!=C){T.collapsed=!1;for(var E=0;E<T.childrenIds.length;E++){var D=c[T.childrenIds[E]];D.collapsed=!0}}}}}else if(i==e.action.insert)for(var b=c[a.insertedNodeId];b;)x.push(b.id),b.pid==null&&b.stpid!=null?(b=c[b.stpid],b.min=!1):b=c[b.pid];for(var O=[],k={},A=[],j={},M=[],d=0;d<l.length;d++)e.manager._iterate(l[d],l[d],c,0,O,k,A,j,``,x,M,t);if(i==e.action.collapse&&a&&Array.isArray(a.expandIds)&&Array.isArray(a.collapseIds))for(var d=0;d<a.ids.length;d++)if(a.expandIds.has(a.collapseIds[d]))console.error(`id ${a.collapseIds[d]} exist in both collapseIds and expandIds`);else{var b=c[a.collapseIds[d]];b&&(b.collapsed=!0)}for(var d=l.length-1;d>=0;d--)l[d].collapsed&&l.splice(d,1);for(var d=0;d<M.length;d++){for(var b=c[M[d]],N=[],P=[],F=[],I={},ee=0,L=0,R=0,te=[],ne=[],E=0;E<b.children.length;E++){var w=b.children[E];w.isAssistant?N.push(w.id):w.tags.indexOf(`right-partner`)==-1?w.tags.indexOf(`left-partner`)==-1?w.tags.indexOf(`partner`)!=-1&&!(ee%2)?(w.isPartner=1,w.children=[],P.push(w.id),ee++):w.tags.indexOf(`partner`)!=-1&&ee%2?(w.isPartner=2,w.children=[],F.push(w.id),ee++):w.parentPartner?(I[w.parentPartner.id]||(I[w.parentPartner.id]=[]),I[w.parentPartner.id].push(w.id)):N.push(w.id):(w.isPartner=2,w.children=[],F.push(w.id)):(w.isPartner=1,w.children=[],P.push(w.id))}b.children=[];for(var re=[],E=0;E<P.length;E++){var w=c[P[E]];I[w.id]?b.children.push(w):b.children.splice(0,0,w);for(var ie=0;ie<w.childrenIds.length;ie++)re.push(w.childrenIds[ie])}for(var ae=[],E=0;E<F.length;E++){var w=c[F[E]];I[w.id]?b.children.push(w):b.children.splice(0,0,w);for(var ie=0;ie<w.childrenIds.length;ie++)ae.push(w.childrenIds[ie])}for(var E=0;E<ae.length;E++){var w=c[ae[E]];w.collapsed||(w.parentPartner=w.parent,w.parent=b,w.isChildOfPartner=!0,b.children.push(w))}for(var E=F.length-1;E>=0;E--)if(I[F[E]])for(var g=0;g<I[F[E]].length;g++)b.children.push(c[I[F[E]][g]]),L++,ne.indexOf(F[E])==-1&&ne.push(F[E]);for(var E=0;E<N.length;E++){var w=c[N[E]];b.children.push(w)}for(var E=0;E<P.length;E++)if(I[P[E]])for(var g=0;g<I[P[E]].length;g++)b.children.push(c[I[P[E]][g]]),R++,te.indexOf(P[E])==-1&&te.push(P[E]);for(var E=0;E<re.length;E++){var w=c[re[E]];w.collapsed||(w.parentPartner=w.parent,w.parent=b,w.isChildOfPartner=!0,b.children.push(w))}b.partnerSeparation=Math.max(ne.length,te.length)*n.partnerChildrenSplitSeparation+n.minPartnerSeparation,!N.length&&L&&!R?b.hasPartners=2:!N.length&&!L&&R?b.hasPartners=3:!N.length&&L==1&&R==1?b.hasPartners=4:!N.length&&!L&&!R?b.hasPartners=5:N.length&&!L&&!R?b.hasPartners=6:N.length&&(L||R)?b.hasPartners=7:b.hasPartners=1}for(var d=0;d<A.length;d++)for(var b=c[A[d]],oe=b.lcn?b.lcn:`base`,se=r[oe],E=0;E<b.subLevels;E++){var z=new e.node(b.id+`_sub_level_index_`+E,b.pid,[],`subLevel`);e.manager._initDinamicNode(z,b.lcn);var _=b.parent;if(_){b.movex!=null&&(z.movex=b.movex),b.movey!=null&&(z.movey=b.movey);var v=_.children.indexOf(b);v>-1&&(_.children.splice(v,1),_.children.splice(v,0,z)),z.children.push(b),z.parent=_,b.parent=z,c[z.id]=z}}for(var B in k){var _=c[B];_.hasAssistants=!0;var z=new e.node(_.id+`_split_assitant_0`,_.id,[`assistant`],`split`);_.movex!=null&&(z.movex=_.movex),_.movey!=null&&(z.movey=_.movey),e.manager._initDinamicNode(z,_.lcn,!0),c[z.id]=z;for(var V=[],E=_.children.length-1;E>=0;E--){var w=_.children[E];w.isAssistant?(w.parent=null,_.children.splice(E,1),V.splice(0,0,w.id)):w.isPartner||(w.parent&&j[w.parent.id]&&z&&w.parent.id!=z.id&&(Object.defineProperty(j,z.id,Object.getOwnPropertyDescriptor(j,w.parent.id)),delete j[w.parent.id]),w.parent=z,z.children.unshift(w),_.children.splice(E,1))}if(V.length%2){var ce=c[V[V.length-1]],H=new e.node(ce.id+`_mirror`,_.pid,[],`mirror`);e.manager._initDinamicNode(H,ce.lcn,!0),H.isAssistant=!0,H.w=ce.w,H.h=ce.h,c[H.id]=H,V.splice(V.length-1,0,H.id)}for(var le=1,E=V.length-1;E>=0;E--)if(E%2&&E!=V.length-1){var U=new e.node(_.id+`_split_assitant_`+le,_.pid,[],`split`);e.manager._initDinamicNode(U,_.lcn,!0),_.movex!=null&&(U.movex=_.movex),_.movey!=null&&(U.movey=_.movey),c[U.id]=U,V.splice(E,0,U.id),le++}else E%2&&V.splice(E,0,z.id);for(var E=0;E<V.length;E+=3){var W=null;W=E==0?_:c[V[E-2]];var ue=c[V[E]],de=c[V[E+1]],fe=c[V[E+2]];ue.parent=W,de.parent=W,fe.parent=W,W.children.push(ue),W.children.push(de),W.children.push(fe)}}var pe=!1;for(var me in r){var se=r[me];if(se.layout!=0){pe=!0;break}}var he=e.events.has(`node-layout`,t._event_id);if(pe||he){var G={nodes:c,config:n,action:i,actionParams:a};if(A.length){var ge=!1;for(var B in j){for(var S=j[B],d=0;d<S.length;d++){var b=c[S[d]];if(b.subLevels){ge=!0;break}}if(ge)break}if(ge){var _e={},ve={},ye={};for(var B in j)for(var S=j[B],be=!1,K=null,d=0;d<S.length;d++){var q=S[d];(K===null||A.has(q))&&(K=c[q].parent.id,!be&&!e.isNEU(c[q].subLevels)&&(be=c[q].subLevels>0)),_e[K]||(_e[K]=[]),_e[K].push(q),be&&(ye[K]=B,ve[K]||(ve[K]=[]),ve[K].push(q))}for(var B in j={},ve)if(ve[B].length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN)for(var xe=ye[B],d=c[xe].children.length-1;d>=0;d--){var w=c[xe].children[d];ve[B].has(w.id)&&c[xe].children.splice(d,1)}for(var B in _e)_e[B].length>e.MIXED_LAYOUT_IF_NUMBER_OF_CHILDREN_IS_MORE_THEN&&(j[B]=_e[B])}}for(var B in j){for(var _=c[B],J=_;J.isSplit;)J=c[J.pid];for(;J.isSubLevel;)J=c[J.pid];var oe=_.lcn?_.lcn:`base`,se=r[oe];if(se.layout!=0||he){G.pnode=_,G.layout=se.layout,G.layoutGridColumns=n.layoutGridColumns,G.childrenIds=j[B],G.lastChildrenPidIds=j,G.subLevels=0,G.layouts=[],e.events.publish(`node-layout`,[t,G]),e.events.publish(`layout`,[G]),G.layouts.length||G.layouts.push({layout:G.layout,childrenIds:G.childrenIds,subLevels:G.subLevels,layoutGridColumns:G.layoutGridColumns});for(var Y=0;Y<G.layouts.length;Y++){var X=G.layouts[Y];for(e.isNEU(X.subLevels)&&(X.subLevels=0),e.isNEU(X.layout)&&(X.layout=se.layout),_=c[B],J=_;J.isSplit;)J=c[J.pid];for(;J.isSubLevel;)J=c[J.pid];for(var Z=_,E=0;E<X.subLevels;E++){var z=new e.node(Y+`_sublevel_layout_`+E,Z.id,[],`subLevel`);e.manager._initDinamicNode(z,Z.lcn),z.parent=Z,Z.children.push(z),c[z.id]=z,Z=z}if(X.subLevels){for(var E=0;E<X.childrenIds.length;E++){var w=c[X.childrenIds[E]],v=_.children.indexOf(w);v!=-1&&_.children.splice(v,1),w.parent=Z,Z.children.push(w)}_=Z}if(X.layout==e.layout.grid&&X.childrenIds.length>2){X.layoutGridColumns==`dynamic`&&(X.layoutGridColumns=e._getDynamicGridCoulumns(X.childrenIds.length));for(var Se=_.id,d=_.children.length-1;d>=0;d--)for(var E=0;E<X.childrenIds.length;E++){var q=X.childrenIds[E];if(_.children[d].id==q){_.children.splice(d,1);break}}var Q=X.layoutGridColumns;Q%2!=0&&Q>2&&Q--;for(var d=0;d<X.childrenIds.length;d+=Q)for(var Ce=null,E=0;E<Q;E++){var we=d+Q>=X.childrenIds.length;if(X.childrenIds.length-1<d+E)break;var q=X.childrenIds[d+E],w=c[q];w.parent=c[Se],c[Se].children.push(w),we||(Q/2-1==E&&(Ce=new e.node(X.childrenIds[d+E-1]+`_grid_pseudo_node_`+X.childrenIds[d+E+1],Se,[],`subLevel`),e.manager._initDinamicNode(Ce,_.lcn),Ce.parent=c[Se],c[Se].children.push(Ce),c[Ce.id]=Ce),Q-1==E&&(Se=Ce.id))}}if(X.layout==e.layout.mixed)for(var Te=X.childrenIds,d=Te.length-1;d>=0;d--){var w=c[Te[d]];_=w.parent,w.layout=e.layout.mixed;for(var E=_.children.length-1;E>=0;E--)if(w.id==_.children[E].id){_.children.splice(E,1);break}if(d>0){var Ee=c[Te[d-1]];w.parent=Ee,w.layout=e.layout.mixed,Ee.children.push(w)}else _.children.push(w)}else if(X.layout>1){var z=new e.node(Y+`_`+_.id+`_split_0`,J.id,[],`split`);_.movex!=null&&(z.movex=_.movex),_.movey!=null&&(z.movey=_.movey),e.manager._initDinamicNode(z,_.lcn),c[z.id]=z,z.layout=X.layout;for(var $=[],d=X.childrenIds.length-1;d>=0;d--){for(var w=c[X.childrenIds[d]],E=0;E<_.children.length;E++)_.children[E].id==w.id&&_.children.splice(E,1);if(w.parent=null,w.layout=X.layout,(X.layout==e.layout.treeRightOffset||X.layout==e.layout.treeRight)&&$.splice(0,0,w.id),X.layout>2){var De=new e.node(Y+`_`+w.id+`_mirror`,J.id,[],`mirror`);e.manager._initDinamicNode(De,w.lcn),De.layout=X.layout,c[De.id]=De,$.splice(0,0,De.id)}X.layout!=e.layout.treeRightOffset&&X.layout!=e.layout.treeRight&&$.splice(0,0,w.id)}for(var le=1,E=$.length-1;E>=0;E--)if(E%2&&E!=$.length-1){var U=new e.node(Y+`_`+_.id+`_split_`+le,J.id,[],`split`);e.manager._initDinamicNode(U,_.lcn),_.movex!=null&&(U.movex=_.movex),_.movey!=null&&(U.movey=_.movey),U.layout=X.layout,c[U.id]=U,$.splice(E,0,U.id),le++}else E%2&&$.splice(E,0,z.id);for(var E=0;E<$.length;E+=3){var W=null;E==0&&(W=_);var ue=c[$[E]],de=c[$[E+1]],fe=c[$[E+2]];E!=0&&(W=c[$[E-3]]),E!=0&&!de&&(W=c[$[E-2]]),ue.parent=W,W.children.push(ue),de&&(E!=0&&(W=c[$[E-2]]),de.parent=W,W.children.push(de)),fe&&(E!=0&&(W=c[$[E-1]]),fe.parent=W,W.children.push(fe))}}}}}}if(e.VERTICAL_CHILDREN_ASSISTANT)for(var d=0;d<l.length;d++)e.manager._verticalAssistantIterate(l[d],c);var G={nodes:c,roots:l};return e.events.publish(`nodes-initialized`,[t,G]),{nodes:G.nodes,roots:G.roots,rootList:u}},e.manager._getOrderSortArray=function(e){if(typeof e==`string`)return[{field:e,desc:!1}];if(Array.isArray(e)){var t=[];for(var n of e)typeof n==`string`?t.push({field:n,desc:!1}):e instanceof Object?t.push(n):console.error(`Unseported orderBy value!`);return t}else if(e instanceof Object)return[e];else console.error(`Unseported orderBy value!`)},e.manager._getNodeWidth=function(t,n){switch(n.orientation){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:return t.w;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:return t.h}return 0},e.manager._isVisible=function(t,n,r,i,a,o,s){var c=0;if(e.LAZY_LOADING_FACTOR==`auto`){var l=o/a*2,u=s/a*2;c=Math.ceil(l>u?l:u)}else c=e.LAZY_LOADING_FACTOR/a;if(!(t.x==null||t.y==null)){if(e._getLazyLoading(n)&&i!==e.action.exporting){function e(e,t){var n=e.x,r=e.y,i=e.w,a=e.h,o=t[0]-c,s=t[2]+c+t[0],l=t[1]-c,u=t[3]+c+t[1],d=n+i>o&&s>n;return d&&=r+a>l&&u>r,d}if(e(t,r))return!0;for(var d=0;d<t.children.length;d++)if(e(t.children[d],r))return!0;return!1}return!0}},e.manager.getAllFields=function(t){var n=[e.TAGS];for(var r in t.nodeBinding)n.push(t.nodeBinding[r]);for(var r=0;r<t.nodes.length;r++)for(var i in t.nodes[r])i!==e.ID&&i!==e.TAGS&&i!==e.NODES&&i!==e.PID&&i!==e.STPID&&i!==`movex`&&i!==`movey`&&(t.nodeBinding[i]||n.has(i)||n.push(i));return n},e.manager._getMostDeepChild=function(e){if(!e)return;var t=e;function n(e){e.sl>t.sl&&(t=e);for(var r=0;r<e.children.length;r++)n(e.children[r])}return n(e),t},e.manager._getResponse=function(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){var g=u[0],_=[],v={top:null,left:null,bottom:null,right:null,minX:null,maxX:null,minY:null,maxY:null},y=[[],[],[]],b=a-s+i.padding*2,x=o-c+i.padding*2,S=e.getScale(l,t,n,i.scaleInitial,i.scaleMax,i.scaleMin,b,x);if(v.top=c-i.padding,v.left=s-i.padding,v.bottom=o+i.padding-n/S,v.right=a+i.padding-t/S,v.maxX=a,v.minX=s,v.maxY=o,v.minY=c,u.length==0||l==null&&!h&&i.align==e.CENTER){var C=Math.ceil(t/S),w=Math.ceil(n/S),T=0,E=0;if(C-i.padding*2>=a-s)switch(T=(a+s)/2-C/2,i.orientation){case e.orientation.right:case e.orientation.right_top:T=(s-a)/2-C/2;break}else switch(T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,i.orientation){case e.orientation.right:case e.orientation.right_top:T=-(C/2-(s-a)/2),T<i.padding-C&&(T=i.padding-C);break;case e.orientation.left:case e.orientation.bottom_left:case e.orientation.top_left:case e.orientation.left_top:T=-(C/2-(a-s)/2),T>-i.padding&&(T=-i.padding);break}if(w-i.padding*2>=o-c)switch(E=(o+c)/2-w/2,i.orientation){case e.orientation.bottom:case e.orientation.bottom_left:E=(c-o)/2-w/2;break}else switch(E=-(w/2-(o-c)/2),E>-i.padding&&(E=-i.padding),i.orientation){case e.orientation.bottom:case e.orientation.bottom_left:E=-(w/2-(c-o)/2),E<i.padding-w&&(E=i.padding-w);break;case e.orientation.left:case e.orientation.right:E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break}l=[T,E,C,w]}else if(l==null&&!h&&i.align==e.ORIENTATION){var C=Math.ceil(t/S),w=Math.ceil(n/S),T=0,E=0;switch(i.orientation){case e.orientation.top:T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,E=-i.padding;break;case e.orientation.bottom:T=g.x-C/2+e.manager._getNodeWidth(g,i)/2,E=i.padding-w;break;case e.orientation.left:T=-i.padding,E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break;case e.orientation.right:T=i.padding-C,E=g.y-w/2+e.manager._getNodeWidth(g,i)/2;break;case e.orientation.top_left:T=-i.padding,E=-i.padding;break;case e.orientation.right_top:T=i.padding-C,E=-i.padding;break;case e.orientation.left_top:T=-i.padding,E=-i.padding;break;case e.orientation.bottom_left:T=-i.padding,E=i.padding-w;break}l=[T,E,C,w]}if(d==e.action.centerNode||d==e.action.maximize){var D=e._getCenterNodeFromParams(p,f);f.options.horizontal==1&&(l[0]=D.x+D.w/2-l[2]/2),f.options.vertical==1&&(l[1]=D.y+D.h/2-l[3]/2)}if(d==e.action.insert||d==e.action.expand||d==e.action.collapse||d==e.action.update||d==e.action.centerNode){var O=null;if(d==e.action.insert&&f&&f.insertedNodeId!=null&&f.insertedNodeId!=null)O=p[f.insertedNodeId];else if(d==e.action.update&&f&&f.visId!=null&&f.visId!=null)O=p[f.visId];else if((d==e.action.expand||d==e.action.collapse)&&f&&f.id!=null&&f.id!=null)O=p[f.id],O=e.manager._getMostDeepChild(O);else if(d==e.action.centerNode){switch(i.orientation){case e.orientation.top:case e.orientation.top_left:case e.orientation.bottom:case e.orientation.bottom_left:f.options.vertical||(O=p[f.id]);break;case e.orientation.right:case e.orientation.right_top:case e.orientation.left:case e.orientation.left_top:f.options.horizontal||(O=p[f.id]);break}O&&=e.manager._getMostDeepChild(O)}if(!e.FIXED_POSITION_ON_CLICK&&O){if(O.isTreeListItem){for(;!O.stParent;)O=O.parent;O=O.stParent}switch(i.orientation){case e.orientation.top:case e.orientation.top_left:var k=O.y+O.h-l[3]+i.padding;l[1]<k&&(l[1]=k);break;case e.orientation.bottom:case e.orientation.bottom_left:var k=O.y-i.padding;l[1]>k&&(l[1]=k);break;case e.orientation.right:case e.orientation.right_top:var k=O.x-i.padding;l[0]>k&&(l[0]=k);break;case e.orientation.left:case e.orientation.left_top:var k=O.x+O.w-l[2]+i.padding;l[0]<k&&(l[0]=k);break}}}for(var A=0;A<u.length;A++)e.manager._iterate2(u[A],p,i,l,d,f,_,m,r,y,S,t,n);return{animations:y,boundary:v,viewBox:l,visibleNodeIds:_,nodes:p,allFields:e.manager.getAllFields(i)}},e.manager._iterate2=function(t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.manager._isVisible(t,r,i,a,d,f,p)){s.push(t.id);var m=null;if((a==e.action.expand||a==e.action.collapse||a==e.action.maximize)&&c&&c[t.id]&&o.method==`expandCollapseToLevel`){var h=c[t.id];if(m={x:h.x,y:h.y},h){m={x:h.x,y:h.y};for(var g=t,_=null;g!=null;)c[g.id]&&c[g.id].collapsed&&(_=g),g=g.parent;_&&_.parent&&(m={x:_.parent.x,y:_.parent.y})}var v=n[o.id];if(v){for(var g=t.parent;g!=null;)g=g.parent;g&&(m={x:v.x+v.w/2-t.w/2,y:v.y+v.h/2-t.h/2})}}else if((a==e.action.expand||a==e.action.collapse)&&c&&c[t.id]){var h=c[t.id];if(m={x:h.x,y:h.y},o.ids==`all`&&h){m={x:h.x,y:h.y};for(var g=t,_=null;g!=null;)c[g.id]&&c[g.id].collapsed&&(_=g),g=g.parent;_&&_.parent&&(m={x:_.parent.x,y:_.parent.y})}var v=n[o.id];if(v){for(var g=t.parent;g!=null&&o.ids.indexOf(t.id)==-1&&o.ids.indexOf(g.id)==-1;)g=g.parent;g&&(m={x:v.x+v.w/2-t.w/2,y:v.y+v.h/2-t.h/2})}}else if(a==e.action.centerNode&&c&&c[t.id]){var h=c[t.id];h.x!=null&&h.y!=null&&(m={x:h.x,y:h.y});var y=e._getCenterNodeFromParams(n,o);if(y&&y==t){var g=t.parent;g&&g.id==o.id&&(m={x:y.x+y.w/2-t.w/2,y:y.y+y.h/2-t.h/2})}}else if(a==e.action.maximize&&c&&c[t.id]){var h=c[t.id];h.x!=null&&h.y!=null&&(m={x:h.x,y:h.y});var y=e._getCenterNodeFromParams(n,o);if(y&&y==t){var g=t.parent;g&&g.id==o.id&&(m={x:y.x+y.w/2-t.w/2,y:y.y+y.h/2-t.h/2})}}else if(a==e.action.minimize&&c&&c[t.id]){var h=c[t.id];m={x:h.x,y:h.y}}else if(a==e.action.insert&&o&&o.insertedNodeId==t.id&&t.parent)m={x:t.parent.x,y:t.parent.y};else if((a==e.action.update||a==e.action.insert)&&c){var h=c[t.id];if((!h||e.isNEU(h.x)&&e.isNEU(h.y))&&o){var v=n[o.id];if(v){for(var g=v;g&&g.id==t.id;)g=g.parent;g&&(m={x:v.x,y:v.y})}}else h&&(m={x:h.x,y:h.y})}else a!==e.action.exporting&&a!==e.action.init&&l.indexOf(t.id)==-1&&(u[0].push(t.id),u[1].push({opacity:0}),u[2].push({opacity:1}));m!=null&&m.x!=null&&m.y!=null&&(m.x!=t.x||m.y!=t.y)&&!(o&&o.dragNodeIdList&&o.dragNodeIdList.indexOf(t.id)!=-1)&&!t.isSplit&&(u[0].push(t.id),u[1].push({transform:[1,0,0,1,m.x,m.y]}),u[2].push({transform:[1,0,0,1,t.x,t.y]}))}for(var b=0;b<t.stChildren.length;b++)e.manager._iterate2(t.stChildren[b],n,r,i,a,o,s,c,l,u,d,f,p);for(var b=0;b<t.children.length;b++)e.manager._iterate2(t.children[b],n,r,i,a,o,s,c,l,u,d,f,p)},e.manager._addExpandedNodeIdsIterate=function(t,n,r){for(var i=0;i<t.childrenIds.length;i++)r.push(t.childrenIds[i]),e.manager._addExpandedNodeIdsIterate(n[t.childrenIds[i]],n,r)},e.manager._setChildCountPropsIterate=function(t,n){t.w===void 0&&(t.collapsedChildCount=t.childrenIds.length),t.deepChildCount=t.childCount=t.childrenIds.length,t.deepCollapsedChildCount=t.collapsedChildCount;for(var r=n[t.pid];r;)r.deepCollapsedChildCount+=t.collapsedChildCount,r.deepChildCount+=t.childCount,r=n[r.pid];for(var i of t.stChildrenIds)e.manager._setChildCountPropsIterate(n[i],n);for(var i of t.childrenIds)e.manager._setChildCountPropsIterate(n[i],n)},e.manager._setMinMaxXYAdjustifyIterate=function(t,n,r,i,a,o,s,c){t.x+=o.x,t.y+=o.y;for(var l of t.stChildren)e.manager._setMinMaxXYAdjustifyIterate(l,l,r,0,a,o,s,c);t.isPartner?t.sl=i-1:t.sl=i,a[n.id]??(a[n.id]={}),a[n.id][t.sl]??(a[n.id][t.sl]={minX:null,minY:null,maxX:null,maxY:null}),t.layout?(c[n.id]??(c[n.id]={}),c[n.id][t.sl]??(c[n.id][t.sl]=t)):e._setMinMaxXY(t,a[n.id][t.sl],!0),t.movex!=null&&(t.x+=t.movex),t.movey!=null&&(t.y+=t.movey),e._setMinMaxXY(t,r,!0),i++;for(var l of t.children)e.manager._setMinMaxXYAdjustifyIterate(l,n,r,i,a,o,s,c)},e.manager._doNotChangePositionOfClickedNodeIfAny=function(t,n,r,i,a,o){if(r!=e.action.expand&&r!=e.action.collapse&&r!=e.action.minimize&&r!=e.action.maximize&&r!=e.action.centerNode&&r!=e.action.update&&r!=e.action.insert)return{x:0,y:0};if(r==e.action.update&&(!i||i.id==null)){if(!t||!t.length)return{x:0,y:0};i={id:t[0].id}}if(i.id==null)return{x:0,y:0};var s=i.id;(r==e.action.minimize&&n[s].parent||r==e.action.maximize&&n[s].parent)&&(s=n[s].pid);var c=n[s],l=a[s];if(!l)return{x:0,y:0};var u=l.movex==null?0:l.movex,d=l.movey==null?0:l.movey,f={x:(l.x?l.x-u:0)-c.x,y:(l.y?l.y-d:0)-c.y};return c&&c.isTreeListItem?{x:0,y:0}:f},e.manager._verticalAssistantIterate=function(t,n){for(var r=0;r<t.stChildren.length;r++)e.manager._verticalAssistantIterate(t.stChildren[r],n);if(t.children.length==3)e.manager._verticalAssistantIterate(t.children[0],n),e.manager._verticalAssistantIterate(t.children[2],n),e.manager._verticalAssistantIterate(t.children[1],n);else for(var r=0;r<t.children.length;r++)e.manager._verticalAssistantIterate(t.children[r],n);if(t.isAssistant&&t.isSplit&&t.children.length){for(var i=t.parent.children[0],a=t.parent.children[2],o=t.parent;!o.hasAssistants;)o=o.parent;var s={max:0},c={max:0};e.manager._verticalAssistantLevelCountIterate(i,0,s),e.manager._verticalAssistantLevelCountIterate(a,0,c);for(var l=Math.max(s.max,c.max),u=[],r=0;r<l;r++){var d=new e.node(t.parent.id+`_split_assitant_level_`+r,t.pid,[],`subLevel`);e.manager._initDinamicNode(d,t.lcn,!0),o.movex!=null&&(d.movex=o.movex),o.movey!=null&&(d.movey=o.movey),r>0&&(u[r-1].children.push(d),d.parent=u[r-1]),n[d.id]=d,u.push(d)}if(u.length){for(var f=u[u.length-1],p=u[0],m=t.children.length-1;m>=0;m--){var h=t.children[m];f.children.unshift(h),h.parent=f,t.children.splice(m,1)}t.children.push(p),p.parent=t}}},e.manager._verticalAssistantLevelCountIterate=function(t,n,r){r.max<n&&(r.max=n),n++;for(var i=0;i<t.children.length;i++)e.manager._verticalAssistantLevelCountIterate(t.children[i],n,r)},e._addDottedLines=function(e){var t=e.nodes;if((e.groupDottedLines.length||e.dottedLines.length)&&(t=JSON.parse(JSON.stringify(t))),e.groupDottedLines.length)for(var n=[],r=0;r<e.groupDottedLines.length;r++){var i=e.groupDottedLines[r];i.rootId??=i.to;var a=`balkan_group_dotted_${i.rootId}`;if(!n.has(a)){for(var o=0;o<t.length;o++)if(t[o].id==i.rootId){var s=JSON.parse(JSON.stringify(t[o]));s.id=`balkan_group_dotted_${i.rootId}_balkan_id_${t[o].id}`,s.pid=void 0,s.stpid=t[o].id,t.push(s),n.push(a),t[o].tags||(t[o].tags=[]),t[o].tags.push(`group-dotted-lines`),t[o].tags.push(`group-dotted-lines-`+a);break}}for(var o=0;o<t.length;o++)if(t[o].id==i.from){var s=JSON.parse(JSON.stringify(t[o]));if(s.id=`balkan_group_dotted_${i.rootId}_balkan_id_${t[o].id}`,s.pid=`balkan_group_dotted_${i.rootId}_balkan_id_${i.to}`,s.tags){var c=s.tags.indexOf(`group-dotted-lines`);c!=-1&&s.tags.splice(c,1)}if(s.tags||=[],s.tags.push(`boc-dotted-connector`),i.tags)for(var l=0;l<i.tags.length;l++)s.tags.push(i.tags[l]);t.push(s);break}}if(e.dottedLines.length)for(var r=0;r<e.dottedLines.length;r++){var u=e.dottedLines[r];u.rootId??=u.to;for(var o=0;o<t.length;o++)if(t[o].id==u.from){var s=JSON.parse(JSON.stringify(t[o]));if(s.id=`balkan_dotted_${u.rootId}_balkan_id_${t[o].id}`,u.rootId==u.to?s.pid=u.to:s.pid=`balkan_dotted_${u.rootId}_balkan_id_${u.to}`,s.tags||=[],s.tags.push(`boc-dotted-connector`),u.tags)for(var l=0;l<u.tags.length;l++)s.tags.push(u.tags[l]);t.push(s);break}}return t},e===void 0&&(e={}),e.templates={},e.templates.base={defs:``,size:[250,120],expandCollapseSize:30,linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:`#e6e6e6`,rect:null},svg:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>`,link:`<path stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} {xb},{yb} {xc},{yc} L{xd},{yd}"/>`,node:`<rect x="0" y="0" height="120" width="250" fill="none" stroke-width="1" stroke="#aeaeae" rx="7" ry="7"></rect>`,plus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
194
194
  <text text-anchor="middle" style="font-size: 14px;cursor:pointer;" fill="#aeaeae" x="15" y="21">${e.deepCollapsedChildCount}</text></g>`},minus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
195
195
  <line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line></g>`},nodeMenuButton:`<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,105)"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>`,menuButton:`<div style="user-select:none;position:absolute;right:{p}px;top:{p}px; width:30px;height:50px;cursor:pointer;" `+e.attr.control_export_menu+`=""><hr style="background-color: #7A7A7A; height: 3px; border: none;"><hr style="background-color: #7A7A7A; height: 3px; border: none;"><hr style="background-color: #7A7A7A; height: 3px; border: none;"></div>`,img_0:`<clipPath id="{randId}"><circle cx="60" cy="60" r="40"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#{randId})" xlink:href="{val}" x="20" y="20" width="80" height="80"></image>`,link_field_0:`<text text-anchor="middle" fill="#aeaeae" `+e.attr.width+`="290" x="0" y="0" style="font-size:10px;">{val}</text>`,editFormHeaderColor:`#039BE5`,treeListMaxHeight:500},e.templates.ana={defs:``,size:[250,120],linkAdjuster:{fromX:0,fromY:0,toX:0,toY:0},ripple:{radius:0,color:`#e6e6e6`,rect:null},expandCollapseSize:30,svg:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:block;" width="{w}" height="{h}" viewBox="{viewBox}">{content}</svg>`,link:`<path class="boc-hoverable" stroke-linejoin="round" stroke="#aeaeae" stroke-width="1px" fill="none" d="{rounded}" />`,node:function(e,t,n,r){return`<rect class="boc-hoverable" x="0" y="0" height="${e.h}" width="${e.w}" fill="#039BE5" stroke-width="1" stroke="#aeaeae" rx="10" ry="10"></rect>`},plus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle class="boc-hoverable" cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
196
196
  <text text-anchor="middle" style="font-size: 14px;cursor:pointer;" fill="#aeaeae" x="15" y="21">${e.deepCollapsedChildCount}</text></g>`},minus:function(e,t,n,r,i){var a=r.mode==`dark`?`#1E1E1E`:`#ffffff`;return`<g transform="matrix(1,0,0,1,${i.x-15},${i.y-15})"><circle class="boc-hoverable" cx="15" cy="15" r="15" fill="${a}" stroke="#aeaeae" stroke-width="1"></circle>
197
- <line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line></g>`},up:`<rect x="20" y="-25" width="30" height="17" fill="#aeaeae" rx="3" ry="3"></rect><line x1="35" x2="35" y1="0" y2="-8" stroke="#aeaeae" stroke-width="1"></line>`,nodeMenuButton:function(e,t,n,r){return`<g transform="matrix(1,0,0,1,${e.w-25},${e.h-15})"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>`},menuButton:e.templates.base.menuButton,img_0:function(t,n,r,i,a){var o=50,s=30,c=40,l=e.randomId();return`<clipPath id="${l}"><circle cx="${o}" cy="${s}" r="${c}"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#${l})" xlink:href="${a}" x="${o-c}" y="${s-c}" width="${c*2}" height="${c*2}" ></image>`},link_field_0:`<text text-anchor="middle" fill="#aeaeae" `+e.attr.width+`="290" x="0" y="0" style="font-size:10px;">{val}</text>`,field_0:function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 18px;" fill="#ffffff" x="${t.w/2}" y="${t.h-25}" text-anchor="middle"></text>`,t.w-20,1)},field_1:function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 14px;" fill="#ffffff" x="${t.w-20}" y="30" text-anchor="end"></text>`,t.w-120,3)},padding:[75,5,50,5],editFormHeaderColor:`#039BE5`,treeListMaxHeight:500},e.templates.split=Object.assign({},e.templates.ana),e.templates.split.size=[10,10],e.templates.split.node=`<circle cx="5" cy="5" r="5" fill="none" stroke-width="1" stroke="#aeaeae"></circle>`,e.templates.split.field_0=``,e.templates.split.field_1=``,e.templates.split.img_0=``,e.templates.dot=Object.assign({},e.templates.split),e.templates.group=Object.assign({},e.templates.ana),e.templates.group.size=[250,120],e.templates.group.padding=[50,20,35,20],e.templates.group.node=`<rect rx="50" ry="50" x="0" y="0" height="{h}" width="{w}" fill="#f2f2f2" stroke-width="0"></rect>`,e.templates.group.link=`<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>`,e.templates.group.nodeMenuButton=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,{ew},25)"><g transform="matrix(1,0,0,1,-22,-8)"><rect x="0" y="0" fill="red" fill-opacity="0" width="18" height="22"></rect><line x1="0" y1="2" x2="9" y2="2" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="9" x2="18" y2="9" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="16" x2="22" y2="16" stroke="#aeaeae" stroke-width="1"></line></g></g>`,e.templates.group.field_0=`<text `+e.attr.width+`="230" style="font-size: 18px;" fill="#aeaeae" x="{cw}" y="30" text-anchor="middle">{val}</text>`,e.templates.group.field_1=``,e.templates.group.ripple={radius:50,color:`#aeaeae`},e.templates.invisibleGroup=Object.assign({},e.templates.group),e.templates.invisibleGroup.node=``,e.templates.invisibleGroup.padding=[0,0,0,0],e.templates.invisibleGroup.field_0=``,e.templates.invisibleGroup.nodeMenuButton=``,e.templates.mirror={linkAdjuster:{},link:``,node:``,nodeMenuButton:``,size:[0,0]},e.templates.ula=Object.assign({},e.templates.ana),e.templates.ula.field_0=function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 18px;" fill="#039BE5" x="100" y="55"></text>`,t.w-105,1)},e.templates.ula.field_1=function(t,n,r,i,a){return e.wrapText(a,`<text data-text-overflow="multiline" style="font-size: 14px;" fill="#afafaf" x="100" y="76"></text>`,t.w-105,3)},e.templates.ula.node=function(e,t,n,r){return`<rect class="boc-hoverable" x="0" y="0" height="${e.h}" width="${e.w}" fill="#ffffff" stroke-width="1" stroke="#aeaeae"></rect><line class="boc-hoverable" x1="0" y1="0" x2="${e.w}" y2="0" stroke-width="2" stroke="#039BE5"></line>`},e.templates.ula.img_0=function(t,n,r,i,a){var o=50,s=60,c=40,l=e.randomId();return`<clipPath id="${l}"><circle cx="${o}" cy="${s}" r="${c}"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#${l})" xlink:href="${a}" x="${o-c}" y="${s-c}" width="${c*2}" height="${c*2}" ></image>`},e.templates.ula.menu=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,12)" `+e.attr.control_node_menu_id+`="{id}"><rect x="-4" y="-10" fill="#ffffff" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#039BE5"></circle><circle cx="7" cy="0" r="2" fill="#039BE5"></circle><circle cx="14" cy="0" r="2" fill="#039BE5"></circle></g>`,e.templates.ula.nodeMenuButton=function(e,t,n,r){return`<g transform="matrix(1,0,0,1,${e.w-25}, ${e.h-15})"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="7" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="14" cy="0" r="2" fill="#AEAEAE"></circle></g>`},e.templates.ula.padding=[110,1,1,1],e.templates.olivia=Object.assign({},e.templates.ana),e.templates.olivia.defs=`<style>
197
+ <line x1="4" y1="15" x2="26" y2="15" stroke-width="1" stroke="#aeaeae"></line></g>`},up:`<rect x="20" y="-25" width="30" height="17" fill="#aeaeae" rx="3" ry="3"></rect><line x1="35" x2="35" y1="0" y2="-8" stroke="#aeaeae" stroke-width="1"></line>`,nodeMenuButton:function(e,t,n,r){return`<g transform="matrix(1,0,0,1,${e.w-25},${e.h-15})"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#ffffff"></circle><circle cx="7" cy="0" r="2" fill="#ffffff"></circle><circle cx="14" cy="0" r="2" fill="#ffffff"></circle></g>`},menuButton:e.templates.base.menuButton,img_0:function(t,n,r,i,a){var o=50,s=30,c=40,l=e.randomId();return`<clipPath id="${l}"><circle cx="${o}" cy="${s}" r="${c}"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#${l})" xlink:href="${a}" x="${o-c}" y="${s-c}" width="${c*2}" height="${c*2}" ></image>`},link_field_0:`<text text-anchor="middle" fill="#aeaeae" `+e.attr.width+`="290" x="0" y="0" style="font-size:10px;">{val}</text>`,field_0:function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 18px;" fill="#ffffff" x="${t.w/2}" y="${t.h-25}" text-anchor="middle"></text>`,t.w-20,1)},field_1:function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 14px;" fill="#ffffff" x="${t.w-20}" y="30" text-anchor="end"></text>`,t.w-120,3)},padding:[75,5,50,5],editFormHeaderColor:`#039BE5`,treeListMaxHeight:500},e.templates.emily=Object.assign({},e.templates.ana),e.templates.emily.size=[200,270],e.templates.emily.defs=`<style>.boc-hover .boc-emily-fill{fill: #039BE5;}
198
+ .boc-hover .boc-hoverable{stroke: #039BE5 !important;}
199
+ .boc-emily-link:hover text{ fill: #F57C00; }
200
+ .boc-emily-link:hover path, .boc-emily-link:hover rect{ stroke: #F57C00; }
201
+ .boc-emily-white{ transition: all 0.3s ease-in-out; }
202
+ .boc-hover-self:hover .boc-emily-white {height: calc(var(--boc-emily-h) - 45px);}
203
+ .boc-hover-self .boc-emily-nodemenu{ opacity: 1; }
204
+ .boc-emily-photo{ transition: all 0.3s ease-in-out; }
205
+ .boc-emily-btn:hover{cursor:pointer;}
206
+ .boc-emily-btn:hover path{fill:#F57C00 !important;}
207
+ .boc-hover-self .boc-emily-photo{ transform: matrix(0.4,0,0,0.4,0,30) }
208
+ </style>`,e.templates.emily.node=function(t,n,r,i){return`<rect class="boc-emily-fill" x="0" y="0" height="${t.h}" width="${t.w}" fill="#039BE5" stroke ="#aeaeae" stroke-width="1" rx="10" ry="10"></rect>
209
+ <rect class="boc-emily-white" x="0.5" y="30" height="${t.h-80}" width="${t.w-1}" fill="#fff" style="--boc-emily-h:${t.h-80}px"></rect>
210
+ <g ${e.attr.control_node_btn}="pdf_profile" class="boc-emily-btn " transform="matrix(1,0,0,1,${t.w-70},40)">${e.icon.pdf(24,24,`#039BE5`)}<rect x="0" y="0" width="30" height="30" fill="red" fill-opacity="0"></rect></g>
211
+ <g ${e.attr.control_node_btn}="share_profile" class="boc-emily-btn" transform="matrix(1,0,0,1,${t.w-35},40)">${e.icon.share(24,24,`#039BE5`)}<rect x="0" y="0" width="30" height="30" fill="red" fill-opacity="0"></rect></g>
212
+ `},e.templates.emily.field_0=e.templates.emily.name=e.templates.emily.name=function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 18px;" x="${t.w/2}" y="${t.h-20}" fill="#fff" text-anchor="middle"></text>`,t.w-10,1)},e.templates.emily.field_1=e.templates.emily.title=e.templates.emily.title=function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 14px;" x="${t.w/2}" y="19" fill="#fff" text-anchor="middle"></text>`,t.w-10,1)},e.templates.emily.email=function(t,n,r,i,a){return n.email?`<a class="boc-emily-link" href="mailto:${a}">
213
+ <g transform="matrix(1,0,0,1,7,${t.h-150})">
214
+ <rect x="3" y="5" width="18" height="14" rx="2" fill="none" stroke-width="2" stroke="#039BE5"/>
215
+ <path d="m3 7 9 6 9-6" fill="none" stroke-width="2" stroke="#039BE5" />
216
+ ${e.wrapText(a,`<text x="30" y="15" fill="#039BE5" font-size="13"></text>`,t.w-40,1)}
217
+ <rect style="opacity:0" x="0" y="0" width="${t.w-14}" height="20" fill="red" />
218
+ </g>
219
+ </a>`:``},e.templates.emily.address=function(e,t,n,r,i){return t.address?`<a class="boc-emily-link" target="_blank" href="https://www.google.com/maps/place/${i}/" >
220
+ <g transform="matrix(1,0,0,1,7,${e.h-127})">
221
+ <path d="M1 6l7-3 8 3 7-3v15l-7 3-8-3-7 3zM8 3v18M16 6v18" fill="none" stroke-width="2" stroke="#039BE5" />
222
+ <text x="30" y="15" fill="#039BE5" font-size="13">${i}</text>
223
+ <rect style="opacity:0" x="0" y="0" width="${e.w-14}" height="20" fill="red" />
224
+ </g>
225
+ </a>`:``},e.templates.emily.description=function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 14px;" x="${t.w/2}" y="${t.h-70}" fill="#fff" text-anchor="middle"></text>`,t.w-20,3)},e.templates.emily.img_0=function(e,t,n,r,i){return i?`<g class="boc-emily-photo" transform="matrix(1,0,0,1,0,30)" ><image preserveAspectRatio="xMidYMid slice" xlink:href="${i}" x="0.5" y="0" width="${e.w-1}" height="${e.h-80}" ></image></g>`:``},e.templates.emily.nodeMenuButton=function(e,t,n,r){return`
226
+ <g style="cursor:pointer;" transform="matrix(1,0,0,1, ${e.w-25}, 8)" data-ctrl-n-menu-id="${e.id}">
227
+ <rect x="0" y="0" width="18" height="2.5" rx="1.25" fill="#fff" />
228
+ <rect x="0" y="6" width="18" height="2.5" rx="1.25" fill="#fff" />
229
+ <rect x="0" y="12" width="18" height="2.5" rx="1.25" fill="#fff" />
230
+ <rect x="-5" y="-5" width="30" height="25" fill="transparent" />
231
+ </g>
232
+ `},e.templates.split=Object.assign({},e.templates.ana),e.templates.split.size=[10,10],e.templates.split.node=`<circle cx="5" cy="5" r="5" fill="none" stroke-width="1" stroke="#aeaeae"></circle>`,e.templates.split.field_0=``,e.templates.split.field_1=``,e.templates.split.img_0=``,e.templates.dot=Object.assign({},e.templates.split),e.templates.group=Object.assign({},e.templates.ana),e.templates.group.size=[250,120],e.templates.group.padding=[50,20,35,20],e.templates.group.node=`<rect rx="50" ry="50" x="0" y="0" height="{h}" width="{w}" fill="#f2f2f2" stroke-width="0"></rect>`,e.templates.group.link=`<path stroke="#aeaeae" stroke-width="1px" fill="none" d="M{xa},{ya} C{xb},{yb} {xc},{yc} {xd},{yd}"/>`,e.templates.group.nodeMenuButton=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,{ew},25)"><g transform="matrix(1,0,0,1,-22,-8)"><rect x="0" y="0" fill="red" fill-opacity="0" width="18" height="22"></rect><line x1="0" y1="2" x2="9" y2="2" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="9" x2="18" y2="9" stroke="#aeaeae" stroke-width="1"></line><line x1="0" y1="16" x2="22" y2="16" stroke="#aeaeae" stroke-width="1"></line></g></g>`,e.templates.group.field_0=`<text `+e.attr.width+`="230" style="font-size: 18px;" fill="#aeaeae" x="{cw}" y="30" text-anchor="middle">{val}</text>`,e.templates.group.field_1=``,e.templates.group.ripple={radius:50,color:`#aeaeae`},e.templates.invisibleGroup=Object.assign({},e.templates.group),e.templates.invisibleGroup.node=``,e.templates.invisibleGroup.padding=[0,0,0,0],e.templates.invisibleGroup.field_0=``,e.templates.invisibleGroup.nodeMenuButton=``,e.templates.mirror={linkAdjuster:{},link:``,node:``,nodeMenuButton:``,size:[0,0]},e.templates.ula=Object.assign({},e.templates.ana),e.templates.ula.field_0=function(t,n,r,i,a){return e.wrapText(a,`<text style="font-size: 18px;" fill="#039BE5" x="100" y="55"></text>`,t.w-105,1)},e.templates.ula.field_1=function(t,n,r,i,a){return e.wrapText(a,`<text data-text-overflow="multiline" style="font-size: 14px;" fill="#afafaf" x="100" y="76"></text>`,t.w-105,3)},e.templates.ula.node=function(e,t,n,r){return`<rect class="boc-hoverable" x="0" y="0" height="${e.h}" width="${e.w}" fill="#ffffff" stroke-width="1" stroke="#aeaeae"></rect><line class="boc-hoverable" x1="0" y1="0" x2="${e.w}" y2="0" stroke-width="2" stroke="#039BE5"></line>`},e.templates.ula.img_0=function(t,n,r,i,a){var o=50,s=60,c=40,l=e.randomId();return`<clipPath id="${l}"><circle cx="${o}" cy="${s}" r="${c}"></circle></clipPath><image preserveAspectRatio="xMidYMid slice" clip-path="url(#${l})" xlink:href="${a}" x="${o-c}" y="${s-c}" width="${c*2}" height="${c*2}" ></image>`},e.templates.ula.menu=`<g style="cursor:pointer;" transform="matrix(1,0,0,1,225,12)" `+e.attr.control_node_menu_id+`="{id}"><rect x="-4" y="-10" fill="#ffffff" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#039BE5"></circle><circle cx="7" cy="0" r="2" fill="#039BE5"></circle><circle cx="14" cy="0" r="2" fill="#039BE5"></circle></g>`,e.templates.ula.nodeMenuButton=function(e,t,n,r){return`<g transform="matrix(1,0,0,1,${e.w-25}, ${e.h-15})"><rect x="-4" y="-10" fill="#000000" fill-opacity="0" width="22" height="22"></rect><circle cx="0" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="7" cy="0" r="2" fill="#AEAEAE"></circle><circle cx="14" cy="0" r="2" fill="#AEAEAE"></circle></g>`},e.templates.ula.padding=[110,1,1,1],e.templates.olivia=Object.assign({},e.templates.ana),e.templates.olivia.defs=`<style>
198
233
  #olivia_gradient {
199
234
  --color-stop-1: #ffffff;
200
235
  --color-stop-2: #eeeeee;
@@ -263,7 +298,7 @@ var e=function(e,t){var n=this;Object.defineProperty(this,`element`,{get(){retur
263
298
  <path stroke-width="${r}" fill="none" stroke="url(#${e}_linearColors6)" d="${a(n,n,n,300,1)}"/>
264
299
  </g>`},e._intersectionObserver=function(e,t){typeof IntersectionObserver==`function`?new IntersectionObserver(function(e,n){e.forEach(function(e){var n=e.intersectionRatio>0;e.intersectionRatio==0&&(n=e.isIntersecting),t(n)})}).observe(e):t(!0)},e.convertCsvToNodes=function(t){for(var n=e._csvToArray(t),r=n[0],i=[],a=1;a<n.length;a++){for(var o={},s=0;s<n[a].length;s++){var c=r[s],l=n[a][s];o[r[s]]=e._convertStringToArray(c,l)}o.id.trim()!=``&&i.push(o)}return i},e._escapeHtml=function(t){return e.ESCAPE_HTML&&typeof t==`string`?t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`):t},e._escapeDoubleQuotes=function(e){return typeof e==`string`?e.replace(/"/g,`&quot;`):e},e._escapeGreaterLessSign=function(e){return typeof e==`string`?e.replace(/</g,`&lt;`).replace(/>/g,`&gt;`):e},e.roundPathCorners=function(e,t,n){function r(e,t,n){var r=t.x-e.x,a=t.y-e.y,o=Math.sqrt(r*r+a*a);return i(e,t,Math.min(1,n/o))}function i(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function a(e,t){e.length>2&&(e[e.length-2]=t.x,e[e.length-1]=t.y)}function o(e){return{x:parseFloat(e[e.length-2]),y:parseFloat(e[e.length-1])}}Array.isArray(e)||(e=e.split(/[,\s]/).reduce(function(e,t){var n=t.match(`([a-zA-Z])(.+)`);return n?(e.push(n[1]),e.push(n[2])):e.push(t),e},[]),e=e.reduce(function(e,t){return parseFloat(t)==t&&e.length?e[e.length-1].push(t):e.push([t]),e},[]));var s=[];if(e.length>1){var c=o(e[0]),l=null;e[e.length-1][0]==`Z`&&e[0].length>2&&(l=[`L`,c.x,c.y],e[e.length-1]=l),s.push(e[0]);for(var u=1;u<e.length;u++){var d=s[s.length-1],f=e[u],p=f==l?e[1]:e[u+1];if(p&&d&&d.length>2&&f[0]==`L`&&p.length>2&&p[0]==`L`){var m=o(d),h=o(f),g=o(p),_,v;n?(_=i(h,d.origPoint||m,t),v=i(h,p.origPoint||g,t)):(_=r(h,m,t),v=r(h,g,t)),a(f,_),f.origPoint=h,s.push(f);var y=i(_,h,.5),b=i(h,v,.5),x=[`C`,y.x,y.y,b.x,b.y,v.x,v.y];x.origPoint=h,s.push(x)}else s.push(f)}if(l){var S=o(s[s.length-1]);s.push([`Z`]),a(s[0],S)}}else s=e;return s.reduce(function(e,t){return e+t.join(` `)+` `},``)},e._isMoved=function(e){return e.movex!=null||e.movey!=null},e._getDynamicGridCoulumns=function(e){for(var t=1;t<e&&(e/t,!(e/t-t<=0));t++);return t%2!=0&&t>2&&t--,t},e._getLazyLoading=function(e){var t=e.lazyLoading;return t==`auto`&&(t=!!(e&&e.nodes&&e.nodes.length>700)),t},e._getSvgAttributes=function(e){let t=/width="([\d.]+)"/,n=/height="([\d.]+)"/,r=/x="([\d.]+)"/,i=/y="([\d.]+)"/,a=/viewBox="([^"]+)"/,o=e.match(t),s=e.match(n),c=e.match(r),l=e.match(i),u=e.match(a),d=o?parseFloat(o[1]):0,f=s?parseFloat(s[1]):0,p=c?parseFloat(c[1]):0,m=l?parseFloat(l[1]):0,h=[0,0,0,0];return u&&(h=u[1],h=JSON.parse(`[${h}]`)),{width:d,height:f,viewBox:h,x:p,y:m}},e._setSvgAttributes=function(e,t){var n=t.x,r=t.y,i=t.width,a=t.height,o=t.viewBox.join(`,`);let s=e.match(/<svg\s+([^>]*?)>/);if(!s)return e;let c=s[0],l=s[1],u=(e,t,n)=>{if(n==null)return e;let r=RegExp(`\\s*${t}="[^"]*"`,`i`),i=` ${t}="${n}"`;return e.match(r)?e.replace(r,i):e+i};l=u(l,`x`,n),l=u(l,`y`,r),l=u(l,`width`,i),l=u(l,`height`,a),l=u(l,`viewBox`,o);let d=`<svg ${l}>`;return e.replace(c,d)},e._convertTextToNodes=function(e,t){let n=e.split(/\r?\n/).filter(e=>e.trim()!==``),r=[],i=1,a=[];for(let e of n){let n=0;for(;e.startsWith(t);)e=e.slice(t.length),n++;if(e=e.trim(),!e)continue;let o=e.match(/^\[([^\]]+)](.*)$/);if(o){let e=o[1].trim(),t=o[2].trim();a.length>0&&(a[a.length-1][e]=t);continue}let s=e.match(/^([^\(]+)\(([^)]+)\)$/),c,l=[];s?(c=s[1].trim(),l=s[2].split(`,`).map(e=>e.trim())):c=e;let u=n===0?null:a[n-1].id,d={id:i++,pid:u,name:c,tags:l};a[n]=d,a.length=n+1,r.push(d)}return r},e._convertFromNodesToText=function(e,t){let n={},r=[];e.forEach(e=>{n[e.id]={...e,children:[]}}),e.forEach(e=>{e.pid&&n[e.pid]?n[e.pid].children.push(n[e.id]):r.push(n[e.id])});function i(e,n){let r=t.repeat(n),a=r+e.name;Array.isArray(e.tags)&&e.tags.length>0&&(a+=`(`+e.tags.join(`,`)+`)`),a+=`
265
300
  `;for(let t of Object.keys(e))[`id`,`pid`,`name`,`children`,`tags`].includes(t)||(a+=r+`[`+t+`]`+e[t]+`
266
- `);for(let t of e.children)a+=i(t,n+1);return a}return r.map(e=>i(e,0)).join(``).trim()},e._onClickHandler=function(t,n,r,i,a){var o;if(r===void 0)if(n===`add`){var s={id:t.generateId(),pid:i};t.addNode(s,null,!0)}else if(n===`edit`){var c=t.getNode(i);t.editUI.show(c.id)}else if(n===`details`){var c=t.getNode(i);t.editUI.show(c.id,!0)}else if(n===`remove`)t.removeNode(i,null,!0);else if(n===`svg_export`||n===`svg`){var l={};e.isNEU(i)||(l.pages=[{nodeId:i}]),t.exportToSVG(l)}else if(n===`pdf_export`||n===`pdf`){var l={};e.isNEU(i)||(l.pages=[{nodeId:i}]),t.exportToPDF(l)}else if(n===`png_export`||n===`png`){var l={};e.isNEU(i)||(l.pages=[{nodeId:i}]),t.exportToPNG(l)}else if(n===`visio_export`||n===`visio`)t.exportToVisio({nodeId:i});else if(n===`pp_export`||n===`powerpoint`)t.exportToPowerPoint();else if(n===`pp_preview`||n===`pppreview`){var l={parentLevels:0,childLevels:1,expandChildren:!1,pages:[{parentLevels:null,childLevels:null,expandChildren:!0,nodeId:t.roots[0].id}]};i!=null&&(l.expandChildren=!1,l.pages[0].nodeId=i),t.powerPointPreviewUI.show(l)}else if(n===`pdf_preview`||n===`pdfpreview`){var l={parentLevels:0,childLevels:1,expandChildren:!1,pages:[{parentLevels:null,childLevels:null,expandChildren:!0,nodeId:t.roots[0].id}]};i!=null&&(l.expandChildren=!1,l.pages[0].nodeId=i),t.pdfPreviewUI.show(l)}else if(n===`svg_preview`||n===`svgpreview`){var l={parentLevels:0,childLevels:1,expandChildren:!1,pages:[{parentLevels:null,childLevels:null,expandChildren:!0,nodeId:t.roots[0].id}]};i!=null&&(l.expandChildren=!1,l.pages[0].nodeId=i),t.svgPreviewUI.show(l)}else if(n===`png_preview`||n===`pngpreview`){var l={parentLevels:0,childLevels:1,expandChildren:!1,pages:[{parentLevels:null,childLevels:null,expandChildren:!0,nodeId:t.roots[0].id}]};i!=null&&(l.expandChildren=!1,l.pages[0].nodeId=i),t.pngPreviewUI.show(l)}else n===`csv_export`||n===`csv`?t.exportToCSV({nodeId:i}):n===`xml_export`||n===`xml`?t.exportToXML({nodeId:i}):n===`json_export`||n===`json`?t.exportToJSON({nodeId:i}):n===`fit`?t.fit():n===`expand_all`?t.expand(null,`all`):n===`full_screen`?t.toggleFullScreen():n===`zoom_in`?t.zoom(!0,null,!0):n===`zoom_out`||n===`zoom_out`?t.zoom(!1,null,!0):n===`layout_mixed`?t.setLayout(e.layout.mixed):n===`layout_normal`?t.setLayout(e.layout.normal):n===`layout_right_offset`?t.setLayout(e.layout.treeRightOffset):n===`layout_left_offset`?t.setLayout(e.layout.treeLeftOffset):n===`layout_tree`?t.setLayout(e.layout.tree):n===`layout_grid`&&t.setLayout(e.layout.grid);else o=r.call(t,i,a);return o},e._isSVG=function(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t.startsWith(`<svg`)||!t.endsWith(`</svg>`))return!1;try{let e=new DOMParser().parseFromString(t,`image/svg+xml`);return e.querySelector(`parsererror`)?!1:e.documentElement.nodeName.toLowerCase()===`svg`}catch{return!1}},e._treeListAdjustToSTNodePostition=function(t,n){for(var r of t)r.y+=n.y+n.padding[0],r.x+=n.x+n.padding[3],e._treeListAdjustToSTNodePostition(r.children,n)},e._treeListSetProps=function(t,n){var r=-t.treeList.scrollTop,i={nodesByLevels:[],lastNode:null,y:0};t.treeList.pinnedIds=[],e._treeListIterate(t.stChildren,i,-1);var a=i.lastNode.y+i.lastNode.h-0-(t.treeList.maxHeight-t.padding[0]-t.padding[2]);r>0||a<0?r=0:r!=0&&r*-1>a&&(r=-a);for(var o=i.nodesByLevels.length-1;o>=0;o--)for(var s=i.nodesByLevels[o],c=s.length-1;c>=0;c--){for(var l=s[c],u=l.y,d=0,f=l.parent;f&&(d+=f.h,f.parent);)f=f.parent;if(l.children.length&&l.y+r<=d){u=-r+d;var p=s[c+1];if(p&&p.y<u+l.h&&(u=p.y-l.h),f){var m=t.stChildren.indexOf(f);if(t.stChildren.length>m+1){var h=t.stChildren[m+1];h.y<u+l.h&&(u=h.y-l.h)}}}l.y!=u&&t.treeList.pinnedIds.push(l.id),l.y=u,l.x=0}if(n==e.orientation.bottom){var g=i.lastNode.y+i.lastNode.h;for(var o of i.nodesByLevels)for(var l of o)l.y=g-l.y-l.h}t.treeList.scrollTop=-r,t.treeList.scrollTopMax=a},e._treeListIterate=function(t,n,r){r++;for(var i of t)i.y=n.y,n.y+=i.h,n.nodesByLevels[r]||(n.nodesByLevels[r]=[]),n.nodesByLevels[r].push(i),n.lastNode=i,e._treeListIterate(i.children,n,r)},e._treeListGetTumbPositionFromScrollTop=function(e){var t=e.h-e.padding[0]-e.padding[2],n=t/((e.treeList.scrollTopMax+t)/100),r=t/100*n,i=t-r,a=-e.treeList.scrollTop/(e.treeList.scrollTopMax/100),o=e.y+e.padding[0]+i/-100*a,s=`initial`;return(isNaN(r)||isNaN(o)||r<0||n>100)&&(s=`none`,r=0,o=0),{thumbHeight:r,thumbPosition:o,scrollBarDisplay:s}},e._treeListGetScrollTopFromTumbPosition=function(e,t,n){var r=e.h-e.padding[0]-e.padding[2]-t,i=(n-(e.y+e.padding[0]))/r*100/100*e.treeList.scrollTopMax;return(isNaN(i)||i<0)&&(i=0),i>e.treeList.scrollTopMax&&(i=e.treeList.scrollTopMax),i},e._getCenterNodeFromParams=function(e,t){var n=e[t.id];if(n){if(n.isTreeListItem){for(;!n.stParent;)n=n.parent;n=n.stParent}return n}return null},e._getScrollTopForNode=function(t,n){var r={nodesByLevels:[],lastNode:null,y:0};e._treeListIterate(t.stChildren,r,-1);var i=null;for(var a of r.nodesByLevels){for(var o of a)if(o.id==n){i=o;break}if(i)break}if(!i)return t.treeList.scrollTop;for(var s=0,c=i.parent;c&&(s+=c.h,c.parent);)c=c.parent;var l=t.padding[0],u=t.padding[2],d=t.treeList.maxHeight-l-u,f=r.lastNode.y+r.lastNode.h-d;f<0&&(f=0);var p=t.treeList.scrollTop,m=i.y-s,h=i.y+i.h-d,g=p;return i.y<p+s?g=m:i.y+i.h>p+d&&(g=i.h>d-s?m:h),g<0?g=0:g>f&&(g=f),g},e._getDefailtPositionForExpandCollpase=function(t,n){var r={x:0,y:0};switch(t.orientation){case e.orientation.top:case e.orientation.top_left:r.x=n.w/2,r.y=n.h;break;case e.orientation.bottom:case e.orientation.bottom_left:r.x=n.w/2,r.y=0;break;case e.orientation.right:case e.orientation.right_top:r.x=0,r.y=n.h/2;break;case e.orientation.left:case e.orientation.left_top:r.x=n.w,r.y=n.h/2;break}return r},e._measureCache={svg:null,text:null},e._getMeasureElement=function(){if(e._measureCache.svg)return e._measureCache.text;let t=`http://www.w3.org/2000/svg`;return e._measureCache.svg=document.createElementNS(t,`svg`),e._measureCache.svg.id=`orgchart_js_test__measure`,e._measureCache.svg.style.cssText=`position:absolute;top:-9999px;visibility:hidden;white-space:pre;`,e._measureCache.text=document.createElementNS(t,`text`),e._measureCache.svg.appendChild(e._measureCache.text),document.body.appendChild(e._measureCache.svg),e._measureCache.text},e._lineClamp=function(t,n,r,i){if(n===void 0||n==null)return``;typeof n!=`string`&&(n=n.toString()),n=e._escapeHtml(n);let a=/(\w+(?:-\w+)?)="([^"]*)"/g,o={},s;for(;(s=a.exec(t))!==null;)o[s[1]]=s[2];let c=e._getMeasureElement();c.textContent=``;for(let[e,t]of Object.entries(o))e!==`x`&&e!==`y`&&c.setAttribute(e,t);let l=e=>(c.textContent=e,c.getComputedTextLength()),u=n.split(` `),d=[],f=``,p=0;for(;p<u.length&&d.length<i;){let e=u[p],t=f?f+` `+e:e;if(l(t)<=r)f=t,p++;else if(f===``){let t=0,n=e.length,i=1;for(;t<=n;){let a=t+n>>1;l(e.slice(0,a))<=r?(i=a,t=a+1):n=a-1}d.push(e.slice(0,i)),u[p]=e.slice(i)}else d.push(f),f=``}f&&d.length<i&&d.push(f);let m=p<u.length||p===u.length&&u[p-1]===``&&n.endsWith(` `);if(m&&d.length>0){let e=d[d.length-1],t=0,n=e.length,i=``;for(;t<=n;){let a=Math.floor((t+n)/2),o=e.substring(0,a)+`...`;l(o)<=r?(i=o,t=a+1):n=a-1}d[d.length-1]=i}let h=` x="${o.x||`0`}"`,g=d.length===1?d[0]:d.map((e,t)=>`<tspan${h} dy="${t===0?0:`1.2em`}">${e}</tspan>`).join(``);return`<text${Object.entries(o).map(([e,t])=>` ${e}="${t}"`).join(``)}>${m?`<title>${n}</title>`:``}${g}</text>`},e._getScrollableTreeListNodeInTouchEnabledDevice=function(t){if(!t||!t.isTreeListItem||!e._isTouchDevice())return null;var n=e.getRootOf(t).stParent,{thumbHeight:r,thumbPosition:i,scrollBarDisplay:a}=e._treeListGetTumbPositionFromScrollTop(n);return a==`none`?null:n},e._convertImagesToBase64=async function(t){let n=new DOMParser;return await Promise.all(t.map(async t=>{let r=n.parseFromString(t,`image/svg+xml`),i=r.querySelectorAll(`image`);for(let t of i){let n=t.getAttribute(`href`)||t.getAttribute(`xlink:href`);if(n&&!n.startsWith(`data:`))try{let r=parseFloat(t.getAttribute(`width`))||0,i=parseFloat(t.getAttribute(`height`))||0;if(r>0&&i>0){let a=await e._resizeAndConvert(n,r,i);t.setAttribute(`href`,a),t.removeAttributeNS(`http://www.w3.org/1999/xlink`,`href`)}}catch(e){console.error(`Failed to process image:`,n,e)}}return new XMLSerializer().serializeToString(r)}))},e._resizeAndConvert=function(e,t,n){return new Promise((r,i)=>{let a=new Image;a.crossOrigin=`anonymous`,a.onload=()=>{let e=document.createElement(`canvas`),i=e.getContext(`2d`),o=Math.min(t/a.width,n/a.height),s=a.width*o,c=a.height*o;e.width=s,e.height=c,i.drawImage(a,0,0,s,c),r(e.toDataURL(`image/png`))},a.onerror=i,a.src=e})},e.prototype.zoom=function(t,n,r,i){var a=this.getViewBox().slice(0),o=a,s=a[2],c=a[3];t===!0?(a[2]/=e.SCALE_FACTOR,a[3]/=e.SCALE_FACTOR):t===!1?(a[2]*=e.SCALE_FACTOR,a[3]*=e.SCALE_FACTOR):(a[2]/=t,a[3]/=t),n||=[50,50],a[0]=o[0]-(a[2]-s)/(100/n[0]),a[1]=o[1]-(a[3]-c)/(100/n[1]);var l=this.getScale(a);if(a[2]=this.width()/l,a[3]=this.height()/l,t===!0&&l<this.config.scaleMax||t===!1&&l>this.config.scaleMin||t!=0&&t!=1&&l<this.config.scaleMax&&l>this.config.scaleMin){this._hideBeforeAnimation();var u=this;r?(clearTimeout(u._timeout),e.animate(this.getSvg(),{viewbox:this.getViewBox()},{viewbox:a},this.config.anim.duration,this.config.anim.func,function(){clearTimeout(u._timeout),u._timeout=setTimeout(function(){u._draw(!0,e.action.zoom,null,i)},500)})):(this.setViewBox(a),clearTimeout(u._timeout),u._timeout=setTimeout(function(){u._draw(!0,e.action.zoom,null,i)},500))}},e._ai=function(e){this.instance=e,this.sessionId=null},e._ai.prototype.prompt=function(e,t){var n=this;e=e.trim(),e&&(this.sessionId?n._prompt([{Role:`user`,Text:e}],t):this.setContext(function(){n._prompt([{Role:`user`,Text:e}],t)}))},e._ai.prototype._prompt=function(t,n){var r=this,i=[];for(var a of e.AI_SYSTEM_MESSAGES)i.push({Role:`system`,Text:a});var o=this.instance.config.serverUrl+`/OrgChartJSAI/Prompt?client_messages=${encodeURIComponent(JSON.stringify(t))}&system_messages=${encodeURIComponent(JSON.stringify(i))}&sessionId=${this.sessionId}`;let s=new EventSource(o);s.onmessage=function(e){var t=JSON.parse(e.data),i=``;t.kind==`end`&&s.close(),t.kind==`text`&&(i+=t.text,n&&n(t.text)),t.kind==`assistant-message-with-tools`?r.toolCalls(t.message,n):t.kind==`error`&&console.error(t.text)},s.onerror=function(e){console.error(e),s.close()}},e._ai.prototype.setContext=function(e){if(this.instance&&this.instance.config.enableAI&&this.instance.aiUI.canSetContext){this.sessionId=this.instance._event_id;var t=this.instance.config.serverUrl+`/OrgChartJSAI/SetContext`,n=this.instance.config.aiChatTools.slice();for(var r of n)r.functionParameters??=null,r.functionParameters=JSON.stringify(r.functionParameters);fetch(t,{method:`post`,headers:{"Content-Type":`application/json`,"x-request-type":`ajax`},body:JSON.stringify({context:this.instance.config.nodes,sessionId:this.sessionId,chatTools:n})}).then(function(){e&&e()}).catch(function(e){console.error(e)})}},e._ai.prototype.toolCalls=function(t,n){var r=this,i={toolCalls:t.ToolCalls};e.events.publish(`ai-tool-calls`,[this.instance,i]);var a=[],o=[],s=[],c=[],l=[],u=null,d=null,f=null,p=null,m=null;for(var h of i.toolCalls)h.FunctionResult??(h.FunctionName==`removeNode`?a.push(h):h.FunctionName==`addNode`?o.push(h):h.FunctionName==`updateNode`?s.push(h):h.FunctionName==`select`?c.push(h):h.FunctionName==`deselect`?l.push(h):h.FunctionName==`exportToPDF`?u=h:h.FunctionName==`changeTemplate`?d=h:h.FunctionName==`addSlink`?f=h:h.FunctionName==`removeSlink`?p=h:h.FunctionName==`fit`&&(m=h));var g=!1;if(d&&(g=!0,h.FunctionResult=`ok`,this.instance.config.template=h.FunctionArguments.templateName),f){var _=this.instance.getNode(h.FunctionArguments.employeeId1),v=this.instance.getNode(h.FunctionArguments.employeeId2);!_||!v||_==v?h.FunctionResult=`Cannot add link between ${h.FunctionArguments.employeeId1} and ${h.FunctionArguments.employeeId2}`:(g=!0,this.instance.addSlink(_.id,v.id),h.FunctionResult=`ok`)}if(p){var _=this.instance.getNode(h.FunctionArguments.employeeId1),v=this.instance.getNode(h.FunctionArguments.employeeId2);!_||!v||_==v?h.FunctionResult=`Cannot remove link between ${h.FunctionArguments.employeeId1} and ${h.FunctionArguments.employeeId2}`:(g=!0,this.instance.removeSlink(_.id,v.id),h.FunctionResult=`ok`)}m&&(this.instance.fit(),g=!1);for(var h of a)g=!0,h.FunctionResult=`ok`,this.instance.remove(h.FunctionArguments.id);for(var h of o){g=!0,h.FunctionResult=`ok`;var y=JSON.parse(JSON.stringify(h.FunctionArguments));y.isAssistant&&(y.tags=[`assistant`]),delete y.isAssistant,e.isNEU(y.id)&&(y.id=this.instance.generateId()),this.instance.add(y)}for(var h of s){g=!0,h.FunctionResult=`ok`;var y=this.instance.get(h.FunctionArguments.id);for(var b in h.FunctionArguments)b!=`id`&&h.FunctionArguments[b]!=null&&(y[b]=h.FunctionArguments[b]);this.instance.update(y)}for(var h of c){h.FunctionResult=`ok`;for(var x of h.FunctionArguments.ids){var S=h.FunctionArguments.color;S||=`#FFCA28`;var C=this.instance.getNodeElement(x).firstChild;C&&(C.style.stroke=h.FunctionArguments.color,C.style.strokeWidth=5)}}var w=function(){for(var e of l)if(e.FunctionResult=`ok`,e.FunctionArguments.ids)for(var t of e.FunctionArguments.ids){var n=r.instance.getNodeElement(t).firstChild;n&&(n.style.stroke=`#aeaeae`,n.style.strokeWidth=1)}else g=!0};g?(this.setContext(),this.instance.draw(e.action.update,void 0,w)):w();var T=function(){var e=[];for(var t of i.toolCalls)e.push({Role:`tool`,Text:t.FunctionResult,Id:t.Id});r._prompt(e,n)};u?this.chartInstance.exportToPDF({},function(){h.FunctionResult=`ok`,e._downloadFile(`application/pdf`,response,`OrgChart.pdf`,!1,`pdf`),T()}):T()},e.aiUI=function(){this.instance=null,this.interval=null,this.canSetContext=!1,this.element=null,this.inputElement=null,this.btnSendElement=null,this.messagesElement=null,Object.defineProperty(this,`width`,{get(){return this.isVisible()?this.element.offsetWidth:0}})},e.aiUI.title=`AI for OrgChart JS`,e.aiUI.prototype.init=function(e){this.instance=e;var t=this,n=this.instance.element.querySelector(`[data-boc-ai-button]`);n&&n.addEventListener(`click`,function(e){t.show()})},e.aiUI.prototype.isVisible=function(){return!(!this.element||this.element.style.display==`none`)},e.aiUI.prototype.show=function(t,n){this.instance.pdfPreviewUI.hide(),this.instance.svgPreviewUI.hide(),this.instance.pngPreviewUI.hide(),this.instance.powerPointPreviewUI.hide(),this.instance.aiUI.hide(),this.instance.orgScribeUI.hide(),this._create(),this.element.style.display=``,this.canSetContext||(this.canSetContext=!0,this.instance._ai.setContext());var r=this;n||(this.timeout&&clearInterval(this.interval),this.interval=e.animate(this.element,{opacity:0},{opacity:1},300,e.anim.outSin,function(){t||r.inputElement.focus()}))},e.aiUI.prototype._create=function(){if(!this.element){var t=this,n=`inp_`+this.instance.generateId();this.element=document.createElement(`div`),this.element.setAttribute(`data-boc-ai-form`,``),this.element.style.opacity=0,this.element.classList.add(`boc-ai-form`),this.element.classList.add(this.instance.config.mode),this.element.innerHTML=`<div class="boc-ai-container">
301
+ `);for(let t of e.children)a+=i(t,n+1);return a}return r.map(e=>i(e,0)).join(``).trim()},e._onClickHandler=function(t,n,r,i,a){var o;if(r===void 0)if(n===`add`){var s={id:t.generateId(),pid:i};t.addNode(s,null,!0)}else if(n===`edit`){var c=t.getNode(i);t.editUI.show(c.id)}else if(n===`details`){var c=t.getNode(i);t.editUI.show(c.id,!0)}else if(n===`remove`)t.removeNode(i,null,!0);else if(n===`svg_export`||n===`svg`){var l={};e.isNEU(i)||(l.pages=[{nodeId:i}]),t.exportToSVG(l)}else if(n===`pdf_export`||n===`pdf`){var l={};e.isNEU(i)||(l.pages=[{nodeId:i}]),t.exportToPDF(l)}else if(n===`png_export`||n===`png`){var l={};e.isNEU(i)||(l.pages=[{nodeId:i}]),t.exportToPNG(l)}else if(n===`visio_export`||n===`visio`)t.exportToVisio({nodeId:i});else if(n===`pp_export`||n===`powerpoint`)t.exportToPowerPoint();else if(n===`pp_preview`||n===`pppreview`){var l={parentLevels:0,childLevels:1,expandChildren:!1,pages:[{parentLevels:null,childLevels:null,expandChildren:!0,nodeId:t.roots[0].id}]};i!=null&&(l.expandChildren=!1,l.pages[0].nodeId=i),t.powerPointPreviewUI.show(l)}else if(n===`pdf_preview`||n===`pdfpreview`){var l={parentLevels:0,childLevels:1,expandChildren:!1,pages:[{parentLevels:null,childLevels:null,expandChildren:!0,nodeId:t.roots[0].id}]};i!=null&&(l.expandChildren=!1,l.pages[0].nodeId=i),t.pdfPreviewUI.show(l)}else if(n===`svg_preview`||n===`svgpreview`){var l={parentLevels:0,childLevels:1,expandChildren:!1,pages:[{parentLevels:null,childLevels:null,expandChildren:!0,nodeId:t.roots[0].id}]};i!=null&&(l.expandChildren=!1,l.pages[0].nodeId=i),t.svgPreviewUI.show(l)}else if(n===`png_preview`||n===`pngpreview`){var l={parentLevels:0,childLevels:1,expandChildren:!1,pages:[{parentLevels:null,childLevels:null,expandChildren:!0,nodeId:t.roots[0].id}]};i!=null&&(l.expandChildren=!1,l.pages[0].nodeId=i),t.pngPreviewUI.show(l)}else n===`pdf_profile`||n===`csv`?t.exportToPDFProfile(i):n===`share_profile`||n===`csv`?t.shareProfile(i):n===`csv_export`||n===`csv`?t.exportToCSV({nodeId:i}):n===`xml_export`||n===`xml`?t.exportToXML({nodeId:i}):n===`json_export`||n===`json`?t.exportToJSON({nodeId:i}):n===`fit`?t.fit():n===`expand_all`?t.expand(null,`all`):n===`full_screen`?t.toggleFullScreen():n===`zoom_in`?t.zoom(!0,null,!0):n===`zoom_out`||n===`zoom_out`?t.zoom(!1,null,!0):n===`layout_mixed`?t.setLayout(e.layout.mixed):n===`layout_normal`?t.setLayout(e.layout.normal):n===`layout_right_offset`?t.setLayout(e.layout.treeRightOffset):n===`layout_left_offset`?t.setLayout(e.layout.treeLeftOffset):n===`layout_tree`?t.setLayout(e.layout.tree):n===`layout_grid`&&t.setLayout(e.layout.grid);else o=r.call(t,i,a);return o},e._isSVG=function(e){if(typeof e!=`string`)return!1;let t=e.trim();if(!t.startsWith(`<svg`)||!t.endsWith(`</svg>`))return!1;try{let e=new DOMParser().parseFromString(t,`image/svg+xml`);return e.querySelector(`parsererror`)?!1:e.documentElement.nodeName.toLowerCase()===`svg`}catch{return!1}},e._treeListAdjustToSTNodePostition=function(t,n){for(var r of t)r.y+=n.y+n.padding[0],r.x+=n.x+n.padding[3],e._treeListAdjustToSTNodePostition(r.children,n)},e._treeListSetProps=function(t,n){var r=-t.treeList.scrollTop,i={nodesByLevels:[],lastNode:null,y:0};t.treeList.pinnedIds=[],e._treeListIterate(t.stChildren,i,-1);var a=i.lastNode.y+i.lastNode.h-0-(t.treeList.maxHeight-t.padding[0]-t.padding[2]);r>0||a<0?r=0:r!=0&&r*-1>a&&(r=-a);for(var o=i.nodesByLevels.length-1;o>=0;o--)for(var s=i.nodesByLevels[o],c=s.length-1;c>=0;c--){for(var l=s[c],u=l.y,d=0,f=l.parent;f&&(d+=f.h,f.parent);)f=f.parent;if(l.children.length&&l.y+r<=d){u=-r+d;var p=s[c+1];if(p&&p.y<u+l.h&&(u=p.y-l.h),f){var m=t.stChildren.indexOf(f);if(t.stChildren.length>m+1){var h=t.stChildren[m+1];h.y<u+l.h&&(u=h.y-l.h)}}}l.y!=u&&t.treeList.pinnedIds.push(l.id),l.y=u,l.x=0}if(n==e.orientation.bottom){var g=i.lastNode.y+i.lastNode.h;for(var o of i.nodesByLevels)for(var l of o)l.y=g-l.y-l.h}t.treeList.scrollTop=-r,t.treeList.scrollTopMax=a},e._treeListIterate=function(t,n,r){r++;for(var i of t)i.y=n.y,n.y+=i.h,n.nodesByLevels[r]||(n.nodesByLevels[r]=[]),n.nodesByLevels[r].push(i),n.lastNode=i,e._treeListIterate(i.children,n,r)},e._treeListGetTumbPositionFromScrollTop=function(e){var t=e.h-e.padding[0]-e.padding[2],n=t/((e.treeList.scrollTopMax+t)/100),r=t/100*n,i=t-r,a=-e.treeList.scrollTop/(e.treeList.scrollTopMax/100),o=e.y+e.padding[0]+i/-100*a,s=`initial`;return(isNaN(r)||isNaN(o)||r<0||n>100)&&(s=`none`,r=0,o=0),{thumbHeight:r,thumbPosition:o,scrollBarDisplay:s}},e._treeListGetScrollTopFromTumbPosition=function(e,t,n){var r=e.h-e.padding[0]-e.padding[2]-t,i=(n-(e.y+e.padding[0]))/r*100/100*e.treeList.scrollTopMax;return(isNaN(i)||i<0)&&(i=0),i>e.treeList.scrollTopMax&&(i=e.treeList.scrollTopMax),i},e._getCenterNodeFromParams=function(e,t){var n=e[t.id];if(n){if(n.isTreeListItem){for(;!n.stParent;)n=n.parent;n=n.stParent}return n}return null},e._getScrollTopForNode=function(t,n){var r={nodesByLevels:[],lastNode:null,y:0};e._treeListIterate(t.stChildren,r,-1);var i=null;for(var a of r.nodesByLevels){for(var o of a)if(o.id==n){i=o;break}if(i)break}if(!i)return t.treeList.scrollTop;for(var s=0,c=i.parent;c&&(s+=c.h,c.parent);)c=c.parent;var l=t.padding[0],u=t.padding[2],d=t.treeList.maxHeight-l-u,f=r.lastNode.y+r.lastNode.h-d;f<0&&(f=0);var p=t.treeList.scrollTop,m=i.y-s,h=i.y+i.h-d,g=p;return i.y<p+s?g=m:i.y+i.h>p+d&&(g=i.h>d-s?m:h),g<0?g=0:g>f&&(g=f),g},e._getDefailtPositionForExpandCollpase=function(t,n){var r={x:0,y:0};switch(t.orientation){case e.orientation.top:case e.orientation.top_left:r.x=n.w/2,r.y=n.h;break;case e.orientation.bottom:case e.orientation.bottom_left:r.x=n.w/2,r.y=0;break;case e.orientation.right:case e.orientation.right_top:r.x=0,r.y=n.h/2;break;case e.orientation.left:case e.orientation.left_top:r.x=n.w,r.y=n.h/2;break}return r},e._measureCache={svg:null,text:null},e._getMeasureElement=function(){if(e._measureCache.svg)return e._measureCache.text;let t=`http://www.w3.org/2000/svg`;return e._measureCache.svg=document.createElementNS(t,`svg`),e._measureCache.svg.id=`orgchart_js_test__measure`,e._measureCache.svg.style.cssText=`position:absolute;top:-9999px;visibility:hidden;white-space:pre;`,e._measureCache.text=document.createElementNS(t,`text`),e._measureCache.svg.appendChild(e._measureCache.text),document.body.appendChild(e._measureCache.svg),e._measureCache.text},e._lineClamp=function(t,n,r,i){if(n===void 0||n==null)return``;typeof n!=`string`&&(n=n.toString()),n=e._escapeHtml(n);let a=/(\w+(?:-\w+)?)="([^"]*)"/g,o={},s;for(;(s=a.exec(t))!==null;)o[s[1]]=s[2];let c=e._getMeasureElement();c.textContent=``;for(let[e,t]of Object.entries(o))e!==`x`&&e!==`y`&&c.setAttribute(e,t);let l=e=>(c.textContent=e,c.getComputedTextLength()),u=n.split(` `),d=[],f=``,p=0;for(;p<u.length&&d.length<i;){let e=u[p],t=f?f+` `+e:e;if(l(t)<=r)f=t,p++;else if(f===``){let t=0,n=e.length,i=1;for(;t<=n;){let a=t+n>>1;l(e.slice(0,a))<=r?(i=a,t=a+1):n=a-1}d.push(e.slice(0,i)),u[p]=e.slice(i)}else d.push(f),f=``}f&&d.length<i&&d.push(f);let m=p<u.length||p===u.length&&u[p-1]===``&&n.endsWith(` `);if(m&&d.length>0){let e=d[d.length-1],t=0,n=e.length,i=``;for(;t<=n;){let a=Math.floor((t+n)/2),o=e.substring(0,a)+`...`;l(o)<=r?(i=o,t=a+1):n=a-1}d[d.length-1]=i}let h=` x="${o.x||`0`}"`,g=d.length===1?d[0]:d.map((e,t)=>`<tspan${h} dy="${t===0?0:`1.2em`}">${e}</tspan>`).join(``);return`<text${Object.entries(o).map(([e,t])=>` ${e}="${t}"`).join(``)}>${m?`<title>${n}</title>`:``}${g}</text>`},e._getScrollableTreeListNodeInTouchEnabledDevice=function(t){if(!t||!t.isTreeListItem||!e._isTouchDevice())return null;var n=e.getRootOf(t).stParent,{thumbHeight:r,thumbPosition:i,scrollBarDisplay:a}=e._treeListGetTumbPositionFromScrollTop(n);return a==`none`?null:n},e._convertImagesToBase64=async function(t){let n=new DOMParser;return await Promise.all(t.map(async t=>{let r=n.parseFromString(t,`image/svg+xml`),i=r.querySelectorAll(`image`);for(let t of i){let n=t.getAttribute(`href`)||t.getAttribute(`xlink:href`);if(n&&!n.startsWith(`data:`))try{let r=parseFloat(t.getAttribute(`width`))||0,i=parseFloat(t.getAttribute(`height`))||0;if(r>0&&i>0){let a=await e._resizeAndConvert(n,r,i);t.setAttribute(`href`,a),t.removeAttributeNS(`http://www.w3.org/1999/xlink`,`href`)}}catch(e){console.error(`Failed to process image:`,n,e)}}return new XMLSerializer().serializeToString(r)}))},e._resizeAndConvert=function(e,t,n){return new Promise((r,i)=>{let a=new Image;a.crossOrigin=`anonymous`,a.onload=()=>{let e=document.createElement(`canvas`),i=e.getContext(`2d`),o=Math.min(t/a.width,n/a.height),s=a.width*o,c=a.height*o;e.width=s,e.height=c,i.drawImage(a,0,0,s,c),r(e.toDataURL(`image/png`))},a.onerror=i,a.src=e})},e._reorderNodeBinding=function(e){if(!e.nodeBinding)return;let t={};Object.keys(e.nodeBinding).filter(e=>!e.startsWith(`img`)).forEach(n=>{t[n]=e.nodeBinding[n]}),Object.keys(e.nodeBinding).filter(e=>e.startsWith(`img`)).forEach(n=>{t[n]=e.nodeBinding[n]}),e.nodeBinding=t},e.prototype.zoom=function(t,n,r,i){var a=this.getViewBox().slice(0),o=a,s=a[2],c=a[3];t===!0?(a[2]/=e.SCALE_FACTOR,a[3]/=e.SCALE_FACTOR):t===!1?(a[2]*=e.SCALE_FACTOR,a[3]*=e.SCALE_FACTOR):(a[2]/=t,a[3]/=t),n||=[50,50],a[0]=o[0]-(a[2]-s)/(100/n[0]),a[1]=o[1]-(a[3]-c)/(100/n[1]);var l=this.getScale(a);if(a[2]=this.width()/l,a[3]=this.height()/l,t===!0&&l<this.config.scaleMax||t===!1&&l>this.config.scaleMin||t!=0&&t!=1&&l<this.config.scaleMax&&l>this.config.scaleMin){this._hideBeforeAnimation();var u=this;r?(clearTimeout(u._timeout),e.animate(this.getSvg(),{viewbox:this.getViewBox()},{viewbox:a},this.config.anim.duration,this.config.anim.func,function(){clearTimeout(u._timeout),u._timeout=setTimeout(function(){u._draw(!0,e.action.zoom,null,i)},500)})):(this.setViewBox(a),clearTimeout(u._timeout),u._timeout=setTimeout(function(){u._draw(!0,e.action.zoom,null,i)},500))}},e._ai=function(e){this.instance=e,this.sessionId=null},e._ai.prototype.prompt=function(e,t){var n=this;e=e.trim(),e&&(this.sessionId?n._prompt([{Role:`user`,Text:e}],t):this.setContext(function(){n._prompt([{Role:`user`,Text:e}],t)}))},e._ai.prototype._prompt=function(t,n){var r=this,i=[];for(var a of e.AI_SYSTEM_MESSAGES)i.push({Role:`system`,Text:a});var o=this.instance.config.serverUrl+`/OrgChartJSAI/Prompt?client_messages=${encodeURIComponent(JSON.stringify(t))}&system_messages=${encodeURIComponent(JSON.stringify(i))}&sessionId=${this.sessionId}`;let s=new EventSource(o);s.onmessage=function(e){var t=JSON.parse(e.data),i=``;t.kind==`end`&&s.close(),t.kind==`text`&&(i+=t.text,n&&n(t.text)),t.kind==`assistant-message-with-tools`?r.toolCalls(t.message,n):t.kind==`error`&&console.error(t.text)},s.onerror=function(e){console.error(e),s.close()}},e._ai.prototype.setContext=function(e){if(this.instance&&this.instance.config.enableAI&&this.instance.aiUI.canSetContext){this.sessionId=this.instance._event_id;var t=this.instance.config.serverUrl+`/OrgChartJSAI/SetContext`,n=this.instance.config.aiChatTools.slice();for(var r of n)r.functionParameters??=null,r.functionParameters=JSON.stringify(r.functionParameters);fetch(t,{method:`post`,headers:{"Content-Type":`application/json`,"x-request-type":`ajax`},body:JSON.stringify({context:this.instance.config.nodes,sessionId:this.sessionId,chatTools:n})}).then(function(){e&&e()}).catch(function(e){console.error(e)})}},e._ai.prototype.toolCalls=function(t,n){var r=this,i={toolCalls:t.ToolCalls};e.events.publish(`ai-tool-calls`,[this.instance,i]);var a=[],o=[],s=[],c=[],l=[],u=null,d=null,f=null,p=null,m=null;for(var h of i.toolCalls)h.FunctionResult??(h.FunctionName==`removeNode`?a.push(h):h.FunctionName==`addNode`?o.push(h):h.FunctionName==`updateNode`?s.push(h):h.FunctionName==`select`?c.push(h):h.FunctionName==`deselect`?l.push(h):h.FunctionName==`exportToPDF`?u=h:h.FunctionName==`changeTemplate`?d=h:h.FunctionName==`addSlink`?f=h:h.FunctionName==`removeSlink`?p=h:h.FunctionName==`fit`&&(m=h));var g=!1;if(d&&(g=!0,h.FunctionResult=`ok`,this.instance.config.template=h.FunctionArguments.templateName),f){var _=this.instance.getNode(h.FunctionArguments.employeeId1),v=this.instance.getNode(h.FunctionArguments.employeeId2);!_||!v||_==v?h.FunctionResult=`Cannot add link between ${h.FunctionArguments.employeeId1} and ${h.FunctionArguments.employeeId2}`:(g=!0,this.instance.addSlink(_.id,v.id),h.FunctionResult=`ok`)}if(p){var _=this.instance.getNode(h.FunctionArguments.employeeId1),v=this.instance.getNode(h.FunctionArguments.employeeId2);!_||!v||_==v?h.FunctionResult=`Cannot remove link between ${h.FunctionArguments.employeeId1} and ${h.FunctionArguments.employeeId2}`:(g=!0,this.instance.removeSlink(_.id,v.id),h.FunctionResult=`ok`)}m&&(this.instance.fit(),g=!1);for(var h of a)g=!0,h.FunctionResult=`ok`,this.instance.remove(h.FunctionArguments.id);for(var h of o){g=!0,h.FunctionResult=`ok`;var y=JSON.parse(JSON.stringify(h.FunctionArguments));y.isAssistant&&(y.tags=[`assistant`]),delete y.isAssistant,e.isNEU(y.id)&&(y.id=this.instance.generateId()),this.instance.add(y)}for(var h of s){g=!0,h.FunctionResult=`ok`;var y=this.instance.get(h.FunctionArguments.id);for(var b in h.FunctionArguments)b!=`id`&&h.FunctionArguments[b]!=null&&(y[b]=h.FunctionArguments[b]);this.instance.update(y)}for(var h of c){h.FunctionResult=`ok`;for(var x of h.FunctionArguments.ids){var S=h.FunctionArguments.color;S||=`#FFCA28`;var C=this.instance.getNodeElement(x).firstChild;C&&(C.style.stroke=h.FunctionArguments.color,C.style.strokeWidth=5)}}var w=function(){for(var e of l)if(e.FunctionResult=`ok`,e.FunctionArguments.ids)for(var t of e.FunctionArguments.ids){var n=r.instance.getNodeElement(t).firstChild;n&&(n.style.stroke=`#aeaeae`,n.style.strokeWidth=1)}else g=!0};g?(this.setContext(),this.instance.draw(e.action.update,void 0,w)):w();var T=function(){var e=[];for(var t of i.toolCalls)e.push({Role:`tool`,Text:t.FunctionResult,Id:t.Id});r._prompt(e,n)};u?this.chartInstance.exportToPDF({},function(){h.FunctionResult=`ok`,e._downloadFile(`application/pdf`,response,`OrgChart.pdf`,!1,`pdf`),T()}):T()},e.aiUI=function(){this.instance=null,this.interval=null,this.canSetContext=!1,this.element=null,this.inputElement=null,this.btnSendElement=null,this.messagesElement=null,Object.defineProperty(this,`width`,{get(){return this.isVisible()?this.element.offsetWidth:0}})},e.aiUI.title=`AI for OrgChart JS`,e.aiUI.prototype.init=function(e){this.instance=e;var t=this,n=this.instance.element.querySelector(`[data-boc-ai-button]`);n&&n.addEventListener(`click`,function(e){t.show()})},e.aiUI.prototype.isVisible=function(){return!(!this.element||this.element.style.display==`none`)},e.aiUI.prototype.show=function(t,n){this.instance.pdfPreviewUI.hide(),this.instance.svgPreviewUI.hide(),this.instance.pngPreviewUI.hide(),this.instance.powerPointPreviewUI.hide(),this.instance.aiUI.hide(),this.instance.orgScribeUI.hide(),this._create(),this.element.style.display=``,this.canSetContext||(this.canSetContext=!0,this.instance._ai.setContext());var r=this;n||(this.timeout&&clearInterval(this.interval),this.interval=e.animate(this.element,{opacity:0},{opacity:1},300,e.anim.outSin,function(){t||r.inputElement.focus()}))},e.aiUI.prototype._create=function(){if(!this.element){var t=this,n=`inp_`+this.instance.generateId();this.element=document.createElement(`div`),this.element.setAttribute(`data-boc-ai-form`,``),this.element.style.opacity=0,this.element.classList.add(`boc-ai-form`),this.element.classList.add(this.instance.config.mode),this.element.innerHTML=`<div class="boc-ai-container">
267
302
  <div data-boc-ai-close class="boc-ai-close">${e.icon.x(20,20,`#aeaeae`)}</div>
268
303
  <div class="boc-ai-middle boc-ai-start">
269
304
  <div data-boc-ai-messages class="boc-ai-messages">
package/orgchart.mjs CHANGED
@@ -23,7 +23,7 @@ e.prototype.init = function(t, n) {
23
23
  if (t && !this._initCalled) {
24
24
  this._initCalled = !0, (typeof t == "string" || t instanceof String) && (t = document.querySelector(t)), this.element = t;
25
25
  var r = this;
26
- if (this.config = e.mergeDeep(e._defaultConfig(n), n), this._layoutConfigs = { base: {
26
+ if (e._reorderNodeBinding(n), this.config = e.mergeDeep(e._defaultConfig(n), n), this._layoutConfigs = { base: {
27
27
  orientation: this.config.orientation,
28
28
  levelSeparation: this.config.levelSeparation,
29
29
  mixedHierarchyNodesSeparation: this.config.mixedHierarchyNodesSeparation,
@@ -694,7 +694,7 @@ e.prototype.init = function(t, n) {
694
694
  n._menuClickHandler.apply(n, [this, e]);
695
695
  });
696
696
  }
697
- }, e === void 0 && (e = {}), e.VERSION = "9.2.42", e.orientation = {}, e.orientation.top = 0, e.orientation.bottom = 1, e.orientation.right = 2, e.orientation.left = 3, e.orientation.top_left = 4, e.orientation.bottom_left = 5, e.orientation.right_top = 6, e.orientation.left_top = 7, e.anchor = {
697
+ }, e === void 0 && (e = {}), e.VERSION = "9.2.43", e.orientation = {}, e.orientation.top = 0, e.orientation.bottom = 1, e.orientation.right = 2, e.orientation.left = 3, e.orientation.top_left = 4, e.orientation.bottom_left = 5, e.orientation.right_top = 6, e.orientation.left_top = 7, e.anchor = {
698
698
  top_right: "top_right",
699
699
  right_top: "right_top",
700
700
  bottom_right: "bottom_right",
@@ -707,7 +707,7 @@ e.prototype.init = function(t, n) {
707
707
  bottom: "bottom",
708
708
  left: "left",
709
709
  right: "right"
710
- }, e.align = {}, e.align.center = e.CENTER = 8, e.align.orientation = e.ORIENTATION = 9, e.attr = {}, e.attr.l = "data-l", e.attr.id = "data-id", e.attr.sl = "data-sl", e.attr.lbl = "data-lbl", e.attr.val = "data-val", e.attr.tlbr = "data-tlbr", e.attr.item = "data-item", e.attr.layout = "data-layout", e.attr.node_id = "data-n-id", e.attr.link_id = "data-l-id", e.attr.field_name = "data-f-name", e.attr.c_link_to = "data-c-l-to", e.attr.c_link_from = "data-c-l-from", e.attr.s_link_to = "data-s-l-to", e.attr.s_link_from = "data-s-l-from", e.attr.control_add = "data-ctrl-add", e.attr.control_expcoll_id = "data-ctrl-ec-id", e.attr.control_up_id = "data-ctrl-up-id", e.attr.control_export_menu = "data-ctrl-menu", e.attr.control_node_menu_id = "data-ctrl-n-menu-id", e.attr.control_node_circle_menu_id = "data-ctrl-n-c-menu-id", e.attr.control_node_circle_menu_name = "data-ctrl-n-c-menu-name", e.attr.control_node_circle_menu_wrraper_id = "data-ctrl-n-c-menu-wrapper-id", e.attr.width = "data-width", e.attr.text_overflow = "data-text-overflow", e.ID = "id", e.PID = "pid", e.STPID = "stpid", e.TAGS = "tags", e.NODES = "nodes", e.ELASTIC = "elastic", e.ASSISTANT = "Assistant", e.action = {}, e.action.expand = 0, e.action.collapse = 1, e.action.maximize = 101, e.action.minimize = 102, e.action.expandCollapse = 501, e.action.edit = 1, e.action.zoom = 2, e.action.ctrlZoom = 22, e.action.scroll = 41, e.action.xScroll = 3, e.action.yScroll = 4, e.action.none = 5, e.action.init = 6, e.action.update = 7, e.action.move = 70, e.action.pan = 8, e.action.centerNode = 9, e.action.resize = 10, e.action.insert = 11, e.action.insertfirst = 12, e.action.details = 13, e.action.exporting = 14, e.none = 400001, e.scroll = {}, e.scroll.visible = !0, e.scroll.smooth = 12, e.scroll.speed = 120, e.scroll.safari = {
710
+ }, e.align = {}, e.align.center = e.CENTER = 8, e.align.orientation = e.ORIENTATION = 9, e.attr = {}, e.attr.l = "data-l", e.attr.id = "data-id", e.attr.sl = "data-sl", e.attr.lbl = "data-lbl", e.attr.val = "data-val", e.attr.tlbr = "data-tlbr", e.attr.item = "data-item", e.attr.layout = "data-layout", e.attr.node_id = "data-n-id", e.attr.link_id = "data-l-id", e.attr.field_name = "data-f-name", e.attr.c_link_to = "data-c-l-to", e.attr.c_link_from = "data-c-l-from", e.attr.s_link_to = "data-s-l-to", e.attr.s_link_from = "data-s-l-from", e.attr.control_add = "data-ctrl-add", e.attr.control_expcoll_id = "data-ctrl-ec-id", e.attr.control_up_id = "data-ctrl-up-id", e.attr.control_export_menu = "data-ctrl-menu", e.attr.control_node_menu_id = "data-ctrl-n-menu-id", e.attr.control_node_btn = "data-ctrl-n-btn", e.attr.control_node_circle_menu_id = "data-ctrl-n-c-menu-id", e.attr.control_node_circle_menu_name = "data-ctrl-n-c-menu-name", e.attr.control_node_circle_menu_wrraper_id = "data-ctrl-n-c-menu-wrapper-id", e.attr.width = "data-width", e.attr.text_overflow = "data-text-overflow", e.ID = "id", e.PID = "pid", e.STPID = "stpid", e.TAGS = "tags", e.NODES = "nodes", e.ELASTIC = "elastic", e.ASSISTANT = "Assistant", e.action = {}, e.action.expand = 0, e.action.collapse = 1, e.action.maximize = 101, e.action.minimize = 102, e.action.expandCollapse = 501, e.action.edit = 1, e.action.zoom = 2, e.action.ctrlZoom = 22, e.action.scroll = 41, e.action.xScroll = 3, e.action.yScroll = 4, e.action.none = 5, e.action.init = 6, e.action.update = 7, e.action.move = 70, e.action.pan = 8, e.action.centerNode = 9, e.action.resize = 10, e.action.insert = 11, e.action.insertfirst = 12, e.action.details = 13, e.action.exporting = 14, e.none = 400001, e.scroll = {}, e.scroll.visible = !0, e.scroll.smooth = 12, e.scroll.speed = 120, e.scroll.safari = {
711
711
  smooth: 12,
712
712
  speed: 250
713
713
  }, e.match = {}, e.match.height = 100001, e.match.width = 100002, e.match.boundary = 100003, e.match.boundaryIfOutside = 100004, e.match.none = 1, e.movable = {}, e.movable.node = "node", e.movable.tree = "tree", e.movable.detachTree = "detachTree", e.layout = {}, e.layout.normal = e.normal = 0, e.layout.mixed = e.mixed = 1, e.layout.tree = e.tree = 2, e.layout.treeLeftOffset = e.treeLeftOffset = 3, e.layout.treeRightOffset = e.treeRightOffset = 4, e.layout.treeLeft = 5, e.layout.treeRight = 6, e.layout.grid = -1, e.layout.treeList = -2, e.nodeOpenTag = "<g " + e.attr.node_id + "=\"{id}\" style=\"opacity: {opacity}\" transform=\"matrix(1,0,0,1,{x},{y})\" class=\"{class}\" " + e.attr.sl + "=\"{sl}\" " + e.attr.l + "=\"{level}\" {lcn}>", e.linkOpenTag = "<g " + e.attr.link_id + "=\"[{id}][{child-id}]\" class=\"{class}\">", e.expcollOpenTag = "<g " + e.attr.control_expcoll_id + "=\"{id}\" transform=\"matrix(1,0,0,1,{x},{y})\" style=\"cursor:pointer;\">", e.upOpenTag = "<g " + e.attr.control_up_id + "=\"{id}\" transform=\"matrix(1,0,0,1,{x},{y})\" style=\"cursor:pointer;\">", e.linkFieldsOpenTag = "<g transform=\"matrix(1,0,0,1,{x},{y}) rotate({rotate})\">", e.grCloseTag = "</g>", e.A5 = {
@@ -1407,10 +1407,10 @@ e.prototype.init = function(t, n) {
1407
1407
  up: "touchend",
1408
1408
  touchstart: "touchstart"
1409
1409
  }), this._treeListUpdateInterval &&= (clearInterval(this._treeListUpdateInterval), null);
1410
- for (var i = null, a = n.target; a != t && !a.hasAttribute(e.attr.control_node_menu_id) && !a.hasAttribute(e.attr.control_node_circle_menu_id);) {
1410
+ for (var i = null, a = n.target; a != t && !a.hasAttribute(e.attr.control_node_menu_id) && !a.hasAttribute(e.attr.control_node_btn) && !a.hasAttribute(e.attr.control_node_circle_menu_id);) {
1411
1411
  if (a.hasAttribute) {
1412
1412
  var o = null;
1413
- a.hasAttribute(e.attr.node_id) ? o = this.getNode(a.getAttribute(e.attr.node_id)) : a.hasAttribute(e.attr.control_expcoll_id) ? o = this.getNode(a.getAttribute(e.attr.control_expcoll_id)) : (a.hasAttribute(e.attr.control_node_menu_id) || a.hasAttribute(e.attr.control_node_menu_id)) && (o = this.getNode(a.getAttribute(e.attr.control_node_menu_id))), i ||= e._getScrollableTreeListNodeInTouchEnabledDevice(o);
1413
+ a.hasAttribute(e.attr.node_id) ? o = this.getNode(a.getAttribute(e.attr.node_id)) : a.hasAttribute(e.attr.control_expcoll_id) ? o = this.getNode(a.getAttribute(e.attr.control_expcoll_id)) : a.hasAttribute(e.attr.control_node_menu_id) ? o = this.getNode(a.getAttribute(e.attr.control_node_menu_id)) : a.hasAttribute(e.attr.control_node_btn) && (o = this.getNode(a.getAttribute(e.attr.control_node_btn))), i ||= e._getScrollableTreeListNodeInTouchEnabledDevice(o);
1414
1414
  }
1415
1415
  if (a.hasAttribute(e.attr.node_id) && !i && (this.config.enableDragDrop || this.config.movable)) {
1416
1416
  if (n.touches == null || n.touches.length <= 1) {
@@ -1714,6 +1714,13 @@ e.prototype.init = function(t, n) {
1714
1714
  this._nodeMenuClickHandler(a.id, r, n);
1715
1715
  return;
1716
1716
  }
1717
+ if (r.hasAttribute(e.attr.control_node_btn)) {
1718
+ n.stopPropagation(), n.preventDefault();
1719
+ for (var o = r.getAttribute(e.attr.control_node_btn); !r.hasAttribute(e.attr.node_id);) r = r.parentNode;
1720
+ var i = r.getAttribute(e.attr.node_id);
1721
+ e._onClickHandler(this, o, void 0, i, void 0);
1722
+ return;
1723
+ }
1717
1724
  if (r.hasAttribute(e.attr.control_node_circle_menu_id)) {
1718
1725
  n.stopPropagation(), n.preventDefault();
1719
1726
  var i = r.getAttribute(e.attr.control_node_circle_menu_id);
@@ -2946,6 +2953,46 @@ e.prototype.init = function(t, n) {
2946
2953
  ],
2947
2954
  editFormHeaderColor: "#039BE5",
2948
2955
  treeListMaxHeight: 500
2956
+ }, e.templates.emily = Object.assign({}, e.templates.ana), e.templates.emily.size = [200, 270], e.templates.emily.defs = "<style>.boc-hover .boc-emily-fill{fill: #039BE5;}\n.boc-hover .boc-hoverable{stroke: #039BE5 !important;}\n.boc-emily-link:hover text{ fill: #F57C00; }\n.boc-emily-link:hover path, .boc-emily-link:hover rect{ stroke: #F57C00; }\n.boc-emily-white{ transition: all 0.3s ease-in-out; }\n.boc-hover-self:hover .boc-emily-white {height: calc(var(--boc-emily-h) - 45px);}\n.boc-hover-self .boc-emily-nodemenu{ opacity: 1; }\n.boc-emily-photo{ transition: all 0.3s ease-in-out; }\n.boc-emily-btn:hover{cursor:pointer;}\n.boc-emily-btn:hover path{fill:#F57C00 !important;}\n.boc-hover-self .boc-emily-photo{ transform: matrix(0.4,0,0,0.4,0,30) }\n</style>", e.templates.emily.node = function(t, n, r, i) {
2957
+ return `<rect class="boc-emily-fill" x="0" y="0" height="${t.h}" width="${t.w}" fill="#039BE5" stroke ="#aeaeae" stroke-width="1" rx="10" ry="10"></rect>
2958
+ <rect class="boc-emily-white" x="0.5" y="30" height="${t.h - 80}" width="${t.w - 1}" fill="#fff" style="--boc-emily-h:${t.h - 80}px"></rect>
2959
+ <g ${e.attr.control_node_btn}="pdf_profile" class="boc-emily-btn " transform="matrix(1,0,0,1,${t.w - 70},40)">${e.icon.pdf(24, 24, "#039BE5")}<rect x="0" y="0" width="30" height="30" fill="red" fill-opacity="0"></rect></g>
2960
+ <g ${e.attr.control_node_btn}="share_profile" class="boc-emily-btn" transform="matrix(1,0,0,1,${t.w - 35},40)">${e.icon.share(24, 24, "#039BE5")}<rect x="0" y="0" width="30" height="30" fill="red" fill-opacity="0"></rect></g>
2961
+ `;
2962
+ }, e.templates.emily.field_0 = e.templates.emily.name = e.templates.emily.name = function(t, n, r, i, a) {
2963
+ return e.wrapText(a, `<text style="font-size: 18px;" x="${t.w / 2}" y="${t.h - 20}" fill="#fff" text-anchor="middle"></text>`, t.w - 10, 1);
2964
+ }, e.templates.emily.field_1 = e.templates.emily.title = e.templates.emily.title = function(t, n, r, i, a) {
2965
+ return e.wrapText(a, `<text style="font-size: 14px;" x="${t.w / 2}" y="19" fill="#fff" text-anchor="middle"></text>`, t.w - 10, 1);
2966
+ }, e.templates.emily.email = function(t, n, r, i, a) {
2967
+ return n.email ? `<a class="boc-emily-link" href="mailto:${a}">
2968
+ <g transform="matrix(1,0,0,1,7,${t.h - 150})">
2969
+ <rect x="3" y="5" width="18" height="14" rx="2" fill="none" stroke-width="2" stroke="#039BE5"/>
2970
+ <path d="m3 7 9 6 9-6" fill="none" stroke-width="2" stroke="#039BE5" />
2971
+ ${e.wrapText(a, "<text x=\"30\" y=\"15\" fill=\"#039BE5\" font-size=\"13\"></text>", t.w - 40, 1)}
2972
+ <rect style="opacity:0" x="0" y="0" width="${t.w - 14}" height="20" fill="red" />
2973
+ </g>
2974
+ </a>` : "";
2975
+ }, e.templates.emily.address = function(e, t, n, r, i) {
2976
+ return t.address ? `<a class="boc-emily-link" target="_blank" href="https://www.google.com/maps/place/${i}/" >
2977
+ <g transform="matrix(1,0,0,1,7,${e.h - 127})">
2978
+ <path d="M1 6l7-3 8 3 7-3v15l-7 3-8-3-7 3zM8 3v18M16 6v18" fill="none" stroke-width="2" stroke="#039BE5" />
2979
+ <text x="30" y="15" fill="#039BE5" font-size="13">${i}</text>
2980
+ <rect style="opacity:0" x="0" y="0" width="${e.w - 14}" height="20" fill="red" />
2981
+ </g>
2982
+ </a>` : "";
2983
+ }, e.templates.emily.description = function(t, n, r, i, a) {
2984
+ return e.wrapText(a, `<text style="font-size: 14px;" x="${t.w / 2}" y="${t.h - 70}" fill="#fff" text-anchor="middle"></text>`, t.w - 20, 3);
2985
+ }, e.templates.emily.img_0 = function(e, t, n, r, i) {
2986
+ return i ? `<g class="boc-emily-photo" transform="matrix(1,0,0,1,0,30)" ><image preserveAspectRatio="xMidYMid slice" xlink:href="${i}" x="0.5" y="0" width="${e.w - 1}" height="${e.h - 80}" ></image></g>` : "";
2987
+ }, e.templates.emily.nodeMenuButton = function(e, t, n, r) {
2988
+ return `
2989
+ <g style="cursor:pointer;" transform="matrix(1,0,0,1, ${e.w - 25}, 8)" data-ctrl-n-menu-id="${e.id}">
2990
+ <rect x="0" y="0" width="18" height="2.5" rx="1.25" fill="#fff" />
2991
+ <rect x="0" y="6" width="18" height="2.5" rx="1.25" fill="#fff" />
2992
+ <rect x="0" y="12" width="18" height="2.5" rx="1.25" fill="#fff" />
2993
+ <rect x="-5" y="-5" width="30" height="25" fill="transparent" />
2994
+ </g>
2995
+ `;
2949
2996
  }, e.templates.split = Object.assign({}, e.templates.ana), e.templates.split.size = [10, 10], e.templates.split.node = "<circle cx=\"5\" cy=\"5\" r=\"5\" fill=\"none\" stroke-width=\"1\" stroke=\"#aeaeae\"></circle>", e.templates.split.field_0 = "", e.templates.split.field_1 = "", e.templates.split.img_0 = "", e.templates.dot = Object.assign({}, e.templates.split), e.templates.group = Object.assign({}, e.templates.ana), e.templates.group.size = [250, 120], e.templates.group.padding = [
2950
2997
  50,
2951
2998
  20,
@@ -4802,7 +4849,7 @@ e.prototype.init = function(t, n) {
4802
4849
  }]
4803
4850
  };
4804
4851
  i != null && (l.expandChildren = !1, l.pages[0].nodeId = i), t.pngPreviewUI.show(l);
4805
- } else n === "csv_export" || n === "csv" ? t.exportToCSV({ nodeId: i }) : n === "xml_export" || n === "xml" ? t.exportToXML({ nodeId: i }) : n === "json_export" || n === "json" ? t.exportToJSON({ nodeId: i }) : n === "fit" ? t.fit() : n === "expand_all" ? t.expand(null, "all") : n === "full_screen" ? t.toggleFullScreen() : n === "zoom_in" ? t.zoom(!0, null, !0) : n === "zoom_out" || n === "zoom_out" ? t.zoom(!1, null, !0) : n === "layout_mixed" ? t.setLayout(e.layout.mixed) : n === "layout_normal" ? t.setLayout(e.layout.normal) : n === "layout_right_offset" ? t.setLayout(e.layout.treeRightOffset) : n === "layout_left_offset" ? t.setLayout(e.layout.treeLeftOffset) : n === "layout_tree" ? t.setLayout(e.layout.tree) : n === "layout_grid" && t.setLayout(e.layout.grid);
4852
+ } else n === "pdf_profile" || n === "csv" ? t.exportToPDFProfile(i) : n === "share_profile" || n === "csv" ? t.shareProfile(i) : n === "csv_export" || n === "csv" ? t.exportToCSV({ nodeId: i }) : n === "xml_export" || n === "xml" ? t.exportToXML({ nodeId: i }) : n === "json_export" || n === "json" ? t.exportToJSON({ nodeId: i }) : n === "fit" ? t.fit() : n === "expand_all" ? t.expand(null, "all") : n === "full_screen" ? t.toggleFullScreen() : n === "zoom_in" ? t.zoom(!0, null, !0) : n === "zoom_out" || n === "zoom_out" ? t.zoom(!1, null, !0) : n === "layout_mixed" ? t.setLayout(e.layout.mixed) : n === "layout_normal" ? t.setLayout(e.layout.normal) : n === "layout_right_offset" ? t.setLayout(e.layout.treeRightOffset) : n === "layout_left_offset" ? t.setLayout(e.layout.treeLeftOffset) : n === "layout_tree" ? t.setLayout(e.layout.tree) : n === "layout_grid" && t.setLayout(e.layout.grid);
4806
4853
  else o = r.call(t, i, a);
4807
4854
  return o;
4808
4855
  }, e._isSVG = function(e) {
@@ -4984,6 +5031,14 @@ e.prototype.init = function(t, n) {
4984
5031
  e.width = s, e.height = c, i.drawImage(a, 0, 0, s, c), r(e.toDataURL("image/png"));
4985
5032
  }, a.onerror = i, a.src = e;
4986
5033
  });
5034
+ }, e._reorderNodeBinding = function(e) {
5035
+ if (!e.nodeBinding) return;
5036
+ let t = {};
5037
+ Object.keys(e.nodeBinding).filter((e) => !e.startsWith("img")).forEach((n) => {
5038
+ t[n] = e.nodeBinding[n];
5039
+ }), Object.keys(e.nodeBinding).filter((e) => e.startsWith("img")).forEach((n) => {
5040
+ t[n] = e.nodeBinding[n];
5041
+ }), e.nodeBinding = t;
4987
5042
  }, e.prototype.zoom = function(t, n, r, i) {
4988
5043
  var a = this.getViewBox().slice(0), o = a, s = a[2], c = a[3];
4989
5044
  t === !0 ? (a[2] /= e.SCALE_FACTOR, a[3] /= e.SCALE_FACTOR) : t === !1 ? (a[2] *= e.SCALE_FACTOR, a[3] *= e.SCALE_FACTOR) : (a[2] /= t, a[3] /= t), n ||= [50, 50], a[0] = o[0] - (a[2] - s) / (100 / n[0]), a[1] = o[1] - (a[3] - c) / (100 / n[1]);
package/package.json CHANGED
@@ -58,5 +58,5 @@
58
58
  "url": "git+https://github.com/BALKANGraph/OrgChartJS-Community.git"
59
59
  },
60
60
  "dependencies": {},
61
- "version": "9.2.42"
61
+ "version": "9.2.43"
62
62
  }