m.aio.skinmanager.LocalUrl)e.call(this,this.skins,g,b);else if(g instanceof m.aio.skinmanager.LocalCustomWidgetUrl){var k=this.customWidgetPath+c.sep+g.widgetType+c.sep+g.widgetName+c.sep+g.resourcePath;f.exists(k,function(a){a?b&&b(null,k):b&&b(Error("no such resource"))})}else g instanceof m.aio.skinmanager.InRemoteUrl?this._getInRemoteSkins(g.tenantId,g.remoteId,function(a,c){a?b&&b(a):e.call(this,c,g,b)}.bind(this)):g instanceof m.aio.skinmanager.InRemoteCustomWidgetUrl?this._getRemoteFolder(g.tenantId,
d.permitSkin(b[g].id,a)&&c.push(b[g]));e&&e(null,c)}}.bind(this))},_isSkinPermitted:function(a,b,e){for(var d=0;d<this.skins.length;d++)if(this.skins[d]&&this.skins[d].id&&this.skins[d]&&this.skins[d].id==b&&2==this.skins[d].type){e&&e(null,!0);return}d=this._configmanager;var c=require("m.aio.infomanager");d.trace("config/tenants/"+a,function(a,d){a?e&&e(a):e&&e(null,c.permitSkin(b,d.license))}.bind(this))},getResourceByURL:function(a,b){var e=function(a,b,c){var e=this._getSkin(a,b.skinId);e?d(e,
b,function(f,g){!f&&g?c&&c(null,g):e.base?(e=this._getSkin(a,e.base))?d(e,b,function(a,b){a?c&&c(a):c&&c(null,b)}):c&&c(Error("invalid resource path")):c&&c(Error("invalid resource path"))}.bind(this)):c&&c(Error("no such skin"))},d=function(a,c,b){var d=require("path"),e=require("fs"),f=d.join(a.path,c.widgetType,c.widgetName,c.resourcePath);e.exists(f,function(a){a?b&&b(null,f):b&&b(Error("no such resource"))})},c=require("path"),f=require("fs"),g=m.aio.skinmanager.Url.resolve(a);if(g instanceof
m.aio.skinmanager.LocalUrl)e.call(this,this.skins,g,b);else if(g instanceof m.aio.skinmanager.LocalCustomWidgetUrl){var k=this.customWidgetPath+c.sep+g.widgetType+c.sep+g.widgetName+c.sep+g.resourcePath;f.exists(k,function(a){a?b&&b(null,k):b&&b(Error("no such resource"))})}else g instanceof m.aio.skinmanager.InRemoteUrl?this._getInRemoteSkins(g.tenantId,g.remoteId,function(a,c){a?b&&b(a):e.call(this,c,g,b)}.bind(this)):g instanceof m.aio.skinmanager.InRemoteCustomWidgetUrl?this._getRemoteFolder(g.tenantId,
g.remoteId,function(a,d){if(a)b&&b(a);else{var e=c.join(d+c.sep+m.aio.skinmanager.SkinManager.RESOURCE_FOLDER+c.sep+m.aio.skinmanager.SkinManager.CUSTOM_IN_REMOTE_WIDGET_FOLDER,g.widgetType,g.widgetName,g.resourcePath);f.exists(e,function(a){a?b&&b(null,e):b&&b(Error("no such resource"))})}}.bind(this)):b&&b(Error("no such resource"))},deleteResourceByURL:function(a,b){var e=require("path"),d=require("fs");a=m.aio.skinmanager.Url.resolve(a);if(a instanceof m.aio.skinmanager.LocalCustomWidgetUrl){var c=