angular.module("app").controller("DropInfoModalController",["$modalScope","$q","dropInfo","core","packageManager","modal","utils",function(e,a,o,n,r,p,t){e.delayShow=!0,e.core=n,e.dropLicenses=n.dropLicenses,e.dropInfo=o,e.packageManager=r,e.utils=t,e.getLicenseUrl=function(e,a){if(n&&n.packages&&n.packages.installed&&n.packages.installed[e]&&n.packages.installed[e].meta&&n.packages.installed[e].meta.url){var o=n.packages.installed[e].meta.url;return o.indexOf("?")>=0?o+="&":o+="?",o+="shop="+window.btoa(n.shopURL)+(a?"&"+a:"")}return null},e.showUpdateManager=function(a){e.close(),p.show("PackageManagerModal",null,{mode:"upgrade",overviewMode:"upgrades",package:n.packages.upgradeable[a]})};var showDoc=function(a){e.dropInfo.description=a.documentation||"<h1>Sorry</h1><p>Für dieses Drop ist noch keine Beschreibung verfügbar.</p>",e.dropInfo.faq=a.faq||"",e.show()},s=n.fn.trigger("getDropDocs",[o]);a.all(s).then((function(a){var r=a.find((function(e){return e&&angular.isString(e.documentation)}));r?showDoc(r):$.ajax({type:"POST",url:n.shopURL,data:{kk_get_drop_documentation:o.dropId,kk_dropper_admin_pass:n.adminSecret},dataType:"json",success:function(a){e.$apply((function(){showDoc(a)}))},error:function(a){e.$apply((function(){e.dropInfo.description="<h1>Sorry</h1><p>Für dieses Drop ist noch keine Beschreibung verfügbar.</p>",e.dropInfo.faq="",e.show()}))}})}))}]);