angular.module("app").service("rootScopeLegacy",["editWindow","utils","state","core",function(e,t,o,r){var n={addDropItem:function(e,i){!e&&o.activeDrop&&(e=o.activeDrop),void 0===i&&(i=!0),angular.isArray(e.dropItems)||(e.dropItems=[]);var a=r.templates[e._internal.dropId],p=t.Drops.addItem(e.dropItems,a.itemDefaults||!1,a.itemSettings,e,"Neuer Eintrag");return i&&n.activateDropItem(p),p},activateDropItem:function(t,n){if(n&&n.preventDefault(),!o.activeDrop||!o.activeDrop._internal)return console.log("Could not activate drop item because active drop was not set:",t);let i=r.templates[o.activeDrop._internal.dropId];if(!i)return console.log("Could not activate drop item because template was not found:",t);e.show(!0,"ListItemEditWindow",{item:t,itemParent:o.activeDrop,itemSettings:i.itemSettings,nameBinding:null,newItemName:null})},removeDropItem:function(e,t){if(t&&t.stopPropagation(),!o.activeDrop||!o.activeDrop.dropItems)return console.log("could not remove drop item because active drop was not set",e);o.activeDrop.dropItems.splice(o.activeDrop.dropItems.indexOf(e),1)},ungroupLabel:function(e){return t.Drops.ungroupLabel(e)},groupLabel:function(e){return t.Drops.groupLabel(e)},getDropShortcode:function(e){return t.Drops.getDropShortcode(e)},getDropsFromText:function(e){return t.Drops.getDropsFromText(e)},$install:function(e){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&"$"!==i[0]&&(e[i]=n[i]);Object.defineProperty(e,"activeDrop",{get:function(){return o.activeDrop},set:function(e){t.Drops.activateDrop(e)}}),Object.defineProperty(e,"activeTemplate",{get:function(){return r.templates&&o.activeDrop&&o.activeDrop._internal&&o.activeDrop._internal.dropId?r.templates[o.activeDrop._internal.dropId]:null}})}};return n}]);