!function(a){"function"==typeof YUI?YUI.add("es5",a):a()}(function(){function a(){}function b(a){return a=+a,a!==a?a=0:0!==a&&a!==1/0&&a!==-(1/0)&&(a=(a>0||-1)*Math.floor(Math.abs(a))),a}function c(a){var b=typeof a;return null===a||"undefined"===b||"boolean"===b||"number"===b||"string"===b}function d(a){var b,d,e;if(c(a))return a;if(d=a.valueOf,"function"==typeof d&&(b=d.call(a),c(b)))return b;if(e=a.toString,"function"==typeof e&&(b=e.call(a),c(b)))return b;throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if("function"!=typeof c)throw new TypeError("Function.prototype.bind called on incompatible "+c);var d=m.call(arguments,1),e=function(){if(this instanceof e){var a=c.apply(this,d.concat(m.call(arguments)));return Object(a)===a?a:this}return c.apply(b,d.concat(m.call(arguments)))};return c.prototype&&(a.prototype=c.prototype,e.prototype=new a,a.prototype=null),e});var e,f,g,h,i,j=Function.prototype.call,k=Array.prototype,l=Object.prototype,m=k.slice,n=j.bind(l.toString),o=j.bind(l.hasOwnProperty);if((i=o(l,"__defineGetter__"))&&(e=j.bind(l.__defineGetter__),f=j.bind(l.__defineSetter__),g=j.bind(l.__lookupGetter__),h=j.bind(l.__lookupSetter__)),2!=[1,2].splice(0).length){var p=Array.prototype.splice;Array.prototype.splice=function(){function a(a){for(var b=[];a--;)b.unshift(a);return b}var b,c=[];return c.splice.bind(c,0,0).apply(null,a(20)),c.splice.bind(c,0,0).apply(null,a(26)),b=c.length,c.splice(5,0,"XXX"),b+1==c.length?!0:void 0}()?function(a,b){return arguments.length?p.apply(this,[void 0===a?0:a,void 0===b?this.length-a:b].concat(m.call(arguments,2))):[]}:function(a,b){var c,d=m.call(arguments,2),e=d.length;if(!arguments.length)return[];if(void 0===a&&(a=0),void 0===b&&(b=this.length-a),e>0){if(0>=b){if(a==this.length)return this.push.apply(this,d),[];if(0==a)return this.unshift.apply(this,d),[]}return c=m.call(this,a,a+b),d.push.apply(d,m.call(this,a+b,this.length)),d.unshift.apply(d,m.call(this,0,a)),d.unshift(0,this.length),p.apply(this,d),c}return p.call(this,a,b)}}if(1!=[].unshift(0)){var q=Array.prototype.unshift;Array.prototype.unshift=function(){return q.apply(this,arguments),this.length}}Array.isArray||(Array.isArray=function(a){return"[object Array]"==n(a)});var r=Object("a"),s="a"!=r[0]||!(0 in r);if(Array.prototype.forEach||(Array.prototype.forEach=function(a){var b=G(this),c=s&&"[object String]"==n(this)?this.split(""):b,d=arguments[1],e=-1,f=c.length>>>0;if("[object Function]"!=n(a))throw new TypeError;for(;++e>>0,e=Array(d),f=arguments[1];if("[object Function]"!=n(a))throw new TypeError(a+" is not a function");for(var g=0;d>g;g++)g in c&&(e[g]=a.call(f,c[g],g,b));return e}),Array.prototype.filter||(Array.prototype.filter=function(a){var b,c=G(this),d=s&&"[object String]"==n(this)?this.split(""):c,e=d.length>>>0,f=[],g=arguments[1];if("[object Function]"!=n(a))throw new TypeError(a+" is not a function");for(var h=0;e>h;h++)h in d&&(b=d[h],a.call(g,b,h,c)&&f.push(b));return f}),Array.prototype.every||(Array.prototype.every=function(a){var b=G(this),c=s&&"[object String]"==n(this)?this.split(""):b,d=c.length>>>0,e=arguments[1];if("[object Function]"!=n(a))throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&!a.call(e,c[f],f,b))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(a){var b=G(this),c=s&&"[object String]"==n(this)?this.split(""):b,d=c.length>>>0,e=arguments[1];if("[object Function]"!=n(a))throw new TypeError(a+" is not a function");for(var f=0;d>f;f++)if(f in c&&a.call(e,c[f],f,b))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(a){var b=G(this),c=s&&"[object String]"==n(this)?this.split(""):b,d=c.length>>>0;if("[object Function]"!=n(a))throw new TypeError(a+" is not a function");if(!d&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var e,f=0;if(arguments.length>=2)e=arguments[1];else for(;;){if(f in c){e=c[f++];break}if(++f>=d)throw new TypeError("reduce of empty array with no initial value")}for(;d>f;f++)f in c&&(e=a.call(void 0,e,c[f],f,b));return e}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(a){var b=G(this),c=s&&"[object String]"==n(this)?this.split(""):b,d=c.length>>>0;if("[object Function]"!=n(a))throw new TypeError(a+" is not a function");if(!d&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var e,f=d-1;if(arguments.length>=2)e=arguments[1];else for(;;){if(f in c){e=c[f--];break}if(--f<0)throw new TypeError("reduceRight of empty array with no initial value")}if(0>f)return e;do f in this&&(e=a.call(void 0,e,c[f],f,b));while(f--);return e}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(a){var c=s&&"[object String]"==n(this)?this.split(""):G(this),d=c.length>>>0;if(!d)return-1;var e=0;for(arguments.length>1&&(e=b(arguments[1])),e=e>=0?e:Math.max(0,d+e);d>e;e++)if(e in c&&c[e]===a)return e;return-1}),Array.prototype.lastIndexOf&&-1==[0,1].lastIndexOf(0,-3)||(Array.prototype.lastIndexOf=function(a){var c=s&&"[object String]"==n(this)?this.split(""):G(this),d=c.length>>>0;if(!d)return-1;var e=d-1;for(arguments.length>1&&(e=Math.min(e,b(arguments[1]))),e=e>=0?e:d-Math.abs(e);e>=0;e--)if(e in c&&a===c[e])return e;return-1}),!Object.keys){var t=!0,u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],v=u.length;for(var w in{toString:null})t=!1;Object.keys=function H(a){if("object"!=typeof a&&"function"!=typeof a||null===a)throw new TypeError("Object.keys called on a non-object");var H=[];for(var b in a)o(a,b)&&H.push(b);if(t)for(var c=0,d=v;d>c;c++){var e=u[c];o(a,e)&&H.push(e)}return H}}var x=-621987552e5,y="-000001";Date.prototype.toISOString&&-1!==new Date(x).toISOString().indexOf(y)||(Date.prototype.toISOString=function(){var a,b,c,d,e;if(!isFinite(this))throw new RangeError("Date.prototype.toISOString called on non-finite value.");for(d=this.getUTCFullYear(),e=this.getUTCMonth(),d+=Math.floor(e/12),e=(e%12+12)%12,a=[e+1,this.getUTCDate(),this.getUTCHours(),this.getUTCMinutes(),this.getUTCSeconds()],d=(0>d?"-":d>9999?"+":"")+("00000"+Math.abs(d)).slice(d>=0&&9999>=d?-4:-6),b=a.length;b--;)c=a[b],10>c&&(a[b]="0"+c);return d+"-"+a.slice(0,2).join("-")+"T"+a.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"});var z=!1;try{z=Date.prototype.toJSON&&null===new Date(0/0).toJSON()&&-1!==new Date(x).toJSON().indexOf(y)&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(A){}z||(Date.prototype.toJSON=function(){var a,b=Object(this),c=d(b);if("number"==typeof c&&!isFinite(c))return null;if(a=b.toISOString,"function"!=typeof a)throw new TypeError("toISOString property is not callable");return a.call(b)}),Date=function(a){function b(c,d,e,f,g,h,i){var j=arguments.length;if(this instanceof a){var k=1==j&&String(c)===c?new a(b.parse(c)):j>=7?new a(c,d,e,f,g,h,i):j>=6?new a(c,d,e,f,g,h):j>=5?new a(c,d,e,f,g):j>=4?new a(c,d,e,f):j>=3?new a(c,d,e):j>=2?new a(c,d):j>=1?new a(c):new a;return k.constructor=b,k}return a.apply(this,arguments)}function c(a,b){var c=b>1?1:0;return f[b]+Math.floor((a-1969+c)/4)-Math.floor((a-1901+c)/100)+Math.floor((a-1601+c)/400)+365*(a-1970)}function d(b){return Number(new a(1970,0,1,0,0,0,b))}var e=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$"),f=[0,31,59,90,120,151,181,212,243,273,304,334,365];for(var g in a)b[g]=a[g];return b.now=a.now,b.UTC=a.UTC,b.prototype=a.prototype,b.prototype.constructor=b,b.parse=function(b){var f=e.exec(b);if(f){var g,h=Number(f[1]),i=Number(f[2]||1)-1,j=Number(f[3]||1)-1,k=Number(f[4]||0),l=Number(f[5]||0),m=Number(f[6]||0),n=Math.floor(1e3*Number(f[7]||0)),o=Boolean(f[4]&&!f[8]),p="-"===f[9]?1:-1,q=Number(f[10]||0),r=Number(f[11]||0);return(l>0||m>0||n>0?24:25)>k&&60>l&&60>m&&1e3>n&&i>-1&&12>i&&24>q&&60>r&&j>-1&&j=-864e13&&864e13>=g)?g:0/0}return a.parse.apply(this,arguments)},b}(Date),Date.now||(Date.now=function(){return(new Date).getTime()}),Number.prototype.toFixed&&"0.000"===8e-5.toFixed(3)&&"0"!==.9.toFixed(0)&&"1.25"===1.255.toFixed(2)&&"1000000000000000128"===0xde0b6b3a7640080.toFixed(0)||!function(){function a(a,b){for(var c=-1;++c=0;)c+=h[b],h[b]=Math.floor(c/a),c=c%a*f}function c(){for(var a=g,b="";--a>=0;)if(""!==b||0===a||0!==h[a]){var c=String(h[a]);""===b?b=c:b+="0000000".slice(0,7-c.length)+c}return b}function d(a,b,c){return 0===b?c:1===b%2?d(a,b-1,c*a):d(a*a,b/2,c)}function e(a){for(var b=0;a>=4096;)b+=12,a/=4096;for(;a>=2;)b+=1,a/=2;return b}var f,g,h;f=1e7,g=6,h=[0,0,0,0,0,0],Number.prototype.toFixed=function(f){var g,h,i,j,k,l,m,n;if(g=Number(f),g=g!==g?0:Math.floor(g),0>g||g>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(h=Number(this),h!==h)return"NaN";if(-1e21>=h||h>=1e21)return String(h);if(i="",0>h&&(i="-",h=-h),j="0",h>1e-21)if(k=e(h*d(2,69,1))-69,l=0>k?h*d(2,-k,1):h/d(2,k,1),l*=4503599627370496,k=52-k,k>0){for(a(0,l),m=g;m>=7;)a(1e7,0),m-=7;for(a(d(10,m,1),0),m=k-1;m>=23;)b(1<<23),m-=23;b(1<0?(n=j.length,j=g>=n?i+"0.0000000000000000000".slice(0,g-n+2)+j:i+j.slice(0,n-g)+"."+j.slice(n-g)):j=i+j,j}}();var B=String.prototype.split;if(2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||0==="".split(/.?/).length||".".split(/()()/).length>1?!function(){var a=void 0===/()??/.exec("")[1];String.prototype.split=function(b,c){var d=this;if(void 0===b&&0===c)return[];if("[object RegExp]"!==Object.prototype.toString.call(b))return B.apply(this,arguments);var e,f,g,h,i=[],j=(b.ignoreCase?"i":"")+(b.multiline?"m":"")+(b.extended?"x":"")+(b.sticky?"y":""),k=0,b=new RegExp(b.source,j+"g");for(d+="",a||(e=new RegExp("^"+b.source+"$(?!\\s)",j)),c=void 0===c?-1>>>0:c>>>0;(f=b.exec(d))&&(g=f.index+f[0].length,!(g>k&&(i.push(d.slice(k,f.index)),!a&&f.length>1&&f[0].replace(e,function(){for(var a=1;a1&&f.index=c)));)b.lastIndex===f.index&&b.lastIndex++;return k===d.length?(h||!b.test(""))&&i.push(""):i.push(d.slice(k)),i.length>c?i.slice(0,c):i}}():"0".split(void 0,0).length&&(String.prototype.split=function(a,b){return void 0===a&&0===b?[]:B.apply(this,arguments)}),"".substr&&"b"!=="0b".substr(-1)){var C=String.prototype.substr;String.prototype.substr=function(a,b){return C.call(this,0>a?(a=this.length+a)<0?0:a:a,b)}}var D=" \n \f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||D.trim()){D="["+D+"]";var E=new RegExp("^"+D+D+"*"),F=new RegExp(D+D+"*$");String.prototype.trim=function(){if(void 0===this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(E,"").replace(F,"")}}var G=function(a){if(null==a)throw new TypeError("can't convert "+a+" to object");return Object(a)}}),function(a){var b=["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"],c=[[new RegExp("(m)en$","gi")],[new RegExp("(pe)ople$","gi")],[new RegExp("(child)ren$","gi")],[new RegExp("([ti])a$","gi")],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi")],[new RegExp("(hive)s$","gi")],[new RegExp("(tive)s$","gi")],[new RegExp("(curve)s$","gi")],[new RegExp("([lr])ves$","gi")],[new RegExp("([^fo])ves$","gi")],[new RegExp("([^aeiouy]|qu)ies$","gi")],[new RegExp("(s)eries$","gi")],[new RegExp("(m)ovies$","gi")],[new RegExp("(x|ch|ss|sh)es$","gi")],[new RegExp("([m|l])ice$","gi")],[new RegExp("(bus)es$","gi")],[new RegExp("(o)es$","gi")],[new RegExp("(shoe)s$","gi")],[new RegExp("(cris|ax|test)es$","gi")],[new RegExp("(octop|vir)i$","gi")],[new RegExp("(alias|status)es$","gi")],[new RegExp("^(ox)en","gi")],[new RegExp("(vert|ind)ices$","gi")],[new RegExp("(matr)ices$","gi")],[new RegExp("(quiz)zes$","gi")],[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]],d=[[new RegExp("(m)an$","gi")],[new RegExp("(pe)rson$","gi")],[new RegExp("(child)$","gi")],[new RegExp("^(ox)$","gi")],[new RegExp("(ax|test)is$","gi")],[new RegExp("(octop|vir)us$","gi")],[new RegExp("(alias|status)$","gi")],[new RegExp("(bu)s$","gi")],[new RegExp("(buffal|tomat|potat)o$","gi")],[new RegExp("([ti])um$","gi")],[new RegExp("sis$","gi")],[new RegExp("(?:([^f])fe|([lr])f)$","gi")],[new RegExp("(hive)$","gi")],[new RegExp("([^aeiouy]|qu)y$","gi")],[new RegExp("(x|ch|ss|sh)$","gi")],[new RegExp("(matr|vert|ind)ix|ex$","gi")],[new RegExp("([m|l])ouse$","gi")],[new RegExp("(quiz)$","gi")],[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("ss$","gi"),"ss"],[new RegExp("s$","gi"),""]],e=["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"],f=new RegExp("(_ids|_id)$","g"),g=new RegExp("_","g"),h=new RegExp("[ _]","g"),i=new RegExp("([A-Z])","g"),j=new RegExp("^_"),k={_apply_rules:function(a,b,c,d){if(d)a=d;else{var e=k.indexOf(c,a.toLowerCase())>-1;if(!e)for(var f=0,g=b.length;g>f;f++)if(a.match(b[f][0])){void 0!==b[f][1]&&(a=a.replace(b[f][0],b[f][1]));break}}return a},indexOf:function(a,b,c,d){c||(c=-1);for(var e=-1,f=c,g=a.length;g>f;f++)if(a[f]===b||d&&d(a[f],b)){e=f;break}return e},pluralize:function(a,d){return k._apply_rules(a,c,b,d)},singularize:function(a,c){return k._apply_rules(a,d,b,c)},camelize:function(a,b){for(var c=a.toLowerCase().split("/"),d=0,e=c.length;e>d;d++){for(var f=c[d].split("_"),g=b&&d+1===e?1:0,h=g,i=f.length;i>h;h++)f[h]=f[h].charAt(0).toUpperCase()+f[h].substring(1);c[d]=f.join("")}return c.join("::")},underscore:function(a,b){if(b&&a===a.toUpperCase())return a;for(var c=a.split("::"),d=0,e=c.length;e>d;d++)c[d]=c[d].replace(i,"_$1"),c[d]=c[d].replace(j,"");return c.join("/").toLowerCase()},humanize:function(a,b){return a=a.toLowerCase(),a=a.replace(f,""),a=a.replace(g," "),b||(a=k.capitalize(a)),a},capitalize:function(a){return a=a.toLowerCase(),a.substring(0,1).toUpperCase()+a.substring(1)},dasherize:function(a){return a.replace(h,"-")},titleize:function(a){a=a.toLowerCase().replace(g," ");for(var b=a.split(" "),c=0,d=b.length;d>c;c++){for(var f=b[c].split("-"),h=0,i=f.length;i>h;h++)k.indexOf(e,f[h].toLowerCase())<0&&(f[h]=k.capitalize(f[h]));b[c]=f.join("-")}return a=b.join(" "),a=a.substring(0,1).toUpperCase()+a.substring(1)},demodulize:function(a){var b=a.split("::");return b[b.length-1]},tableize:function(a){return a=k.underscore(a),a=k.pluralize(a)},classify:function(a){return a=k.camelize(a),a=k.singularize(a)},foreign_key:function(a,b){return a=k.demodulize(a),a=k.underscore(a)+(b?"":"_")+"id"},ordinalize:function(a){for(var b=a.split(" "),c=0,d=b.length;d>c;c++){var e=parseInt(b[c],10);if(!isNaN(e)){var f=b[c].substring(b[c].length-2),g=b[c].substring(b[c].length-1),h="th";"11"!=f&&"12"!=f&&"13"!=f&&("1"===g?h="st":"2"===g?h="nd":"3"===g&&(h="rd")),b[c]+=h}}return b.join(" ")}};return"undefined"==typeof exports?a.inflection=k:(k.version="1.2.5",module.exports=k,void 0)}(this),function(){this.Joosy={Modules:{},Resources:{},Templaters:{},Helpers:{},Events:{},debug:function(a){return null!=a?this.__debug=a:!!this.__debug},templater:function(a){if(null!=a)return this.__templater=a;if(!this.__templater)throw new Error("No templater registered");return this.__templater},namespace:function(a,b){var c,d,e,f,g,h,i;for(null==b&&(b=!1),a=a.split("."),f=window,g=0,h=a.length;h>g;g++)e=a[g],e.length>0&&(f=null!=f[e]?f[e]:f[e]={});b&&(b=b.apply(f)),i=[];for(c in f)d=f[c],f.hasOwnProperty(c)&&Joosy.Module.hasAncestor(d,Joosy.Module)?i.push(d.__namespace__=a):i.push(void 0);return i},helpers:function(a,b){var c;return(c=Joosy.Helpers)[a]||(c[a]={}),b.apply(Joosy.Helpers[a])},uid:function(){return this.__uid||(this.__uid=0),"__joosy"+this.__uid++},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b,c;return b=0|16*Math.random(),c="x"===a?b:8|3&b,c.toString(16)}).toUpperCase()},synchronize:function(){var a;return Joosy.Modules.Events?(a=Joosy.Modules.Events).synchronize.apply(a,arguments):console.error("Events module is required to use `Joosy.synchronize'!")},buildUrl:function(a,b){var c,d,e,f;e=[];for(d in b)f=b[d],e.push(""+d+"="+f);return c=a.match(/(\#.*)?$/)[0],a=a.replace(/\#.*$/,""),0!==e.length&&-1===a.indexOf("?")&&(a+="?"),e=e.join("&"),e.length>0&&"?"!==a[a.length-1]&&(e="&"+e),a+e+c}},null!=("undefined"!=typeof define&&null!==define?define.amd:void 0)&&define("joosy",function(){return Joosy})}.call(this),function(){Joosy.Module=function(){function a(){}return a.__namespace__=[],a.__className=function(a){return"function"!=typeof a&&(a=a.constructor),null!=a.name?a.name:a.toString().replace(/^function ([a-zA-Z]+)\([\s\S]+/,"$1")},a.hasAncestor=function(a,b){var c;if(null==a||null==b)return!1;for(a=a.prototype,b=b.prototype;a;){if(a===b)return!0;a=null!=(c=a.constructor)?c.__super__:void 0}return!1},a.aliasMethodChain=function(a,b,c){var d,e;return d=b.charAt(0).toUpperCase()+b.slice(1),e=""+a+"Without"+d,"function"!=typeof c&&(c=this.prototype[c]),this.prototype[e]=this.prototype[a],this.prototype[a]=c},a.aliasStaticMethodChain=function(a,b,c){var d,e;return d=b.charAt(0).toUpperCase()+b.slice(1),e=""+a+"Without"+d,c||(c=this[""+a+"With"+d]),this[e]=this[a],this[a]=c},a.merge=function(a,b,c,d){var e,f,g;null==c&&(c=!0),null==d&&(d=!1);for(e in b)f=b[e],b.hasOwnProperty(e)&&(c||!a.hasOwnProperty(e))&&(d&&f.constructor===Object?((null!=(g=a[e])?g.constructor:void 0)!==Object&&(a[e]={}),Joosy.Module.merge(a[e],f)):a[e]=f);return a},a.include=function(a){var b,c,d;if(!a)throw new Error("include(object) requires obj");for(b in a)c=a[b],"included"!==b&&"extended"!==b&&(this.prototype[b]=c);return null!=(d=a.included)&&d.apply(this),null},a.extend=function(a){var b;if(!a)throw new Error("extend(object) requires object");return this.merge(this,a),null!=(b=a.extended)&&b.apply(this),null},a.concern=function(a){var b,c;return null!=a.ClassMethods&&this.extend(a.ClassMethods),null!=a.InstanceMethods&&this.include(a.InstanceMethods),null!=(b=a.extended)&&b.apply(this),null!=(c=a.included)?c.apply(this):void 0},a}(),null!=("undefined"!=typeof define&&null!==define?define.amd:void 0)&&define("joosy/module",function(){return Joosy.Module})}.call(this),function(){var a,b,c=[].slice;b=function(){function a(){this.actions=[]}return a.prototype["do"]=function(a){return this.actions.push(a)},a.prototype.after=function(a){this.after=a},a}(),a=function(){function a(a){this.parent=a,this.bindings=[]}return a.prototype.bind=function(){var a,b;return a=1<=arguments.length?c.call(arguments,0):[],this.bindings.push((b=this.parent).bind.apply(b,a))},a.prototype.unbind=function(){var a,b,c,d;for(d=this.bindings,b=0,c=d.length;c>b;b++)a=d[b],this.parent.unbind(a);return this.bindings=[]},a}(),Joosy.Modules.Events={eventsNamespace:function(b){var c;return c=new a(this),null!=b&&"function"==typeof b.call&&b.call(c),c},wait:function(a,b,c){return this.hasOwnProperty("__oneShotEvents")||(this.__oneShotEvents={}),2===arguments.length&&(c=b,b=a,a=Object.keys(this.__oneShotEvents).length.toString()),b=this.__splitEvents(b),b.length>0?this.__oneShotEvents[a]=[b,c]:c(),a},unwait:function(a){return this.hasOwnProperty("__oneShotEvents")?delete this.__oneShotEvents[a]:void 0},bind:function(a,b,c){return this.hasOwnProperty("__boundEvents")||(this.__boundEvents={}),2===arguments.length&&(c=b,b=a,a=Object.keys(this.__boundEvents).length.toString()),b=this.__splitEvents(b),b.length>0?this.__boundEvents[a]=[b,c]:c(),a},unbind:function(a){return this.hasOwnProperty("__boundEvents")?delete this.__boundEvents[a]:void 0},trigger:function(){var a,b,d,e,f,g,h,i,j,k,l,m,n,o,p,q=this;if(d=arguments[0],b=2<=arguments.length?c.call(arguments,1):[],Joosy.Modules.Log.debugAs(this,"Event "+d+" triggered"),"string"==typeof d?i=!1:(i=d.remember,d=d.name),this.hasOwnProperty("__oneShotEvents")){f=[],m=this.__oneShotEvents;for(g in m){for(n=m[g],e=n[0],a=n[1];-1!==(h=e.indexOf(d));)e.splice(h,1);0===e.length&&f.push(g)}for(j=function(c){return a=q.__oneShotEvents[c][1],delete q.__oneShotEvents[c],a.apply(null,b)},k=0,l=f.length;l>k;k++)g=f[k],j(g)}if(this.hasOwnProperty("__boundEvents")){o=this.__boundEvents;for(g in o)p=o[g],e=p[0],a=p[1],-1!==e.indexOf(d)&&a.apply(null,b)}return i?(this.hasOwnProperty("__triggeredEvents")||(this.__triggeredEvents={}),this.__triggeredEvents[d]=!0):void 0},synchronize:function(a){var c,d,e,f,g,h,i,j=this;if(d=new b,e=0,a(d),0===d.actions.length)return d.after.call(this);for(h=d.actions,i=[],f=0,g=h.length;g>f;f++)c=h[f],i.push(function(a){return a.call(j,function(){return++e>=d.actions.length?d.after.call(this):void 0})}(c));return i},__splitEvents:function(a){var b=this;return"string"==typeof a&&(a=0===a.length?[]:a.trim().split(/\s+/)),this.hasOwnProperty("__triggeredEvents")&&(a=a.filter(function(a){return!b.__triggeredEvents[a]})),a}},null!=("undefined"!=typeof define&&null!==define?define.amd:void 0)&&define("joosy/modules/events",function(){return Joosy.Modules.Events})}.call(this),function(){var a=[].slice;Joosy.Modules.Log={log:function(){var b;return b=1<=arguments.length?a.call(arguments,0):[],"undefined"!=typeof console&&null!==console?null!=console.log.apply?(b.unshift("Joosy>"),console.log.apply(console,b)):console.log(b.first()):void 0},debug:function(){var b;return b=1<=arguments.length?a.call(arguments,0):[],Joosy.debug()?this.log.apply(this,b):void 0},debugAs:function(){var b,c,d;return c=arguments[0],d=arguments[1],b=3<=arguments.length?a.call(arguments,2):[],Joosy.debug()?(c=Joosy.Module.__className(c)||"unknown context",this.debug.apply(this,[""+c+"> "+d].concat(a.call(b)))):void 0}},null!=("undefined"!=typeof define&&null!==define?define.amd:void 0)&&define("joosy/modules/log",function(){return Joosy.Modules.Log})}.call(this),function(){Joosy.Modules.DOM={eventSplitter:/^(\S+)\s*(.*)$/,ClassMethods:{mapElements:function(a){return this.prototype.hasOwnProperty("__elements")||(this.prototype.__elements=Joosy.Module.merge({},this.__super__.__elements)),Joosy.Module.merge(this.prototype.__elements,a)},mapEvents:function(a){return this.prototype.hasOwnProperty("__events")||(this.prototype.__events=Joosy.Module.merge({},this.__super__.__events)),Joosy.Module.merge(this.prototype.__events,a)}},InstanceMethods:{$:function(a,b){return $(a,b||this.$container)},__extractSelector:function(a){var b=this;return a=a.replace(/(\$[A-z0-9\.\$]+)/g,function(a){var c,d,e,f,g,h;for(a=a.split("."),c=a.pop(),e=b,f=0,g=a.length;g>f;f++)d=a[f],e=null!=e?e[d]:void 0;return null!=e?null!=(h=e[c])?h.selector:void 0:void 0}),a.trim()},__assignElements:function(a,b){var c,d,e,f=this;if(a||(a=this),b||(b=this.__elements),b){e=[];for(c in b)d=b[c],e.push(function(b,c){return"string"!=typeof c?f.__assignElements(a["$"+b]={},c):(c=f.__extractSelector(c),a["$"+b]=f.__wrapElement(c),a["$"+b].selector=c)}(c,d));return e}},__wrapElement:function(a){var b=this;return function(c){return c?b.$(a,c):b.$(a)}},__delegateEvents:function(){var a,b,c,d,e,f=this;if(d=this,a=this.__events){e=[];for(b in a)c=a[b],e.push(function(a,b){var c,e,g,h,i,j,k,l,m;for(l=a.split(","),m=[],j=0,k=l.length;k>j;j++)if(g=l[j],g=g.replace(/^\s+/,""),"function"!=typeof b&&(b=f[b]),c=function(a){return b.call(d,$(this),a)},h=g.match(Joosy.Modules.DOM.eventSplitter),e=h[1],i=f.__extractSelector(h[2]),""===i)f.$container.bind(e,c),m.push(Joosy.Modules.Log.debugAs(f,""+e+" binded on container"));else{if(void 0===i)throw new Error("Unknown element "+h[2]+" in "+Joosy.Module.__className(f.constructor)+" (maybe typo?)");f.$container.on(e,i,c),m.push(Joosy.Modules.Log.debugAs(f,""+e+" binded on "+i))}return m}(b,c));return e}},__clearContainer:function(){return this.$container.unbind().off(),this.$container=$()}}},null!=("undefined"!=typeof define&&null!==define?define.amd:void 0)&&define("joosy/modules/dom",function(){return Joosy.Modules.DOM})}.call(this),function(a){var b=function(){},c=0,d=a.document,e=("undefined"==typeof ENV?{}:ENV).DISABLE_RANGE_API,f=!e&&d&&"createRange"in d&&"undefined"!=typeof Range&&Range.prototype.createContextualFragment,g=d&&function(){var a=d.createElement("div");return a.innerHTML="
",a.firstChild.innerHTML="",""===a.firstChild.innerHTML}(),h=d&&function(){var a=d.createElement("div");return a.innerHTML="Test: Value","Test:"===a.childNodes[0].nodeValue&&" Value"===a.childNodes[2].nodeValue}(),i=function(a){var d;d=this instanceof i?this:new b,d.innerHTML=a;var e="metamorph-"+c++;return d.start=e+"-start",d.end=e+"-end",d};b.prototype=i.prototype;var j,k,l,m,n,o,p,q,r;if(m=function(){return this.startTag()+this.innerHTML+this.endTag()},q=function(){return""},r=function(){return""},f)j=function(a,b){var c=d.createRange(),e=d.getElementById(a.start),f=d.getElementById(a.end);return b?(c.setStartBefore(e),c.setEndAfter(f)):(c.setStartAfter(e),c.setEndBefore(f)),c},k=function(a,b){var c=j(this,b);c.deleteContents();var d=c.createContextualFragment(a);c.insertNode(d)},l=function(){var a=j(this,!0);a.deleteContents()},n=function(a){var b=d.createRange();b.setStart(a),b.collapse(!1);var c=b.createContextualFragment(this.outerHTML());a.appendChild(c)},o=function(a){var b=d.createRange(),c=d.getElementById(this.end);b.setStartAfter(c),b.setEndAfter(c);var e=b.createContextualFragment(a);b.insertNode(e)},p=function(a){var b=d.createRange(),c=d.getElementById(this.start);b.setStartAfter(c),b.setEndAfter(c);var e=b.createContextualFragment(a);b.insertNode(e)};else{var s={select:[1,""],fieldset:[1,"
","
"],table:[1,"","
"],tbody:[2,"","
"],tr:[3,"","
"],colgroup:[2,"","
"],map:[1,"",""],_default:[0,"",""]},t=function(a,b){if(a.getAttribute("id")===b)return a;var c,d,e,f=a.childNodes.length;for(c=0;f>c;c++)if(d=a.childNodes[c],e=1===d.nodeType&&t(d,b))return e},u=function(a,b){var c=[];if(h&&(b=b.replace(/(\s+)(