raumstatus/public/js/vendor/ink.min.js

22 lines
108 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(){"use strict";if(!("Ink"in window)){var e={Ink:"INK_PATH"in window?window.INK_PATH:window.location.protocol+"//js.ink.sapo.pt/Ink/"},n={},t=[],r={},i=[],o=function(e){if("object"!=typeof e)return!1;for(var n in e)if(e.hasOwnProperty(n))return!1;return!0};window.Ink={_checkPendingRequireModules:function(){var e,t,r,o,a,u,s=[];for(e=0,t=i.length;t>e;++e)if(r=i[e]){for(o in r.left)r.left.hasOwnProperty(o)&&(a=n[o],a&&(r.args[r.left[o]]=a,delete r.left[o],--r.remaining));if(r.remaining>0)s.push(r);else{if(u=r.cb,!u)continue;delete r.cb,u.apply(!1,r.args)}}i=s,i.length>0&&setTimeout(function(){Ink._checkPendingRequireModules()},0)},_modNameToUri:function(n){if(-1!==n.indexOf("/"))return n;var t=n.replace(/_/g,".").split("."),r=t.shift(),i=e[r];return i||(i="./"+r+"/"),[i,t.join("/"),"/lib.js"].join("")},getPath:function(n){return e[n||"Ink"]},setPath:function(n,t){e[n]=t},loadScript:function(e){var n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("src",this._modNameToUri(e));var t=document.getElementsByTagName("head");t.length>0&&t[0].appendChild(n)},namespace:function(e,n){if(!e||!e.length)return null;for(var t,r=e.split("."),i=window,o=0,a=r.length;a>o;++o)i[r[o]]=i[r[o]]||{},t=i,i=i[r[o]];return n?[t,r[o-1]]:i},getModule:function(e,t){var r=t?[e,"_",t].join(""):e;return n[r]},createModule:function(e,i,a,u){var s=function(){if("string"!=typeof e)throw Error("module name must be a string!");if(!("number"==typeof i||"string"==typeof i&&i.length>0))throw Error("version number missing!");var a=[e,"_",i].join("");if(!n[a]){delete r[a],delete r[e];var s=Array.prototype.slice.call(arguments),c=u.apply(window,s);t.push(a),"object"==typeof c?c._version=i:"function"==typeof c&&(c.prototype._version=i,c._version=i);var l,f=0===e.indexOf("Ink.");f&&(l=Ink.namespace(e,!0)),n[a]=c,f&&(l[0][l[1]+"_"+i]=c),n[e]=c,f&&o(l[0][l[1]])&&(l[0][l[1]]=c),this&&Ink._checkPendingRequireModules()}};this.requireModules(a,s)},requireModules:function(e,t){var o,a,u,s,c;if(a=e.length,u={args:Array(a),left:{},remaining:a,cb:t},"object"!=typeof e||void 0===e.length)throw Error("Dependency list should be an array!");if("function"!=typeof t)throw Error("Callback should be a function!");for(o=0;a>o;++o)s=e[o],c=n[s],c?(u.args[o]=c,--u.remaining):(r[s]||(r[s]=!0,Ink.loadScript(s)),u.left[s]=o);u.remaining>0?i.push(u):t.apply(!0,u.args)},getModulesLoadOrder:function(){return t.slice()},getModuleScripts:function(){var e=this.getModulesLoadOrder();return e.unshift("Ink_1"),e=e.map(function(e){var n=e.indexOf(".");-1===n&&(n=e.indexOf("_"));var t=e.substring(0,n);e=e.substring(n+1);var r=Ink.getPath(t);return['<script type="text/javascript" src="',r,e.replace(/\./g,"/"),'/"></script>'].join("")}),e.join("\n")},bind:function(e,n){var t=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments),i=t.concat(r);return e.apply(n,i)}},bindMethod:function(e,n){return this.bind.apply(this,[e[n],e].concat([].slice.call(arguments,2)))},bindEvent:function(e,n){var t=Array.prototype.slice.call(arguments,2);return function(r){var i=t.slice();return i.unshift(r||window.event),e.apply(n,i)}},i:function(e){if(!e)throw Error("Ink.i => id or element must be passed");return"string"==typeof e?document.getElementById(e):e},s:function(e,n){if(Ink.Dom===void 0||Ink.Dom.Selector===void 0)throw Error("This method requires Ink.Dom.Selector");return Ink.Dom.Selector.select(e,n||document)[0]||null},ss:function(e,n){if(Ink.Dom===void 0||Ink.Dom.Selector===void 0)throw Error("This method requires Ink.Dom.Selector");return Ink.Dom.Selector.select(e,n||document)},extendObj:function(e,n){if(arguments.length>2&&(n=Ink.extendObj.apply(this,[].slice.call(arguments,1))),n)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e}}}})();
Ink.createModule("Ink.Net.Ajax","1",[],function(){"use strict";var Ajax=function(t,e){this.init(t,e)};Ajax.globalOptions={parameters:{},requestHeaders:{}};var xMLHttpRequestWithCredentials="XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest;return Ajax.prototype={init:function(t,e){if(!t)throw Error("WRONG_ARGUMENTS_ERR");var n=Ink.extendObj({asynchronous:!0,method:"POST",parameters:null,timeout:0,delay:0,postBody:"",contentType:"application/x-www-form-urlencoded",requestHeaders:null,onComplete:null,onSuccess:null,onFailure:null,onException:null,onHeaders:null,onCreate:null,onInit:null,onTimeout:null,sanitizeJSON:!1,evalJS:!0,xhrProxy:"",cors:!1,debug:!1,useCredentials:!1,signRequest:!1},Ajax.globalOptions);if(e&&"object"==typeof e){if(n=Ink.extendObj(n,e),"object"==typeof e.parameters)n.parameters=Ink.extendObj(Ink.extendObj({},Ajax.globalOptions.parameters),e.parameters);else if(null!==e.parameters){var s=this.paramsObjToStr(Ajax.globalOptions.parameters);s&&(n.parameters=e.parameters+"&"+s)}n.requestHeaders=Ink.extendObj({},Ajax.globalOptions.requestHeaders),n.requestHeaders=Ink.extendObj(n.requestHeaders,e.requestHeaders)}this.options=n,this.safeCall("onInit");var r=document.createElementNS?document.createElementNS("http://www.w3.org/1999/xhtml","a"):document.createElement("a");r.href=t,this.url=t,this.isHTTP=r.protocol.match(/^https?:$/i)&&!0,this.requestHasBody=0>n.method.search(/^get|head$/i),this.isCrossDomain=this.isHTTP&&"widget:"!==location.protocol&&"object"!=typeof window.widget?location.protocol!==r.protocol||location.host!==r.host:!1,this.options.cors&&(this.isCrossDomain=!1),this.transport=this.getTransport(),this.request()},getTransport:function(){if(!xMLHttpRequestWithCredentials&&this.options.cors&&"XDomainRequest"in window)return this.usingXDomainReq=!0,new XDomainRequest;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"==typeof ActiveXObject)return null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){return new ActiveXObject("Microsoft.XMLHTTP")}},setHeaders:function(){if(this.transport)try{var t={Accept:"text/javascript,text/xml,application/xml,application/xhtml+xml,text/html,application/json;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1","Accept-Language":navigator.language,"X-Requested-With":"XMLHttpRequest","X-Ink-Version":"1"};if(this.options.cors&&(this.options.signRequest||delete t["X-Requested-With"],delete t["X-Ink-Version"]),this.options.requestHeaders&&"object"==typeof this.options.requestHeaders)for(var e in this.options.requestHeaders)this.options.requestHeaders.hasOwnProperty(e)&&(t[e]=this.options.requestHeaders[e]);this.transport.overrideMimeType&&2005>(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]&&(t.Connection="close");for(var n in t)t.hasOwnProperty(n)&&this.transport.setRequestHeader(n,t[n])}catch(s){}},paramsObjToStr:function(t){var e,n,s,r,i=[];if("object"!=typeof t)return t;for(s in t)if(t.hasOwnProperty(s))if(r=t[s],"[object Array]"!==Object.prototype.toString.call(r)||isNaN(r.length))i=i.concat([encodeURIComponent(s),"=",encodeURIComponent(r),"&"]);else for(e=0,n=r.length;n>e;e++)i=i.concat([encodeURIComponent(s),"[]","=",encodeURIComponent(r[e]),"&"]);return i.length>0&&i.pop(),i.join("")},setParams:function(){var t=null,e=this.options.parameters;t="object"==typeof e?this.paramsObjToStr(e):""+e,t&&(this.url=this.url.indexOf("?")>-1?this.url.split("#")[0]+"&"+t:this.url.split("#")[0]+"?"+t)},getHeader:function(t){if(this.usingXDomainReq&&"Content-Type"===t)return this.transport.contentType;try{return this.transport.getResponseHeader(t)}catch(e){return null}},getAllHeaders:function(){try{return this.transport.getAllResponseHeaders()}catch(t){return null}},getResponse:function(){var t=this.transport,e={headerJSON:null,responseJSON:null,getHeader:this.getHeader,getAllHeaders:this.getAllHeaders,request:this,transport:t,timeTaken:new Date-this.startTime,requestedUrl:this.url};e.readyState=t.readyState;try{e.responseText=t.responseText}catch(n){}try{e.responseXML=t.responseXML}catch(n){}try{e.status=t.status}catch(n){e.status=0}try{e.statusText=t.statusText}catch(n){e.statusText=""}return e},abort:function(){if(this.transport){clearTimeout(this.delayTimeout),clearTimeout(this.stoTimeout);try{this.transport.abort()}catch(t){}this.finish()}},runStateChange:function(){var t=this.transport.readyState;if(3===t)this.isHTTP&&this.safeCall("onHeaders");else if(4===t||this.usingXDomainReq){if(this.options.asynchronous&&this.options.delay&&this.startTime+this.options.delay>(new Date).getTime())return this.delayTimeout=setTimeout(Ink.bind(this.runStateChange,this),this.options.delay+this.startTime-(new Date).getTime()),void 0;var e,n=this.transport.responseText,s=this.getResponse(),r=this.transport.status;this.isHTTP&&!this.options.asynchronous&&this.safeCall("onHeaders"),clearTimeout(this.stoTimeout),0===r?this.isHTTP?this.safeCall("onException",this.makeError(18,"NETWORK_ERR")):r=n?200:404:304===r&&(r=200);var i=this.usingXDomainReq||r>=200&&300>r,o=this.getHeader("Content-Type")||"";if(this.options.evalJS&&(o.indexOf("application/json")>=0||"force"===this.options.evalJS))try{e=this.evalJSON(n,this.sanitizeJSON),e&&(n=s.responseJSON=e)}catch(a){i&&this.safeCall("onException",a)}if(this.usingXDomainReq&&-1!==o.indexOf("xml")&&"DOMParser"in window){var u;switch(o){case"application/xml":case"application/xhtml+xml":case"image/svg+xml":u=o;break;default:u="text/xml"}var l=(new DOMParser).parseFromString(this.transport.responseText,u);this.transport.responseXML=l,s.responseXML=l}null!==this.transport.responseXML&&null===s.responseJSON&&""!==this.transport.responseXML.xml&&(n=this.transport.responseXML),(r||this.usingXDomainReq)&&(i?this.safeCall("onSuccess",s,n):this.safeCall("onFailure",s,n),this.safeCall("on"+r,s,n)),this.finish(s,n)}},finish:function(t,e){if(t&&this.safeCall("onComplete",t,e),clearTimeout(this.stoTimeout),this.transport){try{this.transport.onreadystatechange=null}catch(n){}"function"==typeof this.transport.destroy&&this.transport.destroy(),this.transport=null}},safeCall:function(t,e){function n(t){setTimeout(function(){throw t.message&&(t.message+="\n"+(t.stacktrace||t.stack||"")),t},1)}if("function"==typeof this.options[t])try{this.options[t].apply(this,[].slice.call(arguments,1))}catch(s){n(s)}else e&&window.Error&&e instanceof Error&&n(e)},setRequestHeader:function(t,e){this.options.requestHeaders||(this.options.requestHeaders={}),this.options.requestHeaders[t]=e},request:function(){if(this.transport){var t=null;this.requestHasBody?(null!==this.options.postBody&&""!==this.options.postBody?(t=this.options.postBody,this.setParams()):null!==this.options.parameters&&""!==this.options.parameters&&(t=this.options.parameters),"object"!=typeof t||t.nodeType?"object"!=typeof t&&null!==t&&(t=""+t):t=this.paramsObjToStr(t),this.options.contentType&&this.setRequestHeader("Content-Type",this.options.contentType)):this.setParams();var e=this.url,n=this.options.method,s=this.isCrossDomain;s&&this.options.xhrProxy&&(this.setRequestHeader("X-Url",e),e=this.options.xhrProxy+encodeURIComponent(e),s=!1);try{this.transport.open(n,e,this.options.asynchronous)}catch(r){return this.safeCall("onException",r),this.finish(this.getResponse(),null)}this.setHeaders(),this.safeCall("onCreate"),this.options.timeout&&!isNaN(this.options.timeout)&&(this.stoTimeout=setTimeout(Ink.bind(function(){this.options.onTimeout&&(this.safeCall("onTimeout"),this.abort())},this),1e3*this.options.timeout)),this.options.useCredentials&&!this.usingXDomainReq&&(this.transport.withCredentials=!0),this.options.asynchronous&&!this.usingXDomainReq?this.transport.onreadystatechange=Ink.bind(this.runStateChange,this):this.usingXDomainReq&&(this.transport.onload=Ink.bind(this.runStateChange,this));try{if(s)throw this.makeError(18,"NETWORK_ERR");this.startTime=(new Date).getTime(),this.transport.send(t)}catch(r){return this.safeCall("onException",r),this.finish(this.getResponse(),null)}this.options.asynchronous||this.runStateChange()}},makeError:function(t,e){if("function"!=typeof Error)return{code:t,message:e};var n=Error(e);return n.code=t,n},isJSON:function(t){return"string"==typeof t&&t?(t=t.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""),/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(t)):!1},evalJSON:function(strJSON,sanitize){if(strJSON&&(!sanitize||this.isJSON(strJSON)))try{return"undefined"!=typeof JSON&&JSON.parse!==void 0?JSON.parse(strJSON):eval("("+strJSON+")")}catch(e){throw Error("ERROR: Bad JSON string...")}return null}},Ajax.load=function(t,e){return new Ajax(t,{method:"GET",onSuccess:function(t){e(t.responseText,t)}})},Ajax.ping=function(t,e){return new Ajax(t,{method:"HEAD",onSuccess:function(t){"function"==typeof e&&e(t)}})},Ajax});
Ink.createModule("Ink.Net.JsonP","1",[],function(){"use strict";var t=function(t,e){this.init(t,e)};return t.prototype={init:function(t,e){if(this.options=Ink.extendObj({onSuccess:void 0,onFailure:void 0,failureObj:{},timeout:10,params:{},callbackParam:"jsoncallback",internalCallback:"_cb",randVar:!1},e||{}),this.randVar=this.options.randVar!==!1?this.options.randVar:parseInt(1e5*Math.random(),10),this.options.internalCallback+=this.randVar,this.uri=t,"function"==typeof this.options.onComplete&&(this.options.onSuccess=this.options.onComplete),"string"!=typeof this.uri)throw"Please define an URI";if("function"!=typeof this.options.onSuccess)throw"please define a callback function on option onSuccess!";Ink.Net.JsonP[this.options.internalCallback]=Ink.bind(function(){window.clearTimeout(this.timeout),delete window.Ink.Net.JsonP[this.options.internalCallback],this._removeScriptTag(),this.options.onSuccess(arguments[0])},this),this._addScriptTag()},_addParamsToGet:function(t,e){var n,s,i,o=-1!==t.indexOf("?"),r=[t];for(s in e)e.hasOwnProperty(s)&&(o?n="&":(n="?",o=!0),i=e[s],"number"==typeof i||i||(i=""),r=r.concat([n,s,"=",encodeURIComponent(i)]));return r.join("")},_getScriptContainer:function(){var t=document.getElementsByTagName("head");if(0===t.length){var e=document.getElementsByTagName("script");return e[0]}return t[0]},_addScriptTag:function(){this.options.params[this.options.callbackParam]="Ink.Net.JsonP."+this.options.internalCallback,this.options.params.rnd_seed=this.randVar,this.uri=this._addParamsToGet(this.uri,this.options.params);var t=document.createElement("script");t.type="text/javascript",t.src=this.uri;var e=this._getScriptContainer();e.appendChild(t),this.timeout=setTimeout(Ink.bind(this._requestFailed,this),1e3*this.options.timeout)},_requestFailed:function(){delete Ink.Net.JsonP[this.options.internalCallback],this._removeScriptTag(),"function"==typeof this.options.onFailure&&this.options.onFailure(this.options.failureObj)},_removeScriptTag:function(){for(var t,e,n=document.getElementsByTagName("script"),s=0,i=n.length;i>s;++s)if(t=n[s],e=t.getAttribute("src")||t.src,null!==e&&e===this.uri)return t.parentNode.removeChild(t),void 0}},t});
Ink.createModule("Ink.Dom.Css",1,[],function(){"use strict";var t={addRemoveClassName:function(t,e,n){return n?this.addClassName(t,e):(this.removeClassName(t,e),void 0)},addClassName:function(t,e){t=Ink.i(t),t&&e&&(t.classList!==void 0?t.classList.add(e):this.hasClassName(t,e)||(t.className+=(t.className?" ":"")+e))},removeClassName:function(t,e){if(t=Ink.i(t),t&&e)if(t.classList!==void 0)t.classList.remove(e);else{if(t.className===void 0)return!1;var n=t.className,s=RegExp("(^|\\s+)"+e+"(\\s+|$)");n=n.replace(s," "),n=n.replace(/^\s+/,"").replace(/\s+$/,""),t.className=n}},setClassName:function(t,e,n){this.addRemoveClassName(t,e,n||!1)},hasClassName:function(t,e){if(t=Ink.i(t),t&&e){if(t.classList!==void 0)return t.classList.contains(e);if(t.className===void 0)return!1;var n=t.className;if(n.length===void 0)return!1;if(n.length>0){if(n===e)return!0;var s=RegExp("(^|\\s)"+e+"(\\s|$)");if(s.test(n))return!0}}return!1},blinkClass:function(t,e,n,s){t=Ink.i(t),this.addRemoveClassName(t,e,!s),setTimeout(Ink.bind(function(){this.addRemoveClassName(t,e,s)},this),Number(n)||100)},toggleClassName:function(t,e,n){return t&&e&&t.classList!==void 0?(t=Ink.i(t),null!==t&&t.classList.toggle(e),!0):(n!==void 0?n===!0?this.addClassName(t,e):n===!1&&this.removeClassName(t,e):this.hasClassName(t,e)?this.removeClassName(t,e):this.addClassName(t,e),void 0)},setOpacity:function(t,e){if(t=Ink.i(t),null!==t){var n=1;isNaN(Number(e))||(n=0>=e?0:1>=e?e:100>=e?e/100:1),t.style.opacity!==void 0?t.style.opacity=n:t.style.filter="alpha(opacity:"+(0|100*n)+")"}},_camelCase:function(t){return t?t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()}):t},getStyle:function(t,e){if(t=Ink.i(t),null!==t){e="float"===e?"cssFloat":this._camelCase(e);var n=t.style[e];if(!window.getComputedStyle||n&&"auto"!==n)!n&&t.currentStyle&&(n=t.currentStyle[e],"auto"!==n||"width"!==e&&"height"!==e||(n=t["offset"+e.charAt(0).toUpperCase()+e.slice(1)]+"px"));else{var s=window.getComputedStyle(t,null);n=s?s[e]:null}if("opacity"===e)return n?parseFloat(n,10):1;if("borderTopWidth"===e||"borderBottomWidth"===e||"borderRightWidth"===e||"borderLeftWidth"===e){if("thin"===n)return"1px";if("medium"===n)return"3px";if("thick"===n)return"5px"}return"auto"===n?null:n}},setStyle:function(t,e){if(t=Ink.i(t),null!==t)if("string"==typeof e)t.style.cssText+="; "+e,-1!==e.indexOf("opacity")&&this.setOpacity(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]);else for(var n in e)e.hasOwnProperty(n)&&("opacity"===n?this.setOpacity(t,e[n]):"float"===n||"cssFloat"===n?t.style.styleFloat===void 0?t.style.cssFloat=e[n]:t.style.styleFloat=e[n]:t.style[n]=e[n])},show:function(t,e){t=Ink.i(t),null!==t&&(t.style.display=e?e:"")},hide:function(t){t=Ink.i(t),null!==t&&(t.style.display="none")},showHide:function(t,e){t=Ink.i(t),t&&(t.style.display=e?"":"none")},toggle:function(t,e){t=Ink.i(t),null!==t&&(e!==void 0?e===!0?this.show(t):this.hide(t):"none"===t.style.display?this.show(t):this.hide(t))},_getRefTag:function(t){if(t.firstElementChild)return t.firstElementChild;for(var e=t.firstChild;e;e=e.nextSibling)if(1===e.nodeType)return e;return null},appendStyleTag:function(t,e,n){n=Ink.extendObj({type:"text/css",force:!1},n||{});var s,i,r=document.getElementsByTagName("style"),o=!1,a=!0;for(s=0,i=r.length;i>s;s++)o=r[s].innerHTML,o.indexOf(t)>=0&&(a=!1);if(a){var l=document.createElement("style"),u=document.getElementsByTagName("head")[0],c=!1,h="";l.type=n.type,h+=t+" {",h+=e,h+="} ",l.styleSheet!==void 0?l.styleSheet.cssText=h:l.appendChild(document.createTextNode(h)),n.force?u.appendChild(l):(c=this._getRefTag(u),c&&u.insertBefore(l,c))}},appendStylesheet:function(t,e){e=Ink.extendObj({media:"screen",type:"text/css",force:!1},e||{});var n,s=document.createElement("link"),i=document.getElementsByTagName("head")[0];s.media=e.media,s.type=e.type,s.href=t,s.rel="Stylesheet",e.force?i.appendChild(s):(n=this._getRefTag(i),n&&i.insertBefore(s,n))},_loadingCSSFiles:{},_loadedCSSFiles:{},appendStylesheetCb:function(t,e){if(!t)return e(t);if(this._loadedCSSFiles[t])return e(t);var n=this._loadingCSSFiles[t];if(n)return n.push(e);this._loadingCSSFiles[t]=[e];var s=document.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=t;var i=document.getElementsByTagName("head")[0];i.appendChild(s);var r=document.createElement("img");r.onerror=Ink.bindEvent(function(t,e){var n=e;this._loadedCSSFiles[n]=!0;for(var s=this._loadingCSSFiles[n],i=0,r=s.length;r>i;++i)s[i](n);delete this._loadingCSSFiles[n]},this,t),r.src=t},decToHex:function(t){var e=function(t){return 1===t.length&&(t="0"+t),t=t.toUpperCase()};if("object"==typeof t){var n=e(parseInt(t.r,10).toString(16)),s=e(parseInt(t.g,10).toString(16)),i=e(parseInt(t.b,10).toString(16));return n+s+i}t+="";var r=t.match(/\((\d+),\s?(\d+),\s?(\d+)\)/);return null!==r?e(parseInt(r[1],10).toString(16))+e(parseInt(r[2],10).toString(16))+e(parseInt(r[3],10).toString(16)):e(parseInt(t,10).toString(16))},hexToDec:function(t){return 0===t.indexOf("#")&&(t=t.substr(1)),6===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16)}:3===t.length?{r:parseInt(t.charAt(0)+t.charAt(0),16),g:parseInt(t.charAt(1)+t.charAt(1),16),b:parseInt(t.charAt(2)+t.charAt(2),16)}:2>=t.length?parseInt(t,16):void 0},getPropertyFromStylesheet:function(t,e){var n=this.getRuleFromStylesheet(t);return n?n.style[e]:null},getPropertyFromStylesheet2:function(t,e){for(var n,s=this.getRulesFromStylesheet(t),i=0,r=s.length;r>i;i++)if(n=s[i].style[e],null!==n&&void 0!==n)return n;return null},getRuleFromStylesheet:function(t){var e,n,s,i,r,o=document.styleSheets;if(!o)return null;for(var a=0,l=document.styleSheets.length;l>a;++a){if(e=document.styleSheets[a],n=e.rules?e.rules:e.cssRules,!n)return null;for(s=0,i=n.length;i>s;++s)if(r=n[s],r.selectorText&&r.selectorText===t)return r}return null},getRulesFromStylesheet:function(t){var e,n,s,i,r,o=[],a=document.styleSheets;if(!a)return o;for(var l=0,u=document.styleSheets.length;u>l;++l){if(e=document.styleSheets[l],n=e.rules?e.rules:e.cssRules,!n)return null;for(s=0,i=n.length;i>s;++s)r=n[s],r.selectorText&&r.selectorText===t&&o.push(r)}return o},getPropertiesFromRule:function(t){var e,n,s,i=this.getRuleFromStylesheet(t),r={};i=i.style.cssText;var o,a,l,u,c=i.split(";");for(n=0,s=c.length;s>n;++n)" "===c[n].charAt(0)&&(c[n]=c[n].substring(1)),o=c[n].split(":"),e=this._camelCase(o[0].toLowerCase()),a=o[1],a&&(a=a.substring(1),"padding"===e||"margin"===e||"borderWidth"===e?("borderWidth"===e?(l="border",u="Width"):(l=e,u=""),-1!==a.indexOf(" ")?(a=a.split(" "),r[l+"Top"+u]=a[0],r[l+"Bottom"+u]=a[0],r[l+"Left"+u]=a[1],r[l+"Right"+u]=a[1]):(r[l+"Top"+u]=a,r[l+"Bottom"+u]=a,r[l+"Left"+u]=a,r[l+"Right"+u]=a)):"borderRadius"===e?-1!==a.indexOf(" ")?(a=a.split(" "),r.borderTopLeftRadius=a[0],r.borderBottomRightRadius=a[0],r.borderTopRightRadius=a[1],r.borderBottomLeftRadius=a[1]):(r.borderTopLeftRadius=a,r.borderTopRightRadius=a,r.borderBottomLeftRadius=a,r.borderBottomRightRadius=a):r[e]=a);return r},changeFontSize:function(t,e,n,s,i){var r=this;Ink.requireModules(["Ink.Dom.Selector_1"],function(o){var a;if("string"!=typeof t?a="1st argument must be a CSS selector rule.":"number"!=typeof e?a="2nd argument must be a number.":void 0!==n&&"+"!==n&&"*"!==n?a='3rd argument must be one of "+", "*".':void 0!==s&&("number"!=typeof s||0>=s)?a="4th argument must be a positive number.":void 0!==i&&("number"!=typeof i||i>i)&&(a="5th argument must be a positive number greater than minValue."),a)throw new TypeError(a);var l,u,c=o.select(t);void 0===s&&(s=1),n="*"===n?function(t,e){return t*e}:function(t,e){return t+e};for(var h=0,p=c.length;p>h;++h)u=c[h],l=parseFloat(r.getStyle(u,"fontSize")),l=n(l,e),s>l||"number"==typeof i&&l>i||(u.style.fontSize=l+"px")})}};return t});
Ink.createModule("Ink.Dom.Element",1,[],function(){"use strict";var e={get:function(e){return e!==void 0?"string"==typeof e?document.getElementById(e):e:null},create:function(e,t){var n=document.createElement(e);for(var i in t)t.hasOwnProperty(i)&&("className"===i&&(i="class"),n.setAttribute(i,t[i]));return n},remove:function(e){var t;e&&(t=e.parentNode)&&t.removeChild(e)},scrollTo:function(e){if(e=this.get(e)){if(e.scrollIntoView)return e.scrollIntoView();var t={},n=0,i=0;do n+=e.offsetTop||0,i+=e.offsetLeft||0,e=e.offsetParent;while(e);t={x:i,y:n},window.scrollTo(t.x,t.y)}},offsetTop:function(e){return this.offset(e)[1]},offsetLeft:function(e){return this.offset(e)[0]},positionedOffset:function(e){var t=0,n=0;e=this.get(e);do if(t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent){if("body"===e.tagName.toLowerCase())break;var i=e.style.position;if(!i&&e.currentStyle&&(i=e.currentStyle.position),(!i||"auto"===i)&&"undefined"!=typeof getComputedStyle){var r=getComputedStyle(e,null);i=r?r.position:null}if("relative"===i||"absolute"===i)break}while(e);return[n,t]},offset:function(e){e=Ink.i(e);var t,n,i,r,o=["border-left-width","border-top-width"],s=[0,0],a=this._getPropPx,l=Ink.getModule("Ink.Dom.Browser",1);do r=window.getComputedStyle?window.getComputedStyle(e,null):e.currentStyle,t=[0|e.offsetLeft,0|e.offsetTop],n=[a(r,o[0]),a(r,o[1])],l.OPERA?(s[0]+=t[0],s[1]+=t[1]):(s[0]+=t[0]+n[0],s[1]+=t[1]+n[1]),i=e.offsetParent;while(e=i);return n=[a(r,o[0]),a(r,o[1])],l.GECKO?(s[0]+=n[0],s[1]+=n[1]):l.OPERA||(s[0]-=n[0],s[1]-=n[1]),s},scroll:function(e){return e=e?Ink.i(e):document.body,[window.pageXOffset?window.pageXOffset:e.scrollLeft,window.pageYOffset?window.pageYOffset:e.scrollTop]},_getPropPx:function(e,t){var n,i,r=e.getPropertyValue?e.getPropertyValue(t):e[t];return r?(i=r.indexOf("px"),n=-1===i?0:parseInt(r,10)):n=0,n},offset2:function(e){return this.offset(e)},hasAttribute:function(e,t){return e.hasAttribute?e.hasAttribute(t):!!e.getAttribute(t)},insertAfter:function(e,t){(t=this.get(t))&&t.parentNode.insertBefore(e,t.nextSibling)},insertTop:function(e,t){(t=this.get(t))&&t.insertBefore(e,t.firstChild)},textContent:function(e){e=Ink.i(e);var t,n,i,r;switch(e&&e.nodeType){case 9:return this.textContent(e.documentElement||e.body&&e.body.parentNode||e.body);case 1:if(t=e.innerText,t!==void 0)return t;case 11:if(t=e.textContent,t!==void 0)return t;if(e.firstChild===e.lastChild)return this.textContent(e.firstChild);for(t=[],i=e.childNodes,n=0,r=i.length;r>n;++n)t.push(this.textContent(i[n]));return t.join("");case 3:case 4:return e.nodeValue}return""},setTextContent:function(e,t){switch(e=Ink.i(e),e&&e.nodeType){case 1:if("innerText"in e){e.innerText=t;break}case 11:if("textContent"in e){e.textContent=t;break}case 9:for(;e.firstChild;)e.removeChild(e.firstChild);if(""!==t){var n=e.ownerDocument||e;e.appendChild(n.createTextNode(t))}break;case 3:case 4:e.nodeValue=t}},isLink:function(e){var t=e&&1===e.nodeType&&(/^a|area$/i.test(e.tagName)||e.hasAttributeNS&&e.hasAttributeNS("http://www.w3.org/1999/xlink","href"));return!!t},isAncestorOf:function(e,t){if(!t||!e)return!1;if(t.compareDocumentPosition)return 0!==(16&e.compareDocumentPosition(t));for(;t=t.parentNode;)if(t===e)return!0;return!1},descendantOf:function(e,t){return e!==t&&this.isAncestorOf(e,t)},firstElementChild:function(e){if(!e)return null;if("firstElementChild"in e)return e.firstElementChild;for(var t=e.firstChild;t&&1!==t.nodeType;)t=t.nextSibling;return t},lastElementChild:function(e){if(!e)return null;if("lastElementChild"in e)return e.lastElementChild;for(var t=e.lastChild;t&&1!==t.nodeType;)t=t.previousSibling;return t},nextElementSibling:function(e){var t=null;if(!e)return t;if("nextElementSibling"in e)return e.nextElementSibling;for(t=e.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t},previousElementSibling:function(e){var t=null;if(!e)return t;if("previousElementSibling"in e)return e.previousElementSibling;for(t=e.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t},elementWidth:function(e){return"string"==typeof e&&(e=document.getElementById(e)),e.offsetWidth},elementHeight:function(e){return"string"==typeof e&&(e=document.getElementById(e)),e.offsetHeight},elementLeft:function(e){return"string"==typeof e&&(e=document.getElementById(e)),e.offsetLeft},elementTop:function(e){return"string"==typeof e&&(e=document.getElementById(e)),e.offsetTop},elementDimensions:function(e){return e=Ink.i(e),[e.offsetWidth,e.offsetHeight]},outerDimensions:function(t){var n=e.elementDimensions(t),i=Ink.getModule("Ink.Dom.Css_1");return[n[0]+parseFloat(i.getStyle(t,"marginLeft")||0)+parseFloat(i.getStyle(t,"marginRight")||0),n[1]+parseFloat(i.getStyle(t,"marginTop")||0)+parseFloat(i.getStyle(t,"marginBottom")||0)]},inViewport:function(t,n){var i=Ink.i(t).getBoundingClientRect();return n?i.bottom>0&&i.left<e.viewportWidth()&&i.top<e.viewportHeight()&&i.right>0:i.top>0&&i.right<e.viewportWidth()&&i.bottom<e.viewportHeight()&&i.left>0},clonePosition:function(e,t){var n=this.offset(t);return e.style.left=n[0]+"px",e.style.top=n[1]+"px",e},ellipsizeText:function(e,t){if(e=Ink.i(e))for(;e&&e.scrollHeight>e.offsetHeight+8;)e.textContent=e.textContent.replace(/(\s+\S+)\s*$/,t||"…")},findUpwardsHaving:function(e,t){for(;e&&1===e.nodeType;){if(t(e))return e;e=e.parentNode}return!1},findUpwardsByClass:function(e,t){var n=RegExp("(^|\\s)"+t+"(\\s|$)"),i=function(e){var t=e.className;return t&&n.test(t)};return this.findUpwardsHaving(e,i)},findUpwardsByTag:function(e,t){t=t.toUpperCase();var n=function(e){return e.nodeName&&e.nodeName.toUpperCase()===t};return this.findUpwardsHaving(e,n)},findUpwardsById:function(e,t){var n=function(e){return e.id===t};return this.findUpwardsHaving(e,n)},findUpwardsBySelector:function(e,t){if(Ink.Dom===void 0||Ink.Dom.Selector===void 0)throw Error("This method requires Ink.Dom.Selector");var n=function(e){return Ink.Dom.Selector.matchesSelector(e,t)};return this.findUpwardsHaving(e,n)},getChildrenText:function(e,t){var n,i,r,o=e.childNodes,s=o.length,a="";if(!e)return a;for(i=0;s>i;++i)n=o[i],n&&3===n.nodeType&&(r=this._trimString(n.data+""),r.length>0?(a+=r,t&&e.removeChild(n)):e.removeChild(n));return a},_trimString:function(e){return String.prototype.trim?e.trim():e.replace(/^\s*/,"").replace(/\s*$/,"")},getSelectValues:function(e){for(var t=Ink.i(e),n=[],i=0;t.options.length>i;++i)n.push(t.options[i].value);return n},_normalizeData:function(e){for(var t,n=[],i=0,r=e.length;r>i;++i)t=e[i],t instanceof Array?1===t.length&&t.push(t[0]):t=[t,t],n.push(t);return n},fillSelect:function(e,t,n,i){var r=Ink.i(e);if(r){r.innerHTML="";var o,s;n||(s=document.createElement("option"),s.setAttribute("value",""),r.appendChild(s)),t=this._normalizeData(t);for(var a=0,l=t.length;l>a;++a)o=t[a],s=document.createElement("option"),s.setAttribute("value",o[0]),o.length>2&&s.setAttribute("extra",o[2]),s.appendChild(document.createTextNode(o[1])),o[0]===i&&s.setAttribute("selected","selected"),r.appendChild(s)}},fillSelect2:function(e,t){e=Ink.i(e),e.innerHTML="";var n={skipEmpty:!1,skipCreate:!1,emptyLabel:"none",createLabel:"create",optionsGroupLabel:"groups",emptyOptionsGroupLabel:"none exist",defaultValue:""};if(!t)throw"param opts is a requirement!";if(!t.data)throw"opts.data is a requirement!";t=Ink.extendObj(n,t);var i,r,o=document.createElement("optgroup");o.setAttribute("label",t.optionsGroupLabel),t.data=this._normalizeData(t.data),t.skipCreate||t.data.unshift(["$create$",t.createLabel]),t.skipEmpty||t.data.unshift(["",t.emptyLabel]);for(var s=0,a=t.data.length;a>s;++s)r=t.data[s],i=document.createElement("option"),i.setAttribute("value",r[0]),i.appendChild(document.createTextNode(r[1])),r[0]===t.defaultValue&&i.setAttribute("selected","selected"),""===r[0]||"$create$"===r[0]?e.appendChild(i):o.appendChild(i);var l=function(e){var t=e[e.length-1][0];return""===t||"$create$"===t};l(t.data)&&(i=document.createElement("option"),i.setAttribute("value","$dummy$"),i.setAttribute("disabled","disabled"),i.appendChild(document.createTextNode(t.emptyOptionsGroupLabel)),o.appendChild(i)),e.appendChild(o);var u=function(t,n){var i=e.options[e.options.length-1];i.getAttribute("disabled")&&i.parentNode.removeChild(i),i=document.createElement("option"),i.setAttribute("value",t),i.appendChild(document.createTextNode(n)),o.appendChild(i),e.options[e.options.length-1].setAttribute("selected",!0)};t.skipCreate||(e.onchange=function(){"$create$"===e.value&&"function"==typeof t.onCreate&&t.onCreate(e,u)})},fillRadios:function(e,t,n,i,r,o){var s=Ink.i(e);for(s=s.nextSibling;s&&1!==s.nodeType;)s=s.nextSibling;var a=document.createElement("span");s?s.parentNode.insertBefore(a,s):Ink.i(e).appendChild(a),n=this._normalizeData(n),"]"!==t.substring(t.length-1)&&(t+="[]");var l,u;i||(u=document.createElement("input"),u.setAttribute("type","radio"),u.setAttribute("name",t),u.setAttribute("value",""),a.appendChild(u),o&&a.appendChild(document.createElement(o)));for(var d=0;n.length>d;++d)l=n[d],u=document.createElement("input"),u.setAttribute("type","radio"),u.setAttribute("name",t),u.setAttribute("value",l[0]),a.appendChild(u),a.appendChild(document.createTextNode(l[1])),o&&a.appendChild(document.createElement(o)),l[0]===r&&(u.checked=!0);return a},fillChecks:function(e,t,n,i,r){var o=Ink.i(e);for(o=o.nextSibling;o&&1!==o.nodeType;)o=o.nextSibling;var s=document.createElement("span");o?o.parentNode.insertBefore(s,o):Ink.i(e).appendChild(s),n=this._normalizeData(n),"]"!==t.substring(t.length-1)&&(t+="[]");for(var a,l,u=0;n.length>u;++u)a=n[u],l=document.createElement("input"),l.setAttribute("type","checkbox"),l.setAttribute("name",t),l.setAttribute("value",a[0]),s.appendChild(l),s.appendChild(document.createTextNode(a[1])),r&&s.appendChild(document.createElement(r)),a[0]===i&&(l.checked=!0);return s},parentIndexOf:function(e,t){for(var n,i=0,r=0,o=e.childNodes.length;o>r;++r)if(n=e.childNodes[r],1===n.nodeType){if(n===t)return i;++i}return-1},nextSiblings:function(e){if("string"==typeof e&&(e=document.getElementById(e)),"object"==typeof e&&null!==e&&e.nodeType&&1===e.nodeType){for(var t=[],n=e.parentNode.children,i=this.parentIndexOf(e.parentNode,e),r=++i,o=n.length;o>r;r++)t.push(n[r]);return t}return[]},previousSiblings:function(e){if("string"==typeof e&&(e=document.getElementById(e)),"object"==typeof e&&null!==e&&e.nodeType&&1===e.nodeType){for(var t=[],n=e.parentNode.children,i=this.parentIndexOf(e.parentNode,e),r=0,o=i;o>r;r++)t.push(n[r]);return t}return[]},siblings:function(e){if("string"==typeof e&&(e=document.getElementById(e)),"object"==typeof e&&null!==e&&e.nodeType&&1===e.nodeType){for(var t=[],n=e.parentNode.children,i=0,r=n.length;r>i;i++)e!==n[i]&&t.push(n[i]);return t}return[]},childElementCount:function(e){return e=Ink.i(e),"childElementCount"in e?e.childElementCount:e?this.siblings(e).length+1:0},appendHTML:function(e,t){var n=document.createElement("div");n.innerHTML=t;for(var i=n.children,r=0;i.length>r;r++)e.appendChild(i[r])},prependHTML:function(e,t){var n=document.createElement("div");n.innerHTML=t;for(var i=e.firstChild,r=n.children,o=r.length-1;o>=0;o--)e.insertBefore(r[o],i),i=e.firstChild},removeTextNodeChildren:function(e){var t,n,i=e;for(e=e.firstChild;e;)n=3===e.nodeType,t=e,e=e.nextSibling,n&&i.removeChild(t)},htmlToFragment:function(e){return this.htmlToFragment="function"==typeof document.createRange&&"function"==typeof Range.prototype.createContextualFragment?function(e){var t;return"string"!=typeof e?document.createDocumentFragment():(t=document.createRange(),t.selectNode(document.body),t.createContextualFragment(e))}:function(e){var t,n,i=document.createDocumentFragment();if("string"!=typeof e)return i;for(t=document.createElement("div"),t.innerHTML=e;n=t.firstChild;)i.appendChild(n);return i},this.htmlToFragment.call(this,e)},_camelCase:function(e){return e?e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()}):e},data:function(e){var t;if("object"!=typeof e&&"string"!=typeof e)throw"[Ink.Dom.Element.data] :: Invalid selector defined";if("object"==typeof e)t=e;else{var n=Ink.getModule("Ink.Dom.Selector",1);if(!n)throw"[Ink.Dom.Element.data] :: This method requires Ink.Dom.Selector - v1";if(t=n.select(e),0>=t.length)throw"[Ink.Dom.Element.data] :: Can't find any element with the specified selector";t=t[0]}var i,r,o,s={},a=t.attributes||[];if(a)for(var l=0,u=a.length;u>l;++l)i=a[l],r=i.name,o=i.value,r&&0===r.indexOf("data-")&&(s[this._camelCase(r.replace("data-",""))]=o);return s},moveCursorTo:function(e,t){if(e.setSelectionRange)e.setSelectionRange(t,t);else{var n=e.createTextRange();n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",t),n.select()}},pageWidth:function(){var e;e=window.innerWidth&&window.scrollMaxX?window.innerWidth+window.scrollMaxX:document.body.scrollWidth>document.body.offsetWidth?document.body.scrollWidth:document.body.offsetWidth;var t;return window.self.innerWidth?t=document.documentElement.clientWidth?document.documentElement.clientWidth:window.self.innerWidth:document.documentElement&&document.documentElement.clientWidth?t=document.documentElement.clientWidth:document.body&&(t=document.body.clientWidth),t>e?e:t},pageHeight:function(){var e;e=window.innerHeight&&window.scrollMaxY?window.innerHeight+window.scrollMaxY:document.body.scrollHeight>document.body.offsetHeight?document.body.scrollHeight:document.body.offsetHeight;var t;return window.self.innerHeight?t=window.self.innerHeight:document.documentElement&&document.documentElement.clientHeight?t=document.documentElement.clientHeight:document.body&&(t=document.body.clientHeight),t>e?t:e},viewportWidth:function(){return window.innerWidth!==void 0?window.innerWidth:document.documentElement&&document.documentElement.offsetWidth!==void 0?document.documentElement.offsetWidth:void 0},viewportHeight:function(){return window.innerHeight!==void 0?window.innerHeight:document.documentElement&&document.documentElement.offsetHeight!==void 0?document.documentElement.offsetHeight:void 0},scrollWidth:function(){return window.self.pageXOffset!==void 0?window.self.pageXOffset:document.documentElement!==void 0&&document.documentElement.scrollLeft!==void 0?document.documentElement.scrollLeft:document.body.scrollLeft},scrollHeight:function(){return window.self.pageYOffset!==void 0?window.self.pageYOffset:document.documentElement!==void 0&&document.documentElement.scrollTop!==void 0?document.documentElement.scrollTop:document.body.scrollTop}};return e});
Ink.createModule("Ink.Dom.Event",1,[],function(){"use strict";var e={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,throttle:function(e,t){t=t||0;var n,o=0,r=function(){var i=+new Date,s=i-o;if(s>=t)return o=i,e.apply(this,[].slice.call(arguments));var a=this,l=[].slice.call(arguments);clearTimeout(n),n=setTimeout(function(){return r.apply(a,l)})};return r},element:function(e){var t=e.target||"mouseout"===e.type&&e.fromElement||"mouseleave"===e.type&&e.fromElement||"mouseover"===e.type&&e.toElement||"mouseenter"===e.type&&e.toElement||e.srcElement||null;return!t||3!==t.nodeType&&4!==t.nodeType?t:t.parentNode},relatedTarget:function(e){var t=e.relatedTarget||"mouseout"===e.type&&e.toElement||"mouseleave"===e.type&&e.toElement||"mouseover"===e.type&&e.fromElement||"mouseenter"===e.type&&e.fromElement||null;return!t||3!==t.nodeType&&4!==t.nodeType?t:t.parentNode},findElement:function(e,t,n){for(var o=this.element(e);;){if(o.nodeName.toLowerCase()===t.toLowerCase())return o;if(o=o.parentNode,!o)return n?!1:document;if(!o.parentNode)return n?!1:document}},fire:function(e,t,n){e=Ink.i(e);var o,r;if(r=document.createEvent?{DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,focus:!0,focusin:!0,focusout:!0,blur:!0,load:!0,unload:!0,abort:!0,error:!0,select:!0,change:!0,submit:!0,reset:!0,resize:!0,scroll:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseover:!0,mouseout:!0,mouseup:!0,mousewheel:!0,wheel:!0,textInput:!0,keydown:!0,keypress:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,DOMSubtreeModified:!0,DOMNodeInserted:!0,DOMNodeRemoved:!0,DOMNodeInsertedIntoDocument:!0,DOMNodeRemovedFromDocument:!0,DOMAttrModified:!0,DOMCharacterDataModified:!0,DOMAttributeNameChanged:!0,DOMElementNameChanged:!0,hashchange:!0}:{onabort:!0,onactivate:!0,onafterprint:!0,onafterupdate:!0,onbeforeactivate:!0,onbeforecopy:!0,onbeforecut:!0,onbeforedeactivate:!0,onbeforeeditfocus:!0,onbeforepaste:!0,onbeforeprint:!0,onbeforeunload:!0,onbeforeupdate:!0,onblur:!0,onbounce:!0,oncellchange:!0,onchange:!0,onclick:!0,oncontextmenu:!0,oncontrolselect:!0,oncopy:!0,oncut:!0,ondataavailable:!0,ondatasetchanged:!0,ondatasetcomplete:!0,ondblclick:!0,ondeactivate:!0,ondrag:!0,ondragend:!0,ondragenter:!0,ondragleave:!0,ondragover:!0,ondragstart:!0,ondrop:!0,onerror:!0,onerrorupdate:!0,onfilterchange:!0,onfinish:!0,onfocus:!0,onfocusin:!0,onfocusout:!0,onhashchange:!0,onhelp:!0,onkeydown:!0,onkeypress:!0,onkeyup:!0,onlayoutcomplete:!0,onload:!0,onlosecapture:!0,onmessage:!0,onmousedown:!0,onmouseenter:!0,onmouseleave:!0,onmousemove:!0,onmouseout:!0,onmouseover:!0,onmouseup:!0,onmousewheel:!0,onmove:!0,onmoveend:!0,onmovestart:!0,onoffline:!0,ononline:!0,onpage:!0,onpaste:!0,onprogress:!0,onpropertychange:!0,onreadystatechange:!0,onreset:!0,onresize:!0,onresizeend:!0,onresizestart:!0,onrowenter:!0,onrowexit:!0,onrowsdelete:!0,onrowsinserted:!0,onscroll:!0,onselect:!0,onselectionchange:!0,onselectstart:!0,onstart:!0,onstop:!0,onstorage:!0,onstoragecommit:!0,onsubmit:!0,ontimeout:!0,onunload:!0},null!==e&&void 0!==e){e===document&&document.createEvent&&!e.dispatchEvent&&(e=document.documentElement),document.createEvent?(o=document.createEvent("HTMLEvents"),r[t]===void 0?o.initEvent("dataavailable",!0,!0):o.initEvent(t,!0,!0)):(o=document.createEventObject(),o.eventType=r["on"+t]===void 0?"ondataavailable":"on"+t),o.eventName=t,o.memo=n||{};try{if(document.createEvent)e.dispatchEvent(o);else{if(!e.fireEvent)return;e.fireEvent(o.eventType,o)}}catch(i){}return o}},_callbackForCustomEvents:function(e,t,n){var o="hashchange"===t&&e.attachEvent&&!window.onhashchange,r=-1!==t.indexOf(":");if(o||r){var i=n;return Ink.bindEvent(function(e,t,n){e.eventName===t&&(window.addEventListener&&(window.event=e),n())},this,t,i)}return null},observe:function(e,t,n,o){if(e=Ink.i(e),null!==e&&void 0!==e){var r=this._callbackForCustomEvents(e,t,n);return r&&(n=r,t="dataavailable"),e.addEventListener?e.addEventListener(t,n,!!o):e.attachEvent("on"+t,n),n}},observeMulti:function(e,t,n,o){if("string"==typeof e?e=Ink.ss(e):e instanceof Element&&(e=[e]),!e[0])return!1;var r=this._callbackForCustomEvents(e[0],t,n);r&&(n=r,t="dataavailable");for(var i=0,s=e.length;s>i;i++)this.observe(e[i],t,n,o);return n},stopObserving:function(e,t,n,o){e=Ink.i(e),null!==e&&void 0!==e&&(e.removeEventListener?e.removeEventListener(t,n,!!o):e.detachEvent("on"+t,n))},stop:function(e){null!==e.cancelBubble&&(e.cancelBubble=!0),e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),window.attachEvent&&(e.returnValue=!1),null!==e.cancel&&(e.cancel=!0)},stopPropagation:function(e){null!==e.cancelBubble&&(e.cancelBubble=!0),e.stopPropagation&&e.stopPropagation()},stopDefault:function(e){e.preventDefault&&e.preventDefault(),window.attachEvent&&(e.returnValue=!1),null!==e.cancel&&(e.cancel=!0)},pointer:function(e){return{x:e.pageX||e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft),y:e.pageY||e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)}},pointerX:function(e){return e.pageX||e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)},pointerY:function(e){return e.pageY||e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)},isLeftClick:function(e){if(window.addEventListener){if(0===e.button)return!0;if("touch"===e.type.substring(0,5)&&null===e.button)return!0}else if(1===e.button)return!0;return!1},isRightClick:function(e){return 2===e.button},isMiddleClick:function(e){return window.addEventListener?1===e.button:4===e.button},getCharFromKeyboardEvent:function(e,t){var n=e.keyCode,o=String.fromCharCode(n),r=e.shiftKey;if(n>=65&&90>=n)return"boolean"==typeof t&&(r=t),r?o:o.toLowerCase();if(n>=96&&105>=n)return String.fromCharCode(48+(n-96));switch(n){case 109:case 189:return"-";case 107:case 187:return"+"}return o},debug:function(){}};return e});
Ink.createModule("Ink.Dom.FormSerialize",1,[],function(){"use strict";var e={serialize:function(e){e=Ink.i(e);var t=this._getFieldNameInputsMap(e),n={};for(var o in t)if(t.hasOwnProperty(o))if(null!==o){var r=o.replace(/\[\]$/,"");n[r]=this._getValuesOfField(t[o])}else n[o]=this._getValuesOfField(t[o]);return delete n["null"],n},fillIn:function(e,t){e=Ink.i(e);var n=this._getFieldNameInputsMap(e);delete n["null"];for(var o in t)t.hasOwnProperty(o)&&this._setValuesOfField(n[o],t[o])},_getFieldNameInputsMap:function(e){for(var t,n,o,r={},i=0,s=e.elements.length;s>i;++i)o=e.elements[i],t=o.getAttribute("name"),n=o.nodeName.toLowerCase(),"fieldset"!==n&&(void 0===r[t]?r[t]=[o]:r[t].push(o));return r},_getValuesOfField:function(e){var t,n,o,r,i,s,a=e[0].nodeName.toLowerCase(),l=e[0].getAttribute("type"),u=e[0].value,c=[];switch(a){case"select":for(t=0,n=e.length;n>t;++t)for(c[t]=[],s=e[t].getAttribute("multiple"),o=0,r=e[t].options.length;r>o;++o)if(i=e[t].options[o],i.selected){if(!s){c[t]=i.value;break}c[t].push(i.value)}return e.length>0&&/\[[^\]]*\]$/.test(e[0].getAttribute("name"))?c:c[0];case"textarea":case"input":if("checkbox"===l||"radio"===l){for(t=0,n=e.length;n>t;++t)i=e[t],i.checked&&c.push(i.value);return"checkbox"===l?e.length>1?c:!!c.length:e.length>1?c[0]:!!c.length}if(e.length>0&&/\[[^\]]*\]$/.test(e[0].getAttribute("name"))){var d=[];for(t=0,n=e.length;n>t;++t)d.push(e[t].value);return d}return u;default:return void 0}},_valInArray:function(e,t){for(var n=0,o=t.length;o>n;++n)if(t[n]===e)return!0;return!1},_setValuesOfField:function(e,t){if(e){var n,o,r,i=e[0].nodeName.toLowerCase(),s=e[0].getAttribute("type");switch(i){case"select":if(e.length>1)throw"Got multiple select elements with same name!";for(n=0,o=e[0].options.length;o>n;++n)r=e[0].options[n],r.selected=t instanceof Array?this._valInArray(r.value,t):r.value===t;break;case"textarea":case"input":if("checkbox"===s||"radio"===s)for(n=0,o=e.length;o>n;++n)r=e[n],r.checked=t instanceof Array?this._valInArray(r.value,t):e.length>1?r.value===t:!!t;else{if(e.length>1)throw"Got multiple input elements with same name!";"file"!==s&&(e[0].value=t)}break;default:throw'Unsupported element: "'+i+'"!'}}}};return e});
Ink.createModule("Ink.Dom.Loaded",1,[],function(){"use strict";var e={_contexts:[],run:function(e,t){t||(t=e,e=window);for(var n,o=0,r=this._contexts.length;r>o;o++)if(this._contexts[o][0]===e){n=this._contexts[o][1];break}n||(n={cbQueue:[],win:e,doc:e.document,root:e.document.documentElement,done:!1,top:!0},n.handlers={checkState:Ink.bindEvent(this._checkState,this,n),poll:Ink.bind(this._poll,this,n)},this._contexts.push([e,n]));var i=n.doc.addEventListener;n.add=i?"addEventListener":"attachEvent",n.rem=i?"removeEventListener":"detachEvent",n.pre=i?"":"on",n.det=i?"DOMContentLoaded":"onreadystatechange",n.wet=n.pre+"load";var s=n.handlers.checkState,a="complete"===n.doc.readyState&&"about:blank"!=""+n.win.location;if(a)setTimeout(Ink.bind(function(){t.call(n.win,"lazy")},this),0);else{n.cbQueue.push(t),n.doc[n.add](n.det,s),n.win[n.add](n.wet,s);var l=1;try{l=n.win.frameElement}catch(u){}if(!i&&n.root&&n.root.doScroll){try{n.top=!l}catch(u){}n.top&&this._poll(n)}}},_checkState:function(e,t){if(e&&("readystatechange"!==e.type||"complete"===t.doc.readyState)){var n="load"===e.type?t.win:t.doc;n[t.rem](t.pre+e.type,t.handlers.checkState,!1),this._ready(t)}},_poll:function(e){try{e.root.doScroll("left")}catch(t){return setTimeout(e.handlers.poll,50)}this._ready(e)},_ready:function(e){if(!e.done){e.done=!0;for(var t=0;e.cbQueue.length>t;++t)e.cbQueue[t].call(e.win);e.cbQueue=[]}}};return e});
Ink.createModule("Ink.Dom.Selector",1,[],function(){"use strict";function e(e){return ht.test(e+"")}function t(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>E.cacheLength&&delete e[t.shift()],e[n]=r}}function n(e){return e[P]=!0,e}function r(e){var t=A.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t=null}}function o(e,t,n,r){var o,i,s,a,l,d,f,p,h,m;if((t?t.ownerDocument||t:B)!==A&&O(t),t=t||A,n=n||[],!e||"string"!=typeof e)return n;if(1!==(a=t.nodeType)&&9!==a)return[];if(R&&!r){if(o=mt.exec(e))if(s=o[1]){if(9===a){if(i=t.getElementById(s),!i||!i.parentNode)return n;if(i.id===s)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(s))&&M(t,i)&&i.id===s)return n.push(i),n}else{if(o[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&j.getElementsByClassName&&t.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(s)),n}if(j.qsa&&!L.test(e)){if(f=!0,p=P,h=t,m=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){for(d=u(e),(f=t.getAttribute("id"))?p=f.replace(yt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=d.length;l--;)d[l]=p+c(d[l]);h=pt.test(e)&&t.parentNode||t,m=d.join(",")}if(m)try{return Q.apply(n,h.querySelectorAll(m)),n}catch(g){}finally{f||t.removeAttribute("id")}}}return y(e.replace(at,"$1"),t,n,r)}function i(e,t){var n=t&&e,r=n&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function a(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return n(function(t){return t=+t,n(function(n,r){for(var o,i=e([],n.length,t),s=i.length;s--;)n[o=i[s]]&&(n[o]=!(r[o]=n[o]))})})}function u(e,t){var n,r,i,s,a,l,u,c=W[e+" "];if(c)return t?0:c.slice(0);for(a=e,l=[],u=E.preFilter;a;){(!n||(r=lt.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),l.push(i=[])),n=!1,(r=ut.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(at," ")}),a=a.slice(n.length));for(s in E.filter)!(r=ft[s].exec(a))||u[s]&&!(r=u[s](r))||(n=r.shift(),i.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?o.error(e):W(e,l).slice(0)}function c(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=F++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var a,l,u,c=q+" "+i;if(s){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||o)if(u=t[P]||(t[P]={}),(l=u[r])&&l[0]===c){if((a=l[1])===!0||a===C)return a===!0}else if(l=u[r]=[c],l[1]=e(t,n,s)||C,l[1]===!0)return!0}}function f(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function p(e,t,n,r,o){for(var i,s=[],a=0,l=e.length,u=null!=t;l>a;a++)(i=e[a])&&(!n||n(i,r,o))&&(s.push(i),u&&t.push(a));return s}function h(e,t,r,o,i,s){return o&&!o[P]&&(o=h(o)),i&&!i[P]&&(i=h(i,s)),n(function(n,s,a,l){var u,c,d,f=[],h=[],m=s.length,g=n||v(t||"*",a.nodeType?[a]:a,[]),y=!e||!n&&t?g:p(g,f,e,a,l),b=r?i||(n?e:m||o)?[]:s:y;if(r&&r(y,b,a,l),o)for(u=p(b,h),o(u,[],a,l),c=u.length;c--;)(d=u[c])&&(b[h[c]]=!(y[h[c]]=d));if(n){if(i||e){if(i){for(u=[],c=b.length;c--;)(d=b[c])&&u.push(y[c]=d);i(null,b=[],u,l)}for(c=b.length;c--;)(d=b[c])&&(u=i?et.call(n,d):f[c])>-1&&(n[u]=!(s[u]=d))}}else b=p(b===s?b.splice(m,b.length):b),i?i(null,s,b,l):Q.apply(s,b)})}function m(e){for(var t,n,r,o=e.length,i=E.relative[e[0].type],s=i||E.relative[" "],a=i?1:0,l=d(function(e){return e===t},s,!0),u=d(function(e){return et.call(t,e)>-1},s,!0),p=[function(e,n,r){return!i&&(r||n!==N)||((t=n).nodeType?l(e,n,r):u(e,n,r))}];o>a;a++)if(n=E.relative[e[a].type])p=[d(f(p),n)];else{if(n=E.filter[e[a].type].apply(null,e[a].matches),n[P]){for(r=++a;o>r&&!E.relative[e[r].type];r++);return h(a>1&&f(p),a>1&&c(e.slice(0,a-1)).replace(at,"$1"),n,r>a&&m(e.slice(a,r)),o>r&&m(e=e.slice(r)),o>r&&c(e))}p.push(n)}return f(p)}function g(e,t){var r=0,i=t.length>0,s=e.length>0,a=function(n,a,l,u,c){var d,f,h,m=[],g=0,v="0",y=n&&[],b=null!=c,w=N,T=n||s&&E.find.TAG("*",c&&a.parentNode||a),x=q+=null==w?1:Math.random()||.1;for(b&&(N=a!==A&&a,C=r);null!=(d=T[v]);v++){if(s&&d){for(f=0;h=e[f++];)if(h(d,a,l)){u.push(d);break}b&&(q=x,C=++r)}i&&((d=!h&&d)&&g--,n&&y.push(d))}if(g+=v,i&&v!==g){for(f=0;h=t[f++];)h(y,m,a,l);if(n){if(g>0)for(;v--;)y[v]||m[v]||(m[v]=K.call(u));m=p(m)}Q.apply(u,m),b&&!n&&m.length>0&&g+t.length>1&&o.uniqueSort(u)}return b&&(q=x,N=w),y};return i?n(a):a}function v(e,t,n){for(var r=0,i=t.length;i>r;r++)o(e,t[r],n);return n}function y(e,t,n,r){var o,i,s,a,l,d=u(e);if(!r&&1===d.length){if(i=d[0]=d[0].slice(0),i.length>2&&"ID"===(s=i[0]).type&&9===t.nodeType&&R&&E.relative[i[1].type]){if(t=(E.find.ID(s.matches[0].replace(wt,Ct),t)||[])[0],!t)return n;e=e.slice(i.shift().value.length)}for(o=ft.needsContext.test(e)?0:i.length;o--&&(s=i[o],!E.relative[a=s.type]);)if((l=E.find[a])&&(r=l(s.matches[0].replace(wt,Ct),pt.test(i[0].type)&&t.parentNode||t))){if(i.splice(o,1),e=r.length&&c(i),!e)return Q.apply(n,r),n;break}}return S(e,d)(r,t,!R,n,pt.test(e)),n}function b(){}var w,C,E,T,x,S,N,k,I,O,A,D,R,L,H,_,M,P="sizzle"+-new Date,B=window.document,j={},q=0,F=0,X=t(),W=t(),$=t(),U=!1,J=function(){return 0},V="undefined",Y=1<<31,z=[],K=z.pop,G=z.push,Q=z.push,Z=z.slice,et=z.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},tt="[\\x20\\t\\r\\n\\f]",nt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",rt=nt.replace("w","w#"),ot="([*^$|!~]?=)",it="\\["+tt+"*("+nt+")"+tt+"*(?:"+ot+tt+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+rt+")|)|)"+tt+"*\\]",st=":("+nt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+it.replace(3,8)+")*)|.*)\\)|)",at=RegExp("^"+tt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+tt+"+$","g"),lt=RegExp("^"+tt+"*,"+tt+"*"),ut=RegExp("^"+tt+"*([\\x20\\t\\r\\n\\f>+~])"+tt+"*"),ct=RegExp(st),dt=RegExp("^"+rt+"$"),ft={ID:RegExp("^#("+nt+")"),CLASS:RegExp("^\\.("+nt+")"),NAME:RegExp("^\\[name=['\"]?("+nt+")['\"]?\\]"),TAG:RegExp("^("+nt.replace("w","w*")+")"),ATTR:RegExp("^"+it),PSEUDO:RegExp("^"+st),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+tt+"*(even|odd|(([+-]|)(\\d*)n|)"+tt+"*(?:([+-]|)"+tt+"*(\\d+)|))"+tt+"*\\)|)","i"),needsContext:RegExp("^"+tt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+tt+"*((?:-\\d)?\\d*)"+tt+"*\\)|)(?=[^-]|$)","i")},pt=/[\x20\t\r\n\f]*[+~]/,ht=/^[^{]+\{\s*\[native code/,mt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,gt=/^(?:input|select|textarea|button)$/i,vt=/^h\d$/i,yt=/'|\\/g,bt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,wt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Ct=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{Q.apply(z=Z.call(B.childNodes),B.childNodes),z[B.childNodes.length].nodeType}catch(Et){Q={apply:z.length?function(e,t){G.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=o.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},O=o.setDocument=function(t){var n=t?t.ownerDocument||t:B;return n!==A&&9===n.nodeType&&n.documentElement?(A=n,D=n.documentElement,R=!x(n),j.getElementsByTagName=r(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),j.attributes=r(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),j.getElementsByClassName=r(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),j.getByName=r(function(e){e.id=P+0,e.appendChild(A.createElement("a")).setAttribute("name",P),e.appendChild(A.createElement("i")).setAttribute("name",P),D.appendChild(e);var t=n.getElementsByName&&n.getElementsByName(P).length===2+n.getElementsByName(P+0).length;return D.removeChild(e),t}),j.sortDetached=r(function(e){return e.compareDocumentPosition&&1&e.compareDocumentPosition(A.createElement("div"))}),E.attrHandle=r(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==V&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},j.getByName?(E.find.ID=function(e,t){if(typeof t.getElementById!==V&&R){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},E.filter.ID=function(e){var t=e.replace(wt,Ct);return function(e){return e.getAttribute("id")===t}}):(E.find.ID=function(e,t){if(typeof t.getElementById!==V&&R){var n=t.getElementById(e);return n?n.id===e||typeof n.getAttributeNode!==V&&n.getAttributeNode("id").value===e?[n]:void 0:[]}},E.filter.ID=function(e){var t=e.replace(wt,Ct);return function(e){var n=typeof e.getAttributeNode!==V&&e.getAttributeNode("id");return n&&n.value===t}}),E.find.TAG=j.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==V?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},E.find.NAME=j.getByName&&function(e,t){return typeof t.getElementsByName!==V?t.getElementsByName(name):void 0},E.find.CLASS=j.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==V&&R?t.getElementsByClassName(e):void 0},H=[],L=[":focus"],(j.qsa=e(n.querySelectorAll))&&(r(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||L.push("\\["+tt+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||L.push(":checked")}),r(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&L.push("[*^$]="+tt+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||L.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),L.push(",.*:")})),(j.matchesSelector=e(_=D.matchesSelector||D.mozMatchesSelector||D.webkitMatchesSelector||D.oMatchesSelector||D.msMatchesSelector))&&r(function(e){j.disconnectedMatch=_.call(e,"div"),_.call(e,"[s!='']:x"),H.push("!=",st)}),L=RegExp(L.join("|")),H=H.length&&RegExp(H.join("|")),M=e(D.contains)||D.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},J=D.compareDocumentPosition?function(e,t){if(e===t)return U=!0,0;var r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return r?1&r||k&&t.compareDocumentPosition(e)===r?e===n||M(B,e)?-1:t===n||M(B,t)?1:I?et.call(I,e)-et.call(I,t):0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,o=0,s=e.parentNode,a=t.parentNode,l=[e],u=[t];if(e===t)return U=!0,0;if(!s||!a)return e===n?-1:t===n?1:s?-1:a?1:0;if(s===a)return i(e,t);for(r=e;r=r.parentNode;)l.unshift(r);for(r=t;r=r.parentNode;)u.unshift(r);for(;l[o]===u[o];)o++;return o?i(l[o],u[o]):l[o]===B?-1:u[o]===B?1:0},A):A},o.matches=function(e,t){return o(e,null,null,t)},o.matchesSelector=function(e,t){if((e.ownerDocument||e)!==A&&O(e),t=t.replace(bt,"='$1']"),j.matchesSelector&&R&&(!H||!H.test(t))&&!L.test(t))try{var n=_.call(e,t);if(n||j.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return o(t,A,null,[e]).length>0},o.contains=function(e,t){return(e.ownerDocument||e)!==A&&O(e),M(e,t)},o.attr=function(e,t){var n;return(e.ownerDocument||e)!==A&&O(e),R&&(t=t.toLowerCase()),(n=E.attrHandle[t])?n(e):!R||j.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},o.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},o.uniqueSort=function(e){var t,n=[],r=0,o=0;if(U=!j.detectDuplicates,k=!j.sortDetached,I=!j.sortStable&&e.slice(0),e.sort(J),U){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return e},T=o.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=T(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r];r++)n+=T(t);return n},E=o.selectors={cacheLength:50,createPseudo:n,match:ft,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(wt,Ct),e[3]=(e[4]||e[5]||"").replace(wt,Ct),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||o.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&o.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return ft.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&ct.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(wt,Ct).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=X[e+" "];return t||(t=RegExp("(^|"+tt+")"+e+"("+tt+"|$)"))&&X(e,function(e){return t.test(e.className||typeof e.getAttribute!==V&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=o.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,f,p,h,m=i!==s?"nextSibling":"previousSibling",g=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!l&&!a;if(g){if(i){for(;m;){for(d=t;d=d[m];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?g.firstChild:g.lastChild],s&&y){for(c=g[P]||(g[P]={}),u=c[e]||[],p=u[0]===q&&u[1],f=u[0]===q&&u[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(f=p=0)||h.pop();)if(1===d.nodeType&&++f&&d===t){c[e]=[q,p,f];break}}else if(y&&(u=(t[P]||(t[P]={}))[e])&&u[0]===q)f=u[1];else for(;(d=++p&&d&&d[m]||(f=p=0)||h.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[P]||(d[P]={}))[e]=[q,f]),d!==t)););return f-=o,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var r,i=E.pseudos[e]||E.setFilters[e.toLowerCase()]||o.error("unsupported pseudo: "+e);return i[P]?i(t):i.length>1?(r=[e,e,"",t],E.setFilters.hasOwnProperty(e.toLowerCase())?n(function(e,n){for(var r,o=i(e,t),s=o.length;s--;)r=et.call(e,o[s]),e[r]=!(n[r]=o[s])}):function(e){return i(e,0,r)}):i}},pseudos:{not:n(function(e){var t=[],r=[],o=S(e.replace(at,"$1"));return o[P]?n(function(e,t,n,r){for(var i,s=o(e,null,r,[]),a=e.length;a--;)(i=s[a])&&(e[a]=!(t[a]=i))}):function(e,n,i){return t[0]=e,o(t,null,i,r),!r.pop()}}),has:n(function(e){return function(t){return o(e,t).length>0}}),contains:n(function(e){return function(t){return(t.textContent||t.innerText||T(t)).indexOf(e)>-1}}),lang:n(function(e){return dt.test(e||"")||o.error("unsupported lang: "+e),e=e.replace(wt,Ct).toLowerCase(),function(t){var n;do if(n=R?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===D},focus:function(e){return e===A.activeElement&&(!A.hasFocus||A.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!E.pseudos.empty(e)},header:function(e){return vt.test(e.nodeName)},input:function(e){return gt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[0>n?n+t:n]}),even:l(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:l(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:l(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})E.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})E.pseudos[w]=a(w);return S=o.compile=function(e,t){var n,r=[],o=[],i=$[e+" "];if(!i){for(t||(t=u(e)),n=t.length;n--;)i=m(t[n]),i[P]?r.push(i):o.push(i);i=$(e,g(o,r))}return i},E.pseudos.nth=E.pseudos.eq,b.prototype=E.filters=E.pseudos,E.setFilters=new b,j.sortStable=P.split("").sort(J).join("")===P,O(),[0,0].sort(J),j.detectDuplicates=U,{select:o,matches:o.matches,matchesSelector:o.matchesSelector}});
Ink.createModule("Ink.Dom.Browser","1",[],function(){"use strict";var e={IE:!1,GECKO:!1,OPERA:!1,SAFARI:!1,KONQUEROR:!1,CHROME:!1,model:!1,version:!1,userAgent:!1,init:function(){this.detectBrowser(),this.setDimensions(),this.setReferrer()},setDimensions:function(){var e=0,t=0;"number"==typeof window.innerWidth?(e=window.innerWidth,t=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(e=document.documentElement.clientWidth,t=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(e=document.body.clientWidth,t=document.body.clientHeight),this.windowWidth=e,this.windowHeight=t},setReferrer:function(){this.referrer=void 0!==document.referrer?document.referrer.length>0?window.escape(document.referrer):!1:!1},detectBrowser:function(){var e=navigator.userAgent;if(this.userAgent=e,e=e.toLowerCase(),RegExp("applewebkit/").test(e))RegExp("chrome/").test(e)?(this.CHROME=!0,this.model="chrome",this.version=e.replace(RegExp("(.*)chrome/([^\\s]+)(.*)"),"$2"),this.cssPrefix="-webkit-",this.domPrefix="Webkit"):(this.SAFARI=!0,this.model="safari",this.version=e.replace(RegExp("(.*)applewebkit/([^\\s]+)(.*)"),"$2"),this.cssPrefix="-webkit-",this.domPrefix="Webkit");else if(RegExp("opera").test(e))this.OPERA=!0,this.model="opera",this.version=e.replace(RegExp("(.*)opera.([^\\s$]+)(.*)"),"$2"),this.cssPrefix="-o-",this.domPrefix="O";else if(RegExp("konqueror").test(e))this.KONQUEROR=!0,this.model="konqueror",this.version=e.replace(RegExp("(.*)konqueror/([^;]+);(.*)"),"$2"),this.cssPrefix="-khtml-",this.domPrefix="Khtml";else if(RegExp("msie\\ ").test(e))this.IE=!0,this.model="ie",this.version=e.replace(RegExp("(.*)\\smsie\\s([^;]+);(.*)"),"$2"),this.cssPrefix="-ms-",this.domPrefix="ms";else if(RegExp("gecko").test(e)){this.GECKO=!0;var t=RegExp("(camino|chimera|epiphany|minefield|firefox|firebird|phoenix|galeon|iceweasel|k\\-meleon|seamonkey|netscape|songbird|sylera)");if(t.test(e))this.model=e.match(t)[1],this.version=e.replace(RegExp("(.*)"+this.model+"/([^;\\s$]+)(.*)"),"$2"),this.cssPrefix="-moz-",this.domPrefix="Moz";else{this.model="mozilla";var n=RegExp("(.*)rv:([^)]+)(.*)");n.test(e)&&(this.version=e.replace(n,"$2")),this.cssPrefix="-moz-",this.domPrefix="Moz"}}},debug:function(){var e="known browsers: (ie, gecko, opera, safari, konqueror) \n";e+=[this.IE,this.GECKO,this.OPERA,this.SAFARI,this.KONQUEROR]+"\n",e+="model -> "+this.model+"\n",e+="version -> "+this.version+"\n",e+="\n",e+="original UA -> "+this.userAgent,alert(e)}};return e.init(),e});
Ink.createModule("Ink.Util.Url","1",[],function(){"use strict";var e={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",getUrl:function(){return window.location.href},genQueryString:function(e,t){var n,r,o,i=-1!==e.indexOf("?"),s=[e];for(r in t)t.hasOwnProperty(r)&&(i?n="&":(n="?",i=!0),o=t[r],"number"==typeof o||o||(o=""),s=s.concat([n,encodeURIComponent(r),"=",encodeURIComponent(o)]));return s.join("")},getQueryString:function(e){var t;t=e&&e!==void 0?e:this.getUrl();var n={};if(t.match(/\?(.+)/i)){var r=t.replace(/^(.*)\?([^\#]+)(\#(.*))?/g,"$2");if(r.length>0)for(var o=r.split(/[;&]/),i=0;o.length>i;i++){var s=o[i].split("=");n[decodeURIComponent(s[0])]=s[1]!==void 0&&s[1]?decodeURIComponent(s[1]):!1}}return n},getAnchor:function(e){var t;t=e&&e!==void 0?e:this.getUrl();var n=!1;return t.match(/#(.+)/)&&(n=t.replace(/([^#]+)#(.*)/,"$2")),n},getAnchorString:function(e){var t;t=e&&e!==void 0?e:this.getUrl();var n={};if(t.match(/#(.+)/i)){var r=t.replace(/^([^#]+)#(.*)?/g,"$2");if(r.length>0)for(var o=r.split(/[;&]/),i=0;o.length>i;i++){var s=o[i].split("=");n[decodeURIComponent(s[0])]=s[1]!==void 0&&s[1]?decodeURIComponent(s[1]):!1}}return n},parseUrl:function(e){var t={};if(e&&e!==void 0&&"string"==typeof e){if(e.match(/^([^:]+):\/\//i)){var n=/^([^:]+):\/\/([^\/]*)\/?([^\?#]*)\??([^#]*)#?(.*)/i;e.match(n)&&(t.scheme=e.replace(n,"$1"),t.host=e.replace(n,"$2"),t.path="/"+e.replace(n,"$3"),t.query=e.replace(n,"$4")||!1,t.fragment=e.replace(n,"$5")||!1)}else{var r=RegExp("^([^\\?]+)\\?([^#]+)#(.*)","i"),o=RegExp("^([^\\?]+)\\?([^#]+)#?","i"),i=RegExp("^([^\\?]+)\\??","i");e.match(r)?(t.scheme=!1,t.host=!1,t.path=e.replace(r,"$1"),t.query=e.replace(r,"$2"),t.fragment=e.replace(r,"$3")):e.match(o)?(t.scheme=!1,t.host=!1,t.path=e.replace(o,"$1"),t.query=e.replace(o,"$2"),t.fragment=!1):e.match(i)&&(t.scheme=!1,t.host=!1,t.path=e.replace(i,"$1"),t.query=!1,t.fragment=!1)}if(t.host){var s=RegExp("^(.*)\\:(\\d+)$","i");if(t.host.match(s)){var a=t.host;t.host=a.replace(s,"$1"),t.port=a.replace(s,"$2")}else t.port=!1;if(t.host.match(/@/i)){var l=t.host;t.host=l.split("@")[1];var u=l.split("@")[0];u.match(/\:/)?(t.user=u.split(":")[0],t.pass=u.split(":")[1]):(t.user=u,t.pass=!1)}}}return t},currentScriptElement:function(e){var t=document.getElementsByTagName("script");if(e===void 0)return t.length>0?t[t.length-1]:!1;for(var n=!1,r=RegExp(""+e,"i"),o=0,i=t.length;i>o;o++)if(n=t[o],r.test(n.src))return n;return!1},_debug:function(){}};return e});
Ink.createModule("Ink.Util.Swipe","1",["Ink.Dom.Event_1"],function(e){"use strict";var t=function(e,t){this._options=Ink.extendObj({callback:void 0,forceAxis:void 0,maxDist:void 0,maxDuration:void 0,minDist:void 0,minDuration:void 0,stopEvents:!0,storeGesture:!1},t||{}),this._handlers={down:Ink.bindEvent(this._onDown,this),move:Ink.bindEvent(this._onMove,this),up:Ink.bindEvent(this._onUp,this)},this._element=Ink.i(e),this._init()};return t._supported="ontouchstart"in document.documentElement,t.prototype={_init:function(){var t=document.body;e.observe(t,"touchstart",this._handlers.down),this._options.storeGesture&&e.observe(t,"touchmove",this._handlers.move),e.observe(t,"touchend",this._handlers.up),this._isOn=!1},_isMeOrParent:function(e,t){if(e){do{if(e===t)return!0;e=e.parentNode}while(e);return!1}},_onDown:function(t){1===event.changedTouches.length&&this._isMeOrParent(t.target,this._element)&&(this._options.stopEvents===!0&&e.stop(t),t=t.changedTouches[0],this._isOn=!0,this._target=t.target,this._t0=(new Date).valueOf(),this._p0=[t.pageX,t.pageY],this._options.storeGesture&&(this._gesture=[this._p0],this._time=[0]))},_onMove:function(t){if(this._isOn&&1===event.changedTouches.length){this._options.stopEvents===!0&&e.stop(t),t=t.changedTouches[0];var n=(new Date).valueOf(),r=.001*(n-this._t0);this._gesture.push([t.pageX,t.pageY]),this._time.push(r)}},_onUp:function(t){if(this._isOn&&1===event.changedTouches.length){this._options.stopEvents&&e.stop(t),t=t.changedTouches[0],this._isOn=!1;var n=(new Date).valueOf(),r=[t.pageX,t.pageY],o=.001*(n-this._t0),i=[r[0]-this._p0[0],r[1]-this._p0[1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),a=Math.abs(i[0])>Math.abs(i[1])?"x":"y",l=this._options;if(!(l.minDist&&l.minDist>s||l.maxDist&&s>l.maxDist||l.minDuration&&l.minDuration>o||l.maxDuration&&o>l.maxDuration||l.forceAxis&&a!==l.forceAxis)){var u={upEvent:t,elementId:this._element.id,duration:o,dr:i,dist:s,axis:a,target:this._target};this._options.storeGesture&&(u.gesture=this._gesture,u.time=this._time),this._options.callback(this,u)}}}},t});
Ink.createModule("Ink.Util.String","1",[],function(){"use strict";var InkUtilString={_chars:["&","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","ø","ù","ú","û","ü","ý","þ","ÿ","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","Ø","Ù","Ú","Û","Ü","Ý","Þ","€",'"',"ß","<",">","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾"],_entities:["amp","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","yuml","Agrave","Aacute","Acirc","Atilde","Auml","Aring","AElig","Ccedil","Egrave","Eacute","Ecirc","Euml","Igrave","Iacute","Icirc","Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde","Ouml","Oslash","Ugrave","Uacute","Ucirc","Uuml","Yacute","THORN","euro","quot","szlig","lt","gt","cent","pound","curren","yen","brvbar","sect","uml","copy","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34"],_accentedChars:["à","á","â","ã","ä","å","è","é","ê","ë","ì","í","î","ï","ò","ó","ô","õ","ö","ù","ú","û","ü","ç","ñ","À","Á","Â","Ã","Ä","Å","È","É","Ê","Ë","Ì","Í","Î","Ï","Ò","Ó","Ô","Õ","Ö","Ù","Ú","Û","Ü","Ç","Ñ"],_accentedRemovedChars:["a","a","a","a","a","a","e","e","e","e","i","i","i","i","o","o","o","o","o","u","u","u","u","c","n","A","A","A","A","A","A","E","E","E","E","I","I","I","I","O","O","O","O","O","U","U","U","U","C","N"],_htmlUnsafeChars:{"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&apos;"},ucFirst:function(e,t){var n=t?/(^|\s)(\w)(\S{2,})/:/(^|\s)(\w)(\S{2,})/g;return e?(e+"").replace(n,function(e,t,n,r){return t+n.toUpperCase()+r.toLowerCase()}):e},trim:function(e){return"string"==typeof e?e.replace(/^\s+|\s+$|\n+$/g,""):e},stripTags:function(e,t){if(t&&"string"==typeof t){for(var n=InkUtilString.trim(t).split(","),r=[],o=!1,i=0;n.length>i;i++)""!==InkUtilString.trim(n[i])&&(o=InkUtilString.trim(n[i].replace(/(\<|\>)/g,"").replace(/\s/,"")),r.push("(<"+o+"\\s[^>]+>|<(\\s|\\/)?(\\s|\\/)?"+o+">)"));for(var s=r.join("|"),a=RegExp(s,"i"),l=e.match(RegExp("<[^>]*>","g")),u=0;l.length>u;u++)l[u].match(a)||(e=e.replace(RegExp(l[u],"gm"),""));return e}return e.replace(/\<[^\>]+\>/g,"")},htmlEntitiesEncode:function(e){if(e&&e.replace)for(var t=!1,n=0;InkUtilString._chars.length>n;n++)t=RegExp(InkUtilString._chars[n],"gm"),e=e.replace(t,"&"+InkUtilString._entities[n]+";");return e},htmlEntitiesDecode:function(e){if(e&&e.replace){for(var t=!1,n=0;InkUtilString._entities.length>n;n++)t=RegExp("&"+InkUtilString._entities[n]+";","gm"),e=e.replace(t,InkUtilString._chars[n]);e=e.replace(/&#[^;]+;?/g,function(e){return"x"===e.charAt(2)?String.fromCharCode(parseInt(e.substring(3),16)):String.fromCharCode(parseInt(e.substring(2),10))})}return e},utf8Encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;e.length>n;n++){var r=e.charCodeAt(n);128>r?t+=String.fromCharCode(r):r>127&&2048>r?(t+=String.fromCharCode(192|r>>6),t+=String.fromCharCode(128|63&r)):(t+=String.fromCharCode(224|r>>12),t+=String.fromCharCode(128|63&r>>6),t+=String.fromCharCode(128|63&r))}return t},shortString:function(e,t){for(var n=e.split(" "),r="",o=0;n.length>o;o++){if((r+n[o]+" ").length>=t){r+="&hellip;";break}r+=n[o]+" "}return r},truncateString:function(e,t){return e.length-1>t?e.substr(0,t-1)+"…":e},utf8Decode:function(e){for(var t="",n=0,r=0,o=0,i=0;e.length>n;)r=e.charCodeAt(n),128>r?(t+=String.fromCharCode(r),n++):r>191&&224>r?(o=e.charCodeAt(n+1),t+=String.fromCharCode((31&r)<<6|63&o),n+=2):(o=e.charCodeAt(n+1),i=e.charCodeAt(n+2),t+=String.fromCharCode((15&r)<<12|(63&o)<<6|63&i),n+=3);return t},removeAccentedChars:function(e){for(var t=e,n=!1,r=0;InkUtilString._accentedChars.length>r;r++)n=RegExp(InkUtilString._accentedChars[r],"gm"),t=t.replace(n,""+InkUtilString._accentedRemovedChars[r]);return t},substrCount:function(e,t){return e?e.split(t).length-1:0},evalJSON:function(strJSON,sanitize){if(sanitize===void 0||null===sanitize||InkUtilString.isJSON(strJSON))try{return"undefined"!=typeof JSON&&JSON.parse!==void 0?JSON.parse(strJSON):eval("("+strJSON+")")}catch(e){throw Error("ERROR: Bad JSON string...")}},isJSON:function(e){return e=e.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""),/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(e)},htmlEscapeUnsafe:function(e){var t=InkUtilString._htmlUnsafeChars;return null!=e?(e+"").replace(/[<>&'"]/g,function(e){return t[e]}):e},normalizeWhitespace:function(e){return null!=e?InkUtilString.trim((e+"").replace(/\s+/g," ")):e},toUnicode:function(e){if("string"==typeof e){for(var t="",n=!1,r=!1,o=e.length,i=0;o>i;){if(n=e.charCodeAt(i),n>=32&&126>=n||8==n||9==n||10==n||12==n||13==n||32==n||34==n||47==n||58==n||92==n)r=8==n?"\\b":9==n?"\\t":10==n?"\\n":12==n?"\\f":13==n?"\\r":e.charAt(i);else{for(r=e.charCodeAt(i).toString(16)+"".toUpperCase();4>r.length;)r="0"+r;r="\\u"+r}t+=r,i++}return t}},escape:function(e){var t=e.charCodeAt(0).toString(16).split("");if(3>t.length){for(;2>t.length;)t.unshift("0");t.unshift("x")}else{for(;4>t.length;)t.unshift("0");t.unshift("u")}return t.unshift("\\"),t.join("")},unescape:function(e){var t=e.lastIndexOf("0");t=-1===t?2:Math.min(t,2);var n=e.substring(t),r=parseInt(n,16);return String.fromCharCode(r)},escapeText:function(e,t){void 0===t&&(t=["[","]","'",","]);for(var n,r,o=[],i=0,s=e.length;s>i;++i)n=e[i],r=n.charCodeAt(0),(32>r||r>126&&-1===t.indexOf(n))&&(n=InkUtilString.escape(n)),o.push(n);return o.join("")},escapedCharRegex:/(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4})/g,unescapeText:function(e){for(var t;t=InkUtilString.escapedCharRegex.exec(e);)t=t[0],e=e.replace(t,InkUtilString.unescape(t)),InkUtilString.escapedCharRegex.lastIndex=0;return e},strcmp:function(e,t){return e===t?0:e>t?1:-1},packetize:function(e,t){for(var n,r=e.length,o=Array(Math.ceil(r/t)),i=e.split(""),s=0;r;)n=Math.min(t,r),o[s++]=i.splice(0,n).join(""),r-=n;return o}};return InkUtilString});
Ink.createModule("Ink.Util.Json","1",[],function(){"use strict";function twoDigits(e){var t=""+e;return 1===t.length?"0"+t:t}var function_call=Function.prototype.call,cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,date_toISOString=Date.prototype.toISOString?Ink.bind(function_call,Date.prototype.toISOString):function(e){return e.getUTCFullYear()+"-"+twoDigits(e.getUTCMonth()+1)+"-"+twoDigits(e.getUTCDate())+"T"+twoDigits(e.getUTCHours())+":"+twoDigits(e.getUTCMinutes())+":"+twoDigits(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"},InkJson={_nativeJSON:window.JSON||null,_convertToUnicode:!1,_escape:function(e){var t={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)&&(e=e.replace(/([\x00-\x1f\\"])/g,function(e,n){var r=t[n];return r?r:(r=n.charCodeAt(),"\\u00"+Math.floor(r/16).toString(16)+(r%16).toString(16))})),e},_toUnicode:function(e){if(this._convertToUnicode){for(var t="",n=!1,r=!1,o=0,i=e.length;i>o;){if(n=e.charCodeAt(o),n>=32&&126>=n||8===n||9===n||10===n||12===n||13===n||32===n||34===n||47===n||58===n||92===n)r=34===n||92===n||47===n?"\\"+e.charAt(o):8===n?"\\b":9===n?"\\t":10===n?"\\n":12===n?"\\f":13===n?"\\r":e.charAt(o);else if(this._convertToUnicode){for(r=e.charCodeAt(o).toString(16)+"".toUpperCase();4>r.length;)r="0"+r;r="\\u"+r}else r=e.charAt(o);t+=r,o++}return t}return this._escape(e)},_stringifyValue:function(e){if("string"==typeof e)return'"'+this._toUnicode(e)+'"';if("number"!=typeof e||!isNaN(e)&&isFinite(e)){if(e===void 0||null===e)return"null";if("function"==typeof e.toJSON){var t=e.toJSON();return"string"==typeof t?'"'+this._escape(t)+'"':this._escape(""+t)}if("number"==typeof e||"boolean"==typeof e)return""+e;if("function"==typeof e)return"null";if(e.constructor===Date)throw"";if(e.constructor===Array){for(var n="",r=0,o=e.length;o>r;r++)r>0&&(n+=","),n+=this._stringifyValue(e[r]);return"["+n+"]"}var i="";for(var s in e)({}).hasOwnProperty.call(e,s)&&(""!==i&&(i+=","),i+='"'+this._escape(s)+'": '+this._stringifyValue(e[s]));return"{"+i+"}"}return"null"},stringify:function(e,t){return this._convertToUnicode=!!t,!this._convertToUnicode&&this._nativeJSON?this._nativeJSON.stringify(e):this._stringifyValue(e)},parse:function(text,reviver){function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(e,t,o)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")}};return InkJson});
Ink.createModule("Ink.Util.I18n","1",[],function(){"use strict";var e=/\{(?:(\{.*?})|(?:%s:)?(\d+)|(?:%s)?|([\w-]+))}/g,t=function(e,t){return"function"==typeof e?e.apply(this,t):void 0!==typeof e?e:""},n=function(e,t,r){return this instanceof n?(this.reset().lang(t).testMode(r).append(e||{},t),void 0):new n(e,t,r)};return n.prototype={reset:function(){return this._dicts=[],this._dict={},this._testMode=!1,this._lang=this._gLang,this},append:function(e){return this._dicts.push(e),this._dict=Ink.extendObj(this._dict,e[this._lang]),this},lang:function(e){if(!arguments.length)return this._lang;if(e&&this._lang!==e){this._lang=e,this._dict={};for(var t=0,n=this._dicts.length;n>t;t++)this._dict=Ink.extendObj(this._dict,this._dicts[t][e]||{})}return this},testMode:function(e){return arguments.length?(void 0!==e&&(this._testMode=!!e),this):!!this._testMode},getKey:function(e){var t,r=this._gLang,o=this._lang;return e in this._dict?t=this._dict[e]:(n.lang(o),t=this._gDict[e],n.lang(r)),t},text:function(n){if("string"==typeof n){var r=Array.prototype.slice.call(arguments,1),o=0,i="object"==typeof r[0],s=this.getKey(n);return void 0===s&&(s=this._testMode?"["+n+"]":n),"number"==typeof s&&(s+=""),"string"==typeof s?s=s.replace(e,function(e,n,s,a){var u=n?n:s?r[s-(i?0:1)]:a?r[0][a]||"":r[o++ +(i?1:0)];return t(u,[o].concat(r))}):"function"==typeof s?s.apply(this,r):s instanceof Array?t(s[r[0]],r):"object"==typeof s?t(s[r[0]],r):""}},ntext:function(e,t,n){var r,o=Array.prototype.slice.apply(arguments);if(2===o.length&&"number"==typeof t){if(r=this.getKey(e),!(r instanceof Array))return"";o.splice(0,1),r=r[1===t?0:1]}else o.splice(0,2),r=1===n?e:t;return this.text.apply(this,[r].concat(o))},ordinal:function(e){if(void 0===e)return"";var n=+(""+e).slice(-1),r=this.getKey("_ordinals");if(void 0===r)return"";if("string"==typeof r)return r;var o;return"function"==typeof r&&(o=r(e,n),"string"==typeof o)?o:"exceptions"in r&&(o="function"==typeof r.exceptions?r.exceptions(e,n):e in r.exceptions?t(r.exceptions[e],[e,n]):void 0,"string"==typeof o)?o:"byLastDigit"in r&&(o="function"==typeof r.byLastDigit?r.byLastDigit(n,e):n in r.byLastDigit?t(r.byLastDigit[n],[n,e]):void 0,"string"==typeof o)?o:"default"in r&&(o=t(r["default"],[e,n]),"string"==typeof o)?o:""},alias:function(){var e=Ink.bind(n.prototype.text,this);return e.ntext=Ink.bind(n.prototype.ntext,this),e.append=Ink.bind(n.prototype.append,this),e.ordinal=Ink.bind(n.prototype.ordinal,this),e.testMode=Ink.bind(n.prototype.testMode,this),e}},n.reset=function(){n.prototype._gDicts=[],n.prototype._gDict={},n.prototype._gLang="pt_PT"},n.reset(),n.append=function(e,t){if(t){if(!(t in e)){var r={};r[t]=e,e=r}t!==n.prototype._gLang&&n.lang(t)}n.prototype._gDicts.push(e),Ink.extendObj(n.prototype._gDict,e[n.prototype._gLang])},n.lang=function(e){if(!arguments.length)return n.prototype._gLang;if(e&&n.prototype._gLang!==e){n.prototype._gLang=e,n.prototype._gDict={};for(var t=0,r=n.prototype._gDicts.length;r>t;t++)Ink.extendObj(n.prototype._gDict,n.prototype._gDicts[t][e]||{})}},n});
Ink.createModule("Ink.Util.Dumper","1",[],function(){"use strict";var e={_tab:"    ",_formatParam:function(e){var t="";switch(typeof e){case"string":t="(string) "+e;break;case"number":t="(number) "+e;break;case"boolean":t="(boolean) "+e;break;case"object":t=null!==e?e.constructor===Array?"Array \n{\n"+this._outputFormat(e,0)+"\n}":"Object \n{\n"+this._outputFormat(e,0)+"\n}":"null";break;default:t=!1}return t},_getTabs:function(e){for(var t="",n=0;e>n;n++)t+=this._tab;return t},_outputFormat:function(e,t){var n="",r=!1;for(var o in e)if(null!==e[o])if("object"!=typeof e[o]||e[o].constructor!==Array&&e[o].constructor!==Object){if(e[o].constructor===Function)continue;n=n+this._tab+this._getTabs(t)+"["+o+"] => "+e[o]+"\n"}else e[o].constructor===Array?r="Array":e[o].constructor===Object&&(r="Object"),n+=this._tab+this._getTabs(t)+"["+o+"] => <b>"+r+"</b>\n",n+=this._tab+this._getTabs(t)+"{\n",n+=this._outputFormat(e[o],t+1)+this._tab+this._getTabs(t)+"}\n";else n=n+this._tab+this._getTabs(t)+"["+o+"] => null \n";return n},printDump:function(e,t){if(t&&t!==void 0)if("string"==typeof t)document.getElementById(t).innerHTML="<pre>"+this._formatParam(e)+"</pre>";else{if("object"!=typeof t)throw"TARGET must be an element or an element ID";t.innerHTML="<pre>"+this._formatParam(e)+"</pre>"}else document.write("<pre>"+this._formatParam(e)+"</pre>")},returnDump:function(e){return this._formatParam(e)},alertDump:function(e){window.alert(this._formatParam(e).replace(/(<b>)(Array|Object)(<\/b>)/g,"$2"))},windowDump:function(e){var t="dumperwindow_"+1e4*Math.random(),n=window.open("",t,"width=400,height=300,left=50,top=50,status,menubar,scrollbars,resizable");n.document.open(),n.document.write("<pre>"+this._formatParam(e)+"</pre>"),n.document.close(),n.focus()}};return e});
Ink.createModule("Ink.Util.Date","1",[],function(){"use strict";var e={_months:function(e){var t=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];return t[e]},_iMonth:function(e){return Number(e)?+e-1:{janeiro:0,jan:0,fevereiro:1,fev:1,"março":2,mar:2,abril:3,abr:3,maio:4,mai:4,junho:5,jun:5,julho:6,jul:6,agosto:7,ago:7,setembro:8,set:8,outubro:9,out:9,novembro:10,nov:10,dezembro:11,dez:11}[e.toLowerCase()]},_wDays:function(e){var t=["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"];return t[e]},_iWeek:function(e){return Number(e)?+e||7:{segunda:1,seg:1,"terça":2,ter:2,quarta:3,qua:3,quinta:4,qui:4,sexta:5,sex:5,"sábado":6,"sáb":6,domingo:7,dom:7}[e.toLowerCase()]},_daysInMonth:function(e,t){var n;return n=1===e||3===e||5===e||7===e||8===e||10===e||12===e?31:4===e||6===e||9===e||11===e?30:0===t%400||0===t%4&&0!==t%100?29:28},get:function(e,t){(e===void 0||""===e)&&(e="Y-m-d");var n,r=e.split(""),o=Array(r.length),i="\\";n=t===void 0?new Date:"number"==typeof t?new Date(1e3*t):new Date(t);for(var a,s,u,l=0;r.length>l;l++)switch(r[l]){case i:o[l]=r[l+1],l++;break;case"d":var c=n.getDate();o[l]=(c+"").length>1?c:"0"+c;break;case"D":o[l]=this._wDays(n.getDay()).substring(0,3);break;case"j":o[l]=n.getDate();break;case"l":o[l]=this._wDays(n.getDay());break;case"N":o[l]=n.getDay()||7;break;case"S":var d=n.getDate(),f=["st","nd","rd"],h="";o[l]=d>=11&&13>=d?"th":(h=f[(d+"").substr(-1)-1])?h:"th";break;case"w":o[l]=n.getDay();break;case"z":a=Date.UTC(n.getFullYear(),0,0),s=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()),o[l]=Math.floor((s-a)/864e5);break;case"W":var p=new Date(n.getFullYear(),0,1);a=p.getDay()||7;var m=Math.floor((n-p)/864e5+1);o[l]=Math.ceil((m-(8-a))/7)+1;break;case"F":o[l]=this._months(n.getMonth());break;case"m":var g=n.getMonth()+1+"";o[l]=g.length>1?g:"0"+g;break;case"M":o[l]=this._months(n.getMonth()).substring(0,3);break;case"n":o[l]=n.getMonth()+1;break;case"t":o[l]=this._daysInMonth(n.getMonth()+1,n.getYear());break;case"L":var v=n.getFullYear();o[l]=v%4?!1:v%100?!0:v%400?!1:!0;break;case"o":throw'"o" not implemented!';case"Y":o[l]=n.getFullYear();break;case"y":o[l]=(n.getFullYear()+"").substring(2);break;case"a":o[l]=12>n.getHours()?"am":"pm";break;case"A":o[l]=12>n.getHours?"AM":"PM";break;case"B":throw'"B" not implemented!';case"g":u=n.getHours(),o[l]=12>=u?u:u-12;break;case"G":o[l]=n.getHours()+"";break;case"h":u=n.getHours()+"",u=12>=u?u:u-12,o[l]=u.length>1?u:"0"+u;break;case"H":u=n.getHours()+"",o[l]=u.length>1?u:"0"+u;break;case"i":var y=n.getMinutes()+"";o[l]=y.length>1?y:"0"+y;break;case"s":var b=n.getSeconds()+"";o[l]=b.length>1?b:"0"+b;break;case"u":throw'"u" not implemented!';case"e":throw'"e" not implemented!';case"I":a=new Date(n.getFullYear(),0,1),o[l]=n.getTimezoneOffset()!==a.getTimezoneOffset()?1:0;break;case"O":var w=n.getTimezoneOffset(),k=w%60;u=-1*((w-k)/60)+"","-"!==u.charAt(0)&&(u="+"+u),u=3===u.length?u:u.replace(/([+\-])(\d)/,"$10$2"),o[l]=u+k+"0";break;case"P":throw'"P" not implemented!';case"T":throw'"T" not implemented!';case"Z":o[l]=60*n.getTimezoneOffset();break;case"c":throw'"c" not implemented!';case"r":var E=this._wDays(n.getDay()).substr(0,3),C=this._months(n.getMonth()).substr(0,3);o[l]=E+", "+n.getDate()+" "+C+this.get(" Y H:i:s O",n);break;case"U":o[l]=Math.floor(n.getTime()/1e3);break;default:o[l]=r[l]}return o.join("")},set:function(e,t){if(void 0!==t){(e===void 0||""===e)&&(e="Y-m-d");for(var n,r=e.split(""),o=Array(r.length),i="\\",a={year:void 0,month:void 0,day:void 0,dayY:void 0,dayW:void 0,week:void 0,hour:void 0,hourD:void 0,min:void 0,sec:void 0,msec:void 0,ampm:void 0,diffM:void 0,diffH:void 0,date:void 0},s=0,u=0;r.length>u;u++)switch(r[u]){case i:o[u]=r[u+1],u++;break;case"d":o[u]="(\\d{2})",a.day={original:u,match:s++};break;case"j":o[u]="(\\d{1,2})",a.day={original:u,match:s++};break;case"D":o[u]="([\\wá]{3})",a.dayW={original:u,match:s++};break;case"l":o[u]="([\\wá]{5,7})",a.dayW={original:u,match:s++};break;case"N":o[u]="(\\d)",a.dayW={original:u,match:s++};break;case"w":o[u]="(\\d)",a.dayW={original:u,match:s++};break;case"S":o[u]="\\w{2}";break;case"z":o[u]="(\\d{1,3})",a.dayY={original:u,match:s++};break;case"W":o[u]="(\\d{1,2})",a.week={original:u,match:s++};break;case"F":o[u]="([\\wç]{4,9})",a.month={original:u,match:s++};break;case"M":o[u]="(\\w{3})",a.month={original:u,match:s++};break;case"m":o[u]="(\\d{2})",a.month={original:u,match:s++};break;case"n":o[u]="(\\d{1,2})",a.month={original:u,match:s++};break;case"t":o[u]="\\d{2}";break;case"L":o[u]="\\w{4,5}";break;case"o":throw'"o" not implemented!';case"Y":o[u]="(\\d{4})",a.year={original:u,match:s++};break;case"y":o[u]="(\\d{2})",(a.year===void 0||"Y"!==r[a.year.original])&&(a.year={original:u,match:s++});break;case"a":o[u]="(am|pm)",a.ampm={original:u,match:s++};break;case"A":o[u]="(AM|PM)",a.ampm={original:u,match:s++};break;case"B":throw'"B" not implemented!';case"g":o[u]="(\\d{1,2})",a.hourD={original:u,match:s++};break;case"G":o[u]="(\\d{1,2})",a.hour={original:u,match:s++};break;case"h":o[u]="(\\d{2})",a.hourD={original:u,match:s++};break;case"H":o[u]="(\\d{2})",a.hour={original:u,match:s++};break;case"i":o[u]="(\\d{2})",a.min={original:u,match:s++};break;case"s":o[u]="(\\d{2})",a.sec={original:u,match:s++};break;case"u":throw'"u" not implemented!';case"e":throw'"e" not implemented!';case"I":o[u]="\\d";break;case"O":o[u]="([-+]\\d{4})",a.diffH={original:u,match:s++};break;case"P":throw'"P" not implemented!';case"T":throw'"T" not implemented!';case"Z":o[u]="(\\-?\\d{1,5})",a.diffM={original:u,match:s++};break;case"c":throw'"c" not implemented!';case"r":o[u]="([\\wá]{3}, \\d{1,2} \\w{3} \\d{4} \\d{2}:\\d{2}:\\d{2} [+\\-]\\d{4})",a.date={original:u,match:s++};break;case"U":o[u]="(\\d{1,13})",a.date={original:u,match:s++};break;default:o[u]=r[u]}var l=RegExp(o.join(""));try{if(n=t.match(l),!n)return}catch(c){return}var d,f,h=a.date!==void 0,p=a.year!==void 0,m=a.dayY!==void 0,g=a.day!==void 0,v=a.month!==void 0,y=v&&g,b=!v&&g,w=a.dayW!==void 0,k=a.week!==void 0,E=k&&w,C=!k&&w,x=m||y||!p&&b||E||!p&&C,S=!(p||m||g||v||w||k),T=a.hourD!==void 0&&a.ampm!==void 0,I=a.hour!==void 0,_=T||I,N=a.min!==void 0,O=a.sec!==void 0,D=a.msec!==void 0,A=!S||_,R=A||N,M=a.diffM!==void 0,L=a.diffH!==void 0;if(h){if("U"===r[a.date.original])return new Date(1e3*+n[a.date.match+1]);var H=n[a.date.match+1].match(/\w{3}, (\d{1,2}) (\w{3}) (\d{4}) (\d{2}):(\d{2}):(\d{2}) ([+\-]\d{4})/);return d=+H[4]+ +H[7].slice(0,3),f=+H[5]+60*((H[7].slice(0,1)+H[7].slice(3))/100),new Date(H[3],this._iMonth(H[2]),H[1],d,f,H[6])}var P,j,U,F,q,B,$,W=new Date;if(x||S){if(x){if(p){var J=W.getFullYear()-50+"";P=n[a.year.match+1],"y"===r[a.year.original]&&(P=+J.slice(0,2)+(P>=J.slice(2)?0:1)+P)}else P=W.getFullYear();if(m)j=0,U=n[a.dayY.match+1];else if(g)j=v?this._iMonth(n[a.month.match+1]):W.getMonth(),U=n[a.day.match+1];else{j=0;var Y;Y=k?n[a.week.match+1]:this.get("W",W),U=7*(Y-2)+(8-(new Date(P,0,1).getDay()||7))+this._iWeek(n[a.week.match+1])}if(0===j&&U>31){var X=new Date(P,j,U);j=X.getMonth(),U=X.getDate()}}else P=W.getFullYear(),j=W.getMonth(),U=W.getDate();return F=P+"-"+(j+1)+"-"+U+" ",d=T?+n[a.hourD.match+1]+("pm"===n[a.ampm.match+1]?12:0):I?n[a.hour.match+1]:S?W.getHours():"00",f=N?n[a.min.match+1]:A?"00":W.getMinutes(),q=O?n[a.sec.match+1]:R?"00":W.getSeconds(),B=D?n[a.msec.match+1]:"000",$=L?n[a.diffH.match+1]:M?(100*(-1*n[a.diffM.match+1]/60)+"").replace(/^(\d)/,"+$1").replace(/(^[\-+])(\d{3}$)/,"$10$2"):"+0000",new Date(F+d+":"+f+":"+q+"."+B+$)}}}};return e});
Ink.createModule("Ink.Util.Cookie","1",[],function(){"use strict";var e={get:function(e){var t=document.cookie||!1,n={};if(t){t=t.replace(RegExp("; ","g"),";");var r=t.split(";"),o=[];if(r.length>0)for(var i=0;r.length>i;i++)o=r[i].split("="),2===o.length&&(n[o[0]]=decodeURIComponent(o[1])),o=[]}return e?n[e]!==void 0?n[e]:null:n},set:function(e,t,n,r,o,i){var a;if(!e||t===!1||void 0===e||void 0===t)return!1;a=e+"="+encodeURIComponent(t);var s=!1,u=!1,l=!1,c=!1;if(n&&n!==void 0&&!isNaN(n)){var d=new Date,f=parseInt(Number(d.valueOf()),10)+1e3*Number(parseInt(n,10)),h=new Date(f),p=h.toGMTString(),m=RegExp("([^\\s]+)(\\s\\d\\d)\\s(\\w\\w\\w)\\s(.*)");p=p.replace(m,"$1$2-$3-$4"),s="expires="+p}else s=void 0===n||isNaN(n)||0!==Number(parseInt(n,10))?"expires=Thu, 01-Jan-2037 00:00:01 GMT":"";if(u=r&&r!==void 0?"path="+r:"path=/",o&&o!==void 0)l="domain="+o;else{var g=RegExp(":(.*)");l="domain="+window.location.host,l=l.replace(g,"")}c=i&&i!==void 0?i:!1,document.cookie=a+"; "+s+"; "+u+"; "+l+"; "+c},remove:function(e,t,n){var r=!1,o=!1,i=-999999999;r=t&&t!==void 0?t:"/",o=n&&n!==void 0?n:window.location.host,this.set(e,"deleted",i,r,o)}};return e});
Ink.createModule("Ink.Util.BinPack","1",[],function(){"use strict";var e=function(e,t){this.init(e,t)};e.prototype={init:function(e,t){this.root={x:0,y:0,w:e,h:t}},fit:function(e){var t,n,r;for(t=0;e.length>t;++t)r=e[t],(n=this.findNode(this.root,r.w,r.h))&&(r.fit=this.splitNode(n,r.w,r.h))},findNode:function(e,t,n){return e.used?this.findNode(e.right,t,n)||this.findNode(e.down,t,n):e.w>=t&&e.h>=n?e:null},splitNode:function(e,t,n){return e.used=!0,e.down={x:e.x,y:e.y+n,w:e.w,h:e.h-n},e.right={x:e.x+t,y:e.y,w:e.w-t,h:n},e}};var t=function(){};t.prototype={fit:function(e){var t,n,r,o=e.length,i=o>0?e[0].w:0,a=o>0?e[0].h:0;for(this.root={x:0,y:0,w:i,h:a},t=0;o>t;t++)r=e[t],r.fit=(n=this.findNode(this.root,r.w,r.h))?this.splitNode(n,r.w,r.h):this.growNode(r.w,r.h)},findNode:function(e,t,n){return e.used?this.findNode(e.right,t,n)||this.findNode(e.down,t,n):e.w>=t&&e.h>=n?e:null},splitNode:function(e,t,n){return e.used=!0,e.down={x:e.x,y:e.y+n,w:e.w,h:e.h-n},e.right={x:e.x+t,y:e.y,w:e.w-t,h:n},e},growNode:function(e,t){var n=this.root.w>=e,r=this.root.h>=t,o=r&&this.root.h>=this.root.w+e,i=n&&this.root.w>=this.root.h+t;return o?this.growRight(e,t):i?this.growDown(e,t):r?this.growRight(e,t):n?this.growDown(e,t):null},growRight:function(e,t){this.root={used:!0,x:0,y:0,w:this.root.w+e,h:this.root.h,down:this.root,right:{x:this.root.w,y:0,w:e,h:this.root.h}};var n;return(n=this.findNode(this.root,e,t))?this.splitNode(n,e,t):null},growDown:function(e,t){this.root={used:!0,x:0,y:0,w:this.root.w,h:this.root.h+t,down:{x:0,y:this.root.h,w:this.root.w,h:t},right:this.root};var n;return(n=this.findNode(this.root,e,t))?this.splitNode(n,e,t):null}};var n={random:function(){return Math.random()-.5},w:function(e,t){return t.w-e.w},h:function(e,t){return t.h-e.h},a:function(e,t){return t.area-e.area},max:function(e,t){return Math.max(t.w,t.h)-Math.max(e.w,e.h)},min:function(e,t){return Math.min(t.w,t.h)-Math.min(e.w,e.h)},height:function(e,t){return n.msort(e,t,["h","w"])},width:function(e,t){return n.msort(e,t,["w","h"])},area:function(e,t){return n.msort(e,t,["a","h","w"])},maxside:function(e,t){return n.msort(e,t,["max","min","h","w"])},msort:function(e,t,r){var o,i;for(i=0;r.length>i;++i)if(o=n[r[i]](e,t),0!==o)return o;return 0}},r=function(){return[this.w," x ",this.h].join("")},o={binPack:function(o){var i,a,s;for(i=0,a=o.blocks.length;a>i;++i)s=o.blocks[i],"area"in s||(s.area=s.w*s.h);var u=o.dimensions?new e(o.dimensions[0],o.dimensions[1]):new t;o.sorter||(o.sorter="maxside"),o.blocks.sort(n[o.sorter]),u.fit(o.blocks);var l=[u.root.w,u.root.h],c=[],d=[];for(i=0,a=o.blocks.length;a>i;++i)s=o.blocks[i],s.fit?c.push(s):(s.toString=r,d.push(s));var h=l[0]*l[1],f=0;for(i=0,a=c.length;a>i;++i)s=c[i],f+=s.area;return{dimensions:l,filled:f/h,blocks:o.blocks,fitted:c,unfitted:d}}};return o});
Ink.createModule("Ink.Util.Array","1",[],function(){"use strict";var e=Array.prototype,t={inArray:function(e,t){if("object"==typeof t)for(var n=0,r=t.length;r>n;++n)if(t[n]===e)return!0;return!1},sortMulti:function(e,t){if(e===void 0||e.constructor!==Array)return!1;if("string"!=typeof t)return e.sort();if(e.length>0){if(e[0][t]===void 0)return!1;e.sort(function(e,n){var r=e[t],o=n[t];return o>r?-1:r>o?1:0})}return e},keyValue:function(e,t,n){if(e!==void 0&&"object"==typeof t&&this.inArray(e,t)){for(var r=[],o=0,i=t.length;i>o;++o)if(t[o]===e){if(n!==void 0&&n===!0)return o;r.push(o)}return r}return!1},shuffle:function(e){if(e!==void 0&&e.constructor!==Array)return!1;for(var t=e.length,n=!1,r=!1;t--;)r=Math.floor(Math.random()*(t+1)),n=e[t],e[t]=e[r],e[r]=n;return e},forEach:function(t,n,r){if(e.forEach)return e.forEach.call(t,n,r);for(var o=0,i=t.length>>>0;i>o;o++)n.call(r,t[o],o,t)},each:function(){t.forEach.apply(t,[].slice.call(arguments))},map:function(t,n,r){if(e.map)return e.map.call(t,n,r);for(var o=Array(a),i=0,a=t.length>>>0;a>i;i++)o[i]=n.call(r,t[i],i,t);return o},filter:function(t,n,r){if(e.filter)return e.filter.call(t,n,r);for(var o=[],i=null,a=0,s=t.length;s>a;a++)i=t[a],n.call(r,i,a,t)&&o.push(i);return o},some:function(e,t,n){if(null===e)throw new TypeError("First argument is invalid.");var r=Object(e),o=r.length>>>0;if("function"!=typeof t)throw new TypeError("Second argument must be a function.");for(var i=0;o>i;i++)if(i in r&&t.call(n,r[i],i,r))return!0;return!1},intersect:function(e,t){if(!e||!t||e instanceof Array==!1||t instanceof Array==!1)return[];for(var n=[],r=0,o=e.length;o>r;++r)for(var i=0,a=t.length;a>i;++i)e[r]===t[i]&&n.push(e[r]);return n},convert:function(t){return e.slice.call(t||[],0)},insert:function(e,t,n){e.splice(t,0,n)},remove:function(e,t,n){for(var r=[],o=0,i=e.length;i>o;o++)o>=t&&t+n>o||r.push(e[o]);return r}};return t});
Ink.createModule("Ink.Util.Validator","1",[],function(){"use strict";var e={_countryCodes:["AO","CV","MZ","PT"],_internacionalPT:351,_indicativosPT:{21:"lisboa",22:"porto",231:"mealhada",232:"viseu",233:"figueira da foz",234:"aveiro",235:"arganil",236:"pombal",238:"seia",239:"coimbra",241:"abrantes",242:"ponte de sôr",243:"santarém",244:"leiria",245:"portalegre",249:"torres novas",251:"valença",252:"vila nova de famalicão",253:"braga",254:"peso da régua",255:"penafiel",256:"são joão da madeira",258:"viana do castelo",259:"vila real",261:"torres vedras",262:"caldas da raínha",263:"vila franca de xira",265:"setúbal",266:"évora",268:"estremoz",269:"santiago do cacém",271:"guarda",272:"castelo branco",273:"bragança",274:"proença-a-nova",275:"covilhã",276:"chaves",277:"idanha-a-nova",278:"mirandela",279:"moncorvo",281:"tavira",282:"portimão",283:"odemira",284:"beja",285:"moura",286:"castro verde",289:"faro",291:"funchal, porto santo",292:"corvo, faial, flores, horta, pico",295:"angra do heroísmo, graciosa, são jorge, terceira",296:"ponta delgada, são miguel, santa maria",91:"rede móvel 91 (Vodafone / Yorn)",93:"rede móvel 93 (Optimus)",96:"rede móvel 96 (TMN)",92:"rede móvel 92 (TODOS)",707:"número único",760:"número único",800:"número grátis",808:"chamada local",30:"voip"},_internacionalCV:238,_indicativosCV:{2:"fixo",91:"móvel 91",95:"móvel 95",97:"móvel 97",98:"móvel 98",99:"móvel 99"},_internacionalAO:244,_indicativosAO:{2:"fixo",91:"móvel 91",92:"móvel 92"},_internacionalMZ:258,_indicativosMZ:{2:"fixo",82:"móvel 82",84:"móvel 84"},_internacionalTL:670,_indicativosTL:{3:"fixo",7:"móvel 7"},_characterGroups:{numbers:["0-9"],asciiAlpha:["a-zA-Z"],latin1Alpha:["a-zA-Z","À-ÿ"],unicodeAlpha:["a-zA-Z","À-ÿ","Ā-῿","Ⰰ-퟿"],space:[" "],dash:["-"],underscore:["_"],nicknamePunctuation:["_.-"],singleLineWhitespace:[" "],newline:["\n"],whitespace:[" \n \f\r  "],asciiPunctuation:["!-/",":-@","[-`","{-~"],latin1Punctuation:["!-/",":-@","[-`","{-~","¡-¿","×","÷"],unicodePunctuation:["!-/",":-@","[-`","{-~","¡-¿","×","÷"," -","⸀-⹿"," -〿"]},createRegExp:function(t){var n="^[";for(var r in t)if(t.hasOwnProperty(r)){if(!(r in e._characterGroups))throw Error("group "+r+" is not a valid character group");t[r]&&(n+=e._characterGroups[r].join(""))}return RegExp(n+"]*?$")},checkCharacterGroups:function(t,n){return e.createRegExp(n).test(t)},unicode:function(t,n){return e.checkCharacterGroups(t,Ink.extendObj({unicodeAlpha:!0},n))},latin1:function(t,n){return e.checkCharacterGroups(t,Ink.extendObj({latin1Alpha:!0},n))},ascii:function(t,n){return e.checkCharacterGroups(t,Ink.extendObj({asciiAlpha:!0},n))},number:function(t,n){t+="";var r=Ink.extendObj({decimalSep:".",thousandSep:"",negative:!0,decimalPlaces:null,maxDigits:null,max:null,min:null,returnNumber:!1},n||{});if(r.thousandSep)return t=t.replace(RegExp("\\"+r.thousandSep,"g"),""),r.thousandSep="",e.number(t,r);if(r.negative===!1)return r.min=0,r.negative=!0,e.number(t,r);if("."!==r.decimalSep&&(t=t.replace(RegExp("\\"+r.decimalSep,"g"),".")),!/^(-)?(\d+)?(\.\d+)?$/.test(t)||""===t)return!1;var i;if(r.decimalSep&&-1!==t.indexOf(r.decimalSep)){if(i=t.split(r.decimalSep),null!==r.decimalPlaces&&i[1].length>r.decimalPlaces)return!1}else i=[""+t,""];if(null!==r.maxDigits&&i[0].replace(/-/g,"").length>r.maxDigits)return i;var o=parseFloat(t);return null!==r.maxExcl&&o>=r.maxExcl||null!==r.minExcl&&r.minExcl>=o?!1:null!==r.max&&o>r.max||null!==r.min&&r.min>o?!1:r.returnNumber?o:!0},_isLeapYear:function(e){var t=/^\d{4}$/;return t.test(e)?e%4?!1:e%100?!0:e%400?!1:!0:!1},_dateParsers:{"yyyy-mm-dd":{day:5,month:3,year:1,sep:"-",parser:/^(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/},"yyyy/mm/dd":{day:5,month:3,year:1,sep:"/",parser:/^(\d{4})(\/)(\d{1,2})(\/)(\d{1,2})$/},"yy-mm-dd":{day:5,month:3,year:1,sep:"-",parser:/^(\d{2})(\-)(\d{1,2})(\-)(\d{1,2})$/},"yy/mm/dd":{day:5,month:3,year:1,sep:"/",parser:/^(\d{2})(\/)(\d{1,2})(\/)(\d{1,2})$/},"dd-mm-yyyy":{day:1,month:3,year:5,sep:"-",parser:/^(\d{1,2})(\-)(\d{1,2})(\-)(\d{4})$/},"dd/mm/yyyy":{day:1,month:3,year:5,sep:"/",parser:/^(\d{1,2})(\/)(\d{1,2})(\/)(\d{4})$/},"dd-mm-yy":{day:1,month:3,year:5,sep:"-",parser:/^(\d{1,2})(\-)(\d{1,2})(\-)(\d{2})$/},"dd/mm/yy":{day:1,month:3,year:5,sep:"/",parser:/^(\d{1,2})(\/)(\d{1,2})(\/)(\d{2})$/}},_daysInMonth:function(e,t){var n=0;return n=1===e||3===e||5===e||7===e||8===e||10===e||12===e?31:4===e||6===e||9===e||11===e?30:0===t%400||0===t%4&&0!==t%100?29:28},_isValidDate:function(e,t,n){var r=/^\d{4}$/,i=/^\d{1,2}$/;return r.test(e)&&i.test(t)&&i.test(n)&&t>=1&&12>=t&&n>=1&&this._daysInMonth(t,e)>=n?!0:!1},email:function(e){var t=RegExp("^[_a-z0-9-]+((\\.|\\+)[_a-z0-9-]+)*@([\\w]*-?[\\w]*\\.)+[a-z]{2,4}$","i");return t.test(e)?!0:!1},mail:function(t){return e.email(t)},url:function(e,t){if(t===void 0||t===!1){var n=RegExp("(^(http\\:\\/\\/|https\\:\\/\\/)(.+))","i");n.test(e)===!1&&(e="http://"+e)}var r=RegExp("^(http:\\/\\/|https:\\/\\/)([\\w]*(-?[\\w]*)*\\.)+[a-z]{2,4}","i");return r.test(e)===!1?!1:!0},isPTPhone:function(e){e=""+e;var t=[];for(var n in this._indicativosPT)"string"==typeof this._indicativosPT[n]&&t.push(n);var r=t.join("|"),i=/^(00351|\+351)/;i.test(e)&&(e=e.replace(i,""));var o=/(\s|\-|\.)+/g;e=e.replace(o,"");var a=/[\d]{9}/i;if(9===e.length&&a.test(e)){var s=RegExp("^("+r+")");if(s.test(e))return!0}return!1},isPortuguesePhone:function(e){return this.isPTPhone(e)},isCVPhone:function(e){e=""+e;var t=[];for(var n in this._indicativosCV)"string"==typeof this._indicativosCV[n]&&t.push(n);var r=t.join("|"),i=/^(00238|\+238)/;i.test(e)&&(e=e.replace(i,""));var o=/(\s|\-|\.)+/g;e=e.replace(o,"");var a=/[\d]{7}/i;if(7===e.length&&a.test(e)){var s=RegExp("^("+r+")");if(s.test(e))return!0}return!1},isAOPhone:function(e){e=""+e;var t=[];for(var n in this._indicativosAO)"string"==typeof this._indicativosAO[n]&&t.push(n);var r=t.join("|"),i=/^(00244|\+244)/;i.test(e)&&(e=e.replace(i,""));var o=/(\s|\-|\.)+/g;e=e.replace(o,"");var a=/[\d]{9}/i;if(9===e.length&&a.test(e)){var s=RegExp("^("+r+")");if(s.test(e))return!0}return!1},isMZPhone:function(e){e=""+e;var t=[];for(var n in this._indicativosMZ)"string"==typeof this._indicativosMZ[n]&&t.push(n);var r=t.join("|"),i=/^(00258|\+258)/;i.test(e)&&(e=e.replace(i,""));var o=/(\s|\-|\.)+/g;e=e.replace(o,"");var a=/[\d]{8,9}/i;if((9===e.length||8===e.length)&&a.test(e)){var s=RegExp("^("+r+")");if(s.test(e)){if(0===e.indexOf("2")&&8===e.length)return!0;if(0===e.indexOf("8")&&9===e.length)return!0}}return!1},isTLPhone:function(e){e=""+e;var t=[];for(var n in this._indicativosTL)"string"==typeof this._indicativosTL[n]&&t.push(n);var r=t.join("|"),i=/^(00670|\+670)/;i.test(e)&&(e=e.replace(i,""));var o=/(\s|\-|\.)+/g;e=e.replace(o,"");var a=/[\d]{7}/i;if(7===e.length&&a.test(e)){var s=RegExp("^("+r+")");if(s.test(e))return!0}return!1},isPhone:function(){var e;if(0===arguments.length)return!1;var t=arguments[0];if(arguments.length>1){if(arguments[1].constructor!==Array){if("function"==typeof this["is"+arguments[1].toUpperCase()+"Phone"])return this["is"+arguments[1].toUpperCase()+"Phone"](t);throw"Invalid Country Code!"}var n;for(e=0;arguments[1].length>e;e++){if("function"!=typeof(n=this["is"+arguments[1][e].toUpperCase()+"Phone"]))throw"Invalid Country Code!";if(n(t))return!0}}else for(e=0;this._countryCodes.length>e;e++)if(this["is"+this._countryCodes[e]+"Phone"](t))return!0;return!1},codPostal:function(e,t,n){var r=/^(\s*\-\s*|\s+)$/,i=/^\s+|\s+$/g,o=/^[1-9]\d{3}$/,a=/^\d{3}$/,s=/^(.{4})(.*)(.{3})$/;if(n=!!n,e=e.replace(i,""),t!==void 0){if(t=t.replace(i,""),o.test(e)&&a.test(t))return n===!0?[!0,!0]:!0}else{if(o.test(e))return n===!0?[!0,!1]:!0;var u=e.match(s);if(null!==u&&o.test(u[1])&&r.test(u[2])&&a.test(u[3]))return n===!0?[!0,!1]:!0}return n===!0?[!1,!1]:!1},isDate:function(e,t){if(this._dateParsers[e]===void 0)return!1;var n=this._dateParsers[e].year,r=this._dateParsers[e].month,i=this._dateParsers[e].day,o=this._dateParsers[e].parser,a=this._dateParsers[e].sep,s=t.match(o);if(null!==s&&s[2]===s[4]&&s[2]===a){var u=2===s[n].length?"20"+(""+s[n]):s[n];if(this._isValidDate(u,""+s[r],""+s[i]))return!0}return!1},isColor:function(e){var t,n=!1,r=/^[a-zA-Z]+$/,i=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,o=/^rgb\(\s*([0-9]{1,3})(%)?\s*,\s*([0-9]{1,3})(%)?\s*,\s*([0-9]{1,3})(%)?\s*\)$/,a=/^rgba\(\s*([0-9]{1,3})(%)?\s*,\s*([0-9]{1,3})(%)?\s*,\s*([0-9]{1,3})(%)?\s*,\s*(1(\.0)?|0(\.[0-9])?)\s*\)$/,s=/^hsl\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})(%)?\s*,\s*([0-9]{1,3})(%)?\s*\)$/,u=/^hsla\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})(%)?\s*,\s*([0-9]{1,3})(%)?\s*,\s*(1(\.0)?|0(\.[0-9])?)\s*\)$/;if(r.test(e)||i.test(e))return!0;var l;if(null!==(t=o.exec(e))||null!==(t=a.exec(e)))for(l=t.length;l--;){if((2===l||4===l||6===l)&&t[l]!==void 0&&""!==t[l]){if(!(t[l-1]!==void 0&&t[l-1]>=0&&100>=t[l-1]))return!1;n=!0}if(1===l||3===l||5===l&&(t[l+1]===void 0||""===t[l+1])){if(!(t[l]!==void 0&&t[l]>=0&&255>=t[l]))return!1;n=!0}}if(null!==(t=s.exec(e))||null!==(t=u.exec(e)))for(l=t.length;l--;){if(3===l||5===l){if(!(t[l-1]!==void 0&&t[l]!==void 0&&""!==t[l]&&t[l-1]>=0&&100>=t[l-1]))return!1;n=!0}if(1===l){if(!(t[l]!==void 0&&t[l]>=0&&360>=t[l]))return!1;n=!0}}return n},isIP:function(e,t){if("string"!=typeof e)return!1;switch(t=(t||"ipv4").toLowerCase()){case"ipv4":return/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e);case"ipv6":return/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/.test(e);default:return!1}},_creditCardSpecs:{"default":{length:"13,14,15,16,17,18,19",prefix:/^.+/,luhn:!0},"american express":{length:"15",prefix:/^3[47]/,luhn:!0},"diners club":{length:"14,16",prefix:/^36|55|30[0-5]/,luhn:!0},discover:{length:"16",prefix:/^6(?:5|011)/,luhn:!0},jcb:{length:"15,16",prefix:/^3|1800|2131/,luhn:!0},maestro:{length:"16,18",prefix:/^50(?:20|38)|6(?:304|759)/,luhn:!0},mastercard:{length:"16",prefix:/^5[1-5]/,luhn:!0},visa:{length:"13,16",prefix:/^4/,luhn:!0}},_luhn:function(e){if(e=parseInt(e,10),"number"!=typeof e&&0!==e%1)return!1;e+="";var t,n=e.length,r=0;for(t=n-1;t>=0;t-=2)r+=parseInt(e.substr(t,1),10);for(t=n-2;t>=0;t-=2){var i=parseInt(2*e.substr(t,1),10);r+=i>=10?i-9:i}return 0===r%10},isCreditCard:function(e,t){if(/\d+/.test(e)===!1)return!1;if(t===void 0)t="default";else if("array"==typeof t){var n,r=t.length;for(n=0;r>n;n++)if(this.isCreditCard(e,t[n]))return!0;return!1}if(t=t.toLowerCase(),this._creditCardSpecs[t]===void 0)return!1;var i=e.length+"";return-1===this._creditCardSpecs[t].length.split(",").indexOf(i)?!1:this._creditCardSpecs[t].prefix.test(e)?this._creditCardSpecs[t].luhn===!1?!0:this._luhn(e):!1}};return e});