(function(l){function x(a){var b;if(a&&(b=y.exec(a))){p=b[1];a=b[2].split("/");q=a.shift();z="/"+a.join("/");return true}return false}function F(a){a=a.replace(G,function(e,f){return r[f]||""});if(y.test(a))return a;var b=a.substr(0,1);if(b=="/")return p+"//"+q+a;var c=z.split("/"),d=c.length-1;c[d]=b=="?"?c[d]+a:a;return p+"//"+q+c.join("/")}function A(a,b){i(a)=="array"||(a=a.split(H));for(var c=0,d=a.length;c<d;)b(a[c++])}function B(){var a;if(a=s.shift())a(B);else m=1}function t(a,b,c){function d(){f--;
(e=a.shift())?e(d):f==0&&b()}var e,f=a.length;if(f<1)return b();for(c||(c=1);c-- >0&&(e=a.shift());)e(d)}function j(){if(!C){if(!g.body)return setTimeout(j,1);C=1;m=0;t(s,function(){m=1})}}function I(){if(!u){u=1;if(g.readyState=="complete")return setTimeout(j,1);if(g.addEventListener){var a=function(){g.removeEventListener("DOMContentLoaded",a,false);j()};g.addEventListener("DOMContentLoaded",a,false);l.addEventListener("load",j,false)}else if(g.attachEvent){a=function(){if(g.readyState=="complete"){g.detachEvent("onreadystatechange",
a);j()}};g.attachEvent("onreadystatechange",a);l.attachEvent("onload",j);var b=false;try{b=l.frameElement==null}catch(c){}if(b&&g.documentElement.doScroll){var d=function(){try{g.documentElement.doScroll("left")}catch(e){setTimeout(d,1);return}j()};d()}}}}function n(a,b,c){a=F(a);n[J.test(a)?"link":"script"](a,b,c)}function D(a,b){if(!a)return b();E(a.depends,function(){if(a.state)return b();if(a.test){i(a.test)=="function"||(a.test=new Function("return ("+a.test+") ? true : false;"));if(a.test()){a.state=
200;return b()}}a.state=400;var c=[];A(a.assets,function(d){d&&c.push(function(e){n(d,a.charset,e)})});t(c,function(){a.state=200;b()},3)})}function E(a,b){if(!a)return b();if(i(a)=="object")return D(a,b);var c=[];A(a,function(d){if(d){var e=i(d);if(e!="object"){if(e!="string"||!(d in o))throw'component "'+d+'" is not registered';d=o[d]}c.push(function(f){D(d,f)})}});t(c,b)}function h(a,b){u||I();var c=function(d){var e=i(a);if(e!="object"&&e!="array"&&e!="string")throw"argument 'component' must be object or array or string";
E(a,function(){b&&b();d()})};if(m){m=0;c(B)}else s.push(c)}var g=l.document,k=g.head||g.getElementsByTagName("head")[0]||g.documentElement,H=/[\s|,]+/,y=/^(\w{3,6}:)\/\/([^?]+)/,G=/\{(\w+)\}/g,J=/css$/i,q=location.host,p=location.protocol,z=location.pathname,C=0,m=0,u=0,s=[],K="onload"in g.createElement("link")&&(/AppleWebKit\/([\d\.]+)/.exec(navigator.userAgent)||{1:"537"})[1]>="536",v=1E4,r={},o={},i=function(){for(var a={},b=Object.prototype.toString,c=0,d="Boolean Number String Function Array Date RegExp Object".split(" "),
e;e=d[c++];)a["[object "+e+"]"]=e.toLowerCase();return function(f){return f==null?String(f):a[b.call(f)]||"object"}}();(function(){for(var a=k.getElementsByTagName("base"),b=a.length,c=0;c<b&&!x(a[c++].getAttribute("href")););})();n.link=function(a,b,c){function d(){f&&clearInterval(f);w&&clearTimeout(w);e=e.onload=null}var e=g.createElement("link"),f=null,w=null;b&&e.setAttribute("charset",b);e.rel="stylesheet";e.href=a;e.type="text/css";if(K){e.onload=function(){d();setTimeout(function(){c(200)},
0)};e.onerror=function(){c(404)}}else f=setInterval(function(){d();setTimeout(function(){c(200)},0)},13);w=setTimeout(function(){d();c(404)},v);k.appendChild(e)};n.script=function(a,b,c){var d=g.createElement("script"),e=null,f=function(){e&&clearTimeout(e);d.onload=d.onreadystatechange=d.onerror=null;k&&d.parentNode&&k.removeChild(d);d=null};b&&d.setAttribute("charset",b);d.async="async";d.src=a;d.onload=d.onreadystatechange=function(){if(!d.readyState||/loaded|complete/.test(d.readyState)){f();
setTimeout(function(){c(200)},0)}};d.onerror=function(){f();c(404)};e=setTimeout(function(){f();c(404)},v);k.insertBefore(d,k.firstChild)};h.init=function(a){for(var b in a){var c="set"+b.charAt(0).toUpperCase()+b.substr(1);c in h&&h[c](a[b])}};h.setAlias=function(a,b){if(i(a)=="object")for(var c in a)r[c]=a[c];else r[a]=b};h.setBase=x;h.setTimeout=function(a){v=parseInt(a)};h.register=function(a,b){if(i(a)=="object")for(var c in a)h.register(c,a[c]);else{if(a in o)throw'component name "'+a+'" is conflict in repos';
if(i(b)!="object")throw'argument "conf" must be object';o[a]=b}};l.fet=h})(window);
