/** * @package zlux * @version 2.0.3 * @author ZOOlanders - http://zoolanders.com * @license GNU General Public License v2 or later */ !function(n,t){"use strict";var e={};return e.version="2.0.3",e.url={},e.url.urls={ajax:"",root:"",root_path:"",zlux:""},e.url.push=function(t){n.extend(e.url.urls,t)},e.url.get=function(t,i){t=t.split(":"),i=void 0===i?{}:i;var o;if(2===t.length&&""!==t[1]){var s=e.url.urls.root_path.replace(/^\//,"");o=e.url._get(t[0])+"/"+t[1].replace(new RegExp("^"+s,"g"),"").replace(new RegExp("^/"+s,"g"),"")}else o=e.url._get(t[0])+(n.isEmptyObject(i)?"":"&"+n.param(i));return e.url.clean(o)},e.url._get=function(n){return void 0!==e.url.urls[n]?e.url.urls[n]:n},e.url.clean=function(n){return n?n.replace(/\\/g,"/").replace(/\/\/+/g,"/").replace(/undefined/g,"").replace(/\/$/g,"").replace(/:\//g,"://"):""},e.lang={},e.lang.strings={},e.lang.push=function(t){n.extend(e.lang.strings,t)},e.lang.get=function(n){return e.lang.strings[n]||n},e.lang._=e.lang.get,e.lang.sprintf=function(n){var t=[].slice.call(arguments,1);return n=e.lang.get(n),n.replace(/%[a-z]/g,function(){var n=t.shift();return"undefined"!==e.utils.typeOf(n)?n:""})},e.utils={},e.utils.typeOf=function(n){return{}.toString.call(n).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()},e.utils.options=function(t){if(n.isPlainObject(t))return t;var e=t?t.indexOf("{"):-1,i={};if(-1!=e)try{i=new Function("","var json = "+t.substr(e)+"; return JSON.parse(JSON.stringify(json));")()}catch(o){}return i},String.prototype.hashCode=function(){if(Array.prototype.reduce)return this.split("").reduce(function(n,t){return n=(n<<5)-n+t.charCodeAt(0),n&n},0);var n=0;if(0===this.length)return n;for(var t=0;t')}),n("body").on("show.uk.modal",function(){n(".uk-modal").not(".zx .uk-modal").wrap('
')}),e.component.bootComponents()}),e}(jQuery,UIkit),function(n,t,e){"use strict";t.extensions={},t.component=function(i,o){var s=function(t,e){var o=this;this.element=t?n(t):null,this.options=n.extend(!0,{},this.defaults,e),this.plugins={},this.element&&this.element.data(i,this),this.init(),(this.options.plugins.length?this.options.plugins:Object.keys(s.plugins)).forEach(function(n){s.plugins[n].init&&(s.plugins[n].init(o),o.plugins[n]=!0)}),this.trigger("init",[this])};return s.plugins={},s.instances=[],n.extend(!0,s.prototype,{type:"component",defaults:{plugins:[]},boot:function(){},init:function(){},on:function(){return n(this.element||this).on.apply(this.element||this,arguments)},one:function(){return n(this.element||this).one.apply(this.element||this,arguments)},off:function(t){return n(this.element||this).off(t)},trigger:function(t,e){return n(this.element||this).trigger(t,e)},find:function(t){return this.element?this.element.find(t):n([])},proxy:function(n,t){var e=this;t.split(" ").forEach(function(t){e[t]||(e[t]=function(){return n[t].apply(n,arguments)})})},mixin:function(n,t){var e=this;t.split(" ").forEach(function(t){e[t]||(e[t]=n[t].bind(e))})}},o),this.extensions[i]=s,this[i]=function(){var e,o;if(arguments.length)switch(arguments.length){case 1:"string"==typeof arguments[0]||arguments[0].nodeType||arguments[0]instanceof jQuery?e=n(arguments[0]):o=arguments[0];break;case 2:e=n(arguments[0]),o=arguments[1]}return e&&e.data(i)?e.data(i):new t.extensions[i](e,o)},this[i].plugin=function(n,e){t.extensions[i].plugins[n]=e},e.domready&&e.component.boot(i),s},t.component.boot=function(n){t.extensions[n].prototype&&t.extensions[n].prototype.boot&&!t.extensions[n].booted&&(t.extensions[n].prototype.boot.apply(t,[]),t.extensions[n].booted=!0)},t.component.bootComponents=function(){for(var n in t.extensions)t.component.boot(n)},t.plugin=function(e,i){var o=function(t,e){this.element=t?n(t):null,this.init(e)};return n.extend(!0,o.prototype,{type:"plugin",init:function(){}},i),this.extensions[e]=o,this[e]=function(){var i,o;if(arguments.length)switch(arguments.length){case 1:"string"==typeof arguments[0]||arguments[0].nodeType||arguments[0]instanceof jQuery?i=n(arguments[0]):o=arguments[0];break;case 2:i=n(arguments[0]),o=arguments[1]}return new t.extensions[e](i,o)},o},t.fn=function(e,i){var o=arguments,s=e.match(/^([a-z\-]+)(?:\.([a-z]+))?/i),r=s[1],a=s[2];return t[r]?"component"===t.extensions[r].prototype.type?this.each(function(){var e=n(this),s=e.data(r);s||(e.data(r,s=t[r](this,a?void 0:i)),t.extensions[r].instances.push(s)),a&&s[a].apply(s,Array.prototype.slice.call(o,1))}):"plugin"===t.extensions[r].prototype.type?this.each(function(){t[r](this,Array.prototype.slice.call(o,1))}):void 0:(n.error("ZLUX extension ["+r+"] does not exist."),this)},n.fn.zx=t.fn}(jQuery,zlux,UIkit),function(n,t,e){"use strict";t.ajax={},t.ajax.request=function(e){var i={success:!1,errors:[],notices:[]},o=e.queue?e.queue:null,s=null;return delete e.queue,e=n.extend(!0,{dataType:"json",type:"POST"},e),n.Deferred(function(r){s=o?t.ajax.queue(o,e):n.ajax(e),s.done(function(o,s,a){if("json"===e.dataType)if("object"!==t.utils.typeOf(o))try{json=n.parseJSON(o)}catch(u){i.errors.push(String(o)),i.errors.push("An server-side error occurred. "+String(u)),r.reject(i)}else void 0===o.success?(o.errors=["Response format error: status not specified"],r.reject(o)):o.success?r.resolve(o):r.reject(o);else r.resolve(o)}).fail(function(n,t,e){switch(n.status){case 0:break;case 403:i.errors.push("The session has expired.");break;case 404:i.errors.push("The requested URL is not accesible.");break;case 500:i.errors.push("A server-side error has occurred.");break;default:i.errors.push("An "+t+" occurred
"+e+"

Returned"+n.responseText)}i.status=n.status,r.reject(i)})}).promise()},t.ajax.requestAndNotify=function(e,i){return i=void 0===i?{}:i,t.ajax.request(e).done(function(e){i.group&&t.notify.closeAll(i.group),e.message&&t.notify(e.message,n.extend(!0,{status:"success"},i))}).fail(function(e){i.group&&t.notify.closeAll(i.group),e.errors&&e.errors.length&&n.each(e.errors,function(){t.notify(this,n.extend(!0,{status:"danger"},i))})}).always(function(e){e.notices&&e.notices.length&&n.each(e.notices,function(){t.notify(this,n.extend(!0,{status:"warning"},i))})})};var i={};t.ajax.queue=function(t,e){function o(n){i[t]?i[t].push(n):(i[t]=[],n())}function s(){if(i[t]){var n=i[t].shift();n?n():delete i[t]}}if("undefined"==typeof e)throw"AjaxQ: queue name is not provided";var r=n.Deferred(),a=r.promise();a.success=a.done,a.error=a.fail,a.complete=a.always;var u=n.extend(!0,{},e);return o(function(){var t=n.ajax.apply(window,[u]).always(s);t.done(function(){r.resolve.apply(this,arguments)}),t.fail(function(){r.reject.apply(this,arguments)})}),a},n.each(["getq","postq"],function(e,i){n[i]=function(e,o,s,r,a){return n.isFunction(s)&&(a=a||r,r=s,s=void 0),t.ajax.queue(e,{type:"postq"===i?"post":"get",url:o,data:s,success:r,dataType:a})}});var o=function(n){return i.hasOwnProperty(n)},s=function(){for(var n in i)if(o(n))return!0;return!1};t.ajax.queue.isRunning=function(n){return n?o(n):s()},t.ajax.queue.clear=function(n){if(n)i[n]&&delete i[n];else for(var t in i)i.hasOwnProperty(t)&&delete i[t]}}(jQuery,zlux,UIkit),function(n,t,e){"use strict";t.plugin("animate",{init:function(t){var e=this,i="zx-animate-"+n.trim(t[0]),o=t[1]?t[1]:null;e.animate(i).done(function(){o&&o.apply(e.element)})},animate:function(t){var e=this;return n.Deferred(function(n){e.element.addClass(t).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(i){e.element.removeClass(t),n.resolve()})}).promise()}})}(jQuery,zlux,UIkit),function(n,t,e){"use strict";var i=function(){},o=function(t,e){var i=n.UIkit.modal.dialog(t,e);return n.extend(i,{content:function(n){var t=this.dialog;return n?(t.html(n),this):t.html()}}),i.element.addClass("zx"),i},s=function(e,i){var o=n.UIkit.modal.dialog(['
'+String(e)+"
",'
"].join(""),n.extend({bgclose:!1,keyboard:!1},i));return o.show(),o},r=function(e,i,o){i=n.isFunction(i)?i:function(){};var s=n.UIkit.modal.dialog(['
'+String(e)+"
",'
"].join(""),n.extend({bgclose:!1,keyboard:!1},o));return s.element.find(".js-modal-confirm").on("click",function(){i(),s.hide()}),s.show(),s};t.modal=i,t.modal.dialog=o,t.modal.alert=s,t.modal.confirm=r}(jQuery,zlux,UIkit),function(n,t,e){"use strict";t.component("spin",{defaults:{"class":"",affix:"append"},init:function(){this.on()},on:function(){var t=this;t.icon_class=!1,t.icon=t.element.is("i")?t.element:n("i",t.element).first(),t.icon.length?(t.icon_class=t.icon.attr("class"),t.icon.width(t.icon.width()),t.icon.attr("class","uk-icon-zx-spinner uk-icon-spin")):(t.icon=n(''),"replace"==t.options.affix?t.element.html(t.icon):t.element[t.options.affix](t.icon)),t.icon.addClass(t.options["class"])},off:function(){var n=this;n.icon.removeClass("uk-icon-zx-spinner uk-icon-spin"),n.icon_class&&n.icon.attr("class",n.icon_class),n.icon.width(""),n.element.removeData("spin")}})}(jQuery,zlux,UIkit),function(n,t,e){"use strict";t.component("upload",{defaults:{root:"",extensions:"",storage:"local",storage_params:{},max_file_size:"",resize:{}},init:function(){}}),n.UIkit.ready(function(e){n(".zx-manager [data-zx-manager-upload]",e).each(function(){var e=n(this);if(!e.data("uploadManager")){t.uploadManager(e,n.UIkit.Utils.options(e.attr("data-zx-manager-upload")))}})})}(jQuery,zlux,UIkit);