-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsiga.min.js
More file actions
1 lines (1 loc) · 33.7 KB
/
siga.min.js
File metadata and controls
1 lines (1 loc) · 33.7 KB
1
!function(e){var n,r=[],i={};(n=function(){var e,t;for(t=0;t<r.length;t++)if(e=r[t].apply(n,arguments))return e}).VERSION="0.0.90","undefined"!=typeof window&&(n.alias=window.__Siga_alias||"S",window[n.alias]=n),n.isArray=Array.isArray||function(e){return!(!(e&&e.concat&&e.unshift)||e.callee)},n.toArray=function(e){var t,n=[];for(t=0;t<e.length;t++)n.push(e[t]);return n},n.init=function(e){r.unshift(e)},n.isNumber=function(e){return e===+e||"[object Number]"===toString.call(e)},n.bind=function(e,t){var n=Array.prototype.slice,r=n.apply(arguments,[2]);return function(){return e.apply(t||{},r.concat(n.apply(arguments)))}};var t={},o={};n.addDetectionTest=function(e,t){o[e]||(o[e]=t)},n.detect=function(e){return void 0===t[t]&&(t[e]=o[e]()),t[e]},n.define=function(e,t,n){if("function"==typeof define&&define.amd)define(e,t,n);else{if(t&&t.length)for(var r=0;r<t.length;r++)t[r]=i[t[r]];i[e]=n.apply(this,t||[])}},e.Siga=n,"undefined"!=typeof exports&&(exports.Siga=n),n.define("Siga.core",[],function(){return n}),"undefined"==typeof define&&(e.define=n.define)}("undefined"==typeof window?this:window),define("Siga.oo",["Siga.core"],function(e){var t,r;return t=function(){return r.create.apply(this,arguments)},r={create:function(){var e=null,t=void 0,n=function(){this.$super=function(e,t){return r.$super(this.$parent,this,e,t)},this.initialize.apply(this,arguments)};return"function"==typeof arguments[0]?(t=arguments[0],e=arguments[1]):e=arguments[0],void 0!==t&&(r.extend(n.prototype,t.prototype),n.prototype.$parent=t.prototype),r.mixin(n,e),r.extend(n.prototype,e),(n.prototype.constructor=n).prototype.initialize||(n.prototype.initialize=function(){}),n},mixin:function(e,t){if(void 0!==t.include)if("function"==typeof t.include)r.extend(e.prototype,t.include.prototype);else for(var n=0;n<t.include.length;n++)r.extend(e.prototype,t.include[n].prototype)},extend:function(e,t){for(var n in t)e[n]=t[n];return e},$super:function(e,t,n,r){return e[n].apply(t,r)}},e.Class=t,e.oo=r}),define("Siga.enumerable",["Siga.core"],function(e){function t(s){s.enumerable={Break:{},each:function(e,t,n){try{if(Array.prototype.forEach&&e.forEach===Array.prototype.forEach)e.forEach(t,n);else if(s.isNumber(e.length))for(var r=0,i=e.length;r<i;r++)t.call(e,e[r],r,e);else for(var o in e)hasOwnProperty.call(e,o)&&t.call(n,e[o],o,e)}catch(e){if(e!=s.enumerable.Break)throw e}return e},map:function(e,r,i){if(Array.prototype.map&&e.map===Array.prototype.map)return e.map(r,i);var o=[];return s.enumerable.each(e,function(e,t,n){o.push(r.call(i,e,t,n))}),o},filter:function(e,r,i){if(Array.prototype.filter&&e.filter===Array.prototype.filter)return e.filter(r,i);var o=[],a=!s.isArray(e);return s.enumerable.each(e,function(e,t,n){r.call(i,e,t,n)&&(a?o.push([t,e]):o.push(e))}),o},reject:function(e,t,n){return this.filter(e,function(){return!t.apply(n,arguments)},n)},detect:function(e,r,i){var o;return s.enumerable.each(e,function(e,t,n){if(r.call(i,e,t,n))throw o=e,s.enumerable.Break}),o},reduce:function(e,r,i,o){return Array.prototype.reduce&&e.reduce===Array.prototype.reduce?e.reduce(s.bind(i,o),r):(s.enumerable.each(e,function(e,t,n){r=i.call(o,r,e,t,n)}),r)},flatten:function(e){return s.enumerable.reduce(e,[],function(e,t){return s.isArray(t)?e.concat(s.enumerable.flatten(t)):(e.push(t),e)})},tail:function(e,t){return t=void 0===t?1:t,Array.prototype.slice.apply(e,[t])},invoke:function(e,t){var n=s.enumerable.tail(arguments,2);return s.enumerable.map(e,function(e){return(t?e[t]:e).apply(e,n)})},pluck:function(e,t){return s.enumerable.map(e,function(e){return e[t]})},some:function(e,r,i){if(r=r||s.enumerable.identity,Array.prototype.some&&e.some===Array.prototype.some)return e.some(r,i);var o=!1;return s.enumerable.each(e,function(e,t,n){if(o=r.call(i,e,t,n))throw s.enumerable.Break}),o},all:function(e,r,i){if(r=r||s.enumerable.identity,Array.prototype.every&&e.every===Array.prototype.every)return e.every(r,i);var o=!0;return s.enumerable.each(e,function(e,t,n){if(!(o=o&&r.call(i,e,t,n)))throw s.enumerable.Break}),o},include:function(e,n){if(Array.prototype.indexOf&&e.indexOf===Array.prototype.indexOf)return-1!=e.indexOf(n);var r=!1;return s.enumerable.each(e,function(e,t){if(r=e===n)throw s.enumerable.Break}),r},chain:function(e){return new s.enumerable.Chainer(e)},identity:function(e){return e}},s.enumerable.select=s.enumerable.filter,s.enumerable.collect=s.enumerable.map,s.enumerable.inject=s.enumerable.reduce,s.enumerable.rest=s.enumerable.tail,s.enumerable.any=s.enumerable.some,s.enumerable.every=s.enumerable.all,s.chainableMethods=["map","collect","detect","filter","reduce","each","tail","rest","reject","pluck","any","some","all"],s.enumerable.Chainer=function(e){this.results=e},s.enumerable.Chainer.prototype.values=function(){return this.results},s.enumerable.each(s.chainableMethods,function(e){var t=s.enumerable[e];s.enumerable.Chainer.prototype[e]=function(){var e=Array.prototype.slice.call(arguments);return e.unshift(this.results),this.results=t.apply(this,e),this}}),s.init(function(e){if(e.hasOwnProperty.length&&"string"!=typeof e)return s.enumerable.chain(e)})}"undefined"!=typeof module?module.exports=function(e){return t(e)}:t(e)}),define("Siga.promise",["Siga.core"],function(r){function t(e){function t(){var t=this;this.pending=[],this.resolve=function(e){t.complete("resolve",e)},this.reject=function(e){t.complete("reject",e)}}t.prototype={then:function(e,t){return this.pending.push({resolve:e,reject:t}),this},complete:function(e,t){for(;this.pending[0];)this.pending.shift()[e](t)}};var n={};r.init(function(){if(0===arguments.length)return n}),n.delay=function(e){var t=new r.Promise;return setTimeout(t.resolve,e),t},e.Promise=t}return"undefined"!=typeof module?module.exports=function(e){return t(e)}:t(r),r.Promise}),define("Siga.functional",["Siga.core"],function(e){return e.functional={curry:e.bind,memoize:function(n,r){var i=function(e){var t=n[e];return"number"!=typeof t&&(t=r(i,e),n[e]=t),t};return i}},e}),define("Siga.dom",["Siga.core"],function(o){var t,n,a,r,i,s,u,c,l,f,d,h,p,m,v={},y=Error;function g(e,t){this.root=e,this.key_selector=t.pop(),this.tokens=t,this.results=[]}function b(e,t){this.identity=e,this.finder=t}function w(e){this.selector=e.replace(/^\s+|\s+$/g,"").replace(/[ \t\r\n\f]+/g," "),this.tokens=[],this.tokenize()}function E(e){if("string"==typeof e)return e.replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()})}function T(e,t,n){var r;(r=e)&&r.nodeType!==c.TEXT_NODE&&r.nodeType!==c.COMMENT_NODE&&r.style&&("number"!=typeof n||d[t]||(n+="px"),e.style[t]=n)}function N(e,t,n){var r,i,o=document,a="TABLE"===e.nodeName;(i=o.createElement("div")).innerHTML="<"+e.nodeName+">"+t+"</"+e.nodeName+">",r=a?i.lastChild.lastChild:i.lastChild,n(a?e.lastChild:e,r),i=null}function C(e){var t,n,r="";for(n=0;e[n];n++)(t=e[n]).nodeType===c.TEXT_NODE||t.nodeType===c.CDATA_SECTION_NODE?r+=t.nodeValue:t.nodeType!==c.COMMENT_NODE&&(r+=C(t.childNodes));return r}function O(e,t,n){return h[t]&&(t=h[t]),"value"===t&&"BUTTON"===e.nodeName?e.getAttributeNode(t).nodeValue=n:e.setAttribute(t,n)}return t={nl:"\n|\r\n|\r|\f",w:"[s\r\n\f]*",nonascii:"[^\0-]",num:"-?([0-9]+|[0-9]*.[0-9]+)",unicode:"\\[0-9A-Fa-f]{1,6}(\r\n|[s\n\r\t\f])?",escape:"#{unicode}|\\[^\n\r\f0-9A-Fa-f]",nmchar:"[_A-Za-z0-9-]|#{nonascii}|#{escape}",nmstart:"[_A-Za-z]|#{nonascii}|#{escape}",ident:"[-@]?(#{nmstart})(#{nmchar})*",name:"(#{nmchar})+",string1:'"([^\n\r\f"]|#{nl}|#{nonascii}|#{escape})*"',string2:"'([^\n\r\f']|#{nl}|#{nonascii}|#{escape})*'",string:"#{string1}|#{string2}"},c={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12},d={zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},m={selected:!0,readonly:!0,checked:!0},n={"name and id":"(#{ident}##{ident})",id:"(##{ident})",class:"(\\.#{ident})","name and class":"(#{ident}\\.#{ident})",element:"(#{ident})","pseudo class":"(:#{ident})"},h={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},p={width:!0,height:!0,src:!0,href:!0},o.addDetectionTest("classList",function(){var e=document.createElement("div");return!!e.classList||(e=null,!1)}),u=function(){function o(e,t){for(var n,r=!0;r;)(n=e.match(/#\{([^}]+)\}/))&&n[1]?(e=e.replace(new RegExp("#{"+n[1]+"}","g"),t[n[1]]),r=!0):r=!1;return e}function e(){var e,t,n,r,i={};for(e in 2===arguments.length?(r=arguments[0],n=arguments[1]):(r=arguments[0],n=arguments[0]),n)t=o(n[e],r).replace(/\//g,"//"),i[e]=t;return i}return function(e){var t,n=[];for(t in e)n.push(e[t]);return new RegExp(n.join("|"),"g")}(e(e(t),n))}(),a={byId:function(e,t){return null===e?[]:[e.getElementById(t)]},byNodeName:function(e,t){if(null===e)return[];var n,r=[],i=e.getElementsByTagName(t);for(n=0;n<i.length;n++)r.push(i[n]);return r},byClassName:function(e,t){if(null===e)return[];var n,r=[],i=e.getElementsByTagName("*");for(n=0;n<i.length;n++)i[n].className.match("\\b"+t+"\\b")&&r.push(i[n]);return r}},i={id:function(e,t){return t=t.split("#")[1],a.byId(e,t)},"name and id":function(e,t){var n,r,i=t.split("#");return n=i[0],r=i[1],s.byAttr(a.byId(e,r),"nodeName",n.toUpperCase())},name:function(e,t){return a.byNodeName(e,t)},class:function(e,t){return t=t.split(".")[1],a.byClassName(e,t)},"name and class":function(e,t){var n,r,i=t.split(".");return n=i[0],r=i[1],s.byAttr(a.byClassName(e,r),"nodeName",n.toUpperCase())}},"undefined"!=typeof document&&void 0!==document.getElementsByClassName&&(a.byClassName=function(e,t){return e.getElementsByClassName(t)}),s={byAttr:function(e,t,n){var r,i=[];for(r in e)e[r]&&e[r][t]===n&&i.push(e[r]);return i}},r={id:function(e,t){return t=t.split("#")[1],e&&e.id===t},name:function(e,t){return e.nodeName===t.toUpperCase()},"name and id":function(e,t){return r.id(e,t)&&r.name(e,t.split("#")[0])},class:function(e,t){if(e&&e.className)return t=t.split(".")[1],e.className.match("\\b"+t+"\\b")},"name and class":function(e,t){return r.class(e,t)&&r.name(e,t.split(".")[0])}},g.prototype.matchesToken=function(e,t){if(!r[t.finder])throw new y("Invalid matcher: "+t.finder);return r[t.finder](e,t.identity)},g.prototype.find=function(e){if(!i[e.finder])throw new y("Invalid finder: "+e.finder);return i[e.finder](this.root,e.identity)},g.prototype.matchesAllRules=function(e){if(0!==this.tokens.length){for(var t=this.tokens.length-1,n=this.tokens[t],r=!1;0<=t&&e;)this.matchesToken(e,n)&&(r=!0,t--,n=this.tokens[t]),e=e.parentNode;return r&&t<0}},g.prototype.parse=function(){var e,t,n=this.find(this.key_selector),r=[];for(e=0;e<n.length;e++)t=n[e],0<this.tokens.length?this.matchesAllRules(t.parentNode)&&r.push(t):this.matchesToken(t,this.key_selector)&&r.push(t);return r},g.prototype.values=function(){return this.results},b.prototype.toString=function(){return"identity: "+this.identity+", finder: "+this.finder},w.prototype.tokenize=function(){var e,t,n;for((t=u).lastIndex=0;e=t.exec(this.selector);)n=null,e[10]?n="id":e[1]?n="name and id":e[29]?n="name":e[15]?n="class":e[20]&&(n="name and class"),this.tokens.push(new b(e[0],n));return this.tokens},w.prototype.finders=function(){var e,t=[];for(e in this.tokens)t.push(this.tokens[e].finder);return t},v.tokenize=function(e){return new w(e)},o.addDetectionTest("querySelectorAll",function(){var e=document.createElement("div");return e.innerHTML='<p class="TEST"></p>',e.querySelectorAll?0!==e.querySelectorAll(".TEST").length:(e=null,!1)}),"undefined"!=typeof document&&(document.documentElement.currentStyle?(l=function(e,t){return e.currentStyle[E(t)]},f=function(e,t,n){return T(e,E(t),n)}):document.defaultView.getComputedStyle&&(l=function(e,t){return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(function(e){if("string"==typeof e)return e.replace(/([A-Z])/g,"-$1").toLowerCase()}(t))},f=function(e,t,n){return T(e,t,n)})),v.css=function(e,t){if("string"==typeof t)return l(e,t);for(var n in t)t.hasOwnProperty(n)&&f(e,n,t[n])},v.get=function(e){var t,n=void 0===arguments[1]?document:arguments[1];return o.toArray(o.detect("querySelectorAll")?n.querySelectorAll(e):(t=e,new g(n,v.tokenize(t).tokens).parse()))},v.findElement=function(e,t,n){var r=v.tokenize(t).tokens,i=new g(n,[]);for(i.tokens=r;e;){if(i.matchesAllRules(e))return e;e=e.parentNode}},v.replace=function(n,e){N(n,e,function(e,t){n.replaceChild(t,e)})},v.append=function(e,t){N(e,t,function(e,t){e.appendChild(t.firstChild)})},v.html=function(t,n){if(1===arguments.length)return t.innerHTML;try{t.innerHTML=n}catch(e){v.replace(t,n)}},v.text=function(e,t){if(1===arguments.length)return C(e);v.empty(e),e.appendChild(document.createTextNode(t))},v.empty=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},o.detect("classList")?v.hasClass=function(e,t){return e.classList.contains(t)}:v.hasClass=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},v.addClass=function(e,t){if(t&&"string"==typeof t&&e.nodeType===c.ELEMENT_NODE)return e.classList?e.classList.add(t):void(e.className&&e.className.length?e.className.match("\\b"+t+"\\b")||(e.className+=" "+t):e.className=t)},v.removeClass=function(e,t){if(t&&"string"==typeof t&&e.nodeType===c.ELEMENT_NODE)return e.classList?e.classList.remove(t):void(e.className&&(e.className=e.className.replace(new RegExp("\\s?\\b"+t+"\\b"),"").replace(/^\s+/,"")))},o.addDetectionTest("getAttribute",function(){var e=document.createElement("div");return e.innerHTML='<a href="/example"></a>',"/example"===e.childNodes[0].getAttribute("href")||(e=null,!1)}),v.removeAttr=function(e,t){var n,r;o.detect("getAttribute")?e.removeAttribute(t):(r=t,(n=e).nodeType===c.ELEMENT_NODE&&(h[r]&&(r=h[r]),O(n,r,""),n.removeAttributeNode(n.getAttributeNode(r))))},v.attr=function(e,t,n){return void 0===n?o.detect("getAttribute")?e.getAttribute(t):(r=e,h[i=t]&&(i=h[i]),p[i]?r.getAttribute(i,2):"value"===i&&"BUTTON"===r.nodeName?r.getAttributeNode(i).nodeValue:m[i]?r[i]?i:void 0:r.getAttribute(i)):null===n?v.removeAttr(e,t):o.detect("getAttribute")?e.setAttribute(t,n):O(e,t,n);var r,i},v.prop=function(e,t,n){return h[t]&&(t=h[t]),void 0===n?e[t]:null===n?v.removeProperty(e,t):e[t]=n},v.removeProp=function(e,t){h[t]&&(t=h[t]);try{e[t]=void 0,delete e[t]}catch(e){}},o.init(function(e){if("string"==typeof e||void 0===e)return o.domChain.init(e)}),o.domChain={init:function(e){return this.selector=e,this.length=0,this.prevObject=null,this.elements=[],e?this.find(e):this},writeElements:function(){for(var e=0;e<this.elements.length;e++)this[e]=this.elements[e]},first:function(){var e=o.domChain;return e.elements=0===this.elements.length?[]:[this.elements[0]],e.selector=this.selector,e.length=e.elements.length,e.prevObject=this,e.writeElements(),e},html:function(e){if(0===arguments.length)return 0===this.elements.length?null:v.html(this[0]);for(var t=0;t<this.elements.length;t++)v.html(this[t],e);return this},text:function(e){if(0===arguments.length)return 0===this.elements.length?null:C(this.elements);for(var t=0;t<this.elements.length;t++)v.text(this.elements[t],e);return this},css:function(e){if("string"==typeof e)return 0<this.elements.length?l(this.elements[0],e):null;for(var t=0;t<this.elements.length;t++)v.css(this[t],e);return this},addClass:function(e){for(var t=0;t<this.elements.length;t++)v.addClass(this[t],e);return this},hasClass:function(e){for(var t=0;t<this.length;t++)if(v.hasClass(this[t],e))return!0;return!1},removeClass:function(e){for(var t=0;t<this.elements.length;t++)v.removeClass(this[t],e);return this},attr:function(e,t){if(0<this.elements.length)return v.attr(this[0],e,t)},removeAttr:function(e){return 0<this.elements.length&&v.removeAttr(this[0],e),this},prop:function(e,t){if(0<this.elements.length)return v.prop(this[0],e,t)},removeProp:function(e){if(0<this.elements.length)return v.removeProp(this[0],e,value)},append:function(e){for(var t=0;t<this.elements.length;t++)v.append(this[t],e);return this},find:function(e){var t,n=o.domChain,r=document;return this.prevObject&&(r=0<this.prevObject.elements.length?this.prevObject.elements[0]:null),t=v.get(e,r),this.elements=t,n.elements=t,n.selector=e,n.length=t.length,n.prevObject=this,n.writeElements(),n}},o.domChain.init.prototype=o.domChain,void 0!==o.enumerable&&(o.domChain.values=function(){return this.elements},o.enumerable.each(o.chainableMethods,function(r){o.domChain[r]=function(e){var t=o.enumerable[r](this,e),n=o.domChain;return this.elements=t,n.elements=t,n.selector=this.selector,n.length=t.length,n.prevObject=this,n.writeElements(),n}})),v.nodeTypes=c,o.dom=v}),define("Siga.dom",["Siga.core"],function(n){var r={registered:{}};return r.AlreadyRegistered=Error,r.NotFound=Error,r.register=function(e,t){if(r.registered[e])throw new r.AlreadyRegistered("Already registered a plugin called: "+e);r.registered[e]=t,n.domChain[e]=t[e]},r.remove=function(e){if(!r.registered.hasOwnProperty(e))throw new r.NotFound("Plugin not found: "+e);delete r.registered[e],delete n.domChain[e]},n.plugins=r}),define("Siga.events",["Siga.core","Siga.dom"],function(i){var t,e,o={},a=[],n=!1,r=!1,s=[];function u(e){return 3!==e.nodeType&&8!==e.nodeType}function c(t,e){if(!t)t=window.event;if(t.stop=function(){var e;(e=t).preventDefault(e),e.stopPropagation(e)},void 0===t.target&&(t.target=t.srcElement||e),t.preventDefault||(t.preventDefault=function(){t.returnValue=!1}),t.stopPropagation||(t.stopPropagation=function(){t.cancelBubble=!0}),t.target&&3===t.target.nodeType&&(t.target=t.target.parentNode),null==t.pageX&&null!=t.clientX){var n=document.documentElement,r=document.body;t.pageX=t.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),t.pageY=t.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)}return t}function l(){if(!r){if(!document.body)return setTimeout(l,13);for(var e in r=!0,s)s[e]();s=null}}function f(){if(!r){try{document.documentElement.doScroll("left")}catch(e){return void setTimeout(f,1)}l()}}function d(e){return e.match(/:/)?e:"on"+e}"undefined"!=typeof document&&(document.addEventListener?t=function(){document.removeEventListener("DOMContentLoaded",t,!1),l()}:document.attachEvent&&(t=function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",t),l())})),o.add=function(e,t,n){if(u(e)){var r,i,o=(r=e,i=n,function(e){return c(e,r),i(e)});a.push({element:e,type:t,handler:n,responder:o}),t.match(/:/)&&e.attachEvent?e.attachEvent("ondataavailable",o):e.addEventListener?e.addEventListener(t,o,!1):e.attachEvent&&e.attachEvent(d(t),o)}},o.remove=function(e,t,n){if(u(e)){var r=function(e,t,n){var r,i=0,o=0;for(o=0;o<a.length;o++)a[o].element!==e&&a[o].type!==t&&a[o].handler!==n?a[i++]=a[o]:r=a[o].responder;return a.length=i,r}(e,t,n);document.removeEventListener?e.removeEventListener(t,r,!1):e.detachEvent(d(t),r)}},o.fire=function(e,t){var n;return document.createEventObject?(c(n=document.createEventObject(),e),t.match(/:/)?(n.eventName=t,n.eventType="ondataavailable",e.fireEvent(n.eventType,n)):e.fireEvent(d(t),n)):(c(n=document.createEvent("HTMLEvents"),e),n.eventName=t,n.initEvent(t,!0,!0),!e.dispatchEvent(n))},o.ready=function(e){!function(){if(!n)if(n=!0,"complete"===document.readyState)l();else if(document.addEventListener)document.addEventListener("DOMContentLoaded",t,!1),window.addEventListener("load",l,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",t),window.attachEvent("onload",l);var e=!1;try{e=null==window.frameElement}catch(e){}document.documentElement.doScroll&&e&&f()}}(),s.push(e)},"undefined"!==i.dom&&(o.delegate=function(e,t,n,r){return o.add(e,n,function(e){i.dom.findElement(e.target,t,e.currentTarget)&&r(e)})}),o.addDOMethods=function(){if(void 0!==i.domChain){i.domChain.bind=function(e,t){for(var n,r=0;r<this.length;r++)n=this[r],t?i.events.add(n,e,t):i.events.fire(n,e);return this};for(var e="click dblclick mouseover mouseout mousemove mousedowe mouseup blur focus change keydown keypress keyup resize scroll".split(" "),t=0;t<e.length;t++)!function(t){i.domChain[t]=function(e){return this.bind(t,e)}}(e[t])}},o.addDOMethods(),((e=function(){this.events={}}).prototype={addListener:function(e,t){e in this.events==!1&&(this.events[e]=[]),this.events[e].push(t)},emit:function(e){var t=!1;if(e in this.events==!1)return t;for(var n=this.events[e].slice(),r=0;r<n.length;r++)n[r].apply(this,Array.prototype.slice.call(arguments,1)),t=!0;return t},removeAllListeners:function(e){return e in this.events!=!1&&(delete this.events[e],!0)},removeListenerAt:function(e,t){this.events[e].splice(t,1)},removeListener:function(e,t){if(e in this.events==!1)return!1;for(var n=0;n<this.events[e].length;n++)if(this.events[e][n]==t)return this.removeListenerAt(e,n),!0;return!1}}).on=e.prototype.addListener,o.Emitter=e,i.ready=o.ready,i.events=o,i.init(function(e){1===arguments.length&&"function"==typeof e&&i.events.ready(e)}),"undefined"!=typeof window&&window.attachEvent&&!window.addEventListener&&window.attachEvent("onunload",function(){for(var e=0;e<a.length;e++)try{o.remove(a[e].element,a[e].type),a[e]=null}catch(e){}})}),define("Siga.net",["Siga.core","Siga.dom"],function(t){var u={},n="".trim?function(e){return e.trim()}:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};function r(e,r){var i,n,o=function(){if(!("undefined"==typeof XMLHttpRequest||"file:"===window.location.protocol&&window.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1}(),a={};function s(){try{o.send(r.postBody)}catch(e){r.error&&r.error()}}return t.Promise&&(i=new t.Promise),void 0===r&&(r={}),r.method=r.method?r.method.toLowerCase():"get",r.asynchronous=r.asynchronous||!0,r.postBody=r.postBody||"",o.onreadystatechange=function(e){if(4==o.readyState){var t=o.mimeType||o.getResponseHeader("content-type")||"";if(a.status=o.status,a.responseText=o.responseText,/json/.test(t)?a.responseJSON=u.parseJSON(o.responseText):/xml/.test(t)&&(a.responseXML=u.parseXML(o.responseText)),a.success=200<=(n=o).status&&n.status<300||304==n.status||0==n.status&&n.responseText,r.callback)return r.callback(a,o);a.success?(r.success&&r.success(a,o),i&&i.resolve(a,o)):(r.error&&r.error(a,o),i&&i.reject(a,o))}var n},o.open(r.method,e,r.asynchronous),r.headers=r.headers||{},r.contentType&&(r.headers["Content-Type"]=r.contentType),"string"!=typeof r.postBody&&(r.postBody=u.serialize(r.postBody)),function(){var e={Accept:"text/javascript, application/json, text/html, application/xml, text/xml, */*","Content-Type":"application/x-www-form-urlencoded"};for(var t in e)r.headers.hasOwnProperty(t)||(r.headers[t]=e[t]);for(var t in r.headers)o.setRequestHeader(t,r.headers[t])}(),n={set:function(e,t){return r.headers[e]=t,n},send:function(e,t){return r.postBody=u.serialize(e),r.callback=t,s(),n},end:function(e){return r.callback=e,s(),n},data:function(e){return r.postBody=u.serialize(e),n},then:function(){return n.end(),i&&i.then.apply(i,arguments),n}}}function i(e,t,n){var r=this;this.url=e,this.methodName="__Siga_jsonp_"+parseInt((new Date).getTime()),this.success=t,this.failure=n,window[this.methodName]=function(e){r.success(e),r.teardown()}}u.serialize=function(e){if(e){if("string"==typeof e)return e;var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}},t.addDetectionTest("JSON.parse",function(){return window.JSON&&window.JSON.parse}),u.parseJSON=function(e){return"string"==typeof e&&e?(e=n(e),t.detect("JSON.parse")?window.JSON.parse(e):new Function("return "+e)()):null},window.DOMParser?u.parseXML=function(e){return(new DOMParser).parseFromString(e,"text/xml")}:u.parseXML=function(e){var t=new ActiveXObject("Microsoft.XMLDOM");return t.async="false",t.loadXML(e),t},i.prototype.run=function(){this.scriptTag=document.createElement("script"),this.scriptTag.id=this.methodName,this.scriptTag.src=this.url.replace("{callback}",this.methodName),document.body.appendChild(this.scriptTag)},i.prototype.teardown=function(){window[this.methodName]=null,delete window[this.methodName],this.scriptTag&&document.body.removeChild(this.scriptTag)},u.get=function(e,t){return void 0===t&&(t={}),t.method="get",r(e,t)},u.post=function(e,t){return void 0===t&&(t={}),t.method="post",r(e,t)},u.jsonp=function(e,t){void 0===t&&(t={}),new i(e,t.success,t.failure).run()},t.get=u.get,t.post=u.post,t.jsonp=u.jsonp,u.ajax=r,t.net=u}),define("Siga.dom",["Siga.core","Siga.dom","Siga.events"],function(r,e,t){var n={},i={};function o(e){i.touches=e.touches,i.startTime=(new Date).getTime(),i.x=e.changedTouches[0].clientX,i.y=e.changedTouches[0].clientY,i.startX=i.x,i.startY=i.y,i.target=e.target,i.duration=0}function a(e){var t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;i.x===t&&i.y===n&&1==i.touches.length&&r.events.fire(e.target,"tap")}function s(e){var t,n=e.changedTouches[0];i.duration=(new Date).getTime()-i.startTime,i.x=i.startX-n.pageX,i.y=i.startY-n.pageY,t=Math.sqrt(Math.pow(Math.abs(i.x),2)+Math.pow(Math.abs(i.y),2)),i.duration<1e3&&t>r.touch.swipeThreshold&&r.events.fire(e.target,"swipe")}return n.swipeThreshold=50,n.orientation=function(){var e=window.orientation,t="";switch(e){case 0:t+="portrait";break;case-90:t+="landscape right";break;case 90:t+="landscape left";break;case 180:t+="portrait upside-down"}return[e,t]},n.register=function(){r.events.add(document,"touchstart",o),r.events.add(document,"touchmove",s),r.events.add(document,"touchend",a),r.touch.swipeThreshold=screen.width/5},r.touch=n,r.touch}),define("Siga.anim",["Siga.core","Siga.dom"],function(i,e){var n,h,t,o={},p={},r={};function a(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})}function s(e){this.r=0,this.g=0,this.b=0,this.value=this.normalise(e),this.parse()}function u(e,t,n){return n(t)*e.value}function c(e,t,n){var r=[];return r[0]=Math.round(e.base.r+e.direction[0]*(Math.abs(e.base.r-e.value.r)*n(t))),r[1]=Math.round(e.base.g+e.direction[1]*(Math.abs(e.base.g-e.value.g)*n(t))),r[2]=Math.round(e.base.b+e.direction[2]*(Math.abs(e.base.b-e.value.b)*n(t))),"rgb("+r.join(", ")+")"}function m(e,t,n){if("string"==typeof(a=e)&&a.match(/(#[a-f|A-F|0-9]|rgb)/)){var r={value:new s(e),units:"",transform:c};return r.base=new s(t.style[n]),r.direction=[r.base.r<r.value.r?1:-1,r.base.g<r.value.g?1:-1,r.base.b<r.value.b?1:-1],r}return"object"!=typeof e?{value:o="string"==typeof(i=e)?parseFloat(i):i,units:"string"==typeof i?i.replace(o,""):"",transform:u}:e;var i,o,a}function l(e){var t=o[e];n.prototype[e]=function(){var e=Array.prototype.slice.call(arguments);return e.unshift(this.element),this.position+=e[1]||0,setTimeout(function(){t.apply(null,e)},this.position),this}}for(t in s.matchers=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],s.prototype.normalise=function(e){return e.replace(/ /g,""),"#"===e.charAt(0)&&(e=e.substr(1,6)),e},s.prototype.parse=function(){var e,t=[];for(e=0;e<s.matchers.length;e++)if(t=this.value.match(s.matchers[e].re)){t=s.matchers[e].process(t),this.r=t[0],this.g=t[1],this.b=t[2];break}this.validate()},s.prototype.validate=function(){this.r=this.r<0||isNaN(this.r)?0:255<this.r?255:this.r,this.g=this.g<0||isNaN(this.g)?0:255<this.g?255:this.g,this.b=this.b<0||isNaN(this.b)?0:255<this.b?255:this.b},s.prototype.sum=function(){return this.r+this.g+this.b},s.prototype.toString=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},p.linear=function(e){return e},p.sine=function(e){return-Math.cos(e*Math.PI)/2+.5},p.reverse=function(e){return 1-e},p.spring=function(e){return 1-Math.cos(e*Math.PI*4)*Math.exp(6*-e)},p.bounce=function(e){return e<1/2.75?7.6*e*e:e<2/2.75?7.6*(e-=1.5/2.75)*e+.74:e<2.5/2.75?7.6*(e-=2.25/2.75)*e+.91:7.6*(e-=2.625/2.75)*e+.98},o.animate=function(a,s,u,e){var c,t,l=(new Date).valueOf(),f=l+s,d=p.linear;for(t in h||(h=void 0!==document.body.style.opacity?"opacity":"filter"),(e=e||{}).hasOwnProperty("easing")&&("string"==typeof e.easing?d=p[e.easing]:e.easing&&(d=e.easing)),u)if(u.hasOwnProperty(t))if(u[t]=m(u[t],a,t),"opacity"===t&&"filter"===h)a.style.zoom=1;else if(r.vendorPrefix&&("left"===t||"top"===t))return r.start(a,s,t,u[t].value+u[t].units,e.easing),setTimeout(function(){r.end(a,t)},s);c=setInterval(function(){var e,t,n,r,i=(new Date).valueOf(),o=f<i?1:(i-l)/s;for(e in u)u.hasOwnProperty(e)&&(t=a,r=u[n=e].transform(u[e],o,d)+u[e].units,"opacity"===n&&"filter"===h?t.style[h]="alpha(opacity="+Math.round(100*r)+")":t.style[n]=r);f<i&&clearInterval(c)},10)},(r={vendors:{opera:{prefix:"-o-",detector:function(){try{return document.createEvent("OTransitionEvent"),!0}catch(e){return!1}}},webkit:{prefix:"-webkit-",detector:function(){try{return document.createEvent("WebKitTransitionEvent"),!0}catch(e){return!1}}},firefox:{prefix:"-moz-",detector:function(){var e=document.createElement("div"),t=!1;return void 0!==e.style.MozTransition&&(t=!0),e=null,t}}},findCSS3VendorPrefix:function(){var e;for(e in r.vendors)if(this.vendors.hasOwnProperty(e)&&(e=this.vendors[e]).detector())return e.prefix},vendorPrefix:null,start:function(e,t,n,r,i){e.style[a(this.vendorPrefix+"transition")]=n+" "+t+"ms "+(i||"linear"),e.style[n]=r},end:function(e,t){e.style[a(this.vendorPrefix+"transition")]=null}}).vendorPrefix=r.findCSS3VendorPrefix(),o.fade=function(e,t,n){return e.style.opacity=n.from,o.animate(e,t,{opacity:n.to},{easing:n.easing})},o.fadeIn=function(e,t,n){return(n=n||{}).from=n.from||0,n.to=n.to||1,o.fade(e,t,n)},o.fadeOut=function(e,t,n){var r;return(n=n||{}).from=n.from||1,n.to=n.to||0,r=n.from,n.from=n.to,n.to=r,n.easing=function(e){return 1-e+n.from},o.fade(e,t,n)},o.highlight=function(e,t,n){var r=e.currentStyle?e.currentStyle:getComputedStyle(e,null);return(n=n||{}).from=n.from||"#ff9",n.to=n.to||r.backgroundColor,n.easing=n.easing||p.sine,t=t||500,e.style.backgroundColor=n.from,setTimeout(function(){o.animate(e,t,{backgroundColor:n.to,easing:n.easing})},200)},o.move=function(e,t,n){return o.animate(e,t,{left:n.x,top:n.y},{easing:n.easing||p.sine})},o.parseColour=function(e){return new s(e)},o.pause=function(e,t,n){},o.easing=p,n=function(e){this.element=e,this.position=0},o)o.hasOwnProperty(t)&&l(t);return o.chain=function(e){return new n(e)},o.addDOMethods=function(){if(void 0!==i.domChain){var e,t="animate fade fadeIn fadeOut highlight move parseColour pause easing".split(" ");for(e=0;e<t.length;e++)n(t[e])}function n(r){i.domChain[r]=function(e){var t,n=i.toArray(arguments);for(n.unshift(null),t=0;t<this.length;t++)n[0]=this[t],o[r].apply(this,n);return this}}},o.addDOMethods(),i.anim=o}),define("Siga.require",["Siga.core"],function(o){var i=document.head||document.getElementsByTagName("head"),r=["async","defer","src","text"];function a(e){return"/"===e.charAt(0)||-1!==e.indexOf(location.protocol+"//"+location.host)||!1}function s(e){var t,n=document.createElement("script");for(t in r)e[t=r[t]]&&(n[t]=e[t]);return n}function u(e){i.insertBefore(e,i.firstChild)}function c(e,t,n){t.src=e;var r=s(t);r.onload=r.onreadystatechange=function(){r.readyState&&"complete"!==r.readyState&&"loaded"!==r.readyState||(r.onload=r.onreadystatechange=null,n(),i.removeChild(r))},u(r)}function l(e,t,n){if(!a(e))throw"Scripts loaded with XMLHttpRequest must be from the same origin";if(!o.get)throw"Loading scripts with XMLHttpRequest requires Siga.net to be loaded";o.get(e).end(function(e){t.text=e.responseText,n(t)})}function f(e){this.sources=e,this.events=new o.events.Emitter,this.queue=[],this.currentGroup=0,this.groups={},this.groupKeys=[],this.parseQueue(this.sources,!1,0),this.installEventHandlers(),this.pointer=0,this.preloadCount=0;var t=this;d(function(){t.runQueue()})}function d(e){setTimeout(function(){if("item"in i){if(!i[0])return setTimeout(arguments.callee,25);i=i[0]}e()})}return f.prototype={on:function(){return this.events.on.apply(this.events,arguments),this},emit:function(){return this.events.emit.apply(this.events,arguments),this},installEventHandlers:function(){var n=this;this.on("preloaded",function(e,t){n.groups[e.group];e.preloaded=!0,e.scriptOptions=t,n.preloadCount--,0===n.preloadCount&&n.emit("preload-complete")}),this.on("preload-complete",function(){this.emit("execute-next")}),this.on("execute-next",function(){var e=n.nextItem();function t(){e.loaded=!0,n.emit("loaded",e),n.emit("execute-next")}e?e.preload?n.execute(e,t):n.fetchExecute(e,t):n.emit("complete")})},nextItem:function(){var e,t,n,r;for(t=0;t<this.groupKeys.length;t++)for(e=this.groups[this.groupKeys[t]],n=0;n<e.length;n++)if(!(r=e[n]).loaded)return r},fetchExecute:function(e,t){c(e.src,{async:!0,defer:!0},function(){t()})},execute:function(e,t){e&&e.scriptOptions&&(script=s(e.scriptOptions),u(script),i.removeChild(script)),t()},enqueue:function(e,t){var n;n={src:e,preload:a(e),async:t,group:this.currentGroup},this.groups[this.currentGroup]||(this.groups[this.currentGroup]=[],this.groupKeys.push(this.currentGroup)),this.groups[this.currentGroup].push(n)},parseQueue:function(e,t,n){var r,i;for(r=0;r<e.length;r++)i=e[r],o.isArray(i)?(this.currentGroup++,this.parseQueue(i,!0,n+1)):(0===n&&this.currentGroup++,this.enqueue(i,t))},runQueue:function(){this.preloadAll()},preloadAll:function(){var e,t,n,r,i=this;for(t=0;t<this.groupKeys.length;t++)for(n=this.groups[this.groupKeys[t]],e=0;e<n.length;e++)(r=n[e]).preload&&(this.preloadCount++,function(t){l(t.src,{},function(e){i.emit("preloaded",t,e)})}(r));0===this.preloadCount&&this.emit("execute-next")}},o.require=function(e,t,n){if(t=t||{},n=n||function(){},o.isArray(e))return new f(e);d(function(){switch(t.transport){case"XMLHttpRequest":return l(e,t,function(e){var t=s(e);u(t),i.removeChild(t),n()});case"scriptInsertion":default:return c(e,t,n)}})},o.require.isSameOrigin=a,o.require});