thelounge/client/js/libs.min.js

11 lines
317 KiB
JavaScript
Raw Normal View History

2014-12-11 23:58:03 +00:00
(function(){var a=function(a){"use strict";a=a?a:{};var b={bgColor:"#d00",textColor:"#fff",fontFamily:"sans-serif",fontStyle:"bold",type:"circle",position:"down",animation:"slide",elementId:false};var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;o={};o.ff=typeof InstallTrigger!="undefined";o.chrome=!!window.chrome;o.opera=!!window.opera||navigator.userAgent.indexOf("Opera")>=0;o.ie=false;o.safari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0;o.supported=o.chrome||o.ff||o.opera;var r=[];m=function(){};j=n=false;var s=function(){c=D(b,a);c.bgColor=C(c.bgColor);c.textColor=C(c.textColor);c.position=c.position.toLowerCase();c.animation=F.types[""+c.animation]?c.animation:b.animation;var j=c.position.indexOf("up")>-1;var k=c.position.indexOf("left")>-1;if(j||k){for(var l=0;l<F.types[""+c.animation].length;l++){var m=F.types[""+c.animation][l];if(j){if(m.y<.6){m.y=m.y-.4}else{m.y=m.y-2*m.y+(1-m.w)}}if(k){if(m.x<.6){m.x=m.x-.4}else{m.x=m.x-2*m.x+(1-m.h)}}F.types[""+c.animation][l]=m}}c.type=u[""+c.type]?c.type:b.type;try{d=B.getIcon();g=document.createElement("canvas");i=document.createElement("img");if(d.hasAttribute("href")){i.setAttribute("src",d.getAttribute("href"));i.onload=function(){e=i.height>0?i.height:32;f=i.width>0?i.width:32;g.height=e;g.width=f;h=g.getContext("2d");t.ready()}}else{i.setAttribute("src","");e=32;f=32;i.height=e;i.width=f;g.height=e;g.width=f;h=g.getContext("2d");t.ready()}}catch(n){throw"Error initializing favico. Message: "+n.message}};var t={};t.ready=function(){j=true;t.reset();m()};t.reset=function(){if(!j){return}r=[];k=false;h.clearRect(0,0,f,e);h.drawImage(i,0,0,f,e);B.setIcon(g);window.clearTimeout(p);window.clearTimeout(q)};t.start=function(){if(!j||l){return}var a=function(){k=r[0];l=false;if(r.length>0){r.shift();t.start()}else{}};if(r.length>0){l=true;var b=function(){["type","animation","bgColor","textColor","fontFamily","fontStyle"].forEach(function(a){if(a in r[0].options){c[a]=r[0].options[a]}});F.run(r[0].options,function(){a()},false)};if(k){F.run(k.options,function(){b()},true)}else{b()}}};var u={};var v=function(a){a.n=typeof a.n==="number"?Math.abs(a.n|0):a.n;a.x=f*a.x;a.y=e*a.y;a.w=f*a.w;a.h=e*a.h;a.len=(""+a.n).length;return a};u.circle=function(a){a=v(a);var b=false;if(a.len===2){a.x=a.x-a.w*.4;a.w=a.w*1.4;b=true}else if(a.len>=3){a.x=a.x-a.w*.65;a.w=a.w*1.65;b=true}h.clearRect(0,0,f,e);h.drawImage(i,0,0,f,e);h.beginPath();h.font=c.fontStyle+" "+Math.floor(a.h*(a.n>99?.85:1))+"px "+c.fontFamily;h.textAlign="center";if(b){h.moveTo(a.x+a.w/2,a.y);h.lineTo(a.x+a.w-a.h/2,a.y);h.quadraticCurveTo(a.x+a.w,a.y,a.x+a.w,a.y+a.h/2);h.lineTo(a.x+a.w,a.y+a.h-a.h/2);h.quadraticCurveTo(a.x+a.w,a.y+a.h,a.x+a.w-a.h/2,a.y+a.h);h.lineTo(a.x+a.h/2,a.y+a.h);h.quadraticCurveTo(a.x,a.y+a.h,a.x,a.y+a.h-a.h/2);h.lineTo(a.x,a.y+a.h/2);h.quadraticCurveTo(a.x,a.y,a.x+a.h/2,a.y)}else{h.arc(a.x+a.w/2,a.y+a.h/2,a.h/2,0,2*Math.PI)}h.fillStyle="rgba("+c.bgColor.r+","+c.bgColor.g+","+c.bgColor.b+","+a.o+")";h.fill();h.closePath();h.beginPath();h.stroke();h.fillStyle="rgba("+c.textColor.r+","+c.textColor.g+","+c.textColor.b+","+a.o+")";if(typeof a.n==="number"&&a.n>999){h.fillText((a.n>9999?9:Math.floor(a.n/1e3))+"k+",Math.floor(a.x+a.w/2),Math.floor(a.y+a.h-a.h*.2))}else{h.fillText(a.n,Math.floor(a.x+a.w/2),Math.floor(a.y+a.h-a.h*.15))}h.closePath()};u.rectangle=function(a){a=v(a);var b=false;if(a.len===2){a.x=a.x-a.w*.4;a.w=a.w*1.4;b=true}else if(a.len>=3){a.x=a.x-a.w*.65;a.w=a.w*1.65;b=true}h.clearRect(0,0,f,e);h.drawImage(i,0,0,f,e);h.beginPath();h.font=c.fontStyle+" "+Math.floor(a.h*(a.n>99?.9:1))+"px "+c.fontFamily;h.textAlign="center";h.fillStyle="rgba("+c.bgColor.r+","+c.bgColor.g+","+c.bgColor.b+","+a.o+")";h.fillRect(a.x,a.y,a.w,a.h);h.fillStyle="rgba("+c.textColor.r+","+c.textColor.g+","+c.textColor.b+","+a.o+")";if(typeof a.n==="number"&&a.n>999){h.fillText((a.n>9999?9:Math.floor(a.n/1e3))+"k+",Math.floor(a.x+a.w/2),Math.floor(a.y+a.h-a.h*.2))}else{h.fillText(a.n,Math.floor(a.x+a.w/2),Math.floor(a.y+a.h-a.h*.15))}h.closePath()};var w=function(a,b){b=(typeof b==="string"?{animation:b
if(c.matchesSelector&&p&&(!r||!r.test(b))&&(!q||!q.test(b))){try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&a.document.nodeType!==11){return d}}catch(e){}}return fb(b,n,null,[a]).length>0};fb.contains=function(a,b){if((a.ownerDocument||a)!==n){m(a)}return t(a,b)};fb.attr=function(a,b){if((a.ownerDocument||a)!==n){m(a)}var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):undefined;return f!==undefined?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null};fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};fb.uniqueSort=function(a){var b,d=[],e=0,f=0;l=!c.detectDuplicates;k=!c.sortStable&&a.slice(0);a.sort(B);if(l){while(b=a[f++]){if(b===a[f]){e=d.push(f)}}while(e--){a.splice(d[e],1)}}k=null;return a};e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(!f){while(b=a[d++]){c+=e(b)}}else if(f===1||f===9||f===11){if(typeof a.textContent==="string"){return a.textContent}else{for(a=a.firstChild;a;a=a.nextSibling){c+=e(a)}}}else if(f===3||f===4){return a.nodeValue}return c};d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){a[1]=a[1].replace(cb,db);a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db);if(a[2]==="~="){a[3]=" "+a[3]+" "}return a.slice(0,4)},CHILD:function(a){a[1]=a[1].toLowerCase();if(a[1].slice(0,3)==="nth"){if(!a[3]){fb.error(a[0])}a[4]=+(a[4]?a[5]+(a[6]||1):2*(a[3]==="even"||a[3]==="odd"));a[5]=+(a[7]+a[8]||a[3]==="odd")}else if(a[3]){fb.error(a[0])}return a},PSEUDO:function(a){var b,c=!a[6]&&a[2];if(X["CHILD"].test(a[0])){return null}if(a[3]){a[2]=a[4]||a[5]||""}else if(c&&V.test(c)&&(b=g(c,true))&&(b=c.indexOf(")",c.length-b)-c.length)){a[0]=a[0].slice(0,b);a[2]=c.slice(0,b)}return a.slice(0,3)}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return a==="*"?function(){return true}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test(typeof a.className==="string"&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);if(e==null){return b==="!="}if(!b){return true}e+="";return b==="="?e===c:b==="!="?e!==c:b==="^="?c&&e.indexOf(c)===0:b==="*="?c&&e.indexOf(c)>-1:b==="$="?c&&e.slice(-c.length)===c:b==="~="?(" "+e+" ").indexOf(c)>-1:b==="|="?e===c||e.slice(0,c.length+1)===c+"-":false}},CHILD:function(a,b,c,d,e){var f=a.slice(0,3)!=="nth",g=a.slice(-4)!=="last",h=b==="of-type";return d===1&&e===0?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p]){if(h?l.nodeName.toLowerCase()===r:l.nodeType===1){return false}}o=p=a==="only"&&!o&&"nextSibling"}return true}o=[g?q.firstChild:q.lastChild];if(g&&s){k=q[u]||(q[u]={});j=k[a]||[];n=j[0]===w&&j[1];m=j[0]===w&&j[2];l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop()){if(l.nodeType===1&&++m&&l===b){k[a]=[w,n,m];break}}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w){m=j[1]}else{while(l=++n&&l&&l[p]||(m=n=0)||o.pop()){if((h?l.nodeName.toLowerCase()===r:l.nodeType===1)&&++m){if(s){(l[u]||(l[u]={}))[a]=[w,m]}if(l===b){break}}}}m-=e;return m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);if(e[u]){return e(b)}if(e.length>1){c=[a,a,"",b];return d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--){d=K.call(a,f[g]);a[d]=!(c[d]=f[g])}}):function(a){return e(a,0,c)}}return e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--){if(f=g[h]){a[h]=!(b[h]=f)}}}):function(a,e,f){b[0]=a;d(b,null,f,c);return!c.pop()}}
}}}})}n.fn.extend({on:function(a,b,c,d,e){var f,g;if(typeof a==="object"){if(typeof b!=="string"){c=c||b;b=undefined}for(g in a){this.on(g,b,c,a[g],e)}return this}if(c==null&&d==null){d=b;c=b=undefined}else if(d==null){if(typeof b==="string"){d=c;c=undefined}else{d=c;c=b;b=undefined}}if(d===false){d=$}else if(!d){return this}if(e===1){f=d;d=function(a){n().off(a);return f.apply(this,arguments)};d.guid=f.guid||(f.guid=n.guid++)}return this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj){d=a.handleObj;n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler);return this}if(typeof a==="object"){for(e in a){this.off(e,b,a[e])}return this}if(b===false||typeof b==="function"){c=b;b=undefined}if(c===false){c=$}return this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c){return n.event.trigger(a,b,c,true)}}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option;ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead;ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(b.nodeType!==11?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){a.type=(a.getAttribute("type")!==null)+"/"+a.type;return a}function lb(a){var b=gb.exec(a.type);if(b){a.type=b[1]}else{a.removeAttribute("type")}return a}function mb(a,b){var c=0,d=a.length;for(;c<d;c++){L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}}function nb(a,b){var c,d,e,f,g,h,i,j;if(b.nodeType!==1){return}if(L.hasData(a)){f=L.access(a);g=L.set(b,f);j=f.events;if(j){delete g.handle;g.events={};for(e in j){for(c=0,d=j[e].length;c<d;c++){n.event.add(b,e,j[e][c])}}}}if(M.hasData(a)){h=M.access(a);i=n.extend({},h);M.set(b,i)}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return b===undefined||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();if(c==="input"&&T.test(a.type)){b.checked=a.checked}else if(c==="input"||c==="textarea"){b.defaultValue=a.defaultValue}}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(true),i=n.contains(a.ownerDocument,a);if(!k.noCloneChecked&&(a.nodeType===1||a.nodeType===11)&&!n.isXMLDoc(a)){g=ob(h);f=ob(a);for(d=0,e=f.length;d<e;d++){pb(f[d],g[d])}}if(b){if(c){f=f||ob(a);g=g||ob(h);for(d=0,e=f.length;d<e;d++){nb(f[d],g[d])}}else{nb(a,h)}}g=ob(h,"script");if(g.length>0){mb(g,!i&&ob(a,"script"))}return h},buildFragment:function(a,b,c,d){var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;for(;m<o;m++){e=a[m];if(e||e===0){if(n.type(e)==="object"){n.merge(l,e.nodeType?[e]:e)}else if(!cb.test(e)){l.push(b.createTextNode(e))}else{f=f||k.appendChild(b.createElement("div"));g=(bb.exec(e)||["",""])[1].toLowerCase();h=ib[g]||ib._default;f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2];j=h[0];while(j--){f=f.lastChild}n.merge(l,f.childNodes);f=k.firstChild;f.textContent=""}}}k.textContent="";m=0;while(e=l[m++]){if(d&&n.inArray(e,d)!==-1){continue}i=n.contains(e.ownerDocument,e);f=ob(k.appendChild(e),"script");if(i){mb(f)}if(c){j=0;while(e=f[j++]){if(fb.test(e.type||"")){c.push(e)}}}}return k},cleanData:function(a){var b,c,d,e,f=n.event.special,g=0;for(;(c=a[g])!==undefined;g++){if(n.acceptData(c)){e=c[L.expando];if(e&&(b=L.cache[e])){if(b.events){for(d in b.events){if(f[d]){n.event.remove(c,d)}else{n.
if(k.crossDomain==null){h=mc.exec(k.url.toLowerCase());k.crossDomain=!!(h&&(h[1]!==ec[1]||h[2]!==ec[2]||(h[3]||(h[1]==="http:"?"80":"443"))!==(ec[3]||(ec[1]==="http:"?"80":"443"))))}if(k.data&&k.processData&&typeof k.data!=="string"){k.data=n.param(k.data,k.traditional)}sc(nc,k,b,v);if(t===2){return v}i=k.global;if(i&&n.active++===0){n.event.trigger("ajaxStart")}k.type=k.type.toUpperCase();k.hasContent=!kc.test(k.type);d=k.url;if(!k.hasContent){if(k.data){d=k.url+=(dc.test(d)?"&":"?")+k.data;delete k.data}if(k.cache===false){k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++}}if(k.ifModified){if(n.lastModified[d]){v.setRequestHeader("If-Modified-Since",n.lastModified[d])}if(n.etag[d]){v.setRequestHeader("If-None-Match",n.etag[d])}}if(k.data&&k.hasContent&&k.contentType!==false||b.contentType){v.setRequestHeader("Content-Type",k.contentType)}v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+(k.dataTypes[0]!=="*"?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers){v.setRequestHeader(j,k.headers[j])}if(k.beforeSend&&(k.beforeSend.call(l,v,k)===false||t===2)){return v.abort()}u="abort";for(j in{success:1,error:1,complete:1}){v[j](k[j])}c=sc(oc,k,b,v);if(!c){x(-1,"No Transport")}else{v.readyState=1;if(i){m.trigger("ajaxSend",[v,k])}if(k.async&&k.timeout>0){g=setTimeout(function(){v.abort("timeout")},k.timeout)}try{t=1;c.send(r,x)}catch(w){if(t<2){x(-1,w)}else{throw w}}}function x(a,b,f,h){var j,r,s,u,w,x=b;if(t===2){return}t=2;if(g){clearTimeout(g)}c=undefined;e=h||"";v.readyState=a>0?4:0;j=a>=200&&a<300||a===304;if(f){u=uc(k,v,f)}u=vc(k,u,v,j);if(j){if(k.ifModified){w=v.getResponseHeader("Last-Modified");if(w){n.lastModified[d]=w}w=v.getResponseHeader("etag");if(w){n.etag[d]=w}}if(a===204||k.type==="HEAD"){x="nocontent"}else if(a===304){x="notmodified"}else{x=u.state;r=u.data;s=u.error;j=!s}}else{s=x;if(a||!x){x="error";if(a<0){a=0}}}v.status=a;v.statusText=(b||x)+"";if(j){o.resolveWith(l,[r,x,v])}else{o.rejectWith(l,[v,x,s])}v.statusCode(q);q=undefined;if(i){m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s])}p.fireWith(l,[v,x]);if(i){m.trigger("ajaxComplete",[v,k]);if(!--n.active){n.event.trigger("ajaxStop")}}}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,undefined,b,"script")}});n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){if(n.isFunction(c)){e=e||d;d=c;c=undefined}return n.ajax({url:a,type:b,dataType:e,data:c,success:d})}});n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}});n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:false,global:false,"throws":true})};n.fn.extend({wrapAll:function(a){var b;if(n.isFunction(a)){return this.each(function(b){n(this).wrapAll(a.call(this,b))})}if(this[0]){b=n(a,this[0].ownerDocument).eq(0).clone(true);if(this[0].parentNode){b.insertBefore(this[0])}b.map(function(){var a=this;while(a.firstElementChild){a=a.firstElementChild}return a}).append(this)}return this},wrapInner:function(a){if(n.isFunction(a)){return this.each(function(b){n(this).wrapInner(a.call(this,b))})}return this.each(function(){var b=n(this),c=b.contents();if(c.length){c.wrapAll(a)}else{b.append(a)}})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){if(!n.nodeName(this,"body")){n(this).replaceWith(this.childNodes)}}).end()}});n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0};n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b)){n.each(b,function(b,e){if(c||xc.test(a)){d(a,e)}else{Bc(a+"["+(typeof e==="object"?b:"")+"]",e,c,d)}})}else if(!c&&n.type(b)==="object"){for(e in b){Bc(a+"["+e+"]",b[e],c,d)}}else{d(a,b)}}n.param=function(a,b){var c,d=[],e=f
d=d||{};c=a.Event(c);c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();c.target=this.element[0];f=c.originalEvent;if(f){for(e in f){if(!(e in c)){c[e]=f[e]}}}this.element.trigger(c,d);return!(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===false||c.isDefaultPrevented())}};a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){if(typeof e==="string"){e={effect:e}}var g,h=!e?b:e===true||typeof e==="number"?c:e.effect||c;e=e||{};if(typeof e==="number"){e={duration:e}}g=!a.isEmptyObject(e);e.complete=f;if(e.delay){d.delay(e.delay)}if(g&&a.effects&&a.effects.effect[h]){d[b](e)}else if(h!==b&&d[h]){d[h](e.duration,e.easing,f)}else{d.queue(function(c){a(this)[b]();if(f){f.call(d[0])}c()})}}});var f=a.widget;var g=false;a(document).mouseup(function(){g=false});var h=a.widget("ui.mouse",{version:"1.11.1",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(true===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);if(this._mouseMoveDelegate){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(b){if(g){return}this._mouseStarted&&this._mouseUp(b);this._mouseDownEvent=b;var c=this,d=b.which===1,e=typeof this.options.cancel==="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:false;if(!d||e||!this._mouseCapture(b)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==false;if(!this._mouseStarted){b.preventDefault();return true}}if(true===a.data(b.target,this.widgetName+".preventClickEvent")){a.removeData(b.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(a){return c._mouseMove(a)};this._mouseUpDelegate=function(a){return c._mouseUp(a)};this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.preventDefault();g=true;return true},_mouseMove:function(b){if(a.ui.ie&&(!document.documentMode||document.documentMode<9)&&!b.button){return this._mouseUp(b)}else if(!b.which){return this._mouseUp(b)}if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==false;this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)}return!this._mouseStarted},_mouseUp:function(b){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(b.target===this._mouseDownEvent.target){a.data(b.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(b)}g=false;return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}});a.widget("ui.draggable",a.ui.mouse,{version:"1.11.1",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag
for(;b<4;b++){c[b]=parseInt(d[b],10)||0;c[b]+=parseInt(e[b],10)||0}return{height:c[0]+c[2],width:c[1]+c[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var a,b=0,c=this.helper||this.element;for(;b<this._proportionallyResizeElements.length;b++){a=this._proportionallyResizeElements[b];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(a)}a.css({height:c.height()-this.outerDimensions.height||0,width:c.width()-this.outerDimensions.width||0})}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a("<div style='overflow:hidden;'></div>");this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++c.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(a,b){return{width:this.originalSize.width+b}},w:function(a,b){var c=this.originalSize,d=this.originalPosition;return{left:d.left+b,width:c.width-b}},n:function(a,b,c){var d=this.originalSize,e=this.originalPosition;return{top:e.top+c,height:d.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]);b!=="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});a.ui.plugin.add("resizable","animate",{stop:function(b){var c=a(this).resizable("instance"),d=c.options,e=c._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&c._hasScroll(e[0],"left")?0:c.sizeDiff.height,h=f?0:c.sizeDiff.width,i={width:c.size.width-h,height:c.size.height-g},j=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,k=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;c.element.animate(a.extend(i,k&&j?{top:k,left:j}:{}),{duration:d.animateDuration,easing:d.animateEasing,step:function(){var d={width:parseInt(c.element.css("width"),10),height:parseInt(c.element.css("height"),10),top:parseInt(c.element.css("top"),10),left:parseInt(c.element.css("left"),10)};if(e&&e.length){a(e[0]).css({width:d.width,height:d.height})}c._updateCache(d);c._propagate("resize",b)}})}});a.ui.plugin.add("resizable","containment",{start:function(){var b,c,d,e,f,g,h,i=a(this).resizable("instance"),j=i.options,k=i.element,l=j.containment,m=l instanceof a?l.get(0):/parent/.test(l)?k.parent().get(0):l;if(!m){return}i.containerElement=a(m);if(/document/.test(l)||l===document){i.containerOffset={left:0,top:0};i.containerPosition={left:0,top:0};i.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight}}else{b=a(m);c=[];a(["Top","Right","Left","Bottom"]).each(function(a,d){c[a]=i._num(b.css("padding"+d))});i.containerOffset=b.offset();i.containerPosition=b.position();i.containerSize={height:b.innerHeight()-c[3],width:b.innerWidth()-c[1]};d=i.containerOffset;e=i.containerSize.height;f=i.containerSize.width;g=i._hasScroll(m,"left")?m.scrollWidth:f;h=i._hasScroll(m)?m.scrollHeight:e;i.parentData={element:m,left:d.left,top:d.top,width:g,height:h}}},resize:function(b){var c,d,e,f,g=a(this).resizable("instance"),h=g.options,i=g.containerOffset,j=g.position,k=g._aspectRatio||b.shiftKey,l={top:0,left:0},m=g.containerElement,n=true;if(
}}.call(this,this.currentContainer));d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.currentContainer))}}function e(a,b,c){return function(d){c._trigger(a,d,b._uiHash(b))}}for(c=this.containers.length-1;c>=0;c--){if(!b){d.push(e("deactivate",this,this.containers[c]))}if(this.containers[c].containerCache.over){d.push(e("out",this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(c=0;c<d.length;c++){d[c].call(this,a)}this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return false}if(!b){this._trigger("beforeStop",a,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!==this.currentItem[0]){this.helper.remove()}this.helper=null;if(!b){for(c=0;c<d.length;c++){d[c].call(this,a)}this._trigger("stop",a,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}})});(function(a,b,c){var d={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},e={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},f={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},g={option:"alt",command:"meta","return":"enter",escape:"esc",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},h,i={},j={},k={},l,m=false,n=false,o=false;for(var p=1;p<20;++p){d[111+p]="f"+p}for(p=0;p<=9;++p){d[p+96]=p}function q(a,b,c){if(a.addEventListener){a.addEventListener(b,c,false);return}a.attachEvent("on"+b,c)}function r(a){if(a.type=="keypress"){var b=String.fromCharCode(a.which);if(!a.shiftKey){b=b.toLowerCase()}return b}if(d[a.which]){return d[a.which]}if(e[a.which]){return e[a.which]}return String.fromCharCode(a.which).toLowerCase()}function s(a,b){return a.sort().join(",")===b.sort().join(",")}function t(a){a=a||{};var b=false,c;for(c in k){if(a[c]){b=true;continue}k[c]=0}if(!b){o=false}}function u(a,b,c,d,e,f){var g,h,j=[],l=c.type;if(!i[a]){return[]}if(l=="keyup"&&B(a)){b=[a]}for(g=0;g<i[a].length;++g){h=i[a][g];if(!d&&h.seq&&k[h.seq]!=h.level){continue}if(l!=h.action){continue}if(l=="keypress"&&!c.metaKey&&!c.ctrlKey||s(b,h.modifiers)){var m=!d&&h.combo==e;var n=d&&h.seq==d&&h.level==f;if(m||n){i[a].splice(g,1)}j.push(h)}}return j}function v(a){var b=[];if(a.shiftKey){b.push("shift")}if(a.altKey){b.push("alt")}if(a.ctrlKey){b.push("ctrl")}if(a.metaKey){b.push("meta")}return b}function w(a){if(a.preventDefault){a.preventDefault();return}a.returnValue=false}function x(a){if(a.stopPropagation){a.stopPropagation();return}a.cancelBubble=true}function y(a,b,c,d){if(K.stopCallback(b,b.target||b.srcElement,c,d)){return}if(a(b,c)===false){w(b);x(b)}}function z(a,b,c){var d=u(a,b,c),e,f={},g=0,h=false;for(e=0;e<d.length;++e){if(d[e].seq){g=Math.max(g,d[e].level)}}for(e=0;e<d.length;++e){if(d[e].seq){if(d[e].level!=g){continue}h=true;f[d[e].seq]=1;y(d[e].callback,c,d[e].combo,d[e].seq);continue}if(!h){y(d[e].callback,c,d[e].combo)}}var i=c.type=="keypress"&&n;if(c.type==o&&!B(a)&&!i){t(f)}n=h&&c.type=="keydown"}function A(a){if(typeof a.which!=="number"){a.which=a.keyCode}var b=r(a);if(!b){return}if(a.type=="keyup"&&m===b
}d=b.duration.fn._lang=b.fn._lang=Db(a);return d._abbr};b.langData=function(a){if(a&&a._lang&&a._lang._abbr){a=a._lang._abbr}return Db(a)};b.isMoment=function(a){return a instanceof fb||a!=null&&a.hasOwnProperty("_isAMomentObject")};b.isDuration=function(a){return a instanceof gb};for(g=$.length-1;g>=0;--g){rb($[g])}b.normalizeUnits=function(a){return pb(a)};b.invalid=function(a){var c=b.utc(NaN);if(a!=null){hb(c._pf,a)}else{c._pf.userInvalidated=true}return c};b.parseZone=function(){return b.apply(null,arguments).parseZone()};b.parseTwoDigitYear=function(a){return sb(a)+(sb(a)>68?1900:2e3)};hb(b.fn=fb.prototype,{clone:function(){return b(this)},valueOf:function(){return+this._d+(this._offset||0)*6e4},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=b(this).utc();if(0<a.year()&&a.year()<=9999){return Gb(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}else{return Gb(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds()]},isValid:function(){return yb(this)},isDSTShifted:function(){if(this._a){return this.isValid()&&ob(this._a,(this._isUTC?b.utc(this._a):b(this._a)).toArray())>0}return false},parsingFlags:function(){return hb({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(){return this.zone(0)},local:function(){this.zone(0);this._isUTC=false;return this},format:function(a){var c=Gb(this,a||b.defaultFormat);return this.lang().postformat(c)},add:function(a,c){var d;if(typeof a==="string"&&typeof c==="string"){d=b.duration(isNaN(+c)?+a:+c,isNaN(+c)?c:a)}else if(typeof a==="string"){d=b.duration(+c,a)}else{d=b.duration(a,c)}lb(this,d,1);return this},subtract:function(a,c){var d;if(typeof a==="string"&&typeof c==="string"){d=b.duration(isNaN(+c)?+a:+c,isNaN(+c)?c:a)}else if(typeof a==="string"){d=b.duration(+c,a)}else{d=b.duration(a,c)}lb(this,d,-1);return this},diff:function(a,c,d){var e=Ab(a,this),f=(this.zone()-e.zone())*6e4,g,h;c=pb(c);if(c==="year"||c==="month"){g=(this.daysInMonth()+e.daysInMonth())*432e5;h=(this.year()-e.year())*12+(this.month()-e.month());h+=(this-b(this).startOf("month")-(e-b(e).startOf("month")))/g;h-=(this.zone()-b(this).startOf("month").zone()-(e.zone()-b(e).startOf("month").zone()))*6e4/g;if(c==="year"){h=h/12}}else{g=this-e;h=c==="second"?g/1e3:c==="minute"?g/6e4:c==="hour"?g/36e5:c==="day"?(g-f)/864e5:c==="week"?(g-f)/6048e5:g}return d?h:jb(h)},from:function(a,c){return b.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!c)},fromNow:function(a){return this.from(b(),a)},calendar:function(a){var c=a||b(),d=Ab(c,this).startOf("day"),e=this.diff(d,"days",true),f=e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse";return this.format(this.lang().calendar(f,this))},isLeapYear:function(){return wb(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();if(a!=null){a=Yb(a,this.lang());return this.add({d:a-b})}else{return b}},month:gc("Month",true),startOf:function(a){a=pb(a);switch(a){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}if(a==="week"){this.weekday(0)}else if(a==="isoWeek"){this.isoWeekday(1)}if(a==="quarter"){this.month(Math.floor(this.month()/3)*3)}return this},endOf:function(a){a=pb(a);return this.startOf(a).add(a==="isoWeek"?"week":a,1).subtract("ms",1)},isAfter:function(a,c){c=typeof c!=="undefined"?c:"millisecond";return+this.clone().startOf(c)>+b(a).startOf(c)},isBefore:function(a,c){c=typeof c!=="undefined"?c:"millisecond";return+this.clone().startOf(c)<+b(a).startOf(c)},isSame:function(a,b){b=b||"ms";return+this.clone().startOf(b)===+Ab(a,this).startOf(b
this.id=a.sid;this.transport.query.sid=a.sid;this.upgrades=this.filterUpgrades(a.upgrades);this.pingInterval=a.pingInterval;this.pingTimeout=a.pingTimeout;this.onOpen();if("closed"==this.readyState)return;this.setPing();this.removeListener("heartbeat",this.onHeartbeat);this.on("heartbeat",this.onHeartbeat)};n.prototype.onHeartbeat=function(a){clearTimeout(this.pingTimeoutTimer);var b=this;b.pingTimeoutTimer=setTimeout(function(){if("closed"==b.readyState)return;b.onClose("ping timeout")},a||b.pingInterval+b.pingTimeout)};n.prototype.setPing=function(){var a=this;clearTimeout(a.pingIntervalTimer);a.pingIntervalTimer=setTimeout(function(){g("writing ping packet - expecting pong within %sms",a.pingTimeout);a.ping();a.onHeartbeat(a.pingTimeout)},a.pingInterval)};n.prototype.ping=function(){this.sendPacket("ping")};n.prototype.onDrain=function(){for(var a=0;a<this.prevBufferLen;a++){if(this.callbackBuffer[a]){this.callbackBuffer[a]()}}this.writeBuffer.splice(0,this.prevBufferLen);this.callbackBuffer.splice(0,this.prevBufferLen);this.prevBufferLen=0;if(this.writeBuffer.length==0){this.emit("drain")}else{this.flush()}};n.prototype.flush=function(){if("closed"!=this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){g("flushing %d packets in socket",this.writeBuffer.length);this.transport.send(this.writeBuffer);this.prevBufferLen=this.writeBuffer.length;this.emit("flush")}};n.prototype.write=n.prototype.send=function(a,b){this.sendPacket("message",a,b);return this};n.prototype.sendPacket=function(a,b,c){var d={type:a,data:b};this.emit("packetCreate",d);this.writeBuffer.push(d);this.callbackBuffer.push(c);this.flush()};n.prototype.close=function(){if("opening"==this.readyState||"open"==this.readyState){this.onClose("forced close");g("socket closing - telling transport to close");this.transport.close()}return this};n.prototype.onError=function(a){g("socket error %j",a);n.priorWebsocketSuccess=false;this.emit("error",a);this.onClose("transport error",a)};n.prototype.onClose=function(a,b){if("opening"==this.readyState||"open"==this.readyState){g('socket close with reason: "%s"',a);var c=this;clearTimeout(this.pingIntervalTimer);clearTimeout(this.pingTimeoutTimer);setTimeout(function(){c.writeBuffer=[];c.callbackBuffer=[];c.prevBufferLen=0},0);this.transport.removeAllListeners("close");this.transport.close();this.transport.removeAllListeners();this.readyState="closed";this.id=null;this.emit("close",a,b)}};n.prototype.filterUpgrades=function(a){var b=[];for(var c=0,d=a.length;c<d;c++){if(~h(this.transports,a[c]))b.push(a[c])}return b}},{"./transport":14,"./transports":15,"component-emitter":8,debug:9,"engine.io-parser":22,indexof:36,parsejson:29,parseqs:30,parseuri:38}],14:[function(a,b,c){var d=a("engine.io-parser");var e=a("component-emitter");b.exports=f;function f(a){this.path=a.path;this.hostname=a.hostname;this.port=a.port;this.secure=a.secure;this.query=a.query;this.timestampParam=a.timestampParam;this.timestampRequests=a.timestampRequests;this.readyState="";this.agent=a.agent||false;this.socket=a.socket}e(f.prototype);f.timestamps=0;f.prototype.onError=function(a,b){var c=new Error(a);c.type="TransportError";c.description=b;this.emit("error",c);return this};f.prototype.open=function(){if("closed"==this.readyState||""==this.readyState){this.readyState="opening";this.doOpen()}return this};f.prototype.close=function(){if("opening"==this.readyState||"open"==this.readyState){this.doClose();this.onClose()}return this};f.prototype.send=function(a){if("open"==this.readyState){this.write(a)}else{throw new Error("Transport not open")}};f.prototype.onOpen=function(){this.readyState="open";this.writable=true;this.emit("open")};f.prototype.onData=function(a){try{var b=d.decodePacket(a,this.socket.binaryType);this.onPacket(b)}catch(c){c.data=a;this.onError("parser decode error",c)}};f.prototype.onPacket=function(a){this.emit("packet",a)};f.prototype.onClose=function(){this.readyState="closed";this.emit("close")}},{"component-emitter":8,"engine.io-parser":22}],15:[function(a,b,c){var d=typeof self!=="undefined"?s
}catch(i){h=false}}b=h}if(a=="json-parse"){var l=j.parse;if(typeof l=="function"){try{if(l("0")===0&&!l(false)){d=l(e);var n=d["a"].length==5&&d["a"][0]===1;if(n){try{n=!l('" "')}catch(i){}if(n){try{n=l("01")!==1}catch(i){}}if(n){try{n=l("1.")!==1}catch(i){}}}}}catch(i){n=false}}b=n}}return m[a]=!!b}if(!m("json")){var n="[object Function]";var o="[object Date]";var p="[object Number]";var q="[object String]";var r="[object Array]";var s="[object Boolean]";var t=m("bug-string-char-index");if(!k){var u=Math.floor;var v=[0,31,59,90,120,151,181,212,243,273,304,334];var w=function(a,b){return v[b]+365*(a-1970)+u((a-1969+(b=+(b>1)))/4)-u((a-1901+b)/100)+u((a-1601+b)/400)}}if(!(e={}.hasOwnProperty)){e=function(a){var b={},d;if((b.__proto__=null,b.__proto__={toString:1},b).toString!=c){e=function(a){var b=this.__proto__,c=a in(this.__proto__=null,this);this.__proto__=b;return c}}else{d=b.constructor;e=function(a){var b=(this.constructor||d).prototype;return a in this&&!(a in b&&this[a]===b[a])}}b=null;return e.call(this,a)}}var x={"boolean":1,number:1,string:1,undefined:1};var y=function(a,b){var c=typeof a[b];return c=="object"?!!a[b]:!x[c]};f=function(a,b){var d=0,g,h,i;(g=function(){this.valueOf=0}).prototype.valueOf=0;h=new g;for(i in h){if(e.call(h,i)){d++}}g=h=null;if(!d){h=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];f=function(a,b){var d=c.call(a)==n,f,g;var i=!d&&typeof a.constructor!="function"&&y(a,"hasOwnProperty")?a.hasOwnProperty:e;for(f in a){if(!(d&&f=="prototype")&&i.call(a,f)){b(f)}}for(g=h.length;f=h[--g];i.call(a,f)&&b(f));}}else if(d==2){f=function(a,b){var d={},f=c.call(a)==n,g;for(g in a){if(!(f&&g=="prototype")&&!e.call(d,g)&&(d[g]=1)&&e.call(a,g)){b(g)}}}}else{f=function(a,b){var d=c.call(a)==n,f,g;for(f in a){if(!(d&&f=="prototype")&&e.call(a,f)&&!(g=f==="constructor")){b(f)}}if(g||e.call(a,f="constructor")){b(f)}}}return f(a,b)};if(!m("json-stringify")){var z={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"};var A="000000";var B=function(a,b){return(A+(b||0)).slice(-a)};var C="\\u00";var D=function(a){var b='"',c=0,d=a.length,e=d>10&&t,f;if(e){f=a.split("")}for(;c<d;c++){var g=a.charCodeAt(c);switch(g){case 8:case 9:case 10:case 12:case 13:case 34:case 92:b+=z[g];break;default:if(g<32){b+=C+B(2,g.toString(16));break}b+=e?f[c]:t?a.charAt(c):a[c]}}return b+'"'};var E=function(a,b,d,h,i,j,k){var l,m,n,t,v,x,y,z,A,C,F,G,H,I,J,K;try{l=b[a]}catch(L){}if(typeof l=="object"&&l){m=c.call(l);if(m==o&&!e.call(l,"toJSON")){if(l>-1/0&&l<1/0){if(w){v=u(l/864e5);for(n=u(v/365.2425)+1970-1;w(n+1,0)<=v;n++);for(t=u((v-w(n,0))/30.42);w(n,t+1)<=v;t++);v=1+v-w(n,t);x=(l%864e5+864e5)%864e5;y=u(x/36e5)%24;z=u(x/6e4)%60;A=u(x/1e3)%60;C=x%1e3}else{n=l.getUTCFullYear();t=l.getUTCMonth();v=l.getUTCDate();y=l.getUTCHours();z=l.getUTCMinutes();A=l.getUTCSeconds();C=l.getUTCMilliseconds()}l=(n<=0||n>=1e4?(n<0?"-":"+")+B(6,n<0?-n:n):B(4,n))+"-"+B(2,t+1)+"-"+B(2,v)+"T"+B(2,y)+":"+B(2,z)+":"+B(2,A)+"."+B(3,C)+"Z"}else{l=null}}else if(typeof l.toJSON=="function"&&(m!=p&&m!=q&&m!=r||e.call(l,"toJSON"))){l=l.toJSON(a)}}if(d){l=d.call(b,a,l)}if(l===null){return"null"}m=c.call(l);if(m==s){return""+l}else if(m==p){return l>-1/0&&l<1/0?""+l:"null"}else if(m==q){return D(""+l)}if(typeof l=="object"){for(I=k.length;I--;){if(k[I]===l){throw TypeError()}}k.push(l);F=[];J=j;j+=i;if(m==r){for(H=0,I=l.length;H<I;H++){G=E(H,l,d,h,i,j,k);F.push(G===g?"null":G)}K=F.length?i?"[\n"+j+F.join(",\n"+j)+"\n"+J+"]":"["+F.join(",")+"]":"[]"}else{f(h||l,function(a){var b=E(a,l,d,h,i,j,k);if(b!==g){F.push(D(a)+":"+(i?" ":"")+b)}});K=F.length?i?"{\n"+j+F.join(",\n"+j)+"\n"+J+"}":"{"+F.join(",")+"}":"{}"}k.pop();return K}};j.stringify=function(a,b,d){var e,f,g,h;if(typeof b=="function"||typeof b=="object"&&b){if((h=c.call(b))==n){f=b}else if(h==r){g={};for(var i=0,j=b.length,k;i<j;k=b[i++],(h=c.call(k),h==q||h==p)&&(g[k]=1));}}if(d){if((h=c.call(d))==p){if((d-=d%1)>0){for(e="",d>10&&(d=10);e.length<d;e+=" ");}}else if(h==q){e=d.length<=10?d:d.slice(0,10)}}return E("",(k={},k[""]=a,k)
}this.build(!a)}return this};g.normalizeFragment=function(a){if(!this._parts.fragment){this._parts.fragment=null;this.build(!a)}return this};g.normalizeSearch=g.normalizeQuery;g.normalizeHash=g.normalizeFragment;g.iso8859=function(){var a=f.encode;var b=f.decode;f.encode=escape;f.decode=decodeURIComponent;this.normalize();f.encode=a;f.decode=b;return this};g.unicode=function(){var a=f.encode;var b=f.decode;f.encode=p;f.decode=unescape;this.normalize();f.encode=a;f.decode=b;return this};g.readable=function(){var b=this.clone();b.username("").password("").normalize();var c="";if(b._parts.protocol){c+=b._parts.protocol+"://"}if(b._parts.hostname){if(b.is("punycode")&&a){c+=a.toUnicode(b._parts.hostname);if(b._parts.port){c+=":"+b._parts.port}}else{c+=b.host()}}if(b._parts.hostname&&b._parts.path&&b._parts.path.charAt(0)!=="/"){c+="/"}c+=b.path(true);if(b._parts.query){var d="";for(var e=0,g=b._parts.query.split("&"),h=g.length;e<h;e++){var i=(g[e]||"").split("=");d+="&"+f.decodeQuery(i[0],this._parts.escapeQuerySpace).replace(/&/g,"%26");if(i[1]!==undefined){d+="="+f.decodeQuery(i[1],this._parts.escapeQuerySpace).replace(/&/g,"%26")}}c+="?"+d.substring(1)}c+=f.decodeQuery(b.hash(),true);return c};g.absoluteTo=function(a){var b=this.clone();var c=["protocol","username","password","hostname","port"];var d,e,g;if(this._parts.urn){throw new Error("URNs do not have any generally defined hierarchical components")}if(!(a instanceof f)){a=new f(a)}if(!b._parts.protocol){b._parts.protocol=a._parts.protocol}if(this._parts.hostname){return b}for(e=0;g=c[e];e++){b._parts[g]=a._parts[g]}if(!b._parts.path){b._parts.path=a._parts.path;if(!b._parts.query){b._parts.query=a._parts.query}}else if(b._parts.path.substring(-2)===".."){b._parts.path+="/"}if(b.path().charAt(0)!=="/"){d=a.directory();b._parts.path=(d?d+"/":"")+b._parts.path;b.normalizePath()}b.build();return b};g.relativeTo=function(a){var b=this.clone().normalize();var c,d,e,g,h;if(b._parts.urn){throw new Error("URNs do not have any generally defined hierarchical components")}a=new f(a).normalize();c=b._parts;d=a._parts;g=b.path();h=a.path();if(g.charAt(0)!=="/"){throw new Error("URI is already relative")}if(h.charAt(0)!=="/"){throw new Error("Cannot calculate a URI relative to another relative URI")}if(c.protocol===d.protocol){c.protocol=null}if(c.username!==d.username||c.password!==d.password){return b.build()}if(c.protocol!==null||c.username!==null||c.password!==null){return b.build()}if(c.hostname===d.hostname&&c.port===d.port){c.hostname=null;c.port=null}else{return b.build()}if(g===h){c.path="";return b.build()}e=f.commonPath(b.path(),a.path());if(!e){return b.build()}var i=d.path.substring(e.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");c.path=i+c.path.substring(e.length);return b.build()};g.equals=function(a){var b=this.clone();var c=new f(a);var d={};var e={};var g={};var i,j,l;b.normalize();c.normalize();if(b.toString()===c.toString()){return true}i=b.query();j=c.query();b.query("");c.query("");if(b.toString()!==c.toString()){return false}if(i.length!==j.length){return false}d=f.parseQuery(i,this._parts.escapeQuerySpace);e=f.parseQuery(j,this._parts.escapeQuerySpace);for(l in d){if(h.call(d,l)){if(!k(d[l])){if(d[l]!==e[l]){return false}}else if(!n(d[l],e[l])){return false}g[l]=true}}for(l in e){if(h.call(e,l)){if(!g[l]){return false}}}return true};g.duplicateQueryParameters=function(a){this._parts.duplicateQueryParameters=!!a;return this};g.escapeQuerySpace=function(a){this._parts.escapeQuerySpace=!!a;return this};return f});