angular.module("app").controller("NewDropModalController",["$modalScope","$element","core","utils","modal","state","packageManager",function(e,t,n,r,a,o,l){e.core=n,e.utils=r,e.search="",e.droplets=null,e.templates=$.extend(!0,{},n.templates),e.packageManager=l,e.isFrontendEditMode=o.isFrontendMode;var getInstanceCount=function(e){return n.settings&&n.settings.drops&&n.settings.drops.length?n.settings.drops.filter((function(t){return t._internal.dropId===e})).length:0};for(var s in e.templates){e.templates[s]._instanceCount=getInstanceCount(s)}if(e.filterTemplates=function(t){var n={},a=e.templates;for(var l in a){if(!0===t||!1===t){var s=r.Drops.canAddDrop(l);if(!0===t&&!s)continue;if(!1===t&&s)continue}var i=a[l];i&&i.hidden||(i&&!1===i.frontendEditable&&o.isFrontendMode||(n[l]=i))}return n},e.showPackageManager=function(e,t,n){a.show("PackageManagerModal",null,{overviewMode:e||"store",mode:t||"overview",package:n||null})},setTimeout((function(){t.find(".search").get(0).focus()}),350),n.templates.KK_Droplet){var i=n.settings.drops.filter((function(e){return r.Drops.isDropletTemplate(e)}));i.sort((function(e,t){return e._template.name<t._template.name?-1:e._template.name>t._template.name?1:0})),e.droplets=i}}]);