@limble/limble-tree
Advanced tools
Comparing version 0.11.7 to 0.11.8
@@ -15,3 +15,3 @@ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("@limble/limble-tree",["exports","@angular/core","rxjs","rxjs/operators","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).limble=e.limble||{},e.limble["limble-tree"]={}),e.ng.core,e.rxjs,e.rxjs.operators,e.ng.common)}(this,(function(e,t,n,r,o){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */Object.create;function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e}Object.create;function l(e,t){var n,r;if(e.length!==t.length)return!1;try{for(var o=i(e.entries()),s=o.next();!s.done;s=o.next()){var d=a(s.value,2),c=d[0],h=d[1],p=t[c];if(h instanceof Array&&p instanceof Array){if(!l(h,p))return!1}else if(h!==p)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!0}function d(e,t){return void 0!==e&&(!0===e.allowNesting||"function"==typeof e.allowNesting&&void 0!==t&&!0===e.allowNesting(t))}var c=function(){function e(e,t){this.parentCoordinates=e,this.insertIndex=t}return e.prototype.getFullInsertCoordinates=function(){return s(this.parentCoordinates,[this.insertIndex])},e.prototype.setParentCoordinates=function(e){this.parentCoordinates=e},e.prototype.setInsertIndex=function(e){this.insertIndex=e},e}(),h=function(){function e(e,t){this.location=new c(e,t),this.rendered=!1,this.visible=!1,this.active=!1,this.commChannel=new n.Subject}return e.dropZoneLocationsAreEqual=function(e,t){return l(e.getFullInsertCoordinates(),t.getFullInsertCoordinates())},e.prototype.isRendered=function(e){return void 0===e&&(e=void 0),void 0!==e&&(this.rendered=e,void 0!==this.commChannel&&this.commChannel.next("checkRendered"),!1===this.rendered&&this.isVisible(!1)),this.rendered},e.prototype.isVisible=function(e){return void 0===e&&(e=void 0),void 0!==e&&(this.visible=e,void 0!==this.commChannel&&this.commChannel.next("checkVisible"),!1===this.visible&&this.isActive(!1)),this.visible},e.prototype.isActive=function(e){return void 0===e&&(e=void 0),void 0!==e&&(this.active=e,void 0!==this.commChannel&&this.commChannel.next("checkActive")),this.active},e.prototype.getLocation=function(){return this.location},e.prototype.getFamily=function(){return this.family},e.prototype.setFamily=function(e){this.family=e},e.prototype.getCommChannel=function(){return this.commChannel},e.prototype.getFullInsertCoordinates=function(){return this.location.getFullInsertCoordinates()},e.prototype.setHost=function(e){return this.host=e,this.host},e.prototype.getHost=function(){return this.host},e}(),p=function(){function e(){this.state="idle",this.state$=new n.BehaviorSubject(this.state)}return e.prototype.dragging=function(e,t){this._tempData={branch:e,parentContainer:t},this.state="dragging",this.state$.next(this.state)},e.prototype.droppable=function(){if("dragging"!==this.state)throw new Error("Can only call `droppable` when state is `dragging`");this.state="droppable",this.state$.next(this.state)},e.prototype.notDroppable=function(){if("droppable"!==this.state)throw new Error("Can only call `notDroppable` when state is `droppable`");this.state="dragging",this.state$.next(this.state)},e.prototype.capture=function(){var e;if("droppable"!==this.state)throw new Error("Can only move to `captured` state from `droppable` state");return this.state="captured",this.state$.next(this.state),null===(e=this._tempData)||void 0===e?void 0:e.branch},e.prototype.release=function(){this._tempData=void 0,this.state="idle",this.state$.next(this.state)},e.prototype.getData=function(){return this._tempData},e.prototype.getState=function(){return this.state},e}();p.ɵfac=function(e){return new(e||p)},p.ɵprov=t.ɵɵdefineInjectable({token:p,factory:p.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(p,[{type:t.Injectable}],(function(){return[]}),null);var u=function(){function e(){this.beingBuilt=0,this.isReady=!1,this.stable$=new n.BehaviorSubject(this.treeIsStable())}return e.prototype.constructing=function(){this.beingBuilt++,this.emit()},e.prototype.doneConstructing=function(){this.beingBuilt--,this.emit()},e.prototype.treeIsStable=function(){return!0===this.isReady&&0===this.beingBuilt},e.prototype.ready=function(e){this.isReady=e},e.prototype.emit=function(){this.stable$.next(this.treeIsStable())},e}();function v(e,t){var n=e.getFullInsertCoordinates(),r=t.getFullInsertCoordinates();return n.length>r.length?-1:n.length<r.length?1:0}u.ɵfac=function(e){return new(e||u)},u.ɵprov=t.ɵɵdefineInjectable({token:u,factory:u.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(u,[{type:t.Injectable}],(function(){return[]}),null);var f=function(){function e(e,t){var o=this;this.dragStateService=e,this.dropZoneArchive=new Set,this.dropZoneInventory=[],this.dropZoneFamilies=[],this.visibleFamily=null,this.activeDropZone=null,this.tempFamilies=[],this.setActiveDropZone(null);var i=!1,a=t.stable$.pipe(r.tap((function(e){i=e})),r.filter((function(e){return!0===e})));this.update$=new n.Subject,this.update$.pipe(r.debounce((function(){return!0===i?n.EMPTY:a}))).subscribe((function(){setTimeout((function(){o.updateDropZones()}))}))}return e.prototype.addDropZone=function(e){this.dropZoneArchive.add(e)},e.prototype.clearVisibleZones=function(){var e,t;if(null!==this.visibleFamily){try{for(var n=i(this.visibleFamily.members),r=n.next();!r.done;r=n.next()){r.value.isVisible(!1)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.visibleFamily=null}this.setActiveDropZone(null)},e.prototype.getActiveDropZone=function(){return this.activeDropZone},e.prototype.getDropZone=function(e){var t=s(e);t.pop();var n=e[e.length-1],r=new c(t,n);return this.dropZoneInventory.find((function(e){return h.dropZoneLocationsAreEqual(e,r)}))},e.prototype.init=function(e,t){this.tree=e,this.treeOptions=t,this.update()},e.prototype.removeDropZone=function(e){this.dropZoneArchive.delete(e)},e.prototype.reset=function(){this.clearVisibleZones(),this.dropZoneFamilies.length=0,this.dropZoneInventory.length=0},e.prototype.restart=function(){this.reset(),this.dropZoneArchive.clear()},e.prototype.restoreFamilies=function(){var e,t,n,r;if(2===this.tempFamilies.length){this.dropZoneFamilies.pop(),this.dropZoneFamilies.push(this.tempFamilies[0]);try{for(var o=i(this.tempFamilies[0].members),a=o.next();!a.done;a=o.next()){a.value.setFamily(this.tempFamilies[0])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}if(null!==this.tempFamilies[1]){this.dropZoneFamilies.push(this.tempFamilies[1]);try{for(var s=i(this.tempFamilies[1].members),l=s.next();!l.done;l=s.next()){l.value.setFamily(this.tempFamilies[1])}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}this.tempFamilies=[]}},e.prototype.showDropZoneFamily=function(e,t){var n,r,o,a,l,d;if(void 0===t&&(t={joinFamilies:!1,activateLowestInsteadOfFounder:!1}),null===this.activeDropZone||!h.dropZoneLocationsAreEqual(this.activeDropZone,e)){null===this.visibleFamily&&null===this.activeDropZone||this.clearVisibleZones();var p=this.dropZoneInventory.find((function(t){return h.dropZoneLocationsAreEqual(t,e)}));if(void 0===p)throw new Error("Could not find drop zone to show. location: "+JSON.stringify(e.getLocation()));var u=p.getFamily();if(!0===t.joinFamilies){var f=e.getLocation(),g=new c(s(f.parentCoordinates),f.insertIndex+1),y=this.dropZoneInventory.find((function(e){return h.dropZoneLocationsAreEqual(e,g)}));if(void 0===y)throw new Error("Could not find drop zone to show");var m=y.getFamily();if(void 0===u||void 0===m)throw new Error("No family");var b={founder:u.founder,members:s(u.members)};this.showDropZone(u.founder,!0);try{for(var w=i(u.members.sort(v)),Z=w.next();!Z.done;Z=w.next()){(M=Z.value).setFamily(b),M!==u.founder&&(null===this.activeDropZone?this.showDropZone(M,!0):this.showDropZone(M))}}catch(e){n={error:e}}finally{try{Z&&!Z.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}try{for(var C=i(m.members),D=C.next();!D.done;D=C.next()){(M=D.value).setFamily(b),M.getLocation().parentCoordinates.length<y.getLocation().parentCoordinates.length&&(b.members.push(M),this.showDropZone(M))}}catch(e){o={error:e}}finally{try{D&&!D.done&&(a=C.return)&&a.call(C)}finally{if(o)throw o.error}}this.tempFamilies=[u,m];var S=this.dropZoneFamilies.indexOf(u);this.dropZoneFamilies.splice(S,1);var I=this.dropZoneFamilies.indexOf(m);this.dropZoneFamilies.splice(I,1),this.dropZoneFamilies.push(b),this.visibleFamily=b}else{if(void 0===u)throw new Error("No family");if(this.visibleFamily=u,this.showDropZone(u.founder,!0),u.members.length>1)try{for(var x=i(u.members.sort(v)),E=x.next();!E.done;E=x.next()){var M;(M=E.value)!==u.founder&&(null===this.activeDropZone?this.showDropZone(M,!0):this.showDropZone(M))}}catch(e){l={error:e}}finally{try{E&&!E.done&&(d=x.return)&&d.call(x)}finally{if(l)throw l.error}}}if(!0===t.activateLowestInsteadOfFounder&&this.visibleFamily.members.length>1){var F=s(this.visibleFamily.members).sort(v).pop();if(void 0===F)throw new Error("Could not get lowest member");this.swapActiveDropZone(F)}}},e.prototype.swapActiveDropZone=function(e){if(null===this.visibleFamily)throw new Error("No visible family available for swapping");if(-1===this.visibleFamily.members.findIndex((function(t){return t===e})))throw new Error("failed to swap active drop zone");this.setActiveDropZone(e)},e.prototype.update=function(){this.update$.next(null)},e.prototype.assignFamilies=function(){var e,t,n,r,o,a,d=s(this.dropZoneInventory),c=d.filter((function(e){var t=e.getLocation();return 0===t.insertIndex&&t.parentCoordinates.length>0})).sort((function(e,t){for(var n,r,o,i,a=e.getFullInsertCoordinates(),s=t.getFullInsertCoordinates(),l=Math.max(a.length,s.length),d=0;d<l;d++){if((null!==(n=a[d])&&void 0!==n?n:-1)>(null!==(r=s[d])&&void 0!==r?r:-1))return-1;if((null!==(o=a[d])&&void 0!==o?o:-1)<(null!==(i=s[d])&&void 0!==i?i:-1))return 1}return 0})),h=function(e){if(!d.includes(e))return"continue";var t={founder:e,members:[]};e.setFamily(t);for(var n=s(e.getFullInsertCoordinates());n.length>0;){var r=d.findIndex((function(e){return l(e.getFullInsertCoordinates(),n)}));if(-1!==r){var o=d.splice(r,1)[0];t.members.push(o),o.setFamily(t)}n.pop(),n[n.length-1]++}p.dropZoneFamilies.push(t)},p=this;try{for(var u=i(c),v=u.next();!v.done;v=u.next()){h(y=v.value)}}catch(t){e={error:t}}finally{try{v&&!v.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}try{for(var f=i(d.filter((function(e){return 1===e.getFullInsertCoordinates().length}))),g=f.next();!g.done;g=f.next()){var y,m={founder:y=g.value,members:[y]};y.setFamily(m),this.dropZoneFamilies.push(m),d.splice(d.indexOf(y),1)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}if(0!==d.length){var b="";try{for(var w=i(d),Z=w.next();!Z.done;Z=w.next()){var C=Z.value;b+=JSON.stringify(C.getLocation())+", "}}catch(e){o={error:e}}finally{try{Z&&!Z.done&&(a=w.return)&&a.call(w)}finally{if(o)throw o.error}}throw b=b.slice(0,b.length-2),new Error("Some zones were not assigned to a family. The orphan zones have the following locations: "+b)}},e.prototype.buildInventory=function(){var e,t,n=[];try{for(var r=i(this.dropZoneArchive),o=r.next();!o.done;o=r.next()){var a=o.value,s=a.getFullInsertCoordinates().join(",");n.includes(s)?a.isRendered(!1):(this.dropZoneInventory.push(a),n.push(s),a.isRendered(!0))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.setActiveDropZone=function(e){null!==this.activeDropZone&&this.activeDropZone.isActive(!1),this.activeDropZone=e,null!==this.activeDropZone&&"droppable"!==this.dragStateService.getState()?this.dragStateService.droppable():null===this.activeDropZone&&"droppable"===this.dragStateService.getState()&&this.dragStateService.notDroppable(),null!==this.activeDropZone&&this.activeDropZone.isActive(!0)},e.prototype.showDropZone=function(e,t){if(void 0===t&&(t=!1),void 0===this.tree)throw new Error("DropZoneService not initialized");if(!this.zoneIsAllowed(e))return!1;if(void 0===this.tree.findByCoordinates(e.getLocation().parentCoordinates))throw new Error("Bad family member");return e.isVisible(!0),!0===t&&this.setActiveDropZone(e),!0},e.prototype.updateDropZones=function(){this.reset(),this.buildInventory(),this.assignFamilies()},e.prototype.zoneIsAllowed=function(e){if(void 0===this.treeOptions||void 0===this.tree)throw new Error("dropZoneService not initialized");var t=this.dragStateService.getData();if(void 0===t)throw new Error("Can't get dragged node");var n=this.tree.findByCoordinates(e.getLocation().parentCoordinates);if(void 0===n)throw new Error("Could not get drop zone parent");var r=e.getLocation().insertIndex;if(void 0===r)throw new Error("Could not get drop zone index");var o=t.branch;return!!this.treeOptions.allowDrop(o.data,n.data,r)},e}();f.ɵfac=function(e){return new(e||f)(t.ɵɵinject(p),t.ɵɵinject(u))},f.ɵprov=t.ɵɵdefineInjectable({token:f,factory:f.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(f,[{type:t.Injectable}],(function(){return[{type:p},{type:u}]}),null);var g=function(){function e(e){this.data=e,this.children=[],this.parent=null}return e.prototype.isRoot=function(){return null===this.parent},e.prototype.getParent=function(){return this.parent},e.prototype.setParent=function(e){this.parent=e},e.prototype.findByCoordinates=function(e){var t,n,r=this;try{for(var o=i(e.values()),a=o.next();!a.done;a=o.next()){var s=a.value;if(void 0===(r=r.getChild(s)))return}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},e.prototype.getCoordinates=function(){for(var e=[],t=this;null!==t.parent;){var n=t.getIndex();if(null==n)throw new Error("Could not get cursor index");e.unshift(n),t=t.parent}return e},e.prototype.getChild=function(e){return this.children[e]},e.prototype.getChildren=function(){return this.children},e.prototype.clearChildren=function(){var e,t;try{for(var n=i(this.children),r=n.next();!r.done;r=n.next()){r.value.setParent(null)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.children.length=0},e.prototype.getIndex=function(){var e=this;if(null===this.parent)return null;var t=this.parent.children.findIndex((function(t){return t===e}));return-1!==t?t:void 0},e.prototype.getDescendant=function(e){var t,n,r=this;try{for(var o=i(e),a=o.next();!a.done;a=o.next()){var s=a.value;if(void 0===(r=r.children[s]))return}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},e.prototype.findDescendant=function(e){var t,n;if(!0===e(this.data))return this;if(this.children.length>0)try{for(var r=i(this.children),o=r.next();!o.done;o=r.next()){var a=o.value.findDescendant(e);if(void 0!==a)return a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.getAncestors=function(){for(var e=[],t=this;null!==t.parent;)e.push(t.parent),t=t.parent;return e},e.prototype.appendChild=function(e){return null!==e.getParent()&&e.remove(),e.setParent(this),this.children.push(e),e},e.prototype.insertChild=function(e,t){var n=this.children.indexOf(e);return-1===n?(null!==e.getParent()&&e.remove(),e.setParent(this),this.children.splice(t,0,e)):t>n?(this.children.splice(t,0,e),this.removeChild(n),e.setParent(this)):(e.remove(),this.children.splice(t,0,e),e.setParent(this)),e},e.prototype.removeChild=function(e){var t=this.children.splice(e,1)[0];return t.setParent(null),t},e.prototype.remove=function(){var e=this.getIndex();if(null===this.parent||null==e)throw new Error("can't remove root");return this.parent.removeChild(e)},e.prototype.copy=function(){var e=this.copyHelper();return e.setParent(null),e},e.prototype.copyHelper=function(){var t,n,r=new e(this.data);try{for(var o=i(this.children),a=o.next();!a.done;a=o.next()){var s=a.value;r.appendChild(s.copyHelper()).parent=r}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},e}(),y=["children"];function m(e,n){if(1&e&&t.ɵɵelement(0,"drop-zone",3),2&e){var r=t.ɵɵnextContext();t.ɵɵproperty("dropZone",r.dropZoneInside)}}function b(e,t){}var w=function(){function e(e,t,n,r,o){var i;this.treeService=e,this.changeDetectorRef=t,this.dropZoneService=n,this.treeConstructionStatus=r,this.ngZone=o,this.treeConstructionStatus.constructing(),this.indent=null===(i=this.treeService.treeOptions)||void 0===i?void 0:i.indent,this.renderDropZoneInside=!1}return e.prototype.ngOnInit=function(){var e=this;this.addDropZoneInside(),this.ngZone.runOutsideAngular((function(){if(void 0===e.dropZoneInside)throw new Error("drop zone inside is not defined");e.dropZoneInside.getCommChannel().pipe(r.filter((function(e){return"checkRendered"===e}))).subscribe((function(){if(void 0===e.dropZoneInside||void 0===e.branch)throw new Error("Zones not registered");d(e.treeService.treeOptions,e.branch.data)&&(e.renderDropZoneInside=e.dropZoneInside.isRendered())}))}))},e.prototype.ngAfterViewInit=function(){this.reRender(),this.setDropZoneHost(),this.treeConstructionStatus.doneConstructing(),this.changeDetectorRef.detectChanges()},e.prototype.ngOnDestroy=function(){void 0!==this.dropZoneInside&&this.dropZoneService.removeDropZone(this.dropZoneInside),this.treeService.cleanupSignal$.next(!0)},e.prototype.addDropZoneInside=function(){if(void 0===this.branch)throw new Error("failed to register drop zone inside");this.dropZoneInside=new h(s(this.branch.getCoordinates()),0),this.dropZoneService.addDropZone(this.dropZoneInside)},e.prototype.reRender=function(){if(void 0===this.children||void 0===this.branch)throw new Error("Failed to render limble tree branch");this.treeService.renderBranch(this.children,this.branch)},e.prototype.setDropZoneHost=function(){if(void 0===this.children||void 0===this.dropZoneInside)throw new Error("Failed to add drop zone host");this.dropZoneInside.setHost(this.children)},e}();w.ɵfac=function(e){return new(e||w)(t.ɵɵdirectiveInject(R),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(u),t.ɵɵdirectiveInject(t.NgZone))},w.ɵcmp=t.ɵɵdefineComponent({type:w,selectors:[["limble-tree-branch"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(y,1,t.ViewContainerRef),2&e){var r;t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.children=r.first)}},inputs:{branch:"branch"},decls:5,vars:4,consts:[[3,"dropZone",4,"ngIf"],[1,"limble-child-nodes",3,"hidden"],["children",""],[3,"dropZone"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div"),t.ɵɵtemplate(1,m,1,1,"drop-zone",0),t.ɵɵelementStart(2,"span",1),t.ɵɵtemplate(3,b,0,0,"ng-template",null,2,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵstyleProp("margin-left",n.indent,"px"),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",n.renderDropZoneInside),t.ɵɵadvance(1),t.ɵɵproperty("hidden",n.branch&&n.branch.data.collapsed))},styles:["./limble-tree-branch.component.scss"]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(w,[{type:t.Component,args:[{selector:"limble-tree-branch",templateUrl:"./limble-tree-branch.component.html",styles:["./limble-tree-branch.component.scss"]}]}],(function(){return[{type:R},{type:t.ChangeDetectorRef},{type:f},{type:u},{type:t.NgZone}]}),{branch:[{type:t.Input}],children:[{type:t.ViewChild,args:["children",{read:t.ViewContainerRef}]}]});var Z=function(){function e(e){this.factoryResolver=e,this.factoryResolver=e}return e.prototype.appendComponent=function(e,t,n){void 0===n&&(n=void 0);var r=this.factoryResolver.resolveComponentFactory(e);return t.createComponent(r,n)},e}();function C(e){var t,n,r,o=/(auto|scroll)/,a=function(e,t){return null===e||null===e.parentNode?t:a(e.parentElement,t.concat([e]))},s=function(e,t){return getComputedStyle(e,null).getPropertyValue(t)},l=function(e){return o.test(function(e){return s(e,"overflow")+s(e,"overflow-y")+s(e,"overflow-x")}(e))},d=a(e.parentElement,[]);try{for(var c=i(d),h=c.next();!h.done;h=c.next()){var p=h.value;if(l(p))return p}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return null!==(r=document.scrollingElement)&&void 0!==r?r:document.documentElement}Z.ɵfac=function(e){return new(e||Z)(t.ɵɵinject(t.ComponentFactoryResolver))},Z.ɵprov=t.ɵɵdefineInjectable({token:Z,factory:Z.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(Z,[{type:t.Injectable}],(function(){return[{type:t.ComponentFactoryResolver}]}),null);var D=function(){function e(e){var t=this;this.ngZone=e,this.ngZone.runOutsideAngular((function(){t.globalDrag$=n.fromEvent(document,"drag")})),this.scrolling=!1}return e.prototype.addScrolling=function(){var e=this;this.ngZone.runOutsideAngular((function(){if(void 0===e.globalDragSubscription){if(void 0===e.globalDrag$)throw new Error("Could not get observable");var t,n,o,i,a,s,l,d,c;e.globalDragSubscription=e.globalDrag$.pipe(r.throttleTime(25),r.filter((function(e){if(!e.target)return!1;d=C(e.target),t=d.clientHeight;var r,l=d.clientWidth;if("fixed"===window.getComputedStyle(d).getPropertyValue("position").toLowerCase())r=e.clientX,c=e.clientY;else{var h=d.getBoundingClientRect(),p=C(d);r=e.clientX-(h.left+p.scrollLeft),c=e.clientY-(h.top+p.scrollTop)}return!(r<0||r>l||c<0||c>t)&&(n=Math.max(.1*t,100),s=c>(i=t-n),(a=c<(o=n))||s)}))).subscribe((function(){if(null!==d){var r,h=d.scrollHeight-t,p=d.scrollTop;if(a&&p>0){r=p-75*((o-c)/n)}else{if(!s||!(p<h))return;r=p+75*((c-i)/n)}(r=Math.max(0,Math.min(h,r)))!==p&&(d.scrollTo({top:r}),e.scrolling=!0,clearTimeout(l),l=setTimeout((function(){e.scrolling=!1}),100))}}))}}))},e.prototype.removeScrolling=function(){void 0!==this.globalDragSubscription&&this.globalDragSubscription.unsubscribe()},e}();D.ɵfac=function(e){return new(e||D)(t.ɵɵinject(t.NgZone))},D.ɵprov=t.ɵɵdefineInjectable({token:D,factory:D.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(D,[{type:t.Injectable}],(function(){return[{type:t.NgZone}]}),null);var S=["nodeHost"],I=["draggableDiv"],x=["nodeHostContainer"],E=["innerBranch"];function M(e,n){if(1&e&&t.ɵɵelement(0,"drop-zone",7),2&e){var r=t.ɵɵnextContext();t.ɵɵproperty("dropZone",r.dropZoneAbove)}}function F(e,t){}function A(e,n){if(1&e&&t.ɵɵelement(0,"limble-tree-branch",8,9),2&e){var r=t.ɵɵnextContext();t.ɵɵproperty("branch",r.branch)}}function O(e,n){if(1&e&&t.ɵɵelement(0,"drop-zone",7),2&e){var r=t.ɵɵnextContext();t.ɵɵproperty("dropZone",r.dropZoneBelow)}}var j=function(){function e(e,t,n,o,i,a,s,l){var d=this;this.componentCreatorService=e,this.changeDetectorRef=t,this.dragStateService=n,this.dropZoneService=o,this.treeService=i,this.globalEventsService=a,this.ngZone=s,this.treeConstructionStatus=l,this.treeConstructionStatus.constructing(),void 0!==this.treeService.treeOptions&&!0!==this.treeService.treeOptions.listMode?this.renderInnerBranch=!0:this.renderInnerBranch=!1,this.renderDropZoneBelow=!1,this.renderDropZoneAbove=!1,this.treeChangeSubscription=this.treeService.changes$.pipe(r.skip(1)).subscribe((function(){d.treeChangeHandler()}))}return e.prototype.treeChangeHandler=function(){void 0===this.branch||void 0===this.currentBranchCoordinates||l(this.branch.getCoordinates(),this.currentBranchCoordinates)||this.updateDropZones()},e.prototype.ngOnInit=function(){var e,t,o,i=this;if(!1!==(null===(e=this.treeService.treeOptions)||void 0===e?void 0:e.allowDragging)){var a=null===(t=this.branch)||void 0===t?void 0:t.getParent();if(null!==(null==a?void 0:a.data)){var s=null==a?void 0:a.data;if(!d(this.treeService.treeOptions,s))return void(this.renderInnerBranch=!1)}this.registerDropZones(),this.currentBranchCoordinates=null===(o=this.branch)||void 0===o?void 0:o.getCoordinates(),this.ngZone.runOutsideAngular((function(){if(void 0===i.dropZoneAbove||void 0===i.dropZoneBelow)throw new Error("Zones not registered");n.merge(i.dropZoneAbove.getCommChannel(),i.dropZoneBelow.getCommChannel()).pipe(r.filter((function(e){return"checkRendered"===e}))).subscribe((function(){if(void 0===i.dropZoneAbove||void 0===i.dropZoneBelow||void 0===i.branch)throw new Error("Zones not registered");i.renderDropZoneAbove=i.dropZoneAbove.isRendered(),i.renderDropZoneBelow=i.dropZoneBelow.isRendered()}))}))}},e.prototype.ngAfterViewInit=function(){this.renderNode(),this.setDropZoneHosts(),this.checkForHandle(),this.treeConstructionStatus.doneConstructing(),this.changeDetectorRef.detectChanges()},e.prototype.ngOnDestroy=function(){this.treeChangeSubscription.unsubscribe(),void 0!==this.dropZoneAbove&&this.dropZoneService.removeDropZone(this.dropZoneAbove),void 0!==this.dropZoneBelow&&this.dropZoneService.removeDropZone(this.dropZoneBelow),this.treeService.cleanupSignal$.next(!0)},e.prototype.dragstartHandler=function(e){var t,o=this;if(e.stopPropagation(),null===e.dataTransfer||void 0===this.branch||void 0===this.parentHost)throw new Error("failed to run dragstartHandler");var i=e.target;if("LIMBLE-TREE-NODE"===(null===(t=i.parentElement)||void 0===t?void 0:t.tagName)){e.dataTransfer.effectAllowed="move",this.dragStateService.dragging(this.branch,this.parentHost);var a=i.closest("limble-tree-root");if(null===a)throw new Error("could not get root of tree");this.ngZone.runOutsideAngular((function(){setTimeout((function(){var e,t;i.classList.add("dragging"),1===(null===(e=o.treeService.treeData)||void 0===e?void 0:e.length)&&1===(null===(t=o.branch)||void 0===t?void 0:t.getCoordinates().length)&&o.treeService.placeholder$.next(!0)}));var e=n.fromEvent(a,"dragover").pipe(r.first()).subscribe((function(e){if(e.stopPropagation(),void 0===o.branch)throw new Error("Could not show surrounding drop zones");var t,n=o.branch.getParent(),r=!0;null!==(null==n?void 0:n.data)&&(t=null==n?void 0:n.data,r=d(o.treeService.treeOptions,t)),void 0!==o.dropZoneAbove&&r&&o.dropZoneService.showDropZoneFamily(o.dropZoneAbove,{joinFamilies:!0})}));setTimeout((function(){e.closed||e.unsubscribe()}),500)}))}else e.preventDefault()},e.prototype.dragendHandler=function(e){var t,n;if(null==e||e.stopPropagation(),void 0===this.draggableDiv)throw new Error("could not get draggable div");if(this.draggableDiv.nativeElement.classList.remove("dragging"),"captured"===this.dragStateService.getState()){if(!1===this.treeService.captured){if(void 0===this.branch)throw new Error("could not get branch in dragendHandler");this.treeService.cleanupSignal$.next(!0),this.treeService.captured=!1}this.dragStateService.release()}else this.dragStateService.release(),this.dropZoneService.clearVisibleZones(),this.dropZoneService.restoreFamilies(),1===(null===(t=this.treeService.treeData)||void 0===t?void 0:t.length)&&1===(null===(n=this.branch)||void 0===n?void 0:n.getCoordinates().length)&&this.treeService.placeholder$.next(!1)},e.prototype.dragoverHandler=function(e){var t,n;if(!0!==this.globalEventsService.scrolling){if(void 0===this.branch)throw new Error("Can't get current branch during dragover event");var r=this.dragStateService.getData();if(void 0!==r){var o=r.branch;if(o!==this.branch&&!this.branch.getAncestors().includes(o)){var i,a,s=e.currentTarget;a=void 0===(null===(t=this.innerBranch)||void 0===t?void 0:t.dropZoneInside)?i=s.offsetHeight/2-6:2*(i=s.offsetHeight/3-3);var l,c=this.branch.getParent(),p=!0;null!==(null==c?void 0:c.data)&&(l=null==c?void 0:c.data,p=d(this.treeService.treeOptions,l));var u=this.dropZoneService.getActiveDropZone();if(e.offsetY<i&&void 0!==this.dropZoneAbove&&(null===u||!h.dropZoneLocationsAreEqual(u,this.dropZoneAbove))&&p){if(null==this.branch.getIndex())throw new Error("can't get branch index");this.dropZoneService.showDropZoneFamily(this.dropZoneAbove,{activateLowestInsteadOfFounder:!0})}else if(e.offsetY<a&&void 0!==(null===(n=this.innerBranch)||void 0===n?void 0:n.dropZoneInside)&&(null===u||!h.dropZoneLocationsAreEqual(u,this.innerBranch.dropZoneInside)))this.dropZoneService.showDropZoneFamily(this.innerBranch.dropZoneInside);else if(e.offsetY>=a&&void 0!==this.dropZoneBelow&&(null===u||!h.dropZoneLocationsAreEqual(u,this.dropZoneBelow))&&0===this.branch.getChildren().length&&p){if(null==this.branch.getIndex())throw new Error("can't get branch index");this.dropZoneService.showDropZoneFamily(this.dropZoneBelow)}}}}},e.prototype.renderNode=function(){var e;if(void 0===this.nodeHost||void 0===this.branch)throw new Error("Failed to render tree node");var t=this.branch.data.component;if(void 0===t&&(t=null===(e=this.treeService.treeOptions)||void 0===e?void 0:e.defaultComponent),void 0===t)throw new Error("limbleTree requires a component to render");var n=this.componentCreatorService.appendComponent(t.class,this.nodeHost);for(var r in n.instance.nodeData=this.branch.data,t.bindings)n.instance[r]=t.bindings[r]},e.prototype.registerDropZones=function(){this.addDropZoneAbove(),this.addDropZoneBelow()},e.prototype.addDropZoneAbove=function(){var e;if(void 0===this.branch)throw new Error("failed to register drop zone above");var t=this.branch.getParent(),n=this.branch.getCoordinates(),r=n[n.length-1];this.dropZoneAbove=new h(s(null!==(e=null==t?void 0:t.getCoordinates())&&void 0!==e?e:[]),r),this.dropZoneService.addDropZone(this.dropZoneAbove)},e.prototype.addDropZoneBelow=function(){var e;if(void 0===this.branch)throw new Error("failed to register drop zone below");var t=this.branch.getParent(),n=this.branch.getCoordinates(),r=n[n.length-1];this.dropZoneBelow=new h(s(null!==(e=null==t?void 0:t.getCoordinates())&&void 0!==e?e:[]),r+1),this.dropZoneService.addDropZone(this.dropZoneBelow)},e.prototype.updateDropZones=function(){var e;this.currentBranchCoordinates=null===(e=this.branch)||void 0===e?void 0:e.getCoordinates(),this.updateDropZoneAbove(),this.updateDropZoneBelow(),this.updateDropZoneInside(),this.setDropZoneHosts()},e.prototype.updateDropZoneAbove=function(){var e;if(void 0===this.branch||void 0===this.dropZoneAbove)throw new Error("failed to update drop zone above");var t=this.branch.getParent(),n=this.branch.getCoordinates(),r=n[n.length-1],o=this.dropZoneAbove.getLocation();o.setParentCoordinates(s(null!==(e=null==t?void 0:t.getCoordinates())&&void 0!==e?e:[])),o.setInsertIndex(r)},e.prototype.updateDropZoneBelow=function(){var e;if(void 0===this.branch||void 0===this.dropZoneBelow)throw new Error("failed to update drop zone below");var t=this.branch.getParent(),n=this.branch.getCoordinates(),r=n[n.length-1],o=this.dropZoneBelow.getLocation();o.setParentCoordinates(s(null!==(e=null==t?void 0:t.getCoordinates())&&void 0!==e?e:[])),o.setInsertIndex(r+1)},e.prototype.updateDropZoneInside=function(){var e;if(void 0!==(null===(e=this.innerBranch)||void 0===e?void 0:e.dropZoneInside)){if(void 0===this.branch)throw new Error("failed to update drop zone inside");this.innerBranch.dropZoneInside.getLocation().setParentCoordinates(s(this.branch.getCoordinates()))}},e.prototype.setDropZoneHosts=function(){void 0!==this.dropZoneAbove&&void 0!==this.dropZoneBelow&&(this.dropZoneAbove.setHost(this.parentHost),this.dropZoneBelow.setHost(this.parentHost))},e.prototype.checkForHandle=function(){var e,t=this;if(void 0!==this.nodeHostContainer&&void 0!==this.draggableDiv){var n,o,i=this.nodeHostContainer.nativeElement.querySelector(".limble-tree-handle"),a=this.draggableDiv.nativeElement;n=this.treeService.treeOptions,o=null===(e=this.branch)||void 0===e?void 0:e.data,void 0===n||!0!==n.allowDragging&&("function"!=typeof n.allowDragging||void 0===o||!0!==n.allowDragging(o))?a.setAttribute("draggable","false"):null===i?a.setAttribute("draggable","true"):i.addEventListener("mousedown",(function(){a.setAttribute("draggable","true");var e=t.dragStateService.state$.pipe(r.filter((function(e){return"dragging"===e})),r.first());t.dragStateService.state$.pipe(r.skipUntil(e),r.filter((function(e){return"idle"===e})),r.first()).subscribe((function(){a.setAttribute("draggable","false")}))}))}},e}();j.ɵfac=function(e){return new(e||j)(t.ɵɵdirectiveInject(Z),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(p),t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(R),t.ɵɵdirectiveInject(D),t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(u))},j.ɵcmp=t.ɵɵdefineComponent({type:j,selectors:[["limble-tree-node"]],viewQuery:function(e,n){if(1&e&&(t.ɵɵviewQuery(S,1,t.ViewContainerRef),t.ɵɵviewQuery(I,1,t.ElementRef),t.ɵɵviewQuery(x,1,t.ElementRef),t.ɵɵviewQuery(E,1,w)),2&e){var r=void 0;t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.nodeHost=r.first),t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.draggableDiv=r.first),t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.nodeHostContainer=r.first),t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.innerBranch=r.first)}},inputs:{branch:"branch",parentHost:"parentHost"},decls:9,vars:4,consts:[[3,"dropZone",4,"ngIf"],[1,"limble-parent-container",3,"dragstart","dragend"],["draggableDiv",""],[3,"dragoverEventThrottle","dragoverNoChangeDetect"],["nodeHostContainer",""],["nodeHost",""],[3,"branch",4,"ngIf"],[3,"dropZone"],[3,"branch"],["innerBranch",""]],template:function(e,n){1&e&&(t.ɵɵtemplate(0,M,1,1,"drop-zone",0),t.ɵɵelementStart(1,"div",1,2),t.ɵɵlistener("dragstart",(function(e){return n.dragstartHandler(e)}))("dragend",(function(e){return n.dragendHandler(e)})),t.ɵɵelementStart(3,"div",3,4),t.ɵɵlistener("dragoverNoChangeDetect",(function(e){return n.dragoverHandler(e)})),t.ɵɵtemplate(5,F,0,0,"ng-template",null,5,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd(),t.ɵɵtemplate(7,A,2,1,"limble-tree-branch",6),t.ɵɵelementEnd(),t.ɵɵtemplate(8,O,1,1,"drop-zone",0)),2&e&&(t.ɵɵproperty("ngIf",!0===n.renderDropZoneAbove),t.ɵɵadvance(3),t.ɵɵproperty("dragoverEventThrottle",10),t.ɵɵadvance(4),t.ɵɵproperty("ngIf",void 0!==n.branch&&!0===n.renderInnerBranch),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",!0===n.renderDropZoneBelow))},styles:[".dragging[_ngcontent-%COMP%]{position:absolute;transition:transform .01s;transform:translateX(-9999px)}"]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(j,[{type:t.Component,args:[{selector:"limble-tree-node",templateUrl:"./limble-tree-node.component.html",styleUrls:["./limble-tree-node.component.scss"]}]}],(function(){return[{type:Z},{type:t.ChangeDetectorRef},{type:p},{type:f},{type:R},{type:D},{type:t.NgZone},{type:u}]}),{branch:[{type:t.Input}],nodeHost:[{type:t.ViewChild,args:["nodeHost",{read:t.ViewContainerRef}]}],draggableDiv:[{type:t.ViewChild,args:["draggableDiv",{read:t.ElementRef}]}],nodeHostContainer:[{type:t.ViewChild,args:["nodeHostContainer",{read:t.ElementRef}]}],parentHost:[{type:t.Input}],innerBranch:[{type:t.ViewChild,args:["innerBranch",{read:w}]}]});var R=function(){function e(e,t,o,i){var a=this;this.componentCreatorService=e,this.dropZoneService=t,this.dragStateService=o,this.treeConstructionStatus=i,this.changes$=new n.Subject,this.drops$=new n.Subject,this.treeModel=new g(null),this.placeholder=!1,this.captured=!1,this.cleanupSignal$=new n.Subject;var s=!1,l=!1,d=this.treeConstructionStatus.stable$.pipe(r.tap((function(e){l=e})),r.filter((function(e){return!0===e})));this.cleanupSignal$.pipe(r.tap((function(e){s=e})),r.debounce((function(){return!0===l?n.EMPTY:d})),r.debounceTime(5)).subscribe((function(){a.cleanup(s),s=!1})),this.placeholder$=new n.BehaviorSubject(!1),this.placeholder$.subscribe((function(e){a.placeholder=e}))}return e.prototype.drop=function(e,t){var n,r=e.getParent();if(null===r)throw new Error("can't drop root of tree");var o,i,a=e.getIndex();if(null==a)throw new Error("Cannot move the hidden root node");if(!0===this.placeholder?(o=[],i=0):i=(o=s(t)).pop(),void 0===i)throw new Error("target coordinates are empty");var d=this.treeModel.getDescendant(o);if(void 0===d)throw new Error("could not get to target");var c=this.dropZoneService.getDropZone(t),h=null==c?void 0:c.getLocation().insertIndex,p=null==c?void 0:c.getHost(),u=null===(n=this.dragStateService.getData())||void 0===n?void 0:n.parentContainer;if(!0===this.placeholder&&this.placeholder$.next(!1),d.insertChild(e,i),void 0===p||void 0===u||void 0===h)return console.warn("Could not perform a precise update. Re-rendering the entire tree instead"),this.render(),void this.changes$.next(null);var v=u.length,f=this.componentCreatorService.appendComponent(j,p,i);f.instance.branch=e,f.instance.parentHost=p,h<a&&u.length>v&&l(r.getCoordinates(),o)?u.remove(a+1):u.remove(a),this.rebuildTreeData(),this.drops$.next({target:e.data,oldParent:r.data,oldIndex:a,newParent:d.data,newIndex:i}),this.cleanupSignal$.next(!1)},e.prototype.init=function(e,t,n,r,o){if(this.host=e,this.originalData=t,this.treeOptions=this.processOptions(n,r,o),!0===this.treeOptions.listMode){var i=this.treeOptions.itemsPerPage*(this.treeOptions.page-1);isNaN(i)&&(i=0);var a=i+this.treeOptions.itemsPerPage;this.treeData=this.originalData.slice(i,a)}else this.treeData=s(this.originalData);this.render()},e.prototype.cleanup=function(e){var t;void 0===e&&(e=!1),e&&this.rebuildTreeData(),0===(null===(t=this.treeData)||void 0===t?void 0:t.length)?this.render():(this.changes$.next(null),this.dropZoneService.update())},e.prototype.render=function(){var e,t,n,r;if(void 0===this.host||void 0===this.treeData||void 0===this.treeOptions)throw new Error("TreeModel not initialized");if(this.treeConstructionStatus.ready(!1),this.host.clear(),this.dropZoneService.restart(),this.placeholder$.next(!1),this.treeModel=new g(null),0===this.treeData.length)this.placeholder$.next(!0);else{try{for(var o=i(this.treeData),a=o.next();!a.done;a=o.next()){var s=a.value,l=new g(s);this.treeModel.appendChild(l)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}try{for(var d=i(this.treeModel.getChildren()),c=d.next();!c.done;c=d.next()){l=c.value;var h=this.componentCreatorService.appendComponent(j,this.host);h.instance.branch=l,h.instance.parentHost=this.host}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}this.treeConstructionStatus.ready(!0),this.changes$.next(null),this.dropZoneService.init(this.treeModel,this.treeOptions)},e.prototype.renderBranch=function(e,t){var n,r,o,a;if(void 0===this.treeModel)throw new Error("TreeModel not initialized");e.clear(),t.clearChildren();try{for(var s=i(null!==(a=null===(o=t.data)||void 0===o?void 0:o.nodes)&&void 0!==a?a:[]),l=s.next();!l.done;l=s.next()){var d=l.value,c=new g(d);t.appendChild(c);var h=this.componentCreatorService.appendComponent(j,e);h.instance.branch=c,h.instance.parentHost=e}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},e.prototype.processOptions=function(e,t,n){var r,o,i,a,s;return void 0===e&&(e={}),void 0===t&&(t=1/0),void 0===n&&(n=1),!0===e.listMode&&void 0!==e.allowNesting&&!1!==e.allowNesting&&console.warn("The value of `allowNesting` will be ignored; it must be false when `listMode` is true"),{defaultComponent:e.defaultComponent,indent:null!==(r=e.indent)&&void 0!==r?r:45,allowNesting:!0!==e.listMode&&(null===(o=e.allowNesting)||void 0===o||o),allowDragging:null===(i=e.allowDragging)||void 0===i||i,allowDrop:null!==(a=e.allowDrop)&&void 0!==a?a:function(){return!0},listMode:null!==(s=e.listMode)&&void 0!==s&&s,itemsPerPage:e.listMode?t:void 0,page:e.listMode?n:void 0}},e.prototype.rebuildTreeData=function(){var e,t,n,r;if(void 0===this.originalData||void 0===this.treeData||void 0===this.treeOptions||void 0===this.host)throw new Error("Tree data not initialized");this.treeData=[];try{for(var o=i(this.treeModel.getChildren()),a=o.next();!a.done;a=o.next()){var l=a.value;this.treeData.push(this.rebuildBranch(l))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}if(!0===this.treeOptions.listMode&&this.treeOptions.itemsPerPage<1/0){var d=this.treeOptions.itemsPerPage,c=d*(this.treeOptions.page-1);if((n=this.originalData).splice.apply(n,s([c,d],this.treeData)),this.treeData.length!==d){var h=!1;if(this.treeData.length<d&&c+d<=this.originalData.length){for(var p=d-this.treeData.length,u=d-1;u<d+p-1;u++){l=new g(this.originalData[c+u]);this.treeModel.appendChild(l);var v=this.componentCreatorService.appendComponent(j,this.host);v.instance.branch=l,v.instance.parentHost=this.host}h=!0}else if(this.treeData.length>d){for(u=d+(p=this.treeData.length-d)-1;u>=d;u--)this.treeModel.removeChild(u),this.host.remove(u);h=!0}if(!0===h){var f=c+d;this.treeData=this.originalData.slice(c,f)}}}else this.originalData.length=0,(r=this.originalData).push.apply(r,s(this.treeData))},e.prototype.rebuildBranch=function(e){var t,n,r=e.data;r.nodes=[];try{for(var o=i(e.getChildren()),a=o.next();!a.done;a=o.next()){var s=a.value;r.nodes.push(this.rebuildBranch(s))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},e}();R.ɵfac=function(e){return new(e||R)(t.ɵɵinject(Z),t.ɵɵinject(f),t.ɵɵinject(p),t.ɵɵinject(u))},R.ɵprov=t.ɵɵdefineInjectable({token:R,factory:R.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(R,[{type:t.Injectable}],(function(){return[{type:Z},{type:f},{type:p},{type:u}]}),null);var H=function(){function e(e,n){this.ngZone=e,this.el=n,this.dragoverNoChangeDetect=new t.EventEmitter,this.dragoverEventThrottle=0}return e.prototype.ngOnInit=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.eventSubscription=n.fromEvent(e.el.nativeElement,"dragover").pipe(r.throttleTime(e.dragoverEventThrottle)).subscribe((function(t){e.dragoverNoChangeDetect.emit(t)}))}))},e.prototype.ngOnDestroy=function(){void 0!==this.eventSubscription&&this.eventSubscription.unsubscribe()},e}();H.ɵfac=function(e){return new(e||H)(t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(t.ElementRef))},H.ɵdir=t.ɵɵdefineDirective({type:H,selectors:[["","dragoverNoChangeDetect",""]],inputs:{dragoverEventThrottle:"dragoverEventThrottle"},outputs:{dragoverNoChangeDetect:"dragoverNoChangeDetect"}}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(H,[{type:t.Directive,args:[{selector:"[dragoverNoChangeDetect]"}]}],(function(){return[{type:t.NgZone},{type:t.ElementRef}]}),{dragoverEventThrottle:[{type:t.Input}],dragoverNoChangeDetect:[{type:t.Output}]});var P=function(){function e(e,n){this.ngZone=e,this.el=n,this.dragleaveNoChangeDetect=new t.EventEmitter}return e.prototype.ngOnInit=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.eventSubscription=n.fromEvent(e.el.nativeElement,"dragleave").subscribe((function(t){e.dragleaveNoChangeDetect.emit(t)}))}))},e.prototype.ngOnDestroy=function(){void 0!==this.eventSubscription&&this.eventSubscription.unsubscribe()},e}();P.ɵfac=function(e){return new(e||P)(t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(t.ElementRef))},P.ɵdir=t.ɵɵdefineDirective({type:P,selectors:[["","dragleaveNoChangeDetect",""]],outputs:{dragleaveNoChangeDetect:"dragleaveNoChangeDetect"}}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(P,[{type:t.Directive,args:[{selector:"[dragleaveNoChangeDetect]"}]}],(function(){return[{type:t.NgZone},{type:t.ElementRef}]}),{dragleaveNoChangeDetect:[{type:t.Output}]});var N=function(e,t){return{active:e,related:t}};function B(e,n){if(1&e){var r=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",1),t.ɵɵlistener("dragenter",(function(){return t.ɵɵrestoreView(r),t.ɵɵnextContext().dragenterHandler()})),t.ɵɵelement(1,"div",2),t.ɵɵelementEnd()}if(2&e){var o=t.ɵɵnextContext();t.ɵɵadvance(1),t.ɵɵproperty("ngClass",t.ɵɵpureFunction2(1,N,o.active,!o.active))}}var T=function(){function e(e,t){this.dropZoneService=e,this.changeDetectorRef=t,this.visible=!1,this.active=!1}return e.prototype.dragenterHandler=function(){void 0!==this.dropZone&&!0!==this.active&&this.dropZoneService.swapActiveDropZone(this.dropZone)},e.prototype.ngOnInit=function(){var e=this;if(void 0===this.dropZone)throw new Error("No drop zone object at component initialization");this.commSubscription=this.dropZone.getCommChannel().subscribe((function(t){var n,r,o,i;switch(t){case"checkVisible":e.visible=null!==(r=null===(n=e.dropZone)||void 0===n?void 0:n.isVisible())&&void 0!==r&&r;break;case"checkActive":e.active=null!==(i=null===(o=e.dropZone)||void 0===o?void 0:o.isActive())&&void 0!==i&&i;break;case"checkRendered":break;default:throw new Error("unhandled comm message")}e.changeDetectorRef.detectChanges()}))},e.prototype.ngOnDestroy=function(){void 0!==this.commSubscription&&this.commSubscription.unsubscribe()},e}();T.ɵfac=function(e){return new(e||T)(t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(t.ChangeDetectorRef))},T.ɵcmp=t.ɵɵdefineComponent({type:T,selectors:[["drop-zone"]],inputs:{dropZone:"dropZone"},decls:1,vars:1,consts:[["class","dropZoneContainer",3,"dragenter",4,"ngIf"],[1,"dropZoneContainer",3,"dragenter"],[3,"ngClass"]],template:function(e,n){1&e&&t.ɵɵtemplate(0,B,2,4,"div",0),2&e&&t.ɵɵproperty("ngIf",n.visible)},directives:[o.NgIf,o.NgClass],styles:[".active[_ngcontent-%COMP%]{height:105px;border-radius:5px;background:#f0f9ff;border:2px dashed #bed2db}.active[_ngcontent-%COMP%], .related[_ngcontent-%COMP%]{margin:10px 0;width:calc(100% - 20px);box-sizing:border-box}.related[_ngcontent-%COMP%]{height:30px;border-radius:5px;background:#fff6f0;border:1px dashed #dbccbe;opacity:.8}.dropZoneContainer[_ngcontent-%COMP%]{position:relative}"],changeDetection:0}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(T,[{type:t.Component,args:[{selector:"drop-zone",templateUrl:"./drop-zone.component.html",styleUrls:["./drop-zone.component.scss"],changeDetection:t.ChangeDetectionStrategy.OnPush}]}],(function(){return[{type:f},{type:t.ChangeDetectorRef}]}),{dropZone:[{type:t.Input}]});var $=function(){function e(e,t,n,r){var o=this;this.dropZoneService=e,this.changeDetectorRef=t,this.treeService=n,this.treeConstructionStatus=r,this.treeConstructionStatus.constructing(),this.placeholderSubscription=this.treeService.placeholder$.subscribe((function(e){void 0!==o.dropZone&&(o.dropZoneService.removeDropZone(o.dropZone),!0===e&&(o.dropZoneService.addDropZone(o.dropZone),o.dropZone.setHost(o.treeService.host)))}))}return e.prototype.ngOnInit=function(){this.dropZone=new h([],0),this.dropZoneService.addDropZone(this.dropZone)},e.prototype.ngAfterViewInit=function(){if(void 0===this.dropZone)throw new Error("placeholder drop zone is not defined");this.dropZone.setHost(this.treeService.host),this.treeConstructionStatus.doneConstructing(),this.changeDetectorRef.detectChanges()},e.prototype.dragoverHandler=function(){void 0!==this.dropZone&&this.dropZoneService.showDropZoneFamily(this.dropZone)},e.prototype.ngOnDestroy=function(){if(this.placeholderSubscription.unsubscribe(),void 0===this.dropZone)throw new Error("could not remove placeholder drop zone");this.dropZoneService.removeDropZone(this.dropZone)},e}();$.ɵfac=function(e){return new(e||$)(t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(R),t.ɵɵdirectiveInject(u))},$.ɵcmp=t.ɵɵdefineComponent({type:$,selectors:[["limble-tree-placeholder"]],decls:2,vars:1,consts:[[3,"dropZone"],[1,"placeholder",3,"dragoverNoChangeDetect"]],template:function(e,n){1&e&&(t.ɵɵelement(0,"drop-zone",0),t.ɵɵelementStart(1,"div",1),t.ɵɵlistener("dragoverNoChangeDetect",(function(){return n.dragoverHandler()})),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("dropZone",n.dropZone)},directives:[T,H],styles:[".placeholder[_ngcontent-%COMP%]{width:100%;height:20px}"],changeDetection:0}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata($,[{type:t.Component,args:[{selector:"limble-tree-placeholder",templateUrl:"./limble-tree-placeholder.component.html",styleUrls:["./limble-tree-placeholder.component.scss"],changeDetection:t.ChangeDetectionStrategy.OnPush}]}],(function(){return[{type:f},{type:t.ChangeDetectorRef},{type:R},{type:u}]}),null);var z=["host"];function L(e,n){1&e&&t.ɵɵelement(0,"limble-tree-placeholder")}function V(e,t){}var k=function(){function e(e,n,r,o,i){var a=this;this.treeService=e,this.dropZoneService=n,this.dragStateService=r,this.globalEventsService=o,this.changeDetectorRef=i,this.treeChange=new t.EventEmitter,this.treeDrop=new t.EventEmitter,this.changesSubscription=this.treeService.changes$.subscribe((function(){setTimeout((function(){a.treeChange.emit()}))})),this.dropSubscription=this.treeService.drops$.subscribe((function(e){setTimeout((function(){a.treeDrop.emit(e)}))})),this.placeholder=!1,this.treeService.placeholder$.subscribe((function(e){a.placeholder=e,t.NgZone.isInAngularZone()||a.changeDetectorRef.detectChanges()}))}return e.prototype.ngAfterViewInit=function(){var e;!0===(null===(e=this.options)||void 0===e?void 0:e.listMode)||void 0===this.itemsPerPage&&void 0===this.page||console.warn("pagination is only allowed in listMode; `itemsPerPage` and `page` inputs will be ignored"),this.update(),this.changeDetectorRef.detectChanges()},e.prototype.ngOnChanges=function(){void 0!==this.host&&void 0!==this.data&&this.update()},e.prototype.update=function(){if(void 0===this.host)throw new Error("Failed to render limble tree. Failure occurred at root.");if(void 0===this.data)throw new Error("limbleTree requires a data object");this.treeService.init(this.host,this.data,this.options,this.itemsPerPage,this.page),this.globalEventsService.addScrolling()},e.prototype.dragoverHandler=function(e){null!==e.dataTransfer&&(e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.dragleaveHandler=function(e){var t=e.currentTarget,n=e.relatedTarget;t instanceof Node&&n instanceof Node&&!1===function(e,t){if(e===t)return!0;for(var n=t.parentNode;n!==document;){if(null===n)return;if(n===e)return!0;n=n.parentNode}return!1}(t,n)&&(this.dropZoneService.clearVisibleZones(),this.changeDetectorRef.detectChanges())},e.prototype.dropHandler=function(e){var t=this;if(e.stopPropagation(),"droppable"===this.dragStateService.getState()){var n=this.dragStateService.capture();if(void 0===n)throw new Error("failed to get current branch in dragendHandler");var o=this.dropZoneService.getActiveDropZone();if(null===o)throw new Error("failed to get active drop zone at drop handler");this.treeService.captured=!0,this.dragStateService.state$.pipe(r.first((function(e){return"idle"===e}))).subscribe((function(){t.treeService.captured=!1})),this.dropZoneService.clearVisibleZones(),this.treeService.drop(n,o.getFullInsertCoordinates())}},e.prototype.ngOnDestroy=function(){this.changesSubscription.unsubscribe(),this.dropSubscription.unsubscribe()},e}();k.ɵfac=function(e){return new(e||k)(t.ɵɵdirectiveInject(R),t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(p),t.ɵɵdirectiveInject(D),t.ɵɵdirectiveInject(t.ChangeDetectorRef))},k.ɵcmp=t.ɵɵdefineComponent({type:k,selectors:[["limble-tree-root"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(z,1,t.ViewContainerRef),2&e){var r;t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.host=r.first)}},inputs:{data:"data",options:"options",itemsPerPage:"itemsPerPage",page:"page"},outputs:{treeChange:"treeChange",treeDrop:"treeDrop"},features:[t.ɵɵProvidersFeature([R,f,u]),t.ɵɵNgOnChangesFeature],decls:4,vars:1,consts:[[3,"dragoverNoChangeDetect","dragleaveNoChangeDetect","drop"],[4,"ngIf"],["host",""]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0),t.ɵɵlistener("dragoverNoChangeDetect",(function(e){return n.dragoverHandler(e)}))("dragleaveNoChangeDetect",(function(e){return n.dragleaveHandler(e)}))("drop",(function(e){return n.dropHandler(e)})),t.ɵɵtemplate(1,L,1,0,"limble-tree-placeholder",1),t.ɵɵtemplate(2,V,0,0,"ng-template",null,2,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(1),t.ɵɵproperty("ngIf",!0===n.placeholder))},directives:[H,P,o.NgIf,$],styles:[""]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(k,[{type:t.Component,args:[{selector:"limble-tree-root",templateUrl:"./limble-tree-root.component.html",styleUrls:["./limble-tree-root.component.scss"],providers:[R,f,u]}]}],(function(){return[{type:R},{type:f},{type:p},{type:D},{type:t.ChangeDetectorRef}]}),{data:[{type:t.Input}],options:[{type:t.Input}],itemsPerPage:[{type:t.Input}],page:[{type:t.Input}],host:[{type:t.ViewChild,args:["host",{read:t.ViewContainerRef}]}],treeChange:[{type:t.Output}],treeDrop:[{type:t.Output}]});var q=function(){};q.ɵfac=function(e){return new(e||q)},q.ɵmod=t.ɵɵdefineNgModule({type:q}),q.ɵinj=t.ɵɵdefineInjector({providers:[Z,p,D],imports:[[o.CommonModule]]}),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(q,{declarations:[w,T,j,k,$,H,P],imports:[o.CommonModule],exports:[k]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(q,[{type:t.NgModule,args:[{declarations:[w,T,j,k,$,H,P],imports:[o.CommonModule],exports:[k],providers:[Z,p,D]}]}],null,null),t.ɵɵsetComponentScope(w,[o.NgIf,T],[]),t.ɵɵsetComponentScope(j,[o.NgIf,T,H,w],[]),e.LimbleTreeModule=q,e.LimbleTreeRootComponent=k,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
***************************************************************************** */Object.create;function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e}Object.create;function l(e,t){var n,r;if(e.length!==t.length)return!1;try{for(var o=i(e.entries()),s=o.next();!s.done;s=o.next()){var d=a(s.value,2),c=d[0],h=d[1],p=t[c];if(h instanceof Array&&p instanceof Array){if(!l(h,p))return!1}else if(h!==p)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!0}function d(e,t){return void 0!==e&&(!0===e.allowNesting||"function"==typeof e.allowNesting&&void 0!==t&&!0===e.allowNesting(t))}var c=function(){function e(e,t){this.parentCoordinates=e,this.insertIndex=t}return e.prototype.getFullInsertCoordinates=function(){return s(this.parentCoordinates,[this.insertIndex])},e.prototype.setParentCoordinates=function(e){this.parentCoordinates=e},e.prototype.setInsertIndex=function(e){this.insertIndex=e},e}(),h=function(){function e(e,t){this.location=new c(e,t),this.rendered=!1,this.visible=!1,this.active=!1,this.commChannel=new n.Subject}return e.dropZoneLocationsAreEqual=function(e,t){return l(e.getFullInsertCoordinates(),t.getFullInsertCoordinates())},e.prototype.isRendered=function(e){return void 0===e&&(e=void 0),void 0!==e&&(this.rendered=e,void 0!==this.commChannel&&this.commChannel.next("checkRendered"),!1===this.rendered&&this.isVisible(!1)),this.rendered},e.prototype.isVisible=function(e){return void 0===e&&(e=void 0),void 0!==e&&(this.visible=e,void 0!==this.commChannel&&this.commChannel.next("checkVisible"),!1===this.visible&&this.isActive(!1)),this.visible},e.prototype.isActive=function(e){return void 0===e&&(e=void 0),void 0!==e&&(this.active=e,void 0!==this.commChannel&&this.commChannel.next("checkActive")),this.active},e.prototype.getLocation=function(){return this.location},e.prototype.getFamily=function(){return this.family},e.prototype.setFamily=function(e){this.family=e},e.prototype.getCommChannel=function(){return this.commChannel},e.prototype.getFullInsertCoordinates=function(){return this.location.getFullInsertCoordinates()},e.prototype.setHost=function(e){return this.host=e,this.host},e.prototype.getHost=function(){return this.host},e}(),p=function(){function e(){this.state="idle",this.state$=new n.BehaviorSubject(this.state)}return e.prototype.dragging=function(e,t){this._tempData={branch:e,parentContainer:t},this.state="dragging",this.state$.next(this.state)},e.prototype.droppable=function(){if("dragging"!==this.state)throw new Error("Can only call `droppable` when state is `dragging`");this.state="droppable",this.state$.next(this.state)},e.prototype.notDroppable=function(){if("droppable"!==this.state)throw new Error("Can only call `notDroppable` when state is `droppable`");this.state="dragging",this.state$.next(this.state)},e.prototype.capture=function(){var e;if("droppable"!==this.state)throw new Error("Can only move to `captured` state from `droppable` state");return this.state="captured",this.state$.next(this.state),null===(e=this._tempData)||void 0===e?void 0:e.branch},e.prototype.release=function(){this._tempData=void 0,this.state="idle",this.state$.next(this.state)},e.prototype.getData=function(){return this._tempData},e.prototype.getState=function(){return this.state},e}();p.ɵfac=function(e){return new(e||p)},p.ɵprov=t.ɵɵdefineInjectable({token:p,factory:p.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(p,[{type:t.Injectable}],(function(){return[]}),null);var u=function(){function e(){this.beingBuilt=0,this.isReady=!1,this.stable$=new n.BehaviorSubject(this.treeIsStable())}return e.prototype.constructing=function(){this.beingBuilt++,this.emit()},e.prototype.doneConstructing=function(){this.beingBuilt--,this.emit()},e.prototype.treeIsStable=function(){return!0===this.isReady&&0===this.beingBuilt},e.prototype.ready=function(e){this.isReady=e},e.prototype.emit=function(){this.stable$.next(this.treeIsStable())},e}();function v(e,t){var n=e.getFullInsertCoordinates(),r=t.getFullInsertCoordinates();return n.length>r.length?-1:n.length<r.length?1:0}u.ɵfac=function(e){return new(e||u)},u.ɵprov=t.ɵɵdefineInjectable({token:u,factory:u.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(u,[{type:t.Injectable}],(function(){return[]}),null);var f=function(){function e(e,t){var o=this;this.dragStateService=e,this.dropZoneArchive=new Set,this.dropZoneInventory=[],this.dropZoneFamilies=[],this.visibleFamily=null,this.activeDropZone=null,this.tempFamilies=[],this.setActiveDropZone(null);var i=!1,a=t.stable$.pipe(r.tap((function(e){i=e})),r.filter((function(e){return!0===e})));this.update$=new n.Subject,this.update$.pipe(r.debounce((function(){return!0===i?n.EMPTY:a}))).subscribe((function(){setTimeout((function(){o.updateDropZones()}))}))}return e.prototype.addDropZone=function(e){this.dropZoneArchive.add(e)},e.prototype.clearVisibleZones=function(){var e,t;if(null!==this.visibleFamily){try{for(var n=i(this.visibleFamily.members),r=n.next();!r.done;r=n.next()){r.value.isVisible(!1)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.visibleFamily=null}this.setActiveDropZone(null)},e.prototype.getActiveDropZone=function(){return this.activeDropZone},e.prototype.getDropZone=function(e){var t=s(e);t.pop();var n=e[e.length-1],r=new c(t,n);return this.dropZoneInventory.find((function(e){return h.dropZoneLocationsAreEqual(e,r)}))},e.prototype.init=function(e,t){this.tree=e,this.treeOptions=t,this.update()},e.prototype.removeDropZone=function(e){this.dropZoneArchive.delete(e)},e.prototype.reset=function(){this.clearVisibleZones(),this.dropZoneFamilies.length=0,this.dropZoneInventory.length=0},e.prototype.restart=function(){this.reset(),this.dropZoneArchive.clear()},e.prototype.restoreFamilies=function(){var e,t,n,r;if(2===this.tempFamilies.length){this.dropZoneFamilies.pop(),this.dropZoneFamilies.push(this.tempFamilies[0]);try{for(var o=i(this.tempFamilies[0].members),a=o.next();!a.done;a=o.next()){a.value.setFamily(this.tempFamilies[0])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}if(null!==this.tempFamilies[1]){this.dropZoneFamilies.push(this.tempFamilies[1]);try{for(var s=i(this.tempFamilies[1].members),l=s.next();!l.done;l=s.next()){l.value.setFamily(this.tempFamilies[1])}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}this.tempFamilies=[]}},e.prototype.showDropZoneFamily=function(e,t){var n,r,o,a,l,d;if(void 0===t&&(t={joinFamilies:!1,activateLowestInsteadOfFounder:!1}),null===this.activeDropZone||!h.dropZoneLocationsAreEqual(this.activeDropZone,e)){null===this.visibleFamily&&null===this.activeDropZone||this.clearVisibleZones();var p=this.dropZoneInventory.find((function(t){return h.dropZoneLocationsAreEqual(t,e)}));if(void 0===p)throw new Error("Could not find drop zone to show. location: "+JSON.stringify(e.getLocation()));var u=p.getFamily();if(!0===t.joinFamilies){var f=e.getLocation(),g=new c(s(f.parentCoordinates),f.insertIndex+1),y=this.dropZoneInventory.find((function(e){return h.dropZoneLocationsAreEqual(e,g)}));if(void 0===y)throw new Error("Could not find drop zone to show");var m=y.getFamily();if(void 0===u||void 0===m)throw new Error("No family");var b={founder:u.founder,members:s(u.members)};this.showDropZone(u.founder,!0);try{for(var w=i(u.members.sort(v)),Z=w.next();!Z.done;Z=w.next()){(M=Z.value).setFamily(b),M!==u.founder&&(null===this.activeDropZone?this.showDropZone(M,!0):this.showDropZone(M))}}catch(e){n={error:e}}finally{try{Z&&!Z.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}try{for(var C=i(m.members),D=C.next();!D.done;D=C.next()){(M=D.value).setFamily(b),M.getLocation().parentCoordinates.length<y.getLocation().parentCoordinates.length&&(b.members.push(M),this.showDropZone(M))}}catch(e){o={error:e}}finally{try{D&&!D.done&&(a=C.return)&&a.call(C)}finally{if(o)throw o.error}}this.tempFamilies=[u,m];var S=this.dropZoneFamilies.indexOf(u);this.dropZoneFamilies.splice(S,1);var I=this.dropZoneFamilies.indexOf(m);this.dropZoneFamilies.splice(I,1),this.dropZoneFamilies.push(b),this.visibleFamily=b}else{if(void 0===u)throw new Error("No family");if(this.visibleFamily=u,this.showDropZone(u.founder,!0),u.members.length>1)try{for(var x=i(u.members.sort(v)),E=x.next();!E.done;E=x.next()){var M;(M=E.value)!==u.founder&&(null===this.activeDropZone?this.showDropZone(M,!0):this.showDropZone(M))}}catch(e){l={error:e}}finally{try{E&&!E.done&&(d=x.return)&&d.call(x)}finally{if(l)throw l.error}}}if(!0===t.activateLowestInsteadOfFounder&&this.visibleFamily.members.length>1){var F=s(this.visibleFamily.members).sort(v).pop();if(void 0===F)throw new Error("Could not get lowest member");this.swapActiveDropZone(F)}}},e.prototype.swapActiveDropZone=function(e){if(null===this.visibleFamily)throw new Error("No visible family available for swapping");if(-1===this.visibleFamily.members.findIndex((function(t){return t===e})))throw new Error("failed to swap active drop zone");this.setActiveDropZone(e)},e.prototype.update=function(){this.update$.next(null)},e.prototype.assignFamilies=function(){var e,t,n,r,o,a,d=s(this.dropZoneInventory),c=d.filter((function(e){var t=e.getLocation();return 0===t.insertIndex&&t.parentCoordinates.length>0})).sort((function(e,t){for(var n,r,o,i,a=e.getFullInsertCoordinates(),s=t.getFullInsertCoordinates(),l=Math.max(a.length,s.length),d=0;d<l;d++){if((null!==(n=a[d])&&void 0!==n?n:-1)>(null!==(r=s[d])&&void 0!==r?r:-1))return-1;if((null!==(o=a[d])&&void 0!==o?o:-1)<(null!==(i=s[d])&&void 0!==i?i:-1))return 1}return 0})),h=function(e){if(!d.includes(e))return"continue";var t={founder:e,members:[]};e.setFamily(t);for(var n=s(e.getFullInsertCoordinates());n.length>0;){var r=d.findIndex((function(e){return l(e.getFullInsertCoordinates(),n)}));if(-1!==r){var o=d.splice(r,1)[0];t.members.push(o),o.setFamily(t)}n.pop(),n[n.length-1]++}p.dropZoneFamilies.push(t)},p=this;try{for(var u=i(c),v=u.next();!v.done;v=u.next()){h(y=v.value)}}catch(t){e={error:t}}finally{try{v&&!v.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}try{for(var f=i(d.filter((function(e){return 1===e.getFullInsertCoordinates().length}))),g=f.next();!g.done;g=f.next()){var y,m={founder:y=g.value,members:[y]};y.setFamily(m),this.dropZoneFamilies.push(m),d.splice(d.indexOf(y),1)}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}if(0!==d.length){var b="";try{for(var w=i(d),Z=w.next();!Z.done;Z=w.next()){var C=Z.value;b+=JSON.stringify(C.getLocation())+", "}}catch(e){o={error:e}}finally{try{Z&&!Z.done&&(a=w.return)&&a.call(w)}finally{if(o)throw o.error}}throw b=b.slice(0,b.length-2),new Error("Some zones were not assigned to a family. The orphan zones have the following locations: "+b)}},e.prototype.buildInventory=function(){var e,t,n=[];try{for(var r=i(this.dropZoneArchive),o=r.next();!o.done;o=r.next()){var a=o.value,s=a.getFullInsertCoordinates().join(",");n.includes(s)?a.isRendered(!1):(this.dropZoneInventory.push(a),n.push(s),a.isRendered(!0))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.setActiveDropZone=function(e){null!==this.activeDropZone&&this.activeDropZone.isActive(!1),this.activeDropZone=e,null!==this.activeDropZone&&"droppable"!==this.dragStateService.getState()?this.dragStateService.droppable():null===this.activeDropZone&&"droppable"===this.dragStateService.getState()&&this.dragStateService.notDroppable(),null!==this.activeDropZone&&this.activeDropZone.isActive(!0)},e.prototype.showDropZone=function(e,t){if(void 0===t&&(t=!1),void 0===this.tree)throw new Error("DropZoneService not initialized");if(!this.zoneIsAllowed(e))return!1;if(void 0===this.tree.findByCoordinates(e.getLocation().parentCoordinates))throw new Error("Bad family member");return e.isVisible(!0),!0===t&&this.setActiveDropZone(e),!0},e.prototype.updateDropZones=function(){this.reset(),this.buildInventory(),this.assignFamilies()},e.prototype.zoneIsAllowed=function(e){if(void 0===this.treeOptions||void 0===this.tree)throw new Error("dropZoneService not initialized");var t=this.dragStateService.getData();if(void 0===t)throw new Error("Can't get dragged node");var n=this.tree.findByCoordinates(e.getLocation().parentCoordinates);if(void 0===n)throw new Error("Could not get drop zone parent");var r=e.getLocation().insertIndex;if(void 0===r)throw new Error("Could not get drop zone index");var o=t.branch;return!!this.treeOptions.allowDrop(o.data,n.data,r)},e}();f.ɵfac=function(e){return new(e||f)(t.ɵɵinject(p),t.ɵɵinject(u))},f.ɵprov=t.ɵɵdefineInjectable({token:f,factory:f.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(f,[{type:t.Injectable}],(function(){return[{type:p},{type:u}]}),null);var g=function(){function e(e){this.data=e,this.children=[],this.parent=null}return e.prototype.isRoot=function(){return null===this.parent},e.prototype.getParent=function(){return this.parent},e.prototype.setParent=function(e){this.parent=e},e.prototype.findByCoordinates=function(e){var t,n,r=this;try{for(var o=i(e.values()),a=o.next();!a.done;a=o.next()){var s=a.value;if(void 0===(r=r.getChild(s)))return}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},e.prototype.getCoordinates=function(){for(var e=[],t=this;null!==t.parent;){var n=t.getIndex();if(null==n)throw new Error("Could not get cursor index");e.unshift(n),t=t.parent}return e},e.prototype.getChild=function(e){return this.children[e]},e.prototype.getChildren=function(){return this.children},e.prototype.clearChildren=function(){var e,t;try{for(var n=i(this.children),r=n.next();!r.done;r=n.next()){r.value.setParent(null)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}this.children.length=0},e.prototype.getIndex=function(){var e=this;if(null===this.parent)return null;var t=this.parent.children.findIndex((function(t){return t===e}));return-1!==t?t:void 0},e.prototype.getDescendant=function(e){var t,n,r=this;try{for(var o=i(e),a=o.next();!a.done;a=o.next()){var s=a.value;if(void 0===(r=r.children[s]))return}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},e.prototype.findDescendant=function(e){var t,n;if(!0===e(this.data))return this;if(this.children.length>0)try{for(var r=i(this.children),o=r.next();!o.done;o=r.next()){var a=o.value.findDescendant(e);if(void 0!==a)return a}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.getAncestors=function(){for(var e=[],t=this;null!==t.parent;)e.push(t.parent),t=t.parent;return e},e.prototype.appendChild=function(e){return null!==e.getParent()&&e.remove(),e.setParent(this),this.children.push(e),e},e.prototype.insertChild=function(e,t){var n=this.children.indexOf(e);return-1===n?(null!==e.getParent()&&e.remove(),e.setParent(this),this.children.splice(t,0,e)):t>n?(this.children.splice(t,0,e),this.removeChild(n),e.setParent(this)):(e.remove(),this.children.splice(t,0,e),e.setParent(this)),e},e.prototype.removeChild=function(e){var t=this.children.splice(e,1)[0];return t.setParent(null),t},e.prototype.remove=function(){var e=this.getIndex();if(null===this.parent||null==e)throw new Error("can't remove root");return this.parent.removeChild(e)},e.prototype.copy=function(){var e=this.copyHelper();return e.setParent(null),e},e.prototype.copyHelper=function(){var t,n,r=new e(this.data);try{for(var o=i(this.children),a=o.next();!a.done;a=o.next()){var s=a.value;r.appendChild(s.copyHelper()).parent=r}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},e}(),y=["children"];function m(e,n){if(1&e&&t.ɵɵelement(0,"drop-zone",3),2&e){var r=t.ɵɵnextContext();t.ɵɵproperty("dropZone",r.dropZoneInside)}}function b(e,t){}var w=function(){function e(e,t,n,r,o){var i;this.treeService=e,this.changeDetectorRef=t,this.dropZoneService=n,this.treeConstructionStatus=r,this.ngZone=o,this.treeConstructionStatus.constructing(),this.indent=null===(i=this.treeService.treeOptions)||void 0===i?void 0:i.indent,this.renderDropZoneInside=!1}return e.prototype.ngOnInit=function(){var e=this;this.addDropZoneInside(),this.ngZone.runOutsideAngular((function(){if(void 0===e.dropZoneInside)throw new Error("drop zone inside is not defined");e.dropZoneInside.getCommChannel().pipe(r.filter((function(e){return"checkRendered"===e}))).subscribe((function(){if(void 0===e.dropZoneInside||void 0===e.branch)throw new Error("Zones not registered");d(e.treeService.treeOptions,e.branch.data)&&(e.renderDropZoneInside=e.dropZoneInside.isRendered())}))}))},e.prototype.ngAfterViewInit=function(){this.reRender(),this.setDropZoneHost(),this.treeConstructionStatus.doneConstructing(),this.changeDetectorRef.detectChanges()},e.prototype.ngOnDestroy=function(){void 0!==this.dropZoneInside&&this.dropZoneService.removeDropZone(this.dropZoneInside),this.treeService.cleanupSignal$.next(!0)},e.prototype.addDropZoneInside=function(){if(void 0===this.branch)throw new Error("failed to register drop zone inside");this.dropZoneInside=new h(s(this.branch.getCoordinates()),0),this.dropZoneService.addDropZone(this.dropZoneInside)},e.prototype.reRender=function(){if(void 0===this.children||void 0===this.branch)throw new Error("Failed to render limble tree branch");this.treeService.renderBranch(this.children,this.branch)},e.prototype.setDropZoneHost=function(){if(void 0===this.children||void 0===this.dropZoneInside)throw new Error("Failed to add drop zone host");this.dropZoneInside.setHost(this.children)},e}();w.ɵfac=function(e){return new(e||w)(t.ɵɵdirectiveInject(R),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(u),t.ɵɵdirectiveInject(t.NgZone))},w.ɵcmp=t.ɵɵdefineComponent({type:w,selectors:[["limble-tree-branch"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(y,1,t.ViewContainerRef),2&e){var r;t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.children=r.first)}},inputs:{branch:"branch"},decls:5,vars:4,consts:[[3,"dropZone",4,"ngIf"],[1,"limble-child-nodes",3,"hidden"],["children",""],[3,"dropZone"]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div"),t.ɵɵtemplate(1,m,1,1,"drop-zone",0),t.ɵɵelementStart(2,"span",1),t.ɵɵtemplate(3,b,0,0,"ng-template",null,2,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd(),t.ɵɵelementEnd()),2&e&&(t.ɵɵstyleProp("margin-left",n.indent,"px"),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",n.renderDropZoneInside),t.ɵɵadvance(1),t.ɵɵproperty("hidden",n.branch&&n.branch.data.collapsed))},styles:["./limble-tree-branch.component.scss"]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(w,[{type:t.Component,args:[{selector:"limble-tree-branch",templateUrl:"./limble-tree-branch.component.html",styles:["./limble-tree-branch.component.scss"]}]}],(function(){return[{type:R},{type:t.ChangeDetectorRef},{type:f},{type:u},{type:t.NgZone}]}),{branch:[{type:t.Input}],children:[{type:t.ViewChild,args:["children",{read:t.ViewContainerRef}]}]});var Z=function(){function e(e){this.factoryResolver=e,this.factoryResolver=e}return e.prototype.appendComponent=function(e,t,n){void 0===n&&(n=void 0);var r=this.factoryResolver.resolveComponentFactory(e);return t.createComponent(r,n)},e}();function C(e){var t,n,r,o=/(auto|scroll)/,a=function(e,t){return null===e||null===e.parentNode?t:a(e.parentElement,t.concat([e]))},s=function(e,t){return getComputedStyle(e,null).getPropertyValue(t)},l=function(e){return o.test(function(e){return s(e,"overflow")+s(e,"overflow-y")+s(e,"overflow-x")}(e))},d=a(e.parentElement,[]);try{for(var c=i(d),h=c.next();!h.done;h=c.next()){var p=h.value;if(l(p))return p}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return null!==(r=document.scrollingElement)&&void 0!==r?r:document.documentElement}Z.ɵfac=function(e){return new(e||Z)(t.ɵɵinject(t.ComponentFactoryResolver))},Z.ɵprov=t.ɵɵdefineInjectable({token:Z,factory:Z.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(Z,[{type:t.Injectable}],(function(){return[{type:t.ComponentFactoryResolver}]}),null);var D=function(){function e(e){var t=this;this.ngZone=e,this.ngZone.runOutsideAngular((function(){t.globalDrag$=n.fromEvent(document,"drag")})),this.scrolling=!1}return e.prototype.addScrolling=function(){var e=this;this.ngZone.runOutsideAngular((function(){if(void 0===e.globalDragSubscription){if(void 0===e.globalDrag$)throw new Error("Could not get observable");var t,n,o,i,a,s,l,d,c;e.globalDragSubscription=e.globalDrag$.pipe(r.throttleTime(25),r.filter((function(e){if(!e.target)return!1;d=C(e.target),t=d.clientHeight;var r,l=d.clientWidth;if("fixed"===window.getComputedStyle(d).getPropertyValue("position").toLowerCase())r=e.clientX,c=e.clientY;else{var h=d.getBoundingClientRect(),p=C(d);r=e.clientX-(h.left+p.scrollLeft),c=e.clientY-(h.top+p.scrollTop)}return!(r<0||r>l||c<0||c>t)&&(n=Math.max(.1*t,100),s=c>(i=t-n),(a=c<(o=n))||s)}))).subscribe((function(){if(null!==d){var r,h=d.scrollHeight-t,p=d.scrollTop;if(a&&p>0){r=p-75*((o-c)/n)}else{if(!s||!(p<h))return;r=p+75*((c-i)/n)}(r=Math.max(0,Math.min(h,r)))!==p&&(d.scrollTo({top:r}),e.scrolling=!0,clearTimeout(l),l=setTimeout((function(){e.scrolling=!1}),100))}}))}}))},e.prototype.removeScrolling=function(){void 0!==this.globalDragSubscription&&this.globalDragSubscription.unsubscribe()},e}();D.ɵfac=function(e){return new(e||D)(t.ɵɵinject(t.NgZone))},D.ɵprov=t.ɵɵdefineInjectable({token:D,factory:D.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(D,[{type:t.Injectable}],(function(){return[{type:t.NgZone}]}),null);var S=["nodeHost"],I=["draggableDiv"],x=["nodeHostContainer"],E=["innerBranch"];function M(e,n){if(1&e&&t.ɵɵelement(0,"drop-zone",7),2&e){var r=t.ɵɵnextContext();t.ɵɵproperty("dropZone",r.dropZoneAbove)}}function F(e,t){}function A(e,n){if(1&e&&t.ɵɵelement(0,"limble-tree-branch",8,9),2&e){var r=t.ɵɵnextContext();t.ɵɵproperty("branch",r.branch)}}function j(e,n){if(1&e&&t.ɵɵelement(0,"drop-zone",7),2&e){var r=t.ɵɵnextContext();t.ɵɵproperty("dropZone",r.dropZoneBelow)}}var O=function(){function e(e,t,n,o,i,a,s,l){var d=this;this.componentCreatorService=e,this.changeDetectorRef=t,this.dragStateService=n,this.dropZoneService=o,this.treeService=i,this.globalEventsService=a,this.ngZone=s,this.treeConstructionStatus=l,this.treeConstructionStatus.constructing(),void 0!==this.treeService.treeOptions&&!0!==this.treeService.treeOptions.listMode?this.renderInnerBranch=!0:this.renderInnerBranch=!1,this.renderDropZoneBelow=!1,this.renderDropZoneAbove=!1,this.treeChangeSubscription=this.treeService.changes$.pipe(r.skip(1)).subscribe((function(){d.treeChangeHandler()}))}return e.prototype.treeChangeHandler=function(){void 0===this.branch||void 0===this.currentBranchCoordinates||l(this.branch.getCoordinates(),this.currentBranchCoordinates)||this.updateDropZones()},e.prototype.ngOnInit=function(){var e,t,o,i=this;if(!1!==(null===(e=this.treeService.treeOptions)||void 0===e?void 0:e.allowDragging)){var a=null===(t=this.branch)||void 0===t?void 0:t.getParent();if(null!==(null==a?void 0:a.data)){var s=null==a?void 0:a.data;if(!d(this.treeService.treeOptions,s))return void(this.renderInnerBranch=!1)}this.registerDropZones(),this.currentBranchCoordinates=null===(o=this.branch)||void 0===o?void 0:o.getCoordinates(),this.ngZone.runOutsideAngular((function(){if(void 0===i.dropZoneAbove||void 0===i.dropZoneBelow)throw new Error("Zones not registered");n.merge(i.dropZoneAbove.getCommChannel(),i.dropZoneBelow.getCommChannel()).pipe(r.filter((function(e){return"checkRendered"===e}))).subscribe((function(){if(void 0===i.dropZoneAbove||void 0===i.dropZoneBelow||void 0===i.branch)throw new Error("Zones not registered");i.renderDropZoneAbove=i.dropZoneAbove.isRendered(),i.renderDropZoneBelow=i.dropZoneBelow.isRendered()}))}))}},e.prototype.ngAfterViewInit=function(){this.renderNode(),this.setDropZoneHosts(),this.checkForHandle(),this.treeConstructionStatus.doneConstructing(),this.changeDetectorRef.detectChanges()},e.prototype.ngOnDestroy=function(){this.treeChangeSubscription.unsubscribe(),void 0!==this.dropZoneAbove&&this.dropZoneService.removeDropZone(this.dropZoneAbove),void 0!==this.dropZoneBelow&&this.dropZoneService.removeDropZone(this.dropZoneBelow),this.treeService.cleanupSignal$.next(!0)},e.prototype.dragstartHandler=function(e){var t,o=this;if(e.stopPropagation(),null===e.dataTransfer||void 0===this.branch||void 0===this.parentHost)throw new Error("failed to run dragstartHandler");var i=e.target;if("LIMBLE-TREE-NODE"===(null===(t=i.parentElement)||void 0===t?void 0:t.tagName)){e.dataTransfer.effectAllowed="move",this.dragStateService.dragging(this.branch,this.parentHost);var a=i.closest("limble-tree-root");if(null===a)throw new Error("could not get root of tree");this.ngZone.runOutsideAngular((function(){setTimeout((function(){var e,t;i.classList.add("dragging"),1===(null===(e=o.treeService.treeData)||void 0===e?void 0:e.length)&&1===(null===(t=o.branch)||void 0===t?void 0:t.getCoordinates().length)&&o.treeService.placeholder$.next(!0)}));var e=n.fromEvent(a,"dragover").pipe(r.first()).subscribe((function(e){if(e.stopPropagation(),void 0===o.branch)throw new Error("Could not show surrounding drop zones");var t,n=o.branch.getParent(),r=!0;null!==(null==n?void 0:n.data)&&(t=null==n?void 0:n.data,r=d(o.treeService.treeOptions,t)),void 0!==o.dropZoneAbove&&r&&o.dropZoneService.showDropZoneFamily(o.dropZoneAbove,{joinFamilies:!0})}));setTimeout((function(){e.closed||e.unsubscribe()}),500)}))}else e.preventDefault()},e.prototype.dragendHandler=function(e){var t,n;if(null==e||e.stopPropagation(),void 0===this.draggableDiv)throw new Error("could not get draggable div");if(this.draggableDiv.nativeElement.classList.remove("dragging"),"captured"===this.dragStateService.getState()){if(!1===this.treeService.captured){if(void 0===this.branch)throw new Error("could not get branch in dragendHandler");this.treeService.cleanupSignal$.next(!0),this.treeService.captured=!1}this.dragStateService.release()}else this.dragStateService.release(),this.dropZoneService.clearVisibleZones(),this.dropZoneService.restoreFamilies(),1===(null===(t=this.treeService.treeData)||void 0===t?void 0:t.length)&&1===(null===(n=this.branch)||void 0===n?void 0:n.getCoordinates().length)&&this.treeService.placeholder$.next(!1)},e.prototype.dragoverHandler=function(e){var t,n;if(!0!==this.globalEventsService.scrolling){if(void 0===this.branch)throw new Error("Can't get current branch during dragover event");var r=this.dragStateService.getData();if(void 0!==r){var o=r.branch;if(o!==this.branch&&!this.branch.getAncestors().includes(o)){var i,a,s=e.currentTarget;a=void 0===(null===(t=this.innerBranch)||void 0===t?void 0:t.dropZoneInside)?i=s.offsetHeight/2-6:2*(i=s.offsetHeight/3-3);var l,c=this.branch.getParent(),p=!0;null!==(null==c?void 0:c.data)&&(l=null==c?void 0:c.data,p=d(this.treeService.treeOptions,l));var u=this.dropZoneService.getActiveDropZone();if(e.offsetY<i&&void 0!==this.dropZoneAbove&&(null===u||!h.dropZoneLocationsAreEqual(u,this.dropZoneAbove))&&p){if(null==this.branch.getIndex())throw new Error("can't get branch index");this.dropZoneService.showDropZoneFamily(this.dropZoneAbove,{activateLowestInsteadOfFounder:!0})}else if(e.offsetY<a&&void 0!==(null===(n=this.innerBranch)||void 0===n?void 0:n.dropZoneInside)&&(null===u||!h.dropZoneLocationsAreEqual(u,this.innerBranch.dropZoneInside)))this.dropZoneService.showDropZoneFamily(this.innerBranch.dropZoneInside);else if(e.offsetY>=a&&void 0!==this.dropZoneBelow&&(null===u||!h.dropZoneLocationsAreEqual(u,this.dropZoneBelow))&&0===this.branch.getChildren().length&&p){if(null==this.branch.getIndex())throw new Error("can't get branch index");this.dropZoneService.showDropZoneFamily(this.dropZoneBelow)}}}}},e.prototype.renderNode=function(){var e;if(void 0===this.nodeHost||void 0===this.branch)throw new Error("Failed to render tree node");var t=this.branch.data.component;if(void 0===t&&(t=null===(e=this.treeService.treeOptions)||void 0===e?void 0:e.defaultComponent),void 0===t)throw new Error("limbleTree requires a component to render");var n=this.componentCreatorService.appendComponent(t.class,this.nodeHost);for(var r in n.instance.nodeData=this.branch.data,t.bindings)n.instance[r]=t.bindings[r]},e.prototype.registerDropZones=function(){this.addDropZoneAbove(),this.addDropZoneBelow()},e.prototype.addDropZoneAbove=function(){var e;if(void 0===this.branch)throw new Error("failed to register drop zone above");var t=this.branch.getParent(),n=this.branch.getCoordinates(),r=n[n.length-1];this.dropZoneAbove=new h(s(null!==(e=null==t?void 0:t.getCoordinates())&&void 0!==e?e:[]),r),this.dropZoneService.addDropZone(this.dropZoneAbove)},e.prototype.addDropZoneBelow=function(){var e;if(void 0===this.branch)throw new Error("failed to register drop zone below");var t=this.branch.getParent(),n=this.branch.getCoordinates(),r=n[n.length-1];this.dropZoneBelow=new h(s(null!==(e=null==t?void 0:t.getCoordinates())&&void 0!==e?e:[]),r+1),this.dropZoneService.addDropZone(this.dropZoneBelow)},e.prototype.updateDropZones=function(){var e;this.currentBranchCoordinates=null===(e=this.branch)||void 0===e?void 0:e.getCoordinates(),this.updateDropZoneAbove(),this.updateDropZoneBelow(),this.updateDropZoneInside(),this.setDropZoneHosts()},e.prototype.updateDropZoneAbove=function(){var e;if(void 0===this.branch||void 0===this.dropZoneAbove)throw new Error("failed to update drop zone above");var t=this.branch.getParent(),n=this.branch.getCoordinates(),r=n[n.length-1],o=this.dropZoneAbove.getLocation();o.setParentCoordinates(s(null!==(e=null==t?void 0:t.getCoordinates())&&void 0!==e?e:[])),o.setInsertIndex(r)},e.prototype.updateDropZoneBelow=function(){var e;if(void 0===this.branch||void 0===this.dropZoneBelow)throw new Error("failed to update drop zone below");var t=this.branch.getParent(),n=this.branch.getCoordinates(),r=n[n.length-1],o=this.dropZoneBelow.getLocation();o.setParentCoordinates(s(null!==(e=null==t?void 0:t.getCoordinates())&&void 0!==e?e:[])),o.setInsertIndex(r+1)},e.prototype.updateDropZoneInside=function(){var e;if(void 0!==(null===(e=this.innerBranch)||void 0===e?void 0:e.dropZoneInside)){if(void 0===this.branch)throw new Error("failed to update drop zone inside");this.innerBranch.dropZoneInside.getLocation().setParentCoordinates(s(this.branch.getCoordinates()))}},e.prototype.setDropZoneHosts=function(){void 0!==this.dropZoneAbove&&void 0!==this.dropZoneBelow&&(this.dropZoneAbove.setHost(this.parentHost),this.dropZoneBelow.setHost(this.parentHost))},e.prototype.checkForHandle=function(){var e,t=this;if(void 0!==this.nodeHostContainer&&void 0!==this.draggableDiv){var n,o,i=this.nodeHostContainer.nativeElement.querySelector(".limble-tree-handle"),a=this.draggableDiv.nativeElement;n=this.treeService.treeOptions,o=null===(e=this.branch)||void 0===e?void 0:e.data,void 0===n||!0!==n.allowDragging&&("function"!=typeof n.allowDragging||void 0===o||!0!==n.allowDragging(o))?a.setAttribute("draggable","false"):null===i?a.setAttribute("draggable","true"):i.addEventListener("mousedown",(function(){a.setAttribute("draggable","true");var e=t.dragStateService.state$.pipe(r.filter((function(e){return"dragging"===e})),r.first());t.dragStateService.state$.pipe(r.skipUntil(e),r.filter((function(e){return"idle"===e})),r.first()).subscribe((function(){a.setAttribute("draggable","false")}))}))}},e}();O.ɵfac=function(e){return new(e||O)(t.ɵɵdirectiveInject(Z),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(p),t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(R),t.ɵɵdirectiveInject(D),t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(u))},O.ɵcmp=t.ɵɵdefineComponent({type:O,selectors:[["limble-tree-node"]],viewQuery:function(e,n){if(1&e&&(t.ɵɵviewQuery(S,1,t.ViewContainerRef),t.ɵɵviewQuery(I,1,t.ElementRef),t.ɵɵviewQuery(x,1,t.ElementRef),t.ɵɵviewQuery(E,1,w)),2&e){var r=void 0;t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.nodeHost=r.first),t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.draggableDiv=r.first),t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.nodeHostContainer=r.first),t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.innerBranch=r.first)}},inputs:{branch:"branch",parentHost:"parentHost"},decls:9,vars:4,consts:[[3,"dropZone",4,"ngIf"],[1,"limble-parent-container",3,"dragstart","dragend"],["draggableDiv",""],[3,"dragoverEventThrottle","dragoverNoChangeDetect"],["nodeHostContainer",""],["nodeHost",""],[3,"branch",4,"ngIf"],[3,"dropZone"],[3,"branch"],["innerBranch",""]],template:function(e,n){1&e&&(t.ɵɵtemplate(0,M,1,1,"drop-zone",0),t.ɵɵelementStart(1,"div",1,2),t.ɵɵlistener("dragstart",(function(e){return n.dragstartHandler(e)}))("dragend",(function(e){return n.dragendHandler(e)})),t.ɵɵelementStart(3,"div",3,4),t.ɵɵlistener("dragoverNoChangeDetect",(function(e){return n.dragoverHandler(e)})),t.ɵɵtemplate(5,F,0,0,"ng-template",null,5,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd(),t.ɵɵtemplate(7,A,2,1,"limble-tree-branch",6),t.ɵɵelementEnd(),t.ɵɵtemplate(8,j,1,1,"drop-zone",0)),2&e&&(t.ɵɵproperty("ngIf",!0===n.renderDropZoneAbove),t.ɵɵadvance(3),t.ɵɵproperty("dragoverEventThrottle",10),t.ɵɵadvance(4),t.ɵɵproperty("ngIf",void 0!==n.branch&&!0===n.renderInnerBranch),t.ɵɵadvance(1),t.ɵɵproperty("ngIf",!0===n.renderDropZoneBelow))},styles:[".dragging[_ngcontent-%COMP%]{position:absolute;transition:transform .01s;transform:translateX(-9999px)}"]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(O,[{type:t.Component,args:[{selector:"limble-tree-node",templateUrl:"./limble-tree-node.component.html",styleUrls:["./limble-tree-node.component.scss"]}]}],(function(){return[{type:Z},{type:t.ChangeDetectorRef},{type:p},{type:f},{type:R},{type:D},{type:t.NgZone},{type:u}]}),{branch:[{type:t.Input}],nodeHost:[{type:t.ViewChild,args:["nodeHost",{read:t.ViewContainerRef}]}],draggableDiv:[{type:t.ViewChild,args:["draggableDiv",{read:t.ElementRef}]}],nodeHostContainer:[{type:t.ViewChild,args:["nodeHostContainer",{read:t.ElementRef}]}],parentHost:[{type:t.Input}],innerBranch:[{type:t.ViewChild,args:["innerBranch",{read:w}]}]});var R=function(){function e(e,t,o,i){var a=this;this.componentCreatorService=e,this.dropZoneService=t,this.dragStateService=o,this.treeConstructionStatus=i,this.changes$=new n.Subject,this.drops$=new n.Subject,this.treeModel=new g(null),this.placeholder=!1,this.captured=!1,this.cleanupSignal$=new n.Subject;var s=!1,l=!1,d=this.treeConstructionStatus.stable$.pipe(r.tap((function(e){l=e})),r.filter((function(e){return!0===e})));this.cleanupSignal$.pipe(r.tap((function(e){s=e})),r.debounce((function(){return!0===l?n.EMPTY:d})),r.debounceTime(5)).subscribe((function(){a.cleanup(s),s=!1})),this.placeholder$=new n.BehaviorSubject(!1),this.placeholder$.subscribe((function(e){a.placeholder=e}))}return e.prototype.drop=function(e,t){var n,r=e.getParent();if(null===r)throw new Error("can't drop root of tree");var o,i,a=e.getIndex();if(null==a)throw new Error("Cannot move the hidden root node");if(!0===this.placeholder?(o=[],i=0):i=(o=s(t)).pop(),void 0===i)throw new Error("target coordinates are empty");var d=this.treeModel.getDescendant(o);if(void 0===d)throw new Error("could not get to target");var c=this.dropZoneService.getDropZone(t),h=null==c?void 0:c.getLocation().insertIndex,p=null==c?void 0:c.getHost(),u=null===(n=this.dragStateService.getData())||void 0===n?void 0:n.parentContainer;if(!0===this.placeholder&&this.placeholder$.next(!1),d.insertChild(e,i),void 0===p||void 0===u||void 0===h)return console.warn("Could not perform a precise update. Re-rendering the entire tree instead"),this.render(),void this.changes$.next(null);var v=u.length,f=this.componentCreatorService.appendComponent(O,p,i);f.instance.branch=e,f.instance.parentHost=p,h<a&&u.length>v&&l(r.getCoordinates(),o)?u.remove(a+1):u.remove(a),this.rebuildTreeData(),this.drops$.next({target:e.data,oldParent:r.data,oldIndex:a,newParent:d.data,newIndex:i}),this.cleanupSignal$.next(!1)},e.prototype.init=function(e,t,n,r,o){if(this.host=e,this.originalData=t,this.treeOptions=this.processOptions(n,r,o),!0===this.treeOptions.listMode){var i=this.treeOptions.itemsPerPage*(this.treeOptions.page-1);isNaN(i)&&(i=0);var a=i+this.treeOptions.itemsPerPage;this.treeData=this.originalData.slice(i,a)}else this.treeData=s(this.originalData);this.render()},e.prototype.cleanup=function(e){var t;void 0===e&&(e=!1),e&&this.rebuildTreeData(),0===(null===(t=this.treeData)||void 0===t?void 0:t.length)?this.render():(this.changes$.next(null),this.dropZoneService.update())},e.prototype.render=function(){var e,t,n,r;if(void 0===this.host||void 0===this.treeData||void 0===this.treeOptions)throw new Error("TreeModel not initialized");if(this.treeConstructionStatus.ready(!1),this.host.clear(),this.dropZoneService.restart(),this.placeholder$.next(!1),this.treeModel=new g(null),0===this.treeData.length)this.placeholder$.next(!0);else{try{for(var o=i(this.treeData),a=o.next();!a.done;a=o.next()){var s=a.value,l=new g(s);this.treeModel.appendChild(l)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}try{for(var d=i(this.treeModel.getChildren()),c=d.next();!c.done;c=d.next()){l=c.value;var h=this.componentCreatorService.appendComponent(O,this.host);h.instance.branch=l,h.instance.parentHost=this.host}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}this.treeConstructionStatus.ready(!0),this.changes$.next(null),this.dropZoneService.init(this.treeModel,this.treeOptions)},e.prototype.renderBranch=function(e,t){var n,r,o,a;if(void 0===this.treeModel)throw new Error("TreeModel not initialized");e.clear(),t.clearChildren();try{for(var s=i(null!==(a=null===(o=t.data)||void 0===o?void 0:o.nodes)&&void 0!==a?a:[]),l=s.next();!l.done;l=s.next()){var d=l.value,c=new g(d);t.appendChild(c);var h=this.componentCreatorService.appendComponent(O,e);h.instance.branch=c,h.instance.parentHost=e}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}},e.prototype.processOptions=function(e,t,n){var r,o,i,a,s;return void 0===e&&(e={}),void 0===t&&(t=1/0),void 0===n&&(n=1),!0===e.listMode&&void 0!==e.allowNesting&&!1!==e.allowNesting&&console.warn("The value of `allowNesting` will be ignored; it must be false when `listMode` is true"),{defaultComponent:e.defaultComponent,indent:null!==(r=e.indent)&&void 0!==r?r:45,allowNesting:!0!==e.listMode&&(null===(o=e.allowNesting)||void 0===o||o),allowDragging:null===(i=e.allowDragging)||void 0===i||i,allowDrop:null!==(a=e.allowDrop)&&void 0!==a?a:function(){return!0},listMode:null!==(s=e.listMode)&&void 0!==s&&s,itemsPerPage:e.listMode?t:void 0,page:e.listMode?n:void 0}},e.prototype.rebuildTreeData=function(){var e,t,n,r;if(void 0===this.originalData||void 0===this.treeData||void 0===this.treeOptions||void 0===this.host)throw new Error("Tree data not initialized");this.treeData=[];try{for(var o=i(this.treeModel.getChildren()),a=o.next();!a.done;a=o.next()){var l=a.value;this.treeData.push(this.rebuildBranch(l))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}if(!0===this.treeOptions.listMode&&this.treeOptions.itemsPerPage<1/0){var d=this.treeOptions.itemsPerPage,c=d*(this.treeOptions.page-1);if((n=this.originalData).splice.apply(n,s([c,d],this.treeData)),this.treeData.length!==d){var h=!1;if(this.treeData.length<d&&c+d<=this.originalData.length){for(var p=d-this.treeData.length,u=d-1;u<d+p-1;u++){l=new g(this.originalData[c+u]);this.treeModel.appendChild(l);var v=this.componentCreatorService.appendComponent(O,this.host);v.instance.branch=l,v.instance.parentHost=this.host}h=!0}else if(this.treeData.length>d){for(u=d+(p=this.treeData.length-d)-1;u>=d;u--)this.treeModel.removeChild(u),this.host.remove(u);h=!0}if(!0===h){var f=c+d;this.treeData=this.originalData.slice(c,f)}}}else this.originalData.length=0,(r=this.originalData).push.apply(r,s(this.treeData))},e.prototype.rebuildBranch=function(e){var t,n,r=e.data;r.nodes=[];try{for(var o=i(e.getChildren()),a=o.next();!a.done;a=o.next()){var s=a.value;r.nodes.push(this.rebuildBranch(s))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},e}();R.ɵfac=function(e){return new(e||R)(t.ɵɵinject(Z),t.ɵɵinject(f),t.ɵɵinject(p),t.ɵɵinject(u))},R.ɵprov=t.ɵɵdefineInjectable({token:R,factory:R.ɵfac}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(R,[{type:t.Injectable}],(function(){return[{type:Z},{type:f},{type:p},{type:u}]}),null);var N=function(){function e(e,n){this.ngZone=e,this.el=n,this.dragoverNoChangeDetect=new t.EventEmitter,this.dragoverEventThrottle=25}return e.prototype.ngOnInit=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.eventSubscription=n.fromEvent(e.el.nativeElement,"dragover").pipe(r.throttleTime(e.dragoverEventThrottle)).subscribe((function(t){e.dragoverNoChangeDetect.emit(t)}))}))},e.prototype.ngOnDestroy=function(){void 0!==this.eventSubscription&&this.eventSubscription.unsubscribe()},e}();N.ɵfac=function(e){return new(e||N)(t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(t.ElementRef))},N.ɵdir=t.ɵɵdefineDirective({type:N,selectors:[["","dragoverNoChangeDetect",""]],inputs:{dragoverEventThrottle:"dragoverEventThrottle"},outputs:{dragoverNoChangeDetect:"dragoverNoChangeDetect"}}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(N,[{type:t.Directive,args:[{selector:"[dragoverNoChangeDetect]"}]}],(function(){return[{type:t.NgZone},{type:t.ElementRef}]}),{dragoverEventThrottle:[{type:t.Input}],dragoverNoChangeDetect:[{type:t.Output}]});var H=function(){function e(e,n){this.ngZone=e,this.el=n,this.dragleaveNoChangeDetect=new t.EventEmitter}return e.prototype.ngOnInit=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.eventSubscription=n.fromEvent(e.el.nativeElement,"dragleave").subscribe((function(t){e.dragleaveNoChangeDetect.emit(t)}))}))},e.prototype.ngOnDestroy=function(){void 0!==this.eventSubscription&&this.eventSubscription.unsubscribe()},e}();H.ɵfac=function(e){return new(e||H)(t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(t.ElementRef))},H.ɵdir=t.ɵɵdefineDirective({type:H,selectors:[["","dragleaveNoChangeDetect",""]],outputs:{dragleaveNoChangeDetect:"dragleaveNoChangeDetect"}}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(H,[{type:t.Directive,args:[{selector:"[dragleaveNoChangeDetect]"}]}],(function(){return[{type:t.NgZone},{type:t.ElementRef}]}),{dragleaveNoChangeDetect:[{type:t.Output}]});var P=function(e,t){return{active:e,related:t}};function B(e,n){if(1&e){var r=t.ɵɵgetCurrentView();t.ɵɵelementStart(0,"div",1),t.ɵɵlistener("dragenter",(function(){return t.ɵɵrestoreView(r),t.ɵɵnextContext().dragenterHandler()})),t.ɵɵelement(1,"div",2),t.ɵɵelementEnd()}if(2&e){var o=t.ɵɵnextContext();t.ɵɵadvance(1),t.ɵɵproperty("ngClass",t.ɵɵpureFunction2(1,P,o.active,!o.active))}}var T=function(){function e(e,t){this.dropZoneService=e,this.changeDetectorRef=t,this.visible=!1,this.active=!1}return e.prototype.dragenterHandler=function(){void 0!==this.dropZone&&!0!==this.active&&this.dropZoneService.swapActiveDropZone(this.dropZone)},e.prototype.ngOnInit=function(){var e=this;if(void 0===this.dropZone)throw new Error("No drop zone object at component initialization");this.commSubscription=this.dropZone.getCommChannel().subscribe((function(t){var n,r,o,i;switch(t){case"checkVisible":e.visible=null!==(r=null===(n=e.dropZone)||void 0===n?void 0:n.isVisible())&&void 0!==r&&r;break;case"checkActive":e.active=null!==(i=null===(o=e.dropZone)||void 0===o?void 0:o.isActive())&&void 0!==i&&i;break;case"checkRendered":break;default:throw new Error("unhandled comm message")}e.changeDetectorRef.detectChanges()}))},e.prototype.ngOnDestroy=function(){void 0!==this.commSubscription&&this.commSubscription.unsubscribe()},e}();T.ɵfac=function(e){return new(e||T)(t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(t.ChangeDetectorRef))},T.ɵcmp=t.ɵɵdefineComponent({type:T,selectors:[["drop-zone"]],inputs:{dropZone:"dropZone"},decls:1,vars:1,consts:[["class","dropZoneContainer",3,"dragenter",4,"ngIf"],[1,"dropZoneContainer",3,"dragenter"],[3,"ngClass"]],template:function(e,n){1&e&&t.ɵɵtemplate(0,B,2,4,"div",0),2&e&&t.ɵɵproperty("ngIf",n.visible)},directives:[o.NgIf,o.NgClass],styles:[".active[_ngcontent-%COMP%]{height:105px;border-radius:5px;background:#f0f9ff;border:2px dashed #bed2db}.active[_ngcontent-%COMP%], .related[_ngcontent-%COMP%]{margin:10px 0;width:calc(100% - 20px);box-sizing:border-box}.related[_ngcontent-%COMP%]{height:30px;border-radius:5px;background:#fff6f0;border:1px dashed #dbccbe;opacity:.8}.dropZoneContainer[_ngcontent-%COMP%]{position:relative}"],changeDetection:0}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(T,[{type:t.Component,args:[{selector:"drop-zone",templateUrl:"./drop-zone.component.html",styleUrls:["./drop-zone.component.scss"],changeDetection:t.ChangeDetectionStrategy.OnPush}]}],(function(){return[{type:f},{type:t.ChangeDetectorRef}]}),{dropZone:[{type:t.Input}]});var $=function(){function e(e,t,n,r){var o=this;this.dropZoneService=e,this.changeDetectorRef=t,this.treeService=n,this.treeConstructionStatus=r,this.treeConstructionStatus.constructing(),this.placeholderSubscription=this.treeService.placeholder$.subscribe((function(e){void 0!==o.dropZone&&(o.dropZoneService.removeDropZone(o.dropZone),!0===e&&(o.dropZoneService.addDropZone(o.dropZone),o.dropZone.setHost(o.treeService.host)))}))}return e.prototype.ngOnInit=function(){this.dropZone=new h([],0),this.dropZoneService.addDropZone(this.dropZone)},e.prototype.ngAfterViewInit=function(){if(void 0===this.dropZone)throw new Error("placeholder drop zone is not defined");this.dropZone.setHost(this.treeService.host),this.treeConstructionStatus.doneConstructing(),this.changeDetectorRef.detectChanges()},e.prototype.dragoverHandler=function(){void 0!==this.dropZone&&this.dropZoneService.showDropZoneFamily(this.dropZone)},e.prototype.ngOnDestroy=function(){if(this.placeholderSubscription.unsubscribe(),void 0===this.dropZone)throw new Error("could not remove placeholder drop zone");this.dropZoneService.removeDropZone(this.dropZone)},e}();$.ɵfac=function(e){return new(e||$)(t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(R),t.ɵɵdirectiveInject(u))},$.ɵcmp=t.ɵɵdefineComponent({type:$,selectors:[["limble-tree-placeholder"]],decls:2,vars:1,consts:[[3,"dropZone"],[1,"placeholder",3,"dragoverNoChangeDetect"]],template:function(e,n){1&e&&(t.ɵɵelement(0,"drop-zone",0),t.ɵɵelementStart(1,"div",1),t.ɵɵlistener("dragoverNoChangeDetect",(function(){return n.dragoverHandler()})),t.ɵɵelementEnd()),2&e&&t.ɵɵproperty("dropZone",n.dropZone)},directives:[T,N],styles:[".placeholder[_ngcontent-%COMP%]{width:100%;height:20px}"],changeDetection:0}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata($,[{type:t.Component,args:[{selector:"limble-tree-placeholder",templateUrl:"./limble-tree-placeholder.component.html",styleUrls:["./limble-tree-placeholder.component.scss"],changeDetection:t.ChangeDetectionStrategy.OnPush}]}],(function(){return[{type:f},{type:t.ChangeDetectorRef},{type:R},{type:u}]}),null);var z=["host"];function L(e,n){1&e&&t.ɵɵelement(0,"limble-tree-placeholder")}function V(e,t){}var k=function(){function e(e,n,r,o,i,a,s){var l=this;this.treeService=e,this.dropZoneService=n,this.dragStateService=r,this.globalEventsService=o,this.ngZone=i,this.changeDetectorRef=a,this.el=s,this.treeChange=new t.EventEmitter,this.treeDrop=new t.EventEmitter,this.changesSubscription=this.treeService.changes$.subscribe((function(){setTimeout((function(){l.treeChange.emit()}))})),this.dropSubscription=this.treeService.drops$.subscribe((function(e){setTimeout((function(){l.treeDrop.emit(e)}))})),this.placeholder=!1,this.treeService.placeholder$.subscribe((function(e){l.placeholder=e,t.NgZone.isInAngularZone()||l.changeDetectorRef.detectChanges()}))}return e.prototype.ngAfterViewInit=function(){var e,t=this;!0===(null===(e=this.options)||void 0===e?void 0:e.listMode)||void 0===this.itemsPerPage&&void 0===this.page||console.warn("pagination is only allowed in listMode; `itemsPerPage` and `page` inputs will be ignored"),this.update(),this.changeDetectorRef.detectChanges(),this.ngZone.runOutsideAngular((function(){t.el.nativeElement.addEventListener("dragover",(function(e){e.preventDefault()}))}))},e.prototype.ngOnChanges=function(){void 0!==this.host&&void 0!==this.data&&this.update()},e.prototype.update=function(){if(void 0===this.host)throw new Error("Failed to render limble tree. Failure occurred at root.");if(void 0===this.data)throw new Error("limbleTree requires a data object");this.treeService.init(this.host,this.data,this.options,this.itemsPerPage,this.page),this.globalEventsService.addScrolling()},e.prototype.dragoverHandler=function(e){null!==e.dataTransfer&&(e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.dragleaveHandler=function(e){var t=e.currentTarget,n=e.relatedTarget;t instanceof Node&&n instanceof Node&&!1===function(e,t){if(e===t)return!0;for(var n=t.parentNode;n!==document;){if(null===n)return;if(n===e)return!0;n=n.parentNode}return!1}(t,n)&&(this.dropZoneService.clearVisibleZones(),this.changeDetectorRef.detectChanges())},e.prototype.dropHandler=function(e){var t=this;if(e.stopPropagation(),"droppable"===this.dragStateService.getState()){var n=this.dragStateService.capture();if(void 0===n)throw new Error("failed to get current branch in dragendHandler");var o=this.dropZoneService.getActiveDropZone();if(null===o)throw new Error("failed to get active drop zone at drop handler");this.treeService.captured=!0,this.dragStateService.state$.pipe(r.first((function(e){return"idle"===e}))).subscribe((function(){t.treeService.captured=!1})),this.dropZoneService.clearVisibleZones(),this.treeService.drop(n,o.getFullInsertCoordinates())}},e.prototype.ngOnDestroy=function(){this.changesSubscription.unsubscribe(),this.dropSubscription.unsubscribe()},e}();k.ɵfac=function(e){return new(e||k)(t.ɵɵdirectiveInject(R),t.ɵɵdirectiveInject(f),t.ɵɵdirectiveInject(p),t.ɵɵdirectiveInject(D),t.ɵɵdirectiveInject(t.NgZone),t.ɵɵdirectiveInject(t.ChangeDetectorRef),t.ɵɵdirectiveInject(t.ElementRef))},k.ɵcmp=t.ɵɵdefineComponent({type:k,selectors:[["limble-tree-root"]],viewQuery:function(e,n){if(1&e&&t.ɵɵviewQuery(z,1,t.ViewContainerRef),2&e){var r;t.ɵɵqueryRefresh(r=t.ɵɵloadQuery())&&(n.host=r.first)}},inputs:{data:"data",options:"options",itemsPerPage:"itemsPerPage",page:"page"},outputs:{treeChange:"treeChange",treeDrop:"treeDrop"},features:[t.ɵɵProvidersFeature([R,f,u]),t.ɵɵNgOnChangesFeature],decls:4,vars:1,consts:[[3,"dragoverNoChangeDetect","dragleaveNoChangeDetect","drop"],[4,"ngIf"],["host",""]],template:function(e,n){1&e&&(t.ɵɵelementStart(0,"div",0),t.ɵɵlistener("dragoverNoChangeDetect",(function(e){return n.dragoverHandler(e)}))("dragleaveNoChangeDetect",(function(e){return n.dragleaveHandler(e)}))("drop",(function(e){return n.dropHandler(e)})),t.ɵɵtemplate(1,L,1,0,"limble-tree-placeholder",1),t.ɵɵtemplate(2,V,0,0,"ng-template",null,2,t.ɵɵtemplateRefExtractor),t.ɵɵelementEnd()),2&e&&(t.ɵɵadvance(1),t.ɵɵproperty("ngIf",!0===n.placeholder))},directives:[N,H,o.NgIf,$],styles:[""]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(k,[{type:t.Component,args:[{selector:"limble-tree-root",templateUrl:"./limble-tree-root.component.html",styleUrls:["./limble-tree-root.component.scss"],providers:[R,f,u]}]}],(function(){return[{type:R},{type:f},{type:p},{type:D},{type:t.NgZone},{type:t.ChangeDetectorRef},{type:t.ElementRef}]}),{data:[{type:t.Input}],options:[{type:t.Input}],itemsPerPage:[{type:t.Input}],page:[{type:t.Input}],host:[{type:t.ViewChild,args:["host",{read:t.ViewContainerRef}]}],treeChange:[{type:t.Output}],treeDrop:[{type:t.Output}]});var q=function(){};q.ɵfac=function(e){return new(e||q)},q.ɵmod=t.ɵɵdefineNgModule({type:q}),q.ɵinj=t.ɵɵdefineInjector({providers:[Z,p,D],imports:[[o.CommonModule]]}),("undefined"==typeof ngJitMode||ngJitMode)&&t.ɵɵsetNgModuleScope(q,{declarations:[w,T,O,k,$,N,H],imports:[o.CommonModule],exports:[k]}),("undefined"==typeof ngDevMode||ngDevMode)&&t.ɵsetClassMetadata(q,[{type:t.NgModule,args:[{declarations:[w,T,O,k,$,N,H],imports:[o.CommonModule],exports:[k],providers:[Z,p,D]}]}],null,null),t.ɵɵsetComponentScope(w,[o.NgIf,T],[]),t.ɵɵsetComponentScope(O,[o.NgIf,T,N,w],[]),e.LimbleTreeModule=q,e.LimbleTreeRootComponent=k,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=limble-limble-tree.umd.min.js.map |
@@ -10,3 +10,3 @@ import { Directive, EventEmitter, Input, Output } from "@angular/core"; | ||
this.dragoverNoChangeDetect = new EventEmitter(); | ||
this.dragoverEventThrottle = 0; | ||
this.dragoverEventThrottle = 25; | ||
} | ||
@@ -40,2 +40,2 @@ ngOnInit() { | ||
}] }); })(); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJhZ292ZXItbm8tY2hhbmdlLWRldGVjdC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9saW1ibGUtdHJlZS9zcmMvbGliL2N1c3RvbS1ldmVudC1iaW5kaW5ncy9kcmFnb3Zlci1uby1jaGFuZ2UtZGV0ZWN0LmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0osU0FBUyxFQUVULFlBQVksRUFDWixLQUFLLEVBSUwsTUFBTSxFQUNSLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSxTQUFTLEVBQWdCLE1BQU0sTUFBTSxDQUFDO0FBQy9DLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQzs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sZW1lbnQ+XHJcbiAgICkge1xyXG4gICAgICB0aGlzLmRyYWdvdmVyTm9DaGFuZ2VEZXRlY3QgPSBuZXcgRXZlbnRFbWl0dGVyPERyYWdFdmVudD4oKTtcclxuICAgICAgdGhpcy5kcmFnb3ZlckV2ZW50VGhyb3R0bGUgPSAyNTtcclxuICAgfVxyXG5cclxuICAgbmdPbkluaXQoKSB7XHJcbiAgICAgIHRoaXMubmdab25lLnJ1bk91dHNpZGVBbmd1bGFyKCgpID0+IHtcclxuICAgICAgICAgdGhpcy5ldmVudFN1YnNjcmlwdGlvbiA9IGZyb21FdmVudDxEcmFnRXZlbnQ+KFxyXG4gICAgICAgICAgICB0aGlzLmVsLm5hdGl2ZUVsZW1lbnQsXHJcbiAgICAgICAgICAgIFwiZHJhZ292ZXJcIlxyXG4gICAgICAgICApXHJcbiAgICAgICAgICAgIC5waXBlKHRocm90dGxlVGltZSh0aGlzLmRyYWdvdmVyRXZlbnRUaHJvdHRsZSkpXHJcbiAgICAgICAgICAgIC5zdWJzY3JpYmUoKCRldmVudCkgPT4ge1xyXG4gICAgICAgICAgICAgICB0aGlzLmRyYWdvdmVyTm9DaGFuZ2VEZXRlY3QuZW1pdCgkZXZlbnQpO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgfSk7XHJcbiAgIH1cclxuXHJcbiAgIG5nT25EZXN0cm95KCkge1xyXG4gICAgICBpZiAodGhpcy5ldmVudFN1YnNjcmlwdGlvbiAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgIHRoaXMuZXZlbnRTdWJzY3JpcHRpb24udW5zdWJzY3JpYmUoKTtcclxuICAgICAgfVxyXG4gICB9XHJcbn1cclxuIl19 |
@@ -75,2 +75,2 @@ import { ChangeDetectionStrategy, Component } from "@angular/core"; | ||
}], function () { return [{ type: i1.DropZoneService }, { type: i0.ChangeDetectorRef }, { type: i2.TreeService }, { type: i3.TreeConstructionStatus }]; }, null); })(); | ||
//# sourceMappingURL=data:application/json;base64,e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291bGQgbm90IHJlbW92ZSBwbGFjZWhvbGRlciBkcm9wIHpvbmVcIik7XHJcbiAgICAgIH1cclxuICAgICAgdGhpcy5kcm9wWm9uZVNlcnZpY2UucmVtb3ZlRHJvcFpvbmUodGhpcy5kcm9wWm9uZSk7XHJcbiAgIH1cclxufVxyXG4iLCI8ZHJvcC16b25lIFtkcm9wWm9uZV09XCJkcm9wWm9uZVwiPjwvZHJvcC16b25lPlxuPGRpdiBjbGFzcz1cInBsYWNlaG9sZGVyXCIgKGRyYWdvdmVyTm9DaGFuZ2VEZXRlY3QpPVwiZHJhZ292ZXJIYW5kbGVyKClcIj48L2Rpdj5cbiJdfQ== |
@@ -22,3 +22,3 @@ import { Component, EventEmitter, Input, NgZone, Output, ViewChild, ViewContainerRef } from "@angular/core"; | ||
export class LimbleTreeRootComponent { | ||
constructor(treeService, dropZoneService, dragStateService, globalEventsService, changeDetectorRef) { | ||
constructor(treeService, dropZoneService, dragStateService, globalEventsService, ngZone, changeDetectorRef, el) { | ||
this.treeService = treeService; | ||
@@ -28,3 +28,5 @@ this.dropZoneService = dropZoneService; | ||
this.globalEventsService = globalEventsService; | ||
this.ngZone = ngZone; | ||
this.changeDetectorRef = changeDetectorRef; | ||
this.el = el; | ||
this.treeChange = new EventEmitter(); | ||
@@ -63,2 +65,8 @@ this.treeDrop = new EventEmitter(); | ||
this.changeDetectorRef.detectChanges(); | ||
this.ngZone.runOutsideAngular(() => { | ||
//this is for mac os - without this dragover handler drop events aren't firing correctly | ||
this.el.nativeElement.addEventListener("dragover", (event) => { | ||
event.preventDefault(); | ||
}); | ||
}); | ||
} | ||
@@ -129,3 +137,3 @@ ngOnChanges() { | ||
} | ||
LimbleTreeRootComponent.ɵfac = function LimbleTreeRootComponent_Factory(t) { return new (t || LimbleTreeRootComponent)(i0.ɵɵdirectiveInject(i1.TreeService), i0.ɵɵdirectiveInject(i2.DropZoneService), i0.ɵɵdirectiveInject(i3.DragStateService), i0.ɵɵdirectiveInject(i4.GlobalEventsService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; | ||
LimbleTreeRootComponent.ɵfac = function LimbleTreeRootComponent_Factory(t) { return new (t || LimbleTreeRootComponent)(i0.ɵɵdirectiveInject(i1.TreeService), i0.ɵɵdirectiveInject(i2.DropZoneService), i0.ɵɵdirectiveInject(i3.DragStateService), i0.ɵɵdirectiveInject(i4.GlobalEventsService), i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.ElementRef)); }; | ||
LimbleTreeRootComponent.ɵcmp = i0.ɵɵdefineComponent({ type: LimbleTreeRootComponent, selectors: [["limble-tree-root"]], viewQuery: function LimbleTreeRootComponent_Query(rf, ctx) { if (rf & 1) { | ||
@@ -154,3 +162,3 @@ i0.ɵɵviewQuery(_c0, 1, ViewContainerRef); | ||
}] | ||
}], function () { return [{ type: i1.TreeService }, { type: i2.DropZoneService }, { type: i3.DragStateService }, { type: i4.GlobalEventsService }, { type: i0.ChangeDetectorRef }]; }, { data: [{ | ||
}], function () { return [{ type: i1.TreeService }, { type: i2.DropZoneService }, { type: i3.DragStateService }, { type: i4.GlobalEventsService }, { type: i0.NgZone }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, { data: [{ | ||
type: Input | ||
@@ -171,2 +179,2 @@ }], options: [{ | ||
}] }); })(); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGltYmxlLXRyZWUtcm9vdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9saW1ibGUtdHJlZS9zcmMvbGliL2xpbWJsZS10cmVlLXJvb3QvbGltYmxlLXRyZWUtcm9vdC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9saW1ibGUtdHJlZS9zcmMvbGliL2xpbWJsZS10cmVlLXJv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HBzOi8vYW5ndWxhci5pby9lcnJvcnMvTkcwMTAwIGZvciBkZXRhaWxzLlxyXG4gICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICAgICAgdGhpcy50cmVlQ2hhbmdlLmVtaXQoKTtcclxuICAgICAgICAgfSk7XHJcbiAgICAgIH0pO1xyXG4gICAgICB0aGlzLmRyb3BTdWJzY3JpcHRpb24gPSB0aGlzLnRyZWVTZXJ2aWNlLmRyb3BzJC5zdWJzY3JpYmUoKGRyb3ApID0+IHtcclxuICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgIHRoaXMudHJlZURyb3AuZW1pdChkcm9wKTtcclxuICAgICAgICAgfSk7XHJcbiAgICAgIH0pO1xyXG4gICAgICB0aGlzLnBsYWNlaG9sZGVyID0gZmFsc2U7XHJcbiAgICAgIHRoaXMudHJlZVNlcnZpY2UucGxhY2Vob2xkZXIkLnN1YnNjcmliZSgodmFsdWUpID0+IHtcclxuICAgICAgICAgdGhpcy5wbGFjZWhvbGRlciA9IHZhbHVlO1xyXG4gICAgICAgICBpZiAoIU5nWm9uZS5pc0luQW5ndWxhclpvbmUoKSkge1xyXG4gICAgICAgICAgICB0aGlzLmNoYW5nZURldGVjdG9yUmVmLmRldGVjdENoYW5nZXMoKTtcclxuICAgICAgICAgfVxyXG4gICAgICB9KTtcclxuICAgfVxyXG5cclxuICAgbmdBZnRlclZpZXdJbml0KCkge1xyXG4gICAgICBpZiAoXHJcbiAgICAgICAgIHRoaXMub3B0aW9ucz8ubGlzdE1vZGUgIT09IHRydWUgJiZcclxuICAgICAgICAgKHRoaXMuaXRlbXNQZXJQYWdlICE9PSB1bmRlZmluZWQgfHwgdGhpcy5wYWdlICE9PSB1bmRlZmluZWQpXHJcbiAgICAgICkge1xyXG4gICAgICAgICBjb25zb2xlLndhcm4oXHJcbiAgICAgICAgICAgIFwicGFnaW5hdGlvbiBpcyBvbmx5IGFsbG93ZWQgaW4gbGlzdE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bGVyKCRldmVudClcIlxyXG4+XHJcbiAgIDxsaW1ibGUtdHJlZS1wbGFjZWhvbGRlclxyXG4gICAgICAqbmdJZj1cInBsYWNlaG9sZGVyID09PSB0cnVlXCJcclxuICAgPjwvbGltYmxlLXRyZWUtcGxhY2Vob2xkZXI+XHJcbiAgIDxuZy10ZW1wbGF0ZSAjaG9zdD48L25nLXRlbXBsYXRlPlxyXG48L2Rpdj5cclxuIl19 |
@@ -1,2 +0,2 @@ | ||
import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy } from "@angular/core"; | ||
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy } from "@angular/core"; | ||
import { DropZoneService } from "./drop-zone.service"; | ||
@@ -13,3 +13,5 @@ import { LimbleTreeData, LimbleTreeOptions, TreeDrop } from "../limble-tree-root/tree.service"; | ||
private readonly globalEventsService; | ||
private readonly ngZone; | ||
private readonly changeDetectorRef; | ||
private readonly el; | ||
data: LimbleTreeData | undefined; | ||
@@ -25,3 +27,3 @@ options: LimbleTreeOptions | undefined; | ||
placeholder: boolean; | ||
constructor(treeService: TreeService, dropZoneService: DropZoneService, dragStateService: DragStateService, globalEventsService: GlobalEventsService, changeDetectorRef: ChangeDetectorRef); | ||
constructor(treeService: TreeService, dropZoneService: DropZoneService, dragStateService: DragStateService, globalEventsService: GlobalEventsService, ngZone: NgZone, changeDetectorRef: ChangeDetectorRef, el: ElementRef<Element>); | ||
ngAfterViewInit(): void; | ||
@@ -28,0 +30,0 @@ ngOnChanges(): void; |
{ | ||
"name": "@limble/limble-tree", | ||
"version": "0.11.7", | ||
"version": "0.11.8", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^11.2.5", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1187891
7977