From 16b59383ee650529fb90dfaa0b80a05e4de19b9c Mon Sep 17 00:00:00 2001 From: bellord13 Date: Wed, 26 Jun 2024 05:53:08 +0300 Subject: [PATCH] fix --- assets/core/core.js | 4 ++ assets/core/core.min.js | 2 +- assets/core/core.plugins.config.js | 51 ++++++++++++++++---------- assets/core/core.plugins.config.min.js | 2 +- 4 files changed, 37 insertions(+), 22 deletions(-) diff --git a/assets/core/core.js b/assets/core/core.js index 83a0983..54080e6 100644 --- a/assets/core/core.js +++ b/assets/core/core.js @@ -824,12 +824,16 @@ kit.config = kit.config || {}; * @param {function} callback * @memberOf kit */ + PluginManager.prototype.ready = function(deps, callback = undefined) { var self = this; if(typeof deps === 'function') { callback = deps; deps = []; } + if(typeof callback !== 'function') { + callback = function (){}; + } self.__ready(self.exec, [deps, callback], self); }; PluginManager.prototype.__ready = function(fn, args = [], context = window) { diff --git a/assets/core/core.min.js b/assets/core/core.min.js index b42c0ac..2a90506 100644 --- a/assets/core/core.min.js +++ b/assets/core/core.min.js @@ -1 +1 @@ -window.kit=window.kit||{},kit.service=kit.service||{},kit.config=kit.config||{},function(global){var defaultConfig={version:"2.0",assetsPath:"",requiredDependencies:[],autoloadPluginList:[],debug:!0},stateList={undefined:0,registered:1,loading:3,loaded:4,installing:5,installed:6},MD_TYPE={ES:"ES",UMD:"UMD",HMD:"HMD",default:"default"};function Plugin(e,t={}){this.id=e,this.state=stateList.undefined,this.state2=stateList.undefined,this.module={code:"",exports:{}},this.config={autoRequire:!1,loadJsAfterModule:!1,isSetTimestamp:!0,path:"",module:"",type:"default",handler:void 0,onRegister:function(e){},onLoad:function(e){},onInstall:function(e){},js:[],css:[],alias:[],deps:[],debug:!1},this.pluginManager=void 0,this.promise=new Promise((function(e,t){e()})),this.errors=[],this.register(t)}function isAssetLoaded(e){return e=e.match(/^[^#?]*/)[0],document.querySelector('script[src^="'+e+'"]')||document.querySelector('link[href^="'+e+'"]')||document.querySelector('meta[property="kit:file-load"][content="'+e+'"]')}function getUrlWithTimestamp(e){try{var t=new URL(e);t.searchParams.append("__pm",(new Date).getTime()),e=t.toString()}catch(t){e=(e=String(e).split("?")[0])+"?__pm"+(new Date).getTime()}return e}Plugin.prototype.setPluginManager=function(e){this.pluginManager=e},Plugin.prototype.queuePush=function(e,t=[]){"function"==typeof e&&(this.promise=this.promise.then((function(n){var i=e.apply(this,t);if(i)return i})))},Plugin.prototype.__queue=function(e,t,n=[],i=void 0){var o=this;void 0===i&&(i=o),o.__checkState(e)?t.apply(i,n):o.promise=o.promise.then(function(){return new Promise((function(e,o){t.apply(i,n),e()}))}.bind(o))},Plugin.prototype.__exec=function(e,t,n=[],i=void 0){var o=this;void 0===i&&(i=o),o.__checkState(e)?t.apply(i,n):o.promise=o.promise.then(function(){t.apply(i,n)}.bind(o))},Plugin.prototype.__checkState=function(e,t=void 0){return void 0===t?this.state>=e:this.state>=e&&this.state<=t},Plugin.prototype.__check2State=function(e,t=void 0){return void 0===t?this.state2>=e:this.state2>=e&&this.state2<=t},Plugin.prototype.__getValidConfig=function(e={}){var t=Object.assign({},e);return"function"!=typeof t.onLoad&&(t.onLoad=function(e){}),"function"!=typeof t.onInstall&&(t.onInstall=function(e){}),"function"!=typeof t.onRegister&&(t.onRegister=function(e){}),"string"!=typeof t.path&&(t.path=""),"string"==typeof t.js?t.js=[t.js]:Array.isArray(t.js)||(t.js=[]),"string"==typeof t.css?t.css=[t.css]:Array.isArray(t.css)||(t.css=[]),"string"==typeof t.alias?t.alias=[t.alias]:Array.isArray(t.alias)||(t.alias=[]),t.autoRequire=!!t.hasOwnProperty("autoRequire")&&!!t.autoRequire,t.loadJsAfterModule=!!t.hasOwnProperty("loadJsAfterModule")&&!!t.loadJsAfterModule,t.isSetTimestamp=!t.hasOwnProperty("isSetTimestamp")||!!t.isSetTimestamp,t.type=t.type||"default","string"==typeof t.deps?t.deps=[t.deps]:Array.isArray(t.deps)||(t.deps=[]),t},Plugin.prototype.__setState=function(e,t=!1){var n=this;(t||n.__checkState(e))&&(n.state=e)},Plugin.prototype.register=function(e={}){var t,n=this,i=n.id;if(this.__checkState(stateList.installed))throw new Error("Plugin "+i+" уже невозможно конфигурировать ("+n.state+"/"+n.state2+")");if("function"==typeof e)t=e,(e=this.config).handler=t,e.type=MD_TYPE.HMD;else{if(this.__checkState(stateList.loaded)||this.__check2State(stateList.loading))throw new Error("Plugin "+i+" уже невозможно конфигурировать ("+n.state+")");if("object"!=typeof e)throw new Error("Plugin.register: plugin "+i+" is not a valid format");e=this.__getValidConfig(e),Object.assign(this.config,e)}if(!this.__checkState(stateList.registered)){n.config.debug&&console.log(`Plugin ${n.id}: onRegister + event.`),this.state=stateList.registered,this.config.onRegister(this);var o=new CustomEvent("onRegister"+this.id+"Plugin",{detail:{plugin:this}});document.dispatchEvent(o)}e.autoRequire},Plugin.prototype.load=function(e){var t=this;"function"!=typeof e&&(e=function(){});var n=t.id;if(!t.__checkState(stateList.registered))return console.warn(`Plugin.load(${n}): is not register!.`),t;if(t.__checkState(stateList.loaded))return e(),t;if(t.__check2State(stateList.loading))return t.__exec(stateList.loaded,e),t;t.state2=stateList.loading;var i,o=t.config;o.css.forEach((function(e,n,i){t.getStylePromise(o.path+e)})),t.pluginManager&&(i=t.pluginManager.__getDepsPromiseCallback(t.config.deps),t.queuePush(i));var r,s=(r=o.path+o.module,"string"==typeof o.module&&""!==o.module&&"ES"===o.type?function(){return t.getESModulePromise(r).then(function(e){e.__esModule=!0,t.module.exports=e}.bind(t))}:"string"==typeof o.module&&""!==o.module&&"UMD"===o.type?isAssetLoaded(r)?void(t.config.debug&&console.warn(`Plugin ${t.id}: Скрипт ${r} уже загружен!`)):function(){return t.httpGet(r).then(function(e){t.module.code=e}.bind(t))}:"HMD"!==o.type||o.hasOwnProperty("handler")&&"function"==typeof o.handler?"string"==typeof o.module&&""!==o.module&&"default"===o.type?isAssetLoaded(r)?void(t.config.debug&&console.warn(`Plugin ${t.id}: Скрипт ${r} уже загружен!`)):function(){return t.getScriptPromise(r)}:void 0:function(){return t.getScriptPromise(r)}),l=t.getJsAssetsPromiseCallback(o.js);return o.loadJsAfterModule?(t.queuePush(s),t.queuePush(l)):(t.queuePush(l),t.queuePush(s)),i||s||l||(t.state=stateList.loaded),t.__queue(stateList.loaded,(function(){t.config.debug&&console.log(`Plugin ${t.id}: onLoad + event.`),t.isLoaded()||(t.state=stateList.loaded),o.onLoad.call(t,t);var e=new CustomEvent("onLoad"+t.id+"Plugin",{detail:{plugin:t}});document.dispatchEvent(e)})),t.__exec(stateList.loaded,function(){e()}.bind(t)),t},Plugin.prototype.install=function(callback){var self=this,global=self.pluginManager.global,require=self.pluginManager.require.bind(self.pluginManager);"function"!=typeof callback&&(callback=function(){});var pluginId=self.id;if(!self.__checkState(stateList.registered))return console.warn(`Plugin ${pluginId}: is not register!`),self;if(self.__checkState(stateList.installed))return callback(),self;if(self.__check2State(stateList.installing))return self.__exec(stateList.installed,callback),self;self.__checkState(stateList.loaded)||this.load(),self.state2=stateList.installing;var setGlobals=function(e,t){if(void 0!==t){var n=self.id,i=self.config.alias;e.hasOwnProperty(n)||(e[n]=t),Array.isArray(i)&&i.length&&i.forEach((function(n){e.hasOwnProperty(n)||(e[n]=t)}))}},module=self.module,installer=function(){var __exports=void 0;"ES"===self.config.type&&"string"==typeof self.config.module&&""!==self.config.module?__exports="object"==typeof self.module.exports&&void 0!==self.module.exports.default?self.module.exports.default:self.module.exports:"UMD"===self.config.type&&"string"==typeof self.config.module&&""!==self.config.module?(function(require,exports,module,global){var self=global;eval(module.code)}.bind(global).call(global,require,self.module.exports,module,global),__exports="object"==typeof self.module.exports&&void 0!==self.module.exports.default?self.module.exports.default:self.module.exports):"HMD"===self.config.type&&"function"==typeof self.config.handler&&(__exports=self.config.handler.bind(global).call(global,require,self.module.exports,module,global),void 0===__exports&&self.module.exports&&(__exports=self.module.exports)),"object"==typeof global&&setGlobals(global,__exports),self.state=stateList.installed,console.log(`%cPlugin ${pluginId}: installed.`,"color: green;"),self.config.onInstall.call(self,self);var event=new CustomEvent("onInstall"+self.id+"Plugin",{detail:{plugin:self}});return document.dispatchEvent(event),!0}.bind(this);return this.__queue(stateList.loaded,installer),this.__exec(stateList.loaded,(function(){callback()})),self},Plugin.prototype.exec=function(e,t=[],n=void 0){var i=this;void 0===n&&(n=i),i.__checkState(stateList.installed)||(i.load(),i.install()),i.__exec(stateList.installed,e,t,n)},Plugin.prototype.getESModulePromise=function(e){var t=this;return new Promise((function(n,i){import(e).then((function(e){n(e)}),(function(e){t.errors.push(e),console.log(`%cPlugin ${t.id}: error import module!`,"color: red;"),i(e)}))}))},Plugin.prototype.httpGet=function(e){var t=this;return new Promise((function(n,i){t.config.debug&&console.log(`Plugin ${t.id}: httpGet ${e}`);var o=new XMLHttpRequest;o.open("GET",e,!0),o.onload=function(){if(200==this.status)n(this.response);else{console.log(`%cPlugin.load(${t.id}): error load file!`,"color: red;");var e=new Error(this.statusText);e.code=this.status,i(e)}},o.onerror=function(){console.log(`%cPlugin.load(${t.id}): error load file!`,"color: red;"),i(new Error("Network Error"))},o.send()}))},Plugin.prototype.getScriptPromise=function(e){var t=this;if(!isAssetLoaded(e))return new Promise((function(n,i){t.config.debug&&console.log(`Plugin ${t.id}: load script ${e}`);var o=document.createElement("script");o.src=e,t.config.isSetTimestamp&&(o.src=getUrlWithTimestamp(e)),o.onload=function(){n(o)},o.onerror=function(){var n=new Error(`Ошибка загрузки скрипта ${e}`);t.errors.push(n),console.log(`%cPlugin.load(${t.id}): error load script!`,"color: red;"),i(n)},document.head.append(o)}));t.config.debug&&console.warn(`Plugin ${t.id}: Скрипт ${e} уже загружен!`)},Plugin.prototype.getStylePromise=function(e){var t=this;return new Promise((function(n,i){if(isAssetLoaded(e))t.config.debug&&console.warn(`Plugin ${t.id}: Стиль ${e} уже загружен`),n();else{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.media="all",o.href=e,t.config.isSetTimestamp&&(o.href=getUrlWithTimestamp(e)),document.head.append(o),n(o)}}))},Plugin.prototype.getAsyncScriptListPromise=function(e){var t=e.map(this.getScriptPromise.bind(this)).filter((e=>void 0!==e));if(t.length)return Promise.all(t)},Plugin.prototype.getJsAssetsPromiseCallback=function(e=[]){var t=this;if(e.length)return function(){var n=new Promise((function(e,t){e()}));return e.forEach((function(e,i,o){n=Array.isArray(e)?n.then((function(){return t.getAsyncScriptListPromise(e)})):n.then((function(){return t.getScriptPromise(t.config.path+e)}))})),n}},Plugin.prototype.__getRealId=function(e){var t,n=this,i=e.toLowerCase();if(n.id.toLowerCase()===i)return n.id;for(t of n.config.alias)if(i===t.toLowerCase())return n.id},Plugin.prototype.__is=function(e){return this.id===this.__getRealId(e)},Plugin.prototype.isLoaded=function(){return this.__checkState(stateList.loaded)},Plugin.prototype.isInstalled=function(){return this.__checkState(stateList.installed)},Plugin.prototype.require=function(){var e=this;return e.isInstalled()||e.config.debug&&console.warn(`Plugin ${e.id}: not instaled!`),e.module.exports};var PluginManager=function(e){this.plugins={},this.global=e};function init(e){var t=new PluginManager(e);e.ready=t.ready.bind(t),e.exec=t.exec.bind(t),e.require=t.require.bind(t),t.register("pluginManager",{alias:"pm",type:MD_TYPE.HMD,handler:function(e,n,i,o){return o.PluginManagerClass=PluginManager,"object"==typeof window&&(window.__PluginManager__=t,window.__pmGlobal__=o),i.exports=t},onInstall:function(e){}}),t.install("pluginManager"),t.register("config",{type:MD_TYPE.HMD,handler:function(e,t,n,i){var o=document.currentScript;if(o)try{var r=new URL(o.src);defaultConfig.assetsPath=r.pathname.split("/").slice(0,-2).join("/")}catch(e){var s=o.src.split("?")[0];defaultConfig.assetsPath=s.split("/").slice(0,-2).join("/")}var l=i.config||{};l=Object.assign({},defaultConfig,l),"object"==typeof window&&(window.__pmConfig__=i.config=l),document.addEventListener("DOMContentLoaded",(function(){console.log("%cDOMContentLoaded","color:#2053ff")}))},onInstall:function(e){"object"==typeof window&&window.hasOwnProperty("__PluginManagerConfigHandler__")&&"function"==typeof __PluginManagerConfigHandler__&&t.registerPlugins(__PluginManagerConfigHandler__())}}),t.install("config")}PluginManager.prototype.registerPlugins=function(e){for(var t in e)e.hasOwnProperty(t)&&this.register(t,e[t]);return this},PluginManager.prototype.register=function(e,t={}){if("string"==typeof e&&""!==e){var n=this.__getPlugin(e);n?n.register(t):((n=new Plugin(e,t)).setPluginManager(this),this.plugins[e]=n)}else console.warn("Invalid pluginId!",e)},PluginManager.prototype.__getPlugin=function(e){var t,n,i=this;for(t in i.plugins)if(i.plugins.hasOwnProperty(t)&&(n=i.plugins[t]).__is(e))return n},PluginManager.prototype.__getDepsPromiseCallback=function(e=[]){var t=this,n=e.map((function(e){var n=t.__getPlugin(e);if(n){if(n.install(),n.isInstalled())return;return n.promise}console.log(`%cPluginManager: plugin ${e} not found!`,"color: red;")})).filter((e=>void 0!==e));if(n.length)return function(){return Promise.all(n)}},PluginManager.prototype.__getRealIdList=function(e=[]){var t=this;return e.map((function(e){var n=t.__getPlugin(e);if(n)return n.id}))},PluginManager.prototype.exec=function(e,t,n=[],i=void 0){if("function"==typeof e&&(i=n,n=t,t=e,e=[]),"string"==typeof e&&(e=[e]),void 0===i&&(i=this),void 0===n&&(n=[]),"function"==typeof t){global.config&&global.config.requiredDependencies&&(e=Array.from(new Set(e.concat(global.config.requiredDependencies))));var o=this.__getDepsPromiseCallback(e);o?o().then((function(){t.apply(i,n)})):t.apply(i,n)}},PluginManager.prototype.exec2=function(e,t){var n=this,i=this,o=n.__getDepsPromiseCallback(e),r=function(){var t=[];return e.forEach(function(e){n.__getPlugin(e)?t.push(n.require(e)):t.push(void 0)}.bind(n)),t}.bind(n);o?o().then((function(){t.apply(i,r())})):t.apply(i,r())},PluginManager.prototype.ready=function(e,t=void 0){var n=this;"function"==typeof e&&(t=e,e=[]),n.__ready(n.exec,[e,t],n)},PluginManager.prototype.__ready=function(e,t=[],n=window){n=n||this,/complete|interactive|loaded/.test(document.readyState)?e.apply(n,t):document.addEventListener("DOMContentLoaded",function(){e.apply(n,t)}.bind(this))},PluginManager.prototype.require=function(e,t){var n=this.__getPlugin(e);if(n){e=n.id;var i=n.module;return"function"!=typeof t&&(t=function(){}),n.install(t),i.exports}console.warn("PluginManager.require: plugin "+e+" not found!")},PluginManager.prototype.install=function(e,t){var n=this.__getPlugin(e);if(n){e=n.id;n.module;n.install(t)}else console.warn("PluginManager.install: plugin "+e+" not found!")},init(global)}(kit); \ No newline at end of file +window.kit=window.kit||{},kit.service=kit.service||{},kit.config=kit.config||{},!function(global){var defaultConfig={version:"2.0",assetsPath:"",requiredDependencies:[],autoloadPluginList:[],debug:!0},stateList={undefined:0,registered:1,loading:3,loaded:4,installing:5,installed:6},MD_TYPE={ES:"ES",UMD:"UMD",HMD:"HMD",default:"default"};function Plugin(e,t={}){this.id=e,this.state=stateList.undefined,this.state2=stateList.undefined,this.module={code:"",exports:{}},this.config={autoRequire:!1,loadJsAfterModule:!1,isSetTimestamp:!0,path:"",module:"",type:"default",handler:void 0,onRegister:function(e){},onLoad:function(e){},onInstall:function(e){},js:[],css:[],alias:[],deps:[],debug:!1},this.pluginManager=void 0,this.promise=new Promise(function(e,t){e()}),this.errors=[],this.register(t)}function isAssetLoaded(e){return e=e.match(/^[^#?]*/)[0],document.querySelector('script[src^="'+e+'"]')||document.querySelector('link[href^="'+e+'"]')||document.querySelector('meta[property="kit:file-load"][content="'+e+'"]')}function getUrlWithTimestamp(t){try{var e=new URL(t);e.searchParams.append("__pm",(new Date).getTime()),t=e.toString()}catch(e){t=(t=String(t).split("?")[0])+"?__pm"+(new Date).getTime()}return t}Plugin.prototype.setPluginManager=function(e){this.pluginManager=e},Plugin.prototype.queuePush=function(n,i=[]){"function"==typeof n&&(this.promise=this.promise.then(function(e){var t=n.apply(this,i);if(t)return t}))},Plugin.prototype.__queue=function(e,n,i=[],o=void 0){var t=this;void 0===o&&(o=t),t.__checkState(e)?n.apply(o,i):t.promise=t.promise.then(function(){return new Promise(function(e,t){n.apply(o,i),e()})}.bind(t))},Plugin.prototype.__exec=function(e,t,n=[],i=void 0){var o=this;void 0===i&&(i=o),o.__checkState(e)?t.apply(i,n):o.promise=o.promise.then(function(){t.apply(i,n)}.bind(o))},Plugin.prototype.__checkState=function(e,t=void 0){return void 0===t?this.state>=e:this.state>=e&&this.state<=t},Plugin.prototype.__check2State=function(e,t=void 0){return void 0===t?this.state2>=e:this.state2>=e&&this.state2<=t},Plugin.prototype.__getValidConfig=function(e={}){e=Object.assign({},e);return"function"!=typeof e.onLoad&&(e.onLoad=function(e){}),"function"!=typeof e.onInstall&&(e.onInstall=function(e){}),"function"!=typeof e.onRegister&&(e.onRegister=function(e){}),"string"!=typeof e.path&&(e.path=""),"string"==typeof e.js?e.js=[e.js]:Array.isArray(e.js)||(e.js=[]),"string"==typeof e.css?e.css=[e.css]:Array.isArray(e.css)||(e.css=[]),"string"==typeof e.alias?e.alias=[e.alias]:Array.isArray(e.alias)||(e.alias=[]),e.autoRequire=!!e.hasOwnProperty("autoRequire")&&!!e.autoRequire,e.loadJsAfterModule=!!e.hasOwnProperty("loadJsAfterModule")&&!!e.loadJsAfterModule,e.isSetTimestamp=!e.hasOwnProperty("isSetTimestamp")||!!e.isSetTimestamp,e.type=e.type||"default","string"==typeof e.deps?e.deps=[e.deps]:Array.isArray(e.deps)||(e.deps=[]),e},Plugin.prototype.__setState=function(e,t=!1){var n=this;(t||n.__checkState(e))&&(n.state=e)},Plugin.prototype.register=function(e={}){var t,n=this,i=n.id;if(this.__checkState(stateList.installed))throw new Error("Plugin "+i+" уже невозможно конфигурировать ("+n.state+"/"+n.state2+")");if("function"==typeof e)t=e,(e=this.config).handler=t,e.type=MD_TYPE.HMD;else{if(this.__checkState(stateList.loaded)||this.__check2State(stateList.loading))throw new Error("Plugin "+i+" уже невозможно конфигурировать ("+n.state+")");if("object"!=typeof e)throw new Error("Plugin.register: plugin "+i+" is not a valid format");e=this.__getValidConfig(e),Object.assign(this.config,e)}this.__checkState(stateList.registered)||(n.config.debug&&console.log(`Plugin ${n.id}: onRegister + event.`),this.state=stateList.registered,this.config.onRegister(this),t=new CustomEvent("onRegister"+this.id+"Plugin",{detail:{plugin:this}}),document.dispatchEvent(t)),e.autoRequire},Plugin.prototype.load=function(e){var i,t,n,o,s,r=this,l=("function"!=typeof e&&(e=function(){}),r.id);return r.__checkState(stateList.registered)?r.__checkState(stateList.loaded)?e():r.__check2State(stateList.loading)?r.__exec(stateList.loaded,e):(r.state2=stateList.loading,(i=r.config).css.forEach(function(e,t,n){r.getStylePromise(i.path+e)}),r.pluginManager&&(t=r.pluginManager.__getDepsPromiseCallback(r.config.deps),r.queuePush(t)),o=i.path+i.module,n="string"==typeof i.module&&""!==i.module&&"ES"===i.type?function(){return r.getESModulePromise(o).then(function(e){e.__esModule=!0,r.module.exports=e}.bind(r))}:"string"==typeof i.module&&""!==i.module&&"UMD"===i.type?isAssetLoaded(o)?void(r.config.debug&&console.warn(`Plugin ${r.id}: Скрипт ${o} уже загружен!`)):function(){return r.httpGet(o).then(function(e){r.module.code=e}.bind(r))}:"HMD"!==i.type||i.hasOwnProperty("handler")&&"function"==typeof i.handler?"string"==typeof i.module&&""!==i.module&&"default"===i.type?isAssetLoaded(o)?void(r.config.debug&&console.warn(`Plugin ${r.id}: Скрипт ${o} уже загружен!`)):function(){return r.getScriptPromise(o)}:void 0:function(){return r.getScriptPromise(o)},s=r.getJsAssetsPromiseCallback(i.js),i.loadJsAfterModule?(r.queuePush(n),r.queuePush(s)):(r.queuePush(s),r.queuePush(n)),t||n||s||(r.state=stateList.loaded),r.__queue(stateList.loaded,function(){r.config.debug&&console.log(`Plugin ${r.id}: onLoad + event.`),r.isLoaded()||(r.state=stateList.loaded),i.onLoad.call(r,r);var e=new CustomEvent("onLoad"+r.id+"Plugin",{detail:{plugin:r}});document.dispatchEvent(e)}),r.__exec(stateList.loaded,function(){e()}.bind(r))):console.warn(`Plugin.load(${l}): is not register!.`),r},Plugin.prototype.install=function(callback){var self=this,global=self.pluginManager.global,require=self.pluginManager.require.bind(self.pluginManager),pluginId=("function"!=typeof callback&&(callback=function(){}),self.id),setGlobals,module,installer;return self.__checkState(stateList.registered)?self.__checkState(stateList.installed)?callback():self.__check2State(stateList.installing)?self.__exec(stateList.installed,callback):(self.__checkState(stateList.loaded)||this.load(),self.state2=stateList.installing,setGlobals=function(t,n){var e,i;void 0!==n&&(e=self.id,i=self.config.alias,t.hasOwnProperty(e)||(t[e]=n),Array.isArray(i))&&i.length&&i.forEach(function(e){t.hasOwnProperty(e)||(t[e]=n)})},module=self.module,installer=function(){var __exports=void 0,event=("ES"===self.config.type&&"string"==typeof self.config.module&&""!==self.config.module?__exports="object"==typeof self.module.exports&&void 0!==self.module.exports.default?self.module.exports.default:self.module.exports:"UMD"===self.config.type&&"string"==typeof self.config.module&&""!==self.config.module?(function(require,exports,module,global){var self=global;eval(module.code)}.bind(global).call(global,require,self.module.exports,module,global),__exports="object"==typeof self.module.exports&&void 0!==self.module.exports.default?self.module.exports.default:self.module.exports):"HMD"===self.config.type&&"function"==typeof self.config.handler&&(__exports=self.config.handler.bind(global).call(global,require,self.module.exports,module,global),void 0===__exports)&&self.module.exports&&(__exports=self.module.exports),"object"==typeof global&&setGlobals(global,__exports),self.state=stateList.installed,console.log(`%cPlugin ${pluginId}: installed.`,"color: green;"),self.config.onInstall.call(self,self),new CustomEvent("onInstall"+self.id+"Plugin",{detail:{plugin:self}}));return document.dispatchEvent(event),!0}.bind(this),this.__queue(stateList.loaded,installer),this.__exec(stateList.loaded,function(){callback()})):console.warn(`Plugin ${pluginId}: is not register!`),self},Plugin.prototype.exec=function(e,t=[],n=void 0){var i=this;void 0===n&&(n=i),i.__checkState(stateList.installed)||(i.load(),i.install()),i.__exec(stateList.installed,e,t,n)},Plugin.prototype.getESModulePromise=function(e){var i=this;return new Promise(function(t,n){import(e).then(function(e){t(e)},function(e){i.errors.push(e),console.log(`%cPlugin ${i.id}: error import module!`,"color: red;"),n(e)})})},Plugin.prototype.httpGet=function(i){var o=this;return new Promise(function(t,n){o.config.debug&&console.log(`Plugin ${o.id}: httpGet `+i);var e=new XMLHttpRequest;e.open("GET",i,!0),e.onload=function(){var e;200==this.status?t(this.response):(console.log(`%cPlugin.load(${o.id}): error load file!`,"color: red;"),(e=new Error(this.statusText)).code=this.status,n(e))},e.onerror=function(){console.log(`%cPlugin.load(${o.id}): error load file!`,"color: red;"),n(new Error("Network Error"))},e.send()})},Plugin.prototype.getScriptPromise=function(i){var o=this;if(!isAssetLoaded(i))return new Promise(function(e,t){o.config.debug&&console.log(`Plugin ${o.id}: load script `+i);var n=document.createElement("script");n.src=i,o.config.isSetTimestamp&&(n.src=getUrlWithTimestamp(i)),n.onload=function(){e(n)},n.onerror=function(){var e=new Error("Ошибка загрузки скрипта "+i);o.errors.push(e),console.log(`%cPlugin.load(${o.id}): error load script!`,"color: red;"),t(e)},document.head.append(n)});o.config.debug&&console.warn(`Plugin ${o.id}: Скрипт ${i} уже загружен!`)},Plugin.prototype.getStylePromise=function(i){var o=this;return new Promise(function(e,t){var n;isAssetLoaded(i)?(o.config.debug&&console.warn(`Plugin ${o.id}: Стиль ${i} уже загружен`),e()):((n=document.createElement("link")).rel="stylesheet",n.type="text/css",n.media="all",n.href=i,o.config.isSetTimestamp&&(n.href=getUrlWithTimestamp(i)),document.head.append(n),e(n))})},Plugin.prototype.getAsyncScriptListPromise=function(e){e=e.map(this.getScriptPromise.bind(this)).filter(e=>void 0!==e);if(e.length)return Promise.all(e)},Plugin.prototype.getJsAssetsPromiseCallback=function(e=[]){var o=this;if(e.length)return function(){var i=new Promise(function(e,t){e()});return e.forEach(function(e,t,n){i=Array.isArray(e)?i.then(function(){return o.getAsyncScriptListPromise(e)}):i.then(function(){return o.getScriptPromise(o.config.path+e)})}),i}},Plugin.prototype.__getRealId=function(e){var t,n=e.toLowerCase();if(this.id.toLowerCase()===n)return this.id;for(t of this.config.alias)if(n===t.toLowerCase())return this.id},Plugin.prototype.__is=function(e){return this.id===this.__getRealId(e)},Plugin.prototype.isLoaded=function(){return this.__checkState(stateList.loaded)},Plugin.prototype.isInstalled=function(){return this.__checkState(stateList.installed)},Plugin.prototype.require=function(){return this.isInstalled()||this.config.debug&&console.warn(`Plugin ${this.id}: not instaled!`),this.module.exports};var PluginManager=function(e){this.plugins={},this.global=e};function init(e){var o=new PluginManager(e);e.ready=o.ready.bind(o),e.exec=o.exec.bind(o),e.require=o.require.bind(o),o.register("pluginManager",{alias:"pm",type:MD_TYPE.HMD,handler:function(e,t,n,i){return i.PluginManagerClass=PluginManager,"object"==typeof window&&(window.__PluginManager__=o,window.__pmGlobal__=i),n.exports=o},onInstall:function(e){}}),o.install("pluginManager"),o.register("config",{type:MD_TYPE.HMD,handler:function(e,t,n,i){var o=document.currentScript;if(o)try{var s=new URL(o.src);defaultConfig.assetsPath=s.pathname.split("/").slice(0,-2).join("/")}catch(e){s=o.src.split("?")[0];defaultConfig.assetsPath=s.split("/").slice(0,-2).join("/")}o=i.config||{},o=Object.assign({},defaultConfig,o);"object"==typeof window&&(window.__pmConfig__=i.config=o),document.addEventListener("DOMContentLoaded",function(){console.log("%cDOMContentLoaded","color:#2053ff")})},onInstall:function(e){"object"==typeof window&&window.hasOwnProperty("__PluginManagerConfigHandler__")&&"function"==typeof __PluginManagerConfigHandler__&&o.registerPlugins(__PluginManagerConfigHandler__())}}),o.install("config")}PluginManager.prototype.registerPlugins=function(e){for(var t in e)e.hasOwnProperty(t)&&this.register(t,e[t]);return this},PluginManager.prototype.register=function(e,t={}){var n;"string"!=typeof e||""===e?console.warn("Invalid pluginId!",e):(n=this.__getPlugin(e))?n.register(t):((n=new Plugin(e,t)).setPluginManager(this),this.plugins[e]=n)},PluginManager.prototype.__getPlugin=function(e){var t,n;for(t in this.plugins)if(this.plugins.hasOwnProperty(t)&&(n=this.plugins[t]).__is(e))return n},PluginManager.prototype.__getDepsPromiseCallback=function(e=[]){var n=this,t=e.map(function(e){var t=n.__getPlugin(e);if(t)return t.install(),t.isInstalled()?void 0:t.promise;console.log(`%cPluginManager: plugin ${e} not found!`,"color: red;")}).filter(e=>void 0!==e);if(t.length)return function(){return Promise.all(t)}},PluginManager.prototype.__getRealIdList=function(e=[]){var t=this;return e.map(function(e){e=t.__getPlugin(e);if(e)return e.id})},PluginManager.prototype.exec=function(e,t,n=[],i=void 0){"function"==typeof e&&(i=n,n=t,t=e,e=[]),"string"==typeof e&&(e=[e]),void 0===i&&(i=this),void 0===n&&(n=[]),"function"==typeof t&&(global.config&&global.config.requiredDependencies&&(e=Array.from(new Set(e.concat(global.config.requiredDependencies)))),(e=this.__getDepsPromiseCallback(e))?e().then(function(){t.apply(i,n)}):t.apply(i,n))},PluginManager.prototype.exec2=function(e,t){var n=this,i=this,o=n.__getDepsPromiseCallback(e),s=function(){var t=[];return e.forEach(function(e){n.__getPlugin(e)?t.push(n.require(e)):t.push(void 0)}.bind(n)),t}.bind(n);o?o().then(function(){t.apply(i,s())}):t.apply(i,s())},PluginManager.prototype.ready=function(e,t=void 0){"function"==typeof e&&(t=e,e=[]),this.__ready(this.exec,[e,t="function"!=typeof t?function(){}:t],this)},PluginManager.prototype.__ready=function(e,t=[],n=window){n=n||this,/complete|interactive|loaded/.test(document.readyState)?e.apply(n,t):document.addEventListener("DOMContentLoaded",function(){e.apply(n,t)}.bind(this))},PluginManager.prototype.require=function(e,t){var n,i=this.__getPlugin(e);if(i)return e=i.id,n=i.module,i.install(t="function"!=typeof t?function(){}:t),n.exports;console.warn("PluginManager.require: plugin "+e+" not found!")},PluginManager.prototype.install=function(e,t){var n=this.__getPlugin(e);n?(e=n.id,n.module,n.install(t)):console.warn("PluginManager.install: plugin "+e+" not found!")},init(global)}(kit); \ No newline at end of file diff --git a/assets/core/core.plugins.config.js b/assets/core/core.plugins.config.js index d3b7152..35dc6aa 100644 --- a/assets/core/core.plugins.config.js +++ b/assets/core/core.plugins.config.js @@ -30,30 +30,41 @@ var __PluginManagerConfigHandler__ = function() { module: '/support.min.js', type: 'HMD', }, - jqueryIniter: { + jqueryProxy: { type: 'HMD', handler: function(require, exports, module, global){ - var J = function (){ + init = function(c, prop = '$', args = []){ + c.push([prop, args]); + + return new Proxy({}, { + get(target, prop) { + return function(){ + return init(c, prop, arguments) + } + } + }); + }; + var J = function(){ + if(!J.init){ + J.init = false; + __PluginManager__.ready('jquery'); + } var c = []; J.queue.push(c); - c.push(['$', arguments]); - var J2 = function(){} - J2.ready = function (){ - c.push(['ready', arguments]); - } - return J2 + return init(c, '$', arguments); } J.queue = []; + J.init = false; - function JQueryIniter(){} - JQueryIniter.prototype.J = J; - JQueryIniter.prototype.hasJQuery = function(){ + function JQueryProxy(){} + JQueryProxy.prototype.J = J; + JQueryProxy.prototype.hasJQuery = function(){ return window.hasOwnProperty('jQuery') && window.jQuery.hasOwnProperty('fn'); }; - JQueryIniter.prototype.hasJQueryIniter = function(){ + JQueryProxy.prototype.hasJQueryIniter = function(){ return window.hasOwnProperty('jQuery') && Object.is(window.jQuery, J); }; - JQueryIniter.prototype.onRegister = function(plugin){ + JQueryProxy.prototype.onJQueryRegister = function(plugin){ if(!this.hasJQuery()){ (function(w){ w.$ = w.jQuery = J; @@ -61,7 +72,7 @@ var __PluginManagerConfigHandler__ = function() { })(window); } }; - JQueryIniter.prototype.onInstall = function(plugin){ + JQueryProxy.prototype.onJQueryInstall = function(plugin){ var self = this; (function(w){ var q = plugin.module.initer.queue; @@ -70,14 +81,14 @@ var __PluginManagerConfigHandler__ = function() { for (var ch of q){ var root = w; for (var c of ch){ - root = root[c[0]].apply(c[0], c[1]); + root = root[c[0]].apply(root, c[1]); } } } })(window); }; - module.exports = new JQueryIniter(); + module.exports = new JQueryProxy(); }, }, @@ -87,12 +98,12 @@ var __PluginManagerConfigHandler__ = function() { type: 'UMD', alias: ['$', 'jQuery'], onRegister: function (plugin) { - var initer = kit.require('jqueryIniter'); - initer.onRegister(plugin); + var proxy = kit.require('jqueryProxy'); + proxy.onJQueryRegister(plugin); }, onInstall: function(plugin){ - var initer = kit.require('jqueryIniter'); - initer.onInstall(plugin); + var proxy = kit.require('jqueryProxy'); + proxy.onJQueryInstall(plugin); }, }, popper: { diff --git a/assets/core/core.plugins.config.min.js b/assets/core/core.plugins.config.min.js index eeda8fe..6fd91b0 100644 --- a/assets/core/core.plugins.config.min.js +++ b/assets/core/core.plugins.config.min.js @@ -1 +1 @@ -var __PluginManagerConfigHandler__=function(){var e=__pmConfig__.assetsPath;return{menu:{path:e+"/menu",module:"/menu.js",css:["/menu.css"],type:"HMD",deps:["lib","align","dataStructures","animations","userAction","Collection","support","ActionCollection","Action","Viewer"]},lib:{path:e+"/lib",module:"/lib.js",type:"HMD"},align:{path:e+"/align",module:"/align.js",type:"HMD",deps:["support"]},flexKit:{path:e+"/flex-kit",css:"/flex-kit.css"},support:{path:e+"/support",module:"/support.js",type:"HMD"},jqueryIniter:{type:"HMD",handler:function(e,t,s,o){var l=function(){var e=[];l.queue.push(e),e.push(["$",arguments]);var t=function(){};return t.ready=function(){e.push(["ready",arguments])},t};function a(){}l.queue=[],a.prototype.J=l,a.prototype.hasJQuery=function(){return window.hasOwnProperty("jQuery")&&window.jQuery.hasOwnProperty("fn")},a.prototype.hasJQueryIniter=function(){return window.hasOwnProperty("jQuery")&&Object.is(window.jQuery,l)},a.prototype.onRegister=function(e){var t;this.hasJQuery()||((t=window).$=t.jQuery=l,e.module.initer=l)},a.prototype.onInstall=function(e){var t=this;!function(s){var o=e.module.initer.queue;if(t.hasJQueryIniter())for(var l of(s.$=s.jQuery=e.module.exports,o)){var a=s;for(var i of l)a=a[i[0]].apply(i[0],i[1])}}(window)},s.exports=new a}},jquery:{path:e+"/jquery",module:"/jquery.min.js",type:"UMD",alias:["$","jQuery"],onRegister:function(e){kit.require("jqueryIniter").onRegister(e)},onInstall:function(e){kit.require("jqueryIniter").onInstall(e)}},popper:{path:e+"/popper",alias:"popper.js",module:"/popper.js",type:"HMD",css:"/popper.css"},bsCore:{path:e+"/bsCore",module:"/bsCore.js",type:"HMD",css:["/bsCore.css"]},bsToast:{path:e+"/bsToast",module:"/bsToast.js",type:"HMD",deps:["bsCore"]},bsToastService:{path:e+"/bsToastService",module:"/bsToastService.js",type:"HMD",css:["/bsToastService.css"],deps:["bsToast","support","Collection"]},Tooltip:{path:e+"/tooltip",module:"/tooltip.js",type:"HMD",css:"/tooltip.css",onInstall:function(e){[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map((function(e){return __pmGlobal__.Tooltip.getOrCreateInstance(e,{sanitize:!1})}))},deps:["popper","bsCore"]},Tooltip2:{path:e+"/tooltip2",module:"/tooltip2.js",type:"HMD",css:"/tooltip2.css",onInstall:function(e){console.log("tt2 install"),document.addEventListener("mouseover",(function(e){if(e.target&&"autoload"===e.target.dataset.kitTooltip2&&!kit.support.getNodeData(e.target,"tooltip2")){var t=new __pmGlobal__.Tooltip2(e.target);t.run(),t.show()}}))},deps:["Viewer","support","ActionCollection","Action","userAction","align","Collection","animations"]},Popover:{path:e+"/popover",module:"/popover.js",type:"HMD",css:"/popover.css",onInstall:function(){[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map((function(e){return new __pmGlobal__.Popover(e)}))},deps:["popper","bsCore","Tooltip"]},mask:{path:e+"/mask",module:"/mask.js",type:"HMD",deps:["jQuery"]},toolkit:{path:e+"/toolkit",module:"/toolkit.js",type:"HMD",css:["/toolkit.css"],deps:["jQuery","mask","support"]},Modal:{path:e+"/modal",module:"/modal.js",type:"HMD",css:["/modal.css"],deps:["bsCore"],onRegister:function(e){e.onLoadConditionHandler=function(t){t.target&&t.target.dataset&&t.target.dataset.bsTarget&&"modal"===t.target.dataset.bsToggle&&kit.exec(e.id,(function(){var e=new Event("click");t.target.dispatchEvent(e)}))},window.addEventListener("click",e.onLoadConditionHandler,!1)},onInstall:function(e){e.onLoadConditionHandler&&window.removeEventListener("click",e.onLoadConditionHandler,!1)}},collapse:{path:e+"/collapse",module:"/collapse.js",type:"HMD",css:["/collapse.css"],deps:["bsCore"]},datepicker:{path:e+"/datepicker",module:"/js/datepicker.js",type:"HMD",css:["/css/datepicker.css"],deps:["jQuery"]},cookie:{path:e+"/cookie",module:"/cookie.js",type:"HMD"},animations:{path:e+"/animations",css:"/animations.css",module:"/animations.js",type:"HMD"},Collection:{path:e+"/collection",module:"/collection.js",type:"HMD",deps:["support"]},dataStructures:{path:e+"/dataStructures",module:"/dataStructures.js",type:"HMD"},userAction:{path:e+"/userAction",module:"/userAction.js",type:"HMD",deps:["support","ActionCollection","Action","Viewer"]},Viewer:{path:e+"/Viewer",module:"/Viewer.js",type:"HMD",deps:["Collection","support","ActionCollection","Action"]},ActionCollection:{path:e+"/ActionCollection",module:"/ActionCollection.js",type:"HMD",deps:["Collection","support","Action"]},Action:{path:e+"/Action",module:"/Action.js",type:"HMD",deps:["support"]},date:{path:e+"/date",module:"/date.js",type:"HMD",deps:[]},testing:{path:e+"/testing",module:"/testing.js",type:"module",deps:["log"]},log:{path:e+"/log",module:"/log.js",css:"/log.css",type:"HMD",deps:["support","Collection","lib"]},fancybox:{path:e+"/fancybox",css:"/fancybox.css",js:"/fancybox.umd.js"},lightGallery:{path:e+"/lightGallery",css:"/lightGallery.css",js:"/lightGallery.js",deps:["jQuery"]},owlCarousel:{path:e+"/owlCarousel",css:"/owlCarousel.css",js:"/owlCarousel.js",deps:["jQuery"]},Chosen:{path:e+"/chosen",css:"/chosen.css",js:"/chosen.jquery.js",deps:["jQuery"]},makeCSSAnimations:{path:e+"/makeCSSAnimations",js:"/makeCSSAnimations.js",deps:["jQuery","support"]},mCustomScrollbar:{path:e+"/mCustomScrollbar",alias:"malihu-custom-scrollbar-plugin",js:"/mCustomScrollbar.js",css:"/jquery.mCustomScrollbar.css",deps:["jQuery","jqueryMousewheel"],onInstall:function(e){e.module.exports(kit.require("jQuery"))}},jqueryMousewheel:{path:e+"/jqueryMousewheel",alias:"jquery-mousewheel",js:"/jquery.mousewheel.js",deps:["jQuery"],onInstall:function(e){e.module.exports(kit.require("jQuery"))}},jqueryLazy:{path:e+"/jquery-lazy",alias:"jquery-lazy",js:["/jquery.lazy.min.js","/jquery.lazy.plugins.min.js"],deps:["jQuery"]},slickCarousel:{path:e+"/slickCarousel",alias:["slick","slick-carousel"],js:"/slick.min.js",css:["/slick.css","/slick-theme.css"],deps:["jQuery"]},mustache:{path:e+"/mustache",alias:["mustache.js"],js:"/mustache.js",deps:[]},bxSlider:{path:e+"/bxSlider",module:"/jquery.bxslider.min.js",css:["/jquery.bxslider.min.css"],type:"default",deps:["jQuery"]},selectric:{path:e+"/selectric",module:"/jquery.selectric.min.js",css:["/selectric.css"],type:"UMD",alias:["jquerySelectric"],deps:["jQuery"]},jBox:{path:e+"/jBox",module:"/jBox.min.js",css:["/jBox.min.css"],type:"UMD",deps:["jQuery"]},intlTelInput:{path:e+"/intl-tel-input",module:"/js/intlTelInput.min.js",css:["/css/intlTelInput.min.css"],type:"UMD",alias:["intl-tel-input"]},autoComplete:{path:e+"/autoComplete",module:"/autoComplete.min.js",css:["/css/autoComplete.css"],type:"HMD"}}}; \ No newline at end of file +var __PluginManagerConfigHandler__=function(){var e=__pmConfig__.assetsPath;return{menu:{path:e+"/menu",module:"/menu.js",css:["/menu.css"],type:"HMD",deps:["lib","align","dataStructures","animations","userAction","Collection","support","ActionCollection","Action","Viewer"]},lib:{path:e+"/lib",module:"/lib.js",type:"HMD"},align:{path:e+"/align",module:"/align.js",type:"HMD",deps:["support"]},flexKit:{path:e+"/flex-kit",css:"/flex-kit.css"},support:{path:e+"/support",module:"/support.min.js",type:"HMD"},jqueryProxy:{type:"HMD",handler:function(e,t,s,o){init=function(s,e="$",t=[]){return s.push([e,t]),new Proxy({},{get(e,t){return function(){return init(s,t,arguments)}}})};var l=function(){l.init||(l.init=!1,__PluginManager__.ready("jquery"));var e=[];return l.queue.push(e),init(e,"$",arguments)};function i(){}l.queue=[],l.init=!1,i.prototype.J=l,i.prototype.hasJQuery=function(){return window.hasOwnProperty("jQuery")&&window.jQuery.hasOwnProperty("fn")},i.prototype.hasJQueryIniter=function(){return window.hasOwnProperty("jQuery")&&Object.is(window.jQuery,l)},i.prototype.onJQueryRegister=function(e){var t;this.hasJQuery()||((t=window).$=t.jQuery=l,e.module.initer=l)},i.prototype.onJQueryInstall=function(e){var t=window,s=e.module.initer.queue;if(this.hasJQueryIniter()){t.$=t.jQuery=e.module.exports;for(var o of s){var l,i=t;for(l of o)i=i[l[0]].apply(i,l[1])}}},s.exports=new i}},jquery:{path:e+"/jquery",module:"/jquery.min.js",type:"UMD",alias:["$","jQuery"],onRegister:function(e){kit.require("jqueryProxy").onJQueryRegister(e)},onInstall:function(e){kit.require("jqueryProxy").onJQueryInstall(e)}},popper:{path:e+"/popper",alias:"popper.js",module:"/popper.js",type:"HMD",css:"/popper.css"},bsCore:{path:e+"/bsCore",module:"/bsCore.min.js",type:"HMD",css:["/bsCore.css"]},bsToast:{path:e+"/bsToast",module:"/bsToast.js",type:"HMD",deps:["bsCore"]},bsToastService:{path:e+"/bsToastService",module:"/bsToastService.js",type:"HMD",css:["/bsToastService.css"],deps:["bsToast","support","Collection"]},Tooltip:{path:e+"/tooltip",module:"/tooltip.js",type:"HMD",css:"/tooltip.css",onInstall:function(e){[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(e){return __pmGlobal__.Tooltip.getOrCreateInstance(e,{sanitize:!1})})},deps:["popper","bsCore"]},Tooltip2:{path:e+"/tooltip2",module:"/tooltip2.js",type:"HMD",css:"/tooltip2.css",onInstall:function(e){console.log("tt2 install"),document.addEventListener("mouseover",function(e){e.target&&"autoload"===e.target.dataset.kitTooltip2&&!kit.support.getNodeData(e.target,"tooltip2")&&((e=new __pmGlobal__.Tooltip2(e.target)).run(),e.show())})},deps:["Viewer","support","ActionCollection","Action","userAction","align","Collection","animations"]},Popover:{path:e+"/popover",module:"/popover.js",type:"HMD",css:"/popover.css",onInstall:function(){[].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]')).map(function(e){return new __pmGlobal__.Popover(e)})},deps:["popper","bsCore","Tooltip"]},mask:{path:e+"/mask",module:"/mask.js",type:"HMD",deps:["jQuery"]},toolkit:{path:e+"/toolkit",module:"/toolkit.js",type:"HMD",css:["/toolkit.css"],deps:["jQuery","mask","support"]},Modal:{path:e+"/modal",module:"/modal.min.js",type:"HMD",css:["/modal.css"],deps:["bsCore"],onRegister:function(e){e.onLoadConditionHandler=function(t){t.target&&t.target.dataset&&t.target.dataset.bsTarget&&"modal"===t.target.dataset.bsToggle&&kit.exec(e.id,function(){var e=new Event("click");t.target.dispatchEvent(e)})},window.addEventListener("click",e.onLoadConditionHandler,!1)},onInstall:function(e){e.onLoadConditionHandler&&window.removeEventListener("click",e.onLoadConditionHandler,!1)}},collapse:{path:e+"/collapse",module:"/collapse.min.js",type:"HMD",css:["/collapse.css"],deps:["bsCore"]},datepicker:{path:e+"/datepicker",module:"/js/datepicker.js",type:"HMD",css:["/css/datepicker.css"],deps:["jQuery"]},cookie:{path:e+"/cookie",module:"/cookie.min.js",type:"HMD"},animations:{path:e+"/animations",css:"/animations.css",module:"/animations.js",type:"HMD"},Collection:{path:e+"/collection",module:"/collection.js",type:"HMD",deps:["support"]},dataStructures:{path:e+"/dataStructures",module:"/dataStructures.min.js",type:"HMD"},userAction:{path:e+"/userAction",module:"/userAction.js",type:"HMD",deps:["support","ActionCollection","Action","Viewer"]},Viewer:{path:e+"/Viewer",module:"/Viewer.js",type:"HMD",deps:["Collection","support","ActionCollection","Action"]},ActionCollection:{path:e+"/ActionCollection",module:"/ActionCollection.js",type:"HMD",deps:["Collection","support","Action"]},Action:{path:e+"/Action",module:"/Action.js",type:"HMD",deps:["support"]},date:{path:e+"/date",module:"/date.js",type:"HMD",deps:[]},testing:{path:e+"/testing",module:"/testing.js",type:"module",deps:["log"]},log:{path:e+"/log",module:"/log.js",css:"/log.css",type:"HMD",deps:["support","Collection","lib"]},fancybox:{path:e+"/fancybox",css:"/fancybox.css",js:"/fancybox.umd.js"},lightGallery:{path:e+"/lightGallery",css:"/lightGallery.css",js:"/lightGallery.js",deps:["jQuery"]},owlCarousel:{path:e+"/owlCarousel",css:"/owlCarousel.css",js:"/owlCarousel.js",deps:["jQuery"]},Chosen:{path:e+"/chosen",css:"/chosen.css",js:"/chosen.jquery.js",deps:["jQuery"]},makeCSSAnimations:{path:e+"/makeCSSAnimations",js:"/makeCSSAnimations.js",deps:["jQuery","support"]},mCustomScrollbar:{path:e+"/mCustomScrollbar",alias:"malihu-custom-scrollbar-plugin",js:"/mCustomScrollbar.js",css:"/jquery.mCustomScrollbar.css",deps:["jQuery","jqueryMousewheel"],onInstall:function(e){e.module.exports(kit.require("jQuery"))}},jqueryMousewheel:{path:e+"/jqueryMousewheel",alias:"jquery-mousewheel",js:"/jquery.mousewheel.js",deps:["jQuery"],onInstall:function(e){e.module.exports(kit.require("jQuery"))}},jqueryLazy:{path:e+"/jquery-lazy",alias:"jquery-lazy",js:["/jquery.lazy.min.js","/jquery.lazy.plugins.min.js"],deps:["jQuery"]},slickCarousel:{path:e+"/slickCarousel",alias:["slick","slick-carousel"],js:"/slick.min.js",css:["/slick.css","/slick-theme.css"],deps:["jQuery"]},mustache:{path:e+"/mustache",alias:["mustache.js"],js:"/mustache.js",deps:[]},bxSlider:{path:e+"/bxSlider",module:"/jquery.bxslider.min.js",css:["/jquery.bxslider.min.css"],type:"default",deps:["jQuery"]},selectric:{path:e+"/selectric",module:"/jquery.selectric.min.js",css:["/selectric.css"],type:"UMD",alias:["jquerySelectric"],deps:["jQuery"]},jBox:{path:e+"/jBox",module:"/jBox.min.js",css:["/jBox.min.css"],type:"UMD",deps:["jQuery"]},intlTelInput:{path:e+"/intl-tel-input",module:"/js/intlTelInput.min.js",css:["/css/intlTelInput.min.css"],type:"UMD",alias:["intl-tel-input"]},autoComplete:{path:e+"/autoComplete",module:"/autoComplete.min.js",css:["/css/autoComplete.css"],type:"HMD"}}}; \ No newline at end of file