/**
 * Portions of this code are from the Google Closure Library,
 * received from the Closure Authors under the Apache 2.0 license.
 *
 * All other code is (C) 2011 FriendsOfSymfony and subject to the MIT license.
 */
(function() {var g=this;function i(a,b){var c=a.split("."),d=g;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var e;c.length&&(e=c.shift());)!c.length&&b!==void 0?d[e]=b:d=d[e]?d[e]:d[e]={}}
function k(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array)return"array";else if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(c=="[object Window]")return"object";if(c=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(c=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if(b=="function"&&typeof a.call=="undefined")return"object";return b};var l=/^[a-zA-Z0-9\-_.!~*'()]*$/;function m(a){a=String(a);if(!l.test(a))return encodeURIComponent(a);return a};var n=Array.prototype,p=n.forEach?function(a,b,c){n.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=typeof a=="string"?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};function q(a){var b=0,c;for(c in a)b++;return b}function r(a){var b={},c;for(c in a)b[c]=a[c];return b};function s(a){this.b={};this.a=[];var b=arguments.length;if(b>1){if(b%2)throw Error("Uneven number of arguments");for(var c=0;c<b;c+=2)this.set(arguments[c],arguments[c+1])}else if(a){var d;if(a instanceof s){t(a);c=a.a.concat();t(a);d=[];for(b=0;b<a.a.length;b++)d.push(a.b[a.a[b]])}else{var b=[],e=0;for(c in a)b[e++]=c;c=b;b=[];e=0;for(d in a)b[e++]=a[d];d=b}for(b=0;b<c.length;b++)this.set(c[b],d[b])}}s.prototype.c=0;s.prototype.l=0;
function t(a){if(a.c!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];Object.prototype.hasOwnProperty.call(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.c!=a.a.length){for(var e={},c=b=0;b<a.a.length;)d=a.a[b],Object.prototype.hasOwnProperty.call(e,d)||(a.a[c++]=d,e[d]=1),b++;a.a.length=c}}s.prototype.get=function(a,b){if(Object.prototype.hasOwnProperty.call(this.b,a))return this.b[a];return b};
s.prototype.set=function(a,b){Object.prototype.hasOwnProperty.call(this.b,a)||(this.c++,this.a.push(a),this.l++);this.b[a]=b};function u(a){if(a[1]){var b=a[0],c=b.indexOf("#");c>=0&&(a.push(b.substr(c)),a[0]=b=b.substr(0,c));c=b.indexOf("?");c<0?a[1]="?":c==b.length-1&&(a[1]=void 0)}return a.join("")}function v(a,b){for(var c in b){var d=c,e=b[c],f=a;if(k(e)=="array")for(var h=0;h<e.length;h++)f.push("&",d),e[h]!==""&&f.push("=",m(e[h]));else e!=null&&(f.push("&",d),e!==""&&f.push("=",m(e)))}return a};function w(a,b){this.g=a||{f:""};this.e(b||{})}(function(a){a.d=function(){return a.k||(a.k=new a)}})(w);w.prototype.e=function(a){this.h=new s(a)};w.prototype.i=function(a){this.g.f=a};
w.prototype.j=function(a,b){if(!Object.prototype.hasOwnProperty.call(this.h.b,a))throw Error('The route "'+a+'" does not exist.');var c=this.h.get(a),d=b||{},e=r(d),f="",h=!0;p(c.tokens,function(b){if("text"===b[0])f=b[1]+f,h=!1;else if("variable"===b[0]){if(!1===h||!(b[3]in c.defaults)||b[3]in d&&d[b[3]]!=c.defaults[b[3]]){var j;if(b[3]in d){j=d[b[3]];var o=b[3];o in e&&delete e[o]}else if(b[3]in c.defaults)j=c.defaults[b[3]];else if(h)return;else throw Error('The route "'+a+'" requires the parameter "'+
b[3]+'".');if(!(!0===j||!1===j||""===j)||!h)f=b[1]+encodeURIComponent(j)+f;h=!1}}else throw Error('The token type "'+b[0]+'" is not supported.');});f===""&&(f="/");q(e)>0&&(f=u(v([f],e)));return this.g.f+f};i("fos.Router",w);i("fos.Router.setData",function(a){var b=w.d();b.i(a.base_url);b.e(a.routes)});w.getInstance=w.d;w.prototype.setRoutes=w.prototype.e;w.prototype.setBaseUrl=w.prototype.i;w.prototype.generate=w.prototype.j;window.Routing=w.d();})();

