leonidas 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +1 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +105 -0
- data/LICENSE +21 -0
- data/Manifest +63 -0
- data/README.md +213 -0
- data/Rakefile +42 -0
- data/assets/scripts/coffee/leonidas/client.coffee +15 -0
- data/assets/scripts/coffee/leonidas/commander.coffee +34 -0
- data/assets/scripts/coffee/leonidas/commands/command.coffee +9 -0
- data/assets/scripts/coffee/leonidas/commands/organizer.coffee +24 -0
- data/assets/scripts/coffee/leonidas/commands/processor.coffee +13 -0
- data/assets/scripts/coffee/leonidas/commands/stabilizer.coffee +13 -0
- data/assets/scripts/coffee/leonidas/commands/synchronizer.coffee +38 -0
- data/assets/scripts/js/lib/jquery.js +6 -0
- data/bin/leonidas.js +178 -0
- data/config/assets.rb +7 -0
- data/leonidas.gemspec +36 -0
- data/lib/leonidas.rb +14 -0
- data/lib/leonidas/app/app.rb +80 -0
- data/lib/leonidas/app/connection.rb +20 -0
- data/lib/leonidas/app/repository.rb +41 -0
- data/lib/leonidas/commands/aggregator.rb +31 -0
- data/lib/leonidas/commands/command.rb +24 -0
- data/lib/leonidas/commands/handler.rb +21 -0
- data/lib/leonidas/commands/processor.rb +30 -0
- data/lib/leonidas/dsl/configuration_expression.rb +17 -0
- data/lib/leonidas/memory_layer/memory_registry.rb +33 -0
- data/lib/leonidas/persistence_layer/persister.rb +54 -0
- data/lib/leonidas/persistence_layer/state_builder.rb +17 -0
- data/lib/leonidas/persistence_layer/state_loader.rb +22 -0
- data/lib/leonidas/routes/sync.rb +45 -0
- data/lib/leonidas/symbols.rb +17 -0
- data/spec/jasmine/jasmine.yml +44 -0
- data/spec/jasmine/runner.html +77 -0
- data/spec/jasmine/support/classes.coffee +16 -0
- data/spec/jasmine/support/helpers.coffee +22 -0
- data/spec/jasmine/support/mocks.coffee +19 -0
- data/spec/jasmine/support/objects.coffee +11 -0
- data/spec/jasmine/support/requirements.coffee +1 -0
- data/spec/jasmine/tests/client_spec.coffee +20 -0
- data/spec/jasmine/tests/commander_spec.coffee +69 -0
- data/spec/jasmine/tests/commands/command_spec.coffee +12 -0
- data/spec/jasmine/tests/commands/organizer_spec.coffee +70 -0
- data/spec/jasmine/tests/commands/processor_spec.coffee +22 -0
- data/spec/jasmine/tests/commands/stabilizer_spec.coffee +30 -0
- data/spec/jasmine/tests/commands/synchronizer_spec.coffee +72 -0
- data/spec/rspec/spec_helper.rb +4 -0
- data/spec/rspec/support/classes/app.rb +26 -0
- data/spec/rspec/support/classes/commands.rb +52 -0
- data/spec/rspec/support/classes/persistence.rb +56 -0
- data/spec/rspec/support/config.rb +3 -0
- data/spec/rspec/support/mocks.rb +15 -0
- data/spec/rspec/support/objects.rb +11 -0
- data/spec/rspec/unit/app/app_spec.rb +185 -0
- data/spec/rspec/unit/app/repository_spec.rb +114 -0
- data/spec/rspec/unit/commands/aggregator_spec.rb +103 -0
- data/spec/rspec/unit/commands/command.rb +17 -0
- data/spec/rspec/unit/commands/processor_spec.rb +30 -0
- data/spec/rspec/unit/dsl/configuration_expression_spec.rb +32 -0
- data/spec/rspec/unit/leonidas_spec.rb +26 -0
- data/spec/rspec/unit/memory_layer/memory_registry_spec.rb +85 -0
- data/spec/rspec/unit/persistence_layer/persister_spec.rb +84 -0
- data/spec/rspec/unit/persistence_layer/state_loader_spec.rb +29 -0
- metadata +166 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class Client
|
|
2
|
+
|
|
3
|
+
constructor: (@id, @lockedState)->
|
|
4
|
+
@activeState = { }
|
|
5
|
+
@copyState(@activeState, @lockedState)
|
|
6
|
+
|
|
7
|
+
revertState: -> @copyState(@activeState, @lockedState)
|
|
8
|
+
|
|
9
|
+
lockState: -> @copyState(@lockedState, @activeState)
|
|
10
|
+
|
|
11
|
+
copyState: (to, from)->
|
|
12
|
+
delete to[key] for key of to
|
|
13
|
+
to[key] = value for key, value of from
|
|
14
|
+
|
|
15
|
+
return Client
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Command = require "leonidas/commands/command"
|
|
2
|
+
Organizer = require "leonidas/commands/organizer"
|
|
3
|
+
Processor = require "leonidas/commands/processor"
|
|
4
|
+
Stabilizer = require "leonidas/commands/stabilizer"
|
|
5
|
+
Synchronizer = require "leonidas/commands/synchronizer"
|
|
6
|
+
|
|
7
|
+
class Commander
|
|
8
|
+
|
|
9
|
+
constructor: (@organizer, @processor, @stabilizer, @synchronizer)->
|
|
10
|
+
@pushFrequency = 1000
|
|
11
|
+
@pullFrequency = 5000
|
|
12
|
+
|
|
13
|
+
@default: (commandSource, handlers, syncUrl)->
|
|
14
|
+
organizer = new Organizer()
|
|
15
|
+
processor = new Processor(handlers)
|
|
16
|
+
stabilizer = new Stabilizer(commandSource, organizer, processor)
|
|
17
|
+
synchronizer = new Synchronizer(syncUrl, commandSource, organizer, stabilizer)
|
|
18
|
+
|
|
19
|
+
new @(organizer, processor, stabilizer, synchronizer)
|
|
20
|
+
|
|
21
|
+
startSync: ->
|
|
22
|
+
@pushInterval = setInterval(@synchronizer.push, @pushFrequency)
|
|
23
|
+
@pullInterval = setInterval(@synchronizer.pull, @pullFrequency)
|
|
24
|
+
|
|
25
|
+
stopSync: ->
|
|
26
|
+
clearInterval @pushInterval
|
|
27
|
+
clearInterval @pullInterval
|
|
28
|
+
|
|
29
|
+
issueCommand: (name, data)->
|
|
30
|
+
command = new Command(name, data)
|
|
31
|
+
@organizer.addCommand command
|
|
32
|
+
@processor.processCommand command
|
|
33
|
+
|
|
34
|
+
return Commander
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
class Organizer
|
|
2
|
+
|
|
3
|
+
constructor: ->
|
|
4
|
+
@unsyncedCommands = [ ]
|
|
5
|
+
@syncedCommands = [ ]
|
|
6
|
+
@inactiveCommands = [ ]
|
|
7
|
+
|
|
8
|
+
addCommand: (command, unsynced=true)-> if unsynced then @unsyncedCommands.push command else @syncedCommands.push command
|
|
9
|
+
|
|
10
|
+
addCommands: (commands, unsynced=true)-> @addCommand(command, unsynced) for command in commands
|
|
11
|
+
|
|
12
|
+
markAsSynced: (commands)->
|
|
13
|
+
@syncedCommands.push(command) for command in commands when command not in @syncedCommands
|
|
14
|
+
@unsyncedCommands = (command for command in @unsyncedCommands when command not in commands)
|
|
15
|
+
|
|
16
|
+
markAsInactive: (commands)->
|
|
17
|
+
@inactiveCommands.push(command) for command in commands
|
|
18
|
+
@syncedCommands = (command for command in @syncedCommands when command not in commands)
|
|
19
|
+
|
|
20
|
+
activeCommands: ->
|
|
21
|
+
activeCommands = @unsyncedCommands.concat @syncedCommands
|
|
22
|
+
activeCommands.sort (a,b)-> if a.timestamp > b.timestamp then 1 else -1
|
|
23
|
+
|
|
24
|
+
return Organizer
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class Processor
|
|
2
|
+
|
|
3
|
+
constructor: (@handlers)->
|
|
4
|
+
|
|
5
|
+
processCommand: (command)->
|
|
6
|
+
for handler in @handlers
|
|
7
|
+
handler.run command if handler.handles command
|
|
8
|
+
|
|
9
|
+
processCommands: (commands)->
|
|
10
|
+
for command in commands
|
|
11
|
+
@processCommand command
|
|
12
|
+
|
|
13
|
+
return Processor
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class Stabilizer
|
|
2
|
+
|
|
3
|
+
constructor: (@client, @organizer, @processor)->
|
|
4
|
+
|
|
5
|
+
stabilize: (stableTimestamp)->
|
|
6
|
+
stableCommands = (command for command in @organizer.activeCommands() when command.timestamp <= stableTimestamp)
|
|
7
|
+
@client.revertState()
|
|
8
|
+
@processor.processCommands(stableCommands)
|
|
9
|
+
@client.lockState()
|
|
10
|
+
@organizer.markAsInactive(stableCommands)
|
|
11
|
+
@processor.processCommands(@organizer.activeCommands())
|
|
12
|
+
|
|
13
|
+
return Stabilizer
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require "lib/jquery"
|
|
2
|
+
|
|
3
|
+
Command = require "leonidas/commands/command"
|
|
4
|
+
|
|
5
|
+
class Synchronizer
|
|
6
|
+
|
|
7
|
+
constructor: (@syncUrl, @client, @organizer, @stabilizer)->
|
|
8
|
+
@externalClients = [ ]
|
|
9
|
+
|
|
10
|
+
push: =>
|
|
11
|
+
unsyncedCommands = (command for command in @organizer.unsyncedCommands)
|
|
12
|
+
$.ajax(
|
|
13
|
+
url: "#{@syncUrl}"
|
|
14
|
+
method: "POST"
|
|
15
|
+
data:
|
|
16
|
+
clientId: @client.id
|
|
17
|
+
commands: (command.toHash() for command in unsyncedCommands)
|
|
18
|
+
error: => console.log "push error"
|
|
19
|
+
success: (response)=>
|
|
20
|
+
@organizer.markAsSynced unsyncedCommands
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
pull: =>
|
|
24
|
+
$.ajax(
|
|
25
|
+
url: "#{@syncUrl}"
|
|
26
|
+
method: "GET"
|
|
27
|
+
data:
|
|
28
|
+
clientId: @client.id
|
|
29
|
+
clients: @externalClients
|
|
30
|
+
error: => console.log "pull error"
|
|
31
|
+
success: (response)=>
|
|
32
|
+
@externalClients = response.data.currentClients
|
|
33
|
+
commands = (new Command(command.name, command.data, command.timestamp) for command in response.data.commands)
|
|
34
|
+
@organizer.addCommands commands, false
|
|
35
|
+
@stabilizer.stabilize response.data.stableTimestamp
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return Synchronizer
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*! jQuery v2.0.0 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
|
|
2
|
+
//@ sourceMappingURL=jquery.min.map
|
|
3
|
+
*/
|
|
4
|
+
(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],f="2.0.0",p=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=f.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=o.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?n.ready(e):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},a=2),"object"==typeof s||x.isFunction(s)||(s={}),u===a&&(s=this,--a);u>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&&(l&&r&&(x.isPlainObject(r)||(i=x.isArray(r)))?(i?(i=!1,o=n&&x.isArray(n)?n:[]):o=n&&x.isPlainObject(n)?n:{},s[t]=x.extend(l,o,r)):r!==undefined&&(s[t]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=a),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){(e===!0?--x.readyWait:x.isReady)||(x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(o,[x]),x.fn.trigger&&x(o).trigger("ready").off("ready")))},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&x.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){var t,n=eval;e=x.trim(e),e&&(1===e.indexOf("use strict")?(t=o.createElement("script"),t.text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(k,"ms-").replace(N,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,s=j(e);if(n){if(s){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(s){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":v.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(j(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;n>i;i++)e[r++]=t[i];else while(t[i]!==undefined)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r,i=[],o=0,s=e.length;for(n=!!n;s>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,s=j(e),a=[];if(s)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(a[a.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(a[a.length]=r);return p.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),x.isFunction(e)?(r=d.call(arguments,2),i=function(){return e.apply(t||this,r.concat(d.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):undefined},access:function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n)){i=!0;for(a in n)x.access(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;u>a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},now:Date.now,swap:function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i}}),x.ready.promise=function(t){return n||(n=x.Deferred(),"complete"===o.readyState?setTimeout(x.ready):(o.addEventListener("DOMContentLoaded",S,!1),e.addEventListener("load",S,!1))),n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function j(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}t=x(o),function(e,undefined){var t,n,r,i,o,s,a,u,l,c,f,p,h,d,g,m,y="sizzle"+-new Date,v=e.document,b={},w=0,T=0,C=ot(),k=ot(),N=ot(),E=!1,S=function(){return 0},j=typeof undefined,D=1<<31,A=[],L=A.pop,q=A.push,H=A.push,O=A.slice,F=A.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=M.replace("w","w#"),$="\\["+R+"*("+M+")"+R+"*(?:([*^$|!~]?=)"+R+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+R+"*\\]",B=":("+M+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",I=RegExp("^"+R+"+|((?:^|[^\\\\])(?:\\\\.)*)"+R+"+$","g"),z=RegExp("^"+R+"*,"+R+"*"),_=RegExp("^"+R+"*([>+~]|"+R+")"+R+"*"),X=RegExp(R+"*[+~]"),U=RegExp("="+R+"*([^\\]'\"]*)"+R+"*\\]","g"),Y=RegExp(B),V=RegExp("^"+W+"$"),G={ID:RegExp("^#("+M+")"),CLASS:RegExp("^\\.("+M+")"),TAG:RegExp("^("+M.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+B),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),"boolean":RegExp("^(?:"+P+")$","i"),needsContext:RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,et=/'|\\/g,tt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,nt=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{H.apply(A=O.call(v.childNodes),v.childNodes),A[v.childNodes.length].nodeType}catch(rt){H={apply:A.length?function(e,t){q.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function it(e){return J.test(e+"")}function ot(){var e,t=[];return e=function(n,i){return t.push(n+=" ")>r.cacheLength&&delete e[t.shift()],e[n]=i}}function st(e){return e[y]=!0,e}function at(e){var t=c.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ut(e,t,n,r){var i,o,s,a,u,f,d,g,x,w;if((t?t.ownerDocument||t:v)!==c&&l(t),t=t||c,n=n||[],!e||"string"!=typeof e)return n;if(1!==(a=t.nodeType)&&9!==a)return[];if(p&&!r){if(i=Q.exec(e))if(s=i[1]){if(9===a){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&m(t,o)&&o.id===s)return n.push(o),n}else{if(i[2])return H.apply(n,t.getElementsByTagName(e)),n;if((s=i[3])&&b.getElementsByClassName&&t.getElementsByClassName)return H.apply(n,t.getElementsByClassName(s)),n}if(b.qsa&&(!h||!h.test(e))){if(g=d=y,x=t,w=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){f=gt(e),(d=t.getAttribute("id"))?g=d.replace(et,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=f.length;while(u--)f[u]=g+mt(f[u]);x=X.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return H.apply(n,x.querySelectorAll(w)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(I,"$1"),t,n,r)}o=ut.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},l=ut.setDocument=function(e){var t=e?e.ownerDocument||e:v;return t!==c&&9===t.nodeType&&t.documentElement?(c=t,f=t.documentElement,p=!o(t),b.getElementsByTagName=at(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),b.attributes=at(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByClassName=at(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),b.sortDetached=at(function(e){return 1&e.compareDocumentPosition(c.createElement("div"))}),b.getById=at(function(e){return f.appendChild(e).id=y,!t.getElementsByName||!t.getElementsByName(y).length}),b.getById?(r.find.ID=function(e,t){if(typeof t.getElementById!==j&&p){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){return e.getAttribute("id")===t}}):(r.find.ID=function(e,t){if(typeof t.getElementById!==j&&p){var n=t.getElementById(e);return n?n.id===e||typeof n.getAttributeNode!==j&&n.getAttributeNode("id").value===e?[n]:undefined:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=b.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):undefined}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=b.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&p?t.getElementsByClassName(e):undefined},d=[],h=[],(b.qsa=it(t.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+R+"*(?:value|"+P+")"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){var t=c.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&h.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(b.matchesSelector=it(g=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){b.disconnectedMatch=g.call(e,"div"),g.call(e,"[s!='']:x"),d.push("!=",B)}),h=h.length&&RegExp(h.join("|")),d=d.length&&RegExp(d.join("|")),m=it(f.contains)||f.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)while(t=t.parentNode)if(t===e)return!0;return!1},S=f.compareDocumentPosition?function(e,n){if(e===n)return E=!0,0;var r=n.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(n);return r?1&r||!b.sortDetached&&n.compareDocumentPosition(e)===r?e===t||m(v,e)?-1:n===t||m(v,n)?1:u?F.call(u,e)-F.call(u,n):0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],l=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:u?F.call(u,e)-F.call(u,n):0;if(o===s)return lt(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)l.unshift(r);while(a[i]===l[i])i++;return i?lt(a[i],l[i]):a[i]===v?-1:l[i]===v?1:0},c):c},ut.matches=function(e,t){return ut(e,null,null,t)},ut.matchesSelector=function(e,t){if((e.ownerDocument||e)!==c&&l(e),t=t.replace(U,"='$1']"),!(!b.matchesSelector||!p||d&&d.test(t)||h&&h.test(t)))try{var n=g.call(e,t);if(n||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return ut(t,c,null,[e]).length>0},ut.contains=function(e,t){return(e.ownerDocument||e)!==c&&l(e),m(e,t)},ut.attr=function(e,t){(e.ownerDocument||e)!==c&&l(e);var n=r.attrHandle[t.toLowerCase()],i=n&&n(e,t,!p);return i===undefined?b.attributes||!p?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null:i},ut.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ut.uniqueSort=function(e){var t,n=[],r=0,i=0;if(E=!b.detectDuplicates,u=!b.sortStable&&e.slice(0),e.sort(S),E){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return e};function lt(e,t){var n=t&&e,r=n&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ct(e,t,n){var r;return n?undefined:(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}function ft(e,t,n){var r;return n?undefined:r=e.getAttribute(t,"type"===t.toLowerCase()?1:2)}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function dt(e){return st(function(t){return t=+t,st(function(n,r){var i,o=e([],n.length,t),s=o.length;while(s--)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}i=ut.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+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r];r++)n+=i(t);return n},r=ut.selectors={cacheLength:50,createPseudo:st,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(tt,nt),e[3]=(e[4]||e[5]||"").replace(tt,nt),"~="===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]||ut.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]&&ut.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return G.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&Y.test(n)&&(t=gt(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){var t=e.replace(tt,nt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ut.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,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){f=t;while(f=f[g])if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[y]||(m[y]={}),l=c[e]||[],h=l[0]===w&&l[1],p=l[0]===w&&l[2],f=h&&m.childNodes[h];while(f=++h&&f&&f[g]||(p=h=0)||d.pop())if(1===f.nodeType&&++p&&f===t){c[e]=[w,h,p];break}}else if(x&&(l=(t[y]||(t[y]={}))[e])&&l[0]===w)p=l[1];else while(f=++h&&f&&f[g]||(p=h=0)||d.pop())if((a?f.nodeName.toLowerCase()===v:1===f.nodeType)&&++p&&(x&&((f[y]||(f[y]={}))[e]=[w,p]),f===t))break;return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ut.error("unsupported pseudo: "+e);return i[y]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?st(function(e,n){var r,o=i(e,t),s=o.length;while(s--)r=F.call(e,o[s]),e[r]=!(n[r]=o[s])}):function(e){return i(e,0,n)}):i}},pseudos:{not:st(function(e){var t=[],n=[],r=s(e.replace(I,"$1"));return r[y]?st(function(e,t,n,i){var o,s=r(e,null,i,[]),a=e.length;while(a--)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:st(function(e){return function(t){return ut(e,t).length>0}}),contains:st(function(e){return function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:st(function(e){return V.test(e||"")||ut.error("unsupported lang: "+e),e=e.replace(tt,nt).toLowerCase(),function(t){var n;do if(n=p?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(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===c.activeElement&&(!c.hasFocus||c.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!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return K.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:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[0>n?n+t:n]}),even:dt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:dt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=pt(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=ht(t);function gt(e,t){var n,i,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=r.preFilter;while(a){(!n||(i=z.exec(a)))&&(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),n=!1,(i=_.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(I," ")}),a=a.slice(n.length));for(s in r.filter)!(i=G[s].exec(a))||l[s]&&!(i=l[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ut.error(e):k(e,u).slice(0)}function mt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function yt(e,t,r){var i=t.dir,o=r&&"parentNode"===i,s=T++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,r,a){var u,l,c,f=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,r,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[y]||(t[y]={}),(l=c[i])&&l[0]===f){if((u=l[1])===!0||u===n)return u===!0}else if(l=c[i]=[f],l[1]=e(t,r,a)||n,l[1]===!0)return!0}}function vt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,s=[],a=0,u=e.length,l=null!=t;for(;u>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(s.push(o),l&&t.push(a));return s}function bt(e,t,n,r,i,o){return r&&!r[y]&&(r=bt(r)),i&&!i[y]&&(i=bt(i,o)),st(function(o,s,a,u){var l,c,f,p=[],h=[],d=s.length,g=o||Ct(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:xt(g,p,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=xt(y,h),r(l,[],a,u),c=l.length;while(c--)(f=l[c])&&(y[h[c]]=!(m[h[c]]=f))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(f=y[c])&&l.push(m[c]=f);i(null,y=[],l,u)}c=y.length;while(c--)(f=y[c])&&(l=i?F.call(o,f):p[c])>-1&&(o[l]=!(s[l]=f))}}else y=xt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):H.apply(s,y)})}function wt(e){var t,n,i,o=e.length,s=r.relative[e[0].type],u=s||r.relative[" "],l=s?1:0,c=yt(function(e){return e===t},u,!0),f=yt(function(e){return F.call(t,e)>-1},u,!0),p=[function(e,n,r){return!s&&(r||n!==a)||((t=n).nodeType?c(e,n,r):f(e,n,r))}];for(;o>l;l++)if(n=r.relative[e[l].type])p=[yt(vt(p),n)];else{if(n=r.filter[e[l].type].apply(null,e[l].matches),n[y]){for(i=++l;o>i;i++)if(r.relative[e[i].type])break;return bt(l>1&&vt(p),l>1&&mt(e.slice(0,l-1)).replace(I,"$1"),n,i>l&&wt(e.slice(l,i)),o>i&&wt(e=e.slice(i)),o>i&&mt(e))}p.push(n)}return vt(p)}function Tt(e,t){var i=0,o=t.length>0,s=e.length>0,u=function(u,l,f,p,h){var d,g,m,y=[],v=0,x="0",b=u&&[],T=null!=h,C=a,k=u||s&&r.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(a=l!==c&&l,n=i);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,f)){p.push(d);break}T&&(w=N,n=++i)}o&&((d=!m&&d)&&v--,u&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,f);if(u){if(v>0)while(x--)b[x]||y[x]||(y[x]=L.call(p));y=xt(y)}H.apply(p,y),T&&!u&&y.length>0&&v+t.length>1&&ut.uniqueSort(p)}return T&&(w=N,a=C),b};return o?st(u):u}s=ut.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=gt(e)),n=t.length;while(n--)o=wt(t[n]),o[y]?r.push(o):i.push(o);o=N(e,Tt(i,r))}return o};function Ct(e,t,n){var r=0,i=t.length;for(;i>r;r++)ut(e,t[r],n);return n}function kt(e,t,n,i){var o,a,u,l,c,f=gt(e);if(!i&&1===f.length){if(a=f[0]=f[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&p&&r.relative[a[1].type]){if(t=(r.find.ID(u.matches[0].replace(tt,nt),t)||[])[0],!t)return n;e=e.slice(a.shift().value.length)}o=G.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],r.relative[l=u.type])break;if((c=r.find[l])&&(i=c(u.matches[0].replace(tt,nt),X.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=i.length&&mt(a),!e)return H.apply(n,i),n;break}}}return s(e,f)(i,t,!p,n,X.test(e)),n}r.pseudos.nth=r.pseudos.eq;function Nt(){}Nt.prototype=r.filters=r.pseudos,r.setFilters=new Nt,b.sortStable=y.split("").sort(S).join("")===y,l(),[0,0].sort(S),b.detectDuplicates=E,at(function(e){if(e.innerHTML="<a href='#'></a>","#"!==e.firstChild.getAttribute("href")){var t="type|href|height|width".split("|"),n=t.length;while(n--)r.attrHandle[t[n]]=ft}}),at(function(e){if(null!=e.getAttribute("disabled")){var t=P.split("|"),n=t.length;while(n--)r.attrHandle[t[n]]=ct}}),x.find=ut,x.expr=ut.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ut.uniqueSort,x.text=ut.getText,x.isXMLDoc=ut.isXML,x.contains=ut.contains}(e);var D={};function A(e){var t=D[e]={};return x.each(e.match(w)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?D[e]||A(e):x.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(f){for(t=e.memory&&f,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(f[0],f[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&x.each(arguments,function(e,t){var n;while((n=x.inArray(t,a,n))>-1)a.splice(n,1),r&&(o>=n&&o--,s>=n&&s--)}),this},has:function(e){return e?x.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=undefined,this},disabled:function(){return!a},lock:function(){return u=undefined,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!a||n&&!u||(r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var s=o[0],a=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),s=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},a,u,l;if(r>1)for(a=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(s(t,l,n)).fail(o.reject).progress(s(t,u,a)):--i;return i||o.resolveWith(l,n),o.promise()}}),x.support=function(t){var n=o.createElement("input"),r=o.createDocumentFragment(),i=o.createElement("div"),s=o.createElement("select"),a=s.appendChild(o.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!a.disabled,n=o.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),t.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===i.style.backgroundClip,x(function(){var n,r,s="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=o.getElementsByTagName("body")[0];a&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",x.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===i.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(o.createElement("div")),r.style.cssText=i.style.cssText=s,r.style.marginRight=r.style.width="0",i.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var L,q,H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=x.expando+Math.random()}F.uid=1,F.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},F.prototype={key:function(e){if(!F.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=F.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,x.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(x.isEmptyObject(o))this.cache[i]=t;else for(r in t)o[r]=t[r]},get:function(e,t){var n=this.cache[this.key(e)];return t===undefined?n:n[t]},access:function(e,t,n){return t===undefined||t&&"string"==typeof t&&n===undefined?this.get(e,t):(this.set(e,t,n),n!==undefined?n:t)},remove:function(e,t){var n,r,i=this.key(e),o=this.cache[i];if(t===undefined)this.cache[i]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):t in o?r=[t]:(r=x.camelCase(t),r=r in o?[r]:r.match(w)||[]),n=r.length;while(n--)delete o[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){delete this.cache[this.key(e)]}},L=new F,q=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||q.hasData(e)},data:function(e,t,n){return L.access(e,t,n)},removeData:function(e,t){L.remove(e,t)},_data:function(e,t,n){return q.access(e,t,n)},_removeData:function(e,t){q.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i=this[0],o=0,s=null;if(e===undefined){if(this.length&&(s=L.get(i),1===i.nodeType&&!q.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.substring(5)),P(i,r,s[r]));q.set(i,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){L.set(this,e)}):x.access(this,function(t){var n,r=x.camelCase(e);if(i&&t===undefined){if(n=L.get(i,e),n!==undefined)return n;if(n=L.get(i,r),n!==undefined)return n;if(n=P(i,r,undefined),n!==undefined)return n}else this.each(function(){var n=L.get(this,r);L.set(this,r,t),-1!==e.indexOf("-")&&n!==undefined&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}});function P(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(O,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:H.test(n)?JSON.parse(n):n}catch(i){}L.set(e,t,n)}else n=undefined;return n}x.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=q.get(e,t),n&&(!r||x.isArray(n)?r=q.access(e,t,x.makeArray(n)):r.push(n)),r||[]):undefined},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),s=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(function(){q.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?x.queue(this[0],e):t===undefined?this:this.each(function(){var n=x.queue(this,e,t);
|
|
5
|
+
x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=undefined),e=e||"fx";while(s--)n=q.get(o[s],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var R,M,W=/[\t\r\n]/g,$=/\r/g,B=/^(?:input|select|textarea|button)$/i;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})},addClass:function(e){var t,n,r,i,o,s=0,a=this.length,u="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,i="boolean"==typeof t;return x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,s=0,a=x(this),u=t,l=e.match(w)||[];while(o=l[s++])u=i?u:!a.hasClass(o),a[u?"addClass":"removeClass"](o)}else(n===r||"boolean"===n)&&(this.className&&q.set(this,"__className__",this.className),this.className=this.className||e===!1?"":q.get(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(W," ").indexOf(t)>=0)return!0;return!1},val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=x.isFunction(e),this.each(function(n){var i,o=x(this);1===this.nodeType&&(i=r?e.call(this,n,o.val()):e,null==i?i="":"number"==typeof i?i+="":x.isArray(i)&&(i=x.map(i,function(e){return null==e?"":e+""})),t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace($,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;for(;a>u;u++)if(n=r[u],!(!n.selected&&u!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),s=i.length;while(s--)r=i[s],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,t,n){var i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===r?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(t=t.toLowerCase(),i=x.attrHooks[t]||(x.expr.match.boolean.test(t)?M:R)),n===undefined?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=x.find.attr(e,t),null==o?undefined:o):null!==n?i&&"set"in i&&(o=i.set(e,n,t))!==undefined?o:(e.setAttribute(t,n+""),n):(x.removeAttr(e,t),undefined))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.boolean.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!x.isXMLDoc(e),o&&(t=x.propFix[t]||t,i=x.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||B.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),M={set:function(e,t,n){return t===!1?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.boolean.source.match(/\w+/g),function(e,t){var n=x.expr.attrHandle[t]||x.find.attr;x.expr.attrHandle[t]=function(e,t,r){var i=x.expr.attrHandle[t],o=r?undefined:(x.expr.attrHandle[t]=undefined)!=n(e,t,r)?t.toLowerCase():null;return x.expr.attrHandle[t]=i,o}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){return x.isArray(t)?e.checked=x.inArray(x(e).val(),t)>=0:undefined}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var I=/^key/,z=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,X=/^([^.]*)(?:\.(.+)|)$/;function U(){return!0}function Y(){return!1}function V(){try{return o.activeElement}catch(e){}}x.event={global:{},add:function(e,t,n,i,o){var s,a,u,l,c,f,p,h,d,g,m,y=q.get(e);if(y){n.handler&&(s=n,n=s.handler,o=s.selector),n.guid||(n.guid=x.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return typeof x===r||e&&x.event.triggered===e.type?undefined:x.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=(t||"").match(w)||[""],c=t.length;while(c--)u=X.exec(t[c])||[],d=m=u[1],g=(u[2]||"").split(".").sort(),d&&(p=x.event.special[d]||{},d=(o?p.delegateType:p.bindType)||d,p=x.event.special[d]||{},f=x.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:g.join(".")},s),(h=l[d])||(h=l[d]=[],h.delegateCount=0,p.setup&&p.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,f):h.push(f),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,h,d,g,m=q.hasData(e)&&q.get(e);if(m&&(u=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(a=X.exec(t[l])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){f=x.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,p=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));s&&!p.length&&(f.teardown&&f.teardown.call(e,d,m.handle)!==!1||x.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)x.event.remove(e,h+t[l],n,r,!0);x.isEmptyObject(u)&&(delete m.handle,q.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,f,p,h=[r||o],d=y.call(t,"type")?t.type:t,g=y.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||o,3!==r.nodeType&&8!==r.nodeType&&!_.test(d+x.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),c=0>d.indexOf(":")&&"on"+d,t=t[x.expando]?t:new x.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),p=x.event.special[d]||{},i||!p.trigger||p.trigger.apply(r,n)!==!1)){if(!i&&!p.noBubble&&!x.isWindow(r)){for(l=p.delegateType||d,_.test(l+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||o)&&h.push(u.defaultView||u.parentWindow||e)}s=0;while((a=h[s++])&&!t.isPropagationStopped())t.type=s>1?l:p.bindType||d,f=(q.get(a,"events")||{})[t.type]&&q.get(a,"handle"),f&&f.apply(a,n),f=c&&a[c],f&&x.acceptData(a)&&f.apply&&f.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||p._default&&p._default.apply(h.pop(),n)!==!1||!x.acceptData(r)||c&&x.isFunction(r[d])&&!x.isWindow(r)&&(u=r[c],u&&(r[c]=null),x.event.triggered=d,r[d](),x.event.triggered=undefined,u&&(r[c]=u)),t.result}},dispatch:function(e){e=x.event.fix(e);var t,n,r,i,o,s=[],a=d.call(arguments),u=(q.get(this,"events")||{})[e.type]||[],l=x.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),t=0;while((i=s[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;a>n;n++)o=t[n],i=o.selector+" ",r[i]===undefined&&(r[i]=o.needsContext?x(i,this).index(u)>=0:x.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return t.length>a&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||o,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return 3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==V()&&this.focus?(this.focus(),!1):undefined},delegateType:"focusin"},blur:{trigger:function(){return this===V()&&this.blur?(this.blur(),!1):undefined},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&x.nodeName(this,"input")?(this.click(),!1):undefined},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},x.Event=function(e,t){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,undefined):new x.Event(e,t)},x.Event.prototype={isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=U,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=U,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=undefined):null==r&&("string"==typeof t?(r=n,n=undefined):(r=n,n=t,t=undefined)),r===!1)r=Y;else if(!r)return this;return 1===i&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),this.each(function(){x.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=undefined),n===!1&&(n=Y),this.each(function(){x.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?x.event.trigger(e,t,n,!0):undefined}});var G=/^.[^:#\[\.,]*$/,J=x.expr.match.needsContext,Q={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return t=this,this.pushStack(x(e).filter(function(){for(r=0;i>r;r++)if(x.contains(t[r],this))return!0}));for(n=[],r=0;i>r;r++)x.find(e,this[r],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){var e=0;for(;n>e;e++)if(x.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(Z(this,e||[],!0))},filter:function(e){return this.pushStack(Z(this,e||[],!1))},is:function(e){return!!e&&("string"==typeof e?J.test(e)?x(e,this.context).index(this[0])>=0:x.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],s=J.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(x(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function K(e,t){while((e=e[t])&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return K(e,"nextSibling")},prev:function(e){return K(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(Q[e]||x.unique(i),"p"===e[0]&&i.reverse()),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function Z(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(G.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return g.call(t,e)>=0!==n})}var et=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,tt=/<([\w:]+)/,nt=/<|&#?\w+;/,rt=/<(?:script|style|link)/i,it=/^(?:checkbox|radio)$/i,ot=/checked\s*(?:[^=]|=\s*.checked.)/i,st=/^$|\/(?:java|ecma)script/i,at=/^true\/(.*)/,ut=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,lt={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};lt.optgroup=lt.option,lt.tbody=lt.tfoot=lt.colgroup=lt.caption=lt.col=lt.thead,lt.th=lt.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===undefined?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ct(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ct(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(gt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&ht(gt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(gt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!rt.test(e)&&!lt[(tt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(et,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(gt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=p.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,f=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&ot.test(d))return this.each(function(r){var i=f.eq(r);g&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(r=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=x.map(gt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,gt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,pt),l=0;s>l;l++)a=o[l],st.test(a.type||"")&&!q.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(ut,"")))}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=[],i=x(e),o=i.length-1,s=0;for(;o>=s;s++)n=s===o?this:this.clone(!0),x(i[s])[t](n),h.apply(r,n.get());return this.pushStack(r)}}),x.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=x.contains(e.ownerDocument,e);if(!(x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(s=gt(a),o=gt(e),r=0,i=o.length;i>r;r++)mt(o[r],s[r]);if(t)if(n)for(o=o||gt(e),s=s||gt(a),r=0,i=o.length;i>r;r++)dt(o[r],s[r]);else dt(e,a);return s=gt(a,"script"),s.length>0&&ht(s,!u&>(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,f=e.length,p=t.createDocumentFragment(),h=[];for(;f>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(nt.test(i)){o=o||p.appendChild(t.createElement("div")),s=(tt.exec(i)||["",""])[1].toLowerCase(),a=lt[s]||lt._default,o.innerHTML=a[1]+i.replace(et,"<$1></$2>")+a[2],l=a[0];while(l--)o=o.firstChild;x.merge(h,o.childNodes),o=p.firstChild,o.textContent=""}else h.push(t.createTextNode(i));p.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=gt(p.appendChild(i),"script"),u&&ht(o),n)){l=0;while(i=o[l++])st.test(i.type||"")&&n.push(i)}return p},cleanData:function(e){var t,n,r,i=e.length,o=0,s=x.event.special;for(;i>o;o++){if(n=e[o],x.acceptData(n)&&(t=q.access(n)))for(r in t.events)s[r]?x.event.remove(n,r):x.removeEvent(n,r,t.handle);L.discard(n),q.discard(n)}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"text",async:!1,global:!1,success:x.globalEval})}});function ct(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function pt(e){var t=at.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function ht(e,t){var n=e.length,r=0;for(;n>r;r++)q.set(e[r],"globalEval",!t||q.get(t[r],"globalEval"))}function dt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(q.hasData(e)&&(o=q.access(e),s=x.extend({},o),l=o.events,q.set(t,s),l)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)x.event.add(t,i,l[i][n])}L.hasData(e)&&(a=L.access(e),u=x.extend({},a),L.set(t,u))}}function gt(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return t===undefined||t&&x.nodeName(e,t)?x.merge([e],n):n}function mt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&it.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}x.fn.extend({wrapAll:function(e){var t;return x.isFunction(e)?this.each(function(t){x(this).wrapAll(e.call(this,t))}):(this[0]&&(t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var yt,vt,xt=/^(none|table(?!-c[ea]).+)/,bt=/^margin/,wt=RegExp("^("+b+")(.*)$","i"),Tt=RegExp("^("+b+")(?!px)[a-z%]+$","i"),Ct=RegExp("^([+-])=("+b+")","i"),kt={BODY:"block"},Nt={position:"absolute",visibility:"hidden",display:"block"},Et={letterSpacing:0,fontWeight:400},St=["Top","Right","Bottom","Left"],jt=["Webkit","O","Moz","ms"];function Dt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=jt.length;while(i--)if(t=jt[i]+n,t in e)return t;return r}function At(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function Lt(t){return e.getComputedStyle(t,null)}function qt(e,t){var n,r,i,o=[],s=0,a=e.length;for(;a>s;s++)r=e[s],r.style&&(o[s]=q.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&At(r)&&(o[s]=q.access(r,"olddisplay",Pt(r.nodeName)))):o[s]||(i=At(r),(n&&"none"!==n||!i)&&q.set(r,"olddisplay",i?n:x.css(r,"display"))));for(s=0;a>s;s++)r=e[s],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}x.fn.extend({css:function(e,t){return x.access(this,function(e,t,n){var r,i,o={},s=0;if(x.isArray(t)){for(r=Lt(e),i=t.length;i>s;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return n!==undefined?x.style(e,t,n):x.css(e,t)},e,t,arguments.length>1)},show:function(){return qt(this,!0)},hide:function(){return qt(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:At(this))?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=yt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=x.camelCase(t),u=e.style;return t=x.cssProps[a]||(x.cssProps[a]=Dt(u,a)),s=x.cssHooks[t]||x.cssHooks[a],n===undefined?s&&"get"in s&&(i=s.get(e,!1,r))!==undefined?i:u[t]:(o=typeof n,"string"===o&&(i=Ct.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(x.css(e,t)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||x.cssNumber[a]||(n+="px"),x.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===undefined||(u[t]=n)),undefined)}},css:function(e,t,n,r){var i,o,s,a=x.camelCase(t);return t=x.cssProps[a]||(x.cssProps[a]=Dt(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=yt(e,t,r)),"normal"===i&&t in Et&&(i=Et[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),yt=function(e,t,n){var r,i,o,s=n||Lt(e),a=s?s.getPropertyValue(t)||s[t]:undefined,u=e.style;return s&&(""!==a||x.contains(e.ownerDocument,e)||(a=x.style(e,t)),Tt.test(a)&&bt.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=s.width,u.width=r,u.minWidth=i,u.maxWidth=o)),a};function Ht(e,t,n){var r=wt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ot(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;for(;4>o;o+=2)"margin"===n&&(s+=x.css(e,n+St[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+St[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+St[o]+"Width",!0,i))):(s+=x.css(e,"padding"+St[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+St[o]+"Width",!0,i)));return s}function Ft(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Lt(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=yt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Tt.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ot(e,t,n||(s?"border":"content"),r,o)+"px"}function Pt(e){var t=o,n=kt[e];return n||(n=Rt(e,t),"none"!==n&&n||(vt=(vt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(vt[0].contentWindow||vt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=Rt(e,t),vt.detach()),kt[e]=n),n}function Rt(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,t){x.cssHooks[t]={get:function(e,n,r){return n?0===e.offsetWidth&&xt.test(x.css(e,"display"))?x.swap(e,Nt,function(){return Ft(e,t,r)}):Ft(e,t,r):undefined},set:function(e,n,r){var i=r&&Lt(e);return Ht(e,n,r?Ot(e,t,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,t){return t?x.swap(e,{display:"inline-block"},yt,[e,"marginRight"]):undefined}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,t){x.cssHooks[t]={get:function(e,n){return n?(n=yt(e,t),Tt.test(n)?x(e).position()[t]+"px":n):undefined}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+St[r]+t]=o[r]||o[r-2]||o[0];return i}},bt.test(e)||(x.cssHooks[e+t].set=Ht)});var Mt=/%20/g,Wt=/\[\]$/,$t=/\r?\n/g,Bt=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&It.test(this.nodeName)&&!Bt.test(e)&&(this.checked||!it.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace($t,"\r\n")}}):{name:t.name,value:n.replace($t,"\r\n")}}).get()}}),x.param=function(e,t){var n,r=[],i=function(e,t){t=x.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(t===undefined&&(t=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){i(this.name,this.value)});else for(n in e)zt(n,e[n],t,i);return r.join("&").replace(Mt,"+")};function zt(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||Wt.test(e)?r(e,i):zt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)zt(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var _t,Xt,Ut=x.now(),Yt=/\?/,Vt=/#.*$/,Gt=/([?&])_=[^&]*/,Jt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Qt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kt=/^(?:GET|HEAD)$/,Zt=/^\/\//,en=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,tn=x.fn.load,nn={},rn={},on="*/".concat("*");try{Xt=i.href}catch(sn){Xt=o.createElement("a"),Xt.href="",Xt=Xt.href}_t=en.exec(Xt.toLowerCase())||[];function an(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];
|
|
6
|
+
if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function un(e,t,n,r){var i={},o=e===rn;function s(a){var u;return i[a]=!0,x.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):undefined:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function ln(e,t){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in t)t[n]!==undefined&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,t,n){if("string"!=typeof e&&tn)return tn.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>=0&&(r=e.slice(a),e=e.slice(0,a)),x.isFunction(t)?(n=t,t=undefined):t&&"object"==typeof t&&(i="POST"),s.length>0&&x.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?x("<div>").append(x.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Xt,type:"GET",isLocal:Qt.test(_t[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":on,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ln(ln(e,x.ajaxSettings),t):ln(x.ajaxSettings,e)},ajaxPrefilter:an(nn),ajaxTransport:an(rn),ajax:function(e,t){"object"==typeof e&&(t=e,e=undefined),t=t||{};var n,r,i,o,s,a,u,l,c=x.ajaxSetup({},t),f=c.context||c,p=c.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),d=x.Callbacks("once memory"),g=c.statusCode||{},m={},y={},v=0,b="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===v){if(!o){o={};while(t=Jt.exec(i))o[t[1].toLowerCase()]=t[2]}t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===v?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return v||(e=y[n]=y[n]||e,m[e]=t),this},overrideMimeType:function(e){return v||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>v)for(t in e)g[t]=[g[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),k(0,t),this}};if(h.promise(T).complete=d.add,T.success=T.done,T.error=T.fail,c.url=((e||c.url||Xt)+"").replace(Vt,"").replace(Zt,_t[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=x.trim(c.dataType||"*").toLowerCase().match(w)||[""],null==c.crossDomain&&(a=en.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===_t[1]&&a[2]===_t[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(_t[3]||("http:"===_t[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=x.param(c.data,c.traditional)),un(nn,c,t,T),2===v)return T;u=c.global,u&&0===x.active++&&x.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Kt.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(Yt.test(r)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=Gt.test(r)?r.replace(Gt,"$1_="+Ut++):r+(Yt.test(r)?"&":"?")+"_="+Ut++)),c.ifModified&&(x.lastModified[r]&&T.setRequestHeader("If-Modified-Since",x.lastModified[r]),x.etag[r]&&T.setRequestHeader("If-None-Match",x.etag[r])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&T.setRequestHeader("Content-Type",c.contentType),T.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+on+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)T.setRequestHeader(l,c.headers[l]);if(c.beforeSend&&(c.beforeSend.call(f,T,c)===!1||2===v))return T.abort();b="abort";for(l in{success:1,error:1,complete:1})T[l](c[l]);if(n=un(rn,c,t,T)){T.readyState=1,u&&p.trigger("ajaxSend",[T,c]),c.async&&c.timeout>0&&(s=setTimeout(function(){T.abort("timeout")},c.timeout));try{v=1,n.send(m,k)}catch(C){if(!(2>v))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,t,o,a){var l,m,y,b,w,C=t;2!==v&&(v=2,s&&clearTimeout(s),n=undefined,i=a||"",T.readyState=e>0?4:0,l=e>=200&&300>e||304===e,o&&(b=cn(c,T,o)),b=fn(c,b,T,l),l?(c.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(x.lastModified[r]=w),w=T.getResponseHeader("etag"),w&&(x.etag[r]=w)),204===e?C="nocontent":304===e?C="notmodified":(C=b.state,m=b.data,y=b.error,l=!y)):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),T.status=e,T.statusText=(t||C)+"",l?h.resolveWith(f,[m,C,T]):h.rejectWith(f,[T,C,y]),T.statusCode(g),g=undefined,u&&p.trigger(l?"ajaxSuccess":"ajaxError",[T,c,l?m:y]),d.fireWith(f,[T,C]),u&&(p.trigger("ajaxComplete",[T,c]),--x.active||x.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,undefined,t,"script")}}),x.each(["get","post"],function(e,t){x[t]=function(e,n,r,i){return x.isFunction(n)&&(i=i||r,r=n,n=undefined),x.ajax({url:e,type:t,dataType:i,data:n,success:r})}});function cn(e,t,n){var r,i,o,s,a=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),r===undefined&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}s||(s=i)}o=o||s}return o?(o!==u[0]&&u.unshift(o),n[o]):undefined}function fn(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(s=l[u+" "+o]||l["* "+o],!s)for(i in l)if(a=i.split(" "),a[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){s===!0?s=l[i]:l[i]!==!0&&(o=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(f){return{state:"parsererror",error:s?f:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),x.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=x("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),o.head.appendChild(t[0])},abort:function(){n&&n()}}}});var pn=[],hn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=pn.pop()||x.expando+"_"+Ut++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=t.jsonp!==!1&&(hn.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&hn.test(t.data)&&"data");return a||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=x.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(hn,"$1"+i):t.jsonp!==!1&&(t.url+=(Yt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||x.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,pn.push(i)),s&&x.isFunction(o)&&o(s[0]),s=o=undefined}),"script"):undefined}),x.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var dn=x.ajaxSettings.xhr(),gn={0:200,1223:204},mn=0,yn={};e.ActiveXObject&&x(e).on("unload",function(){for(var e in yn)yn[e]();yn=undefined}),x.support.cors=!!dn&&"withCredentials"in dn,x.support.ajax=dn=!!dn,x.ajaxTransport(function(e){var t;return x.support.cors||dn&&!e.crossDomain?{send:function(n,r){var i,o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)s.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete yn[o],t=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status||404,s.statusText):r(gn[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:undefined,s.getAllResponseHeaders()))}},s.onload=t(),s.onerror=t("error"),t=yn[o=mn++]=t("abort"),s.send(e.hasContent&&e.data||null)},abort:function(){t&&t()}}:undefined});var vn,xn,bn=/^(?:toggle|show|hide)$/,wn=RegExp("^(?:([+-])=|)("+b+")([a-z%]*)$","i"),Tn=/queueHooks$/,Cn=[Dn],kn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=wn.exec(t),s=i.cur(),a=+s||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(x.cssNumber[e]?"":"px"),"px"!==r&&a){a=x.css(i.elem,e,!0)||n||1;do u=u||".5",a/=u,x.style(i.elem,e,a+r);while(u!==(u=i.cur()/s)&&1!==u&&--l)}i.unit=r,i.start=a,i.end=o[1]?a+(o[1]+1)*n:n}return i}]};function Nn(){return setTimeout(function(){vn=undefined}),vn=x.now()}function En(e,t){x.each(t,function(t,n){var r=(kn[t]||[]).concat(kn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function Sn(e,t,n){var r,i,o=0,s=Cn.length,a=x.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=vn||Nn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,s=0,u=l.tweens.length;for(;u>s;s++)l.tweens[s].run(o);return a.notifyWith(e,[l,o,n]),1>o&&u?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:vn||Nn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(jn(c,l.opts.specialEasing);s>o;o++)if(r=Cn[o].call(l,e,c,l.opts))return r;return En(l,c),x.isFunction(l.opts.start)&&l.opts.start.call(e,l),x.fx.timer(x.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function jn(e,t){var n,r,i,o,s;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),s=x.cssHooks[r],s&&"expand"in s){o=s.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(Sn,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],kn[n]=kn[n]||[],kn[n].unshift(t)},prefilter:function(e,t){t?Cn.unshift(e):Cn.push(e)}});function Dn(e,t,n){var r,i,o,s,a,u,l,c,f,p=this,h=e.style,d={},g=[],m=e.nodeType&&At(e);n.queue||(c=x._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,x.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),a=q.get(e,"fxshow");for(r in t)if(o=t[r],bn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show")){if("show"!==o||a===undefined||a[r]===undefined)continue;m=!0}g.push(r)}if(s=g.length){a=q.get(e,"fxshow")||q.access(e,"fxshow",{}),"hidden"in a&&(m=a.hidden),u&&(a.hidden=!m),m?x(e).show():p.done(function(){x(e).hide()}),p.done(function(){var t;q.remove(e,"fxshow");for(t in d)x.style(e,t,d[t])});for(r=0;s>r;r++)i=g[r],l=p.createTween(i,m?a[i]:0),d[i]=a[i]||x.style(e,i),i in a||(a[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function An(e,t,n,r,i){return new An.prototype.init(e,t,n,r,i)}x.Tween=An,An.prototype={constructor:An,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=An.propHooks[this.prop];return e&&e.get?e.get(this):An.propHooks._default.get(this)},run:function(e){var t,n=An.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):An.propHooks._default.set(this),this}},An.prototype.init.prototype=An.prototype,An.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},An.propHooks.scrollTop=An.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(Ln(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(At).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),s=function(){var t=Sn(this,x.extend({},e),o);s.finish=function(){t.stop(!0)},(i||q.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=undefined),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=x.timers,s=q.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&Tn.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=q.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,s=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function Ln(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=St[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:Ln("show"),slideUp:Ln("hide"),slideToggle:Ln("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=An.prototype.init,x.fx.tick=function(){var e,t=x.timers,n=0;for(vn=x.now();t.length>n;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||x.fx.stop(),vn=undefined},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){xn||(xn=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(xn),xn=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===undefined?this:this.each(function(t){x.offset.setOffset(this,e,t)});var t,n,i=this[0],o={top:0,left:0},s=i&&i.ownerDocument;if(s)return t=s.documentElement,x.contains(t,i)?(typeof i.getBoundingClientRect!==r&&(o=i.getBoundingClientRect()),n=qn(s),{top:o.top+n.pageYOffset-t.clientTop,left:o.left+n.pageXOffset-t.clientLeft}):o},x.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l,c=x.css(e,"position"),f=x(e),p={};"static"===c&&(e.style.position="relative"),a=f.offset(),o=x.css(e,"top"),u=x.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1,l?(r=f.position(),s=r.top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),x.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(p.top=t.top-a.top+s),null!=t.left&&(p.left=t.left-a.left+i),"using"in t?t.using.call(e,p):f.css(p)}},x.fn.extend({position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===x.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(r=e.offset()),r.top+=x.css(e[0],"borderTopWidth",!0),r.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-x.css(n,"marginTop",!0),left:t.left-r.left-x.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;x.fn[t]=function(i){return x.access(this,function(t,i,o){var s=qn(t);return o===undefined?s?s[n]:t[i]:(s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o,undefined)},t,i,arguments.length,null)}});function qn(e){return x.isWindow(e)?e:9===e.nodeType&&e.defaultView}x.each({Height:"height",Width:"width"},function(e,t){x.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){x.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(r===!0||i===!0?"margin":"border");return x.access(this,function(t,n,r){var i;return x.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):r===undefined?x.css(t,n,s):x.style(t,n,r,s)},t,o?r:undefined,o,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&"object"==typeof module.exports?module.exports=x:"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=x)})(window);
|
data/bin/leonidas.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
(function(){var m=window.modules||[],n=null;m.leonidas__client=function(){if(null===n){var m=function(l,k){this.id=l;this.lockedState=k;this.activeState={};this.copyState(this.activeState,this.lockedState)};m.prototype.revertState=function(){return this.copyState(this.activeState,this.lockedState)};m.prototype.lockState=function(){return this.copyState(this.lockedState,this.activeState)};m.prototype.copyState=function(l,k){var q,ca,r;for(q in l)delete l[q];r=[];for(q in k)ca=k[q],r.push(l[q]=ca);
|
|
2
|
+
return r};n=m}return n};window.modules=m})();
|
|
3
|
+
(function(){var m=window.modules||[],n=null;m.leonidas__commander=function(){if(null===n){var m,l,k,q,ca;m=require("leonidas/commands/command");l=require("leonidas/commands/organizer");k=require("leonidas/commands/processor");q=require("leonidas/commands/stabilizer");ca=require("leonidas/commands/synchronizer");var r=function(k,q,l,ca){this.organizer=k;this.processor=q;this.stabilizer=l;this.synchronizer=ca;this.pushFrequency=1E3;this.pullFrequency=5E3};r["default"]=function(r,n,m){var V,ka;V=new l;
|
|
4
|
+
n=new k(n);ka=new q(r,V,n);r=new ca(m,r,V,ka);return new this(V,n,ka,r)};r.prototype.startSync=function(){this.pushInterval=setInterval(this.synchronizer.push,this.pushFrequency);return this.pullInterval=setInterval(this.synchronizer.pull,this.pullFrequency)};r.prototype.stopSync=function(){clearInterval(this.pushInterval);return clearInterval(this.pullInterval)};r.prototype.issueCommand=function(k,q){var l;l=new m(k,q);this.organizer.addCommand(l);return this.processor.processCommand(l)};n=r}return n};
|
|
5
|
+
window.modules=m})();(function(){var m=window.modules||[],n=null;m.leonidas__commands__command=function(){if(null===n){var m=function(l,k,q){this.name=l;this.data=k;null==q&&(q=null);this.timestamp=null!=q?q:(new Date).getTime()};m.prototype.toHash=function(){return{name:this.name,data:this.data,timestamp:this.timestamp}};n=m}return n};window.modules=m})();
|
|
6
|
+
(function(){var m=window.modules||[],n=null;m.leonidas__commands__organizer=function(){if(null===n){var m=[].indexOf||function(k){for(var q=0,l=this.length;q<l;q++)if(q in this&&this[q]===k)return q;return-1},l=function(){this.unsyncedCommands=[];this.syncedCommands=[];this.inactiveCommands=[]};l.prototype.addCommand=function(k,q){null==q&&(q=!0);return q?this.unsyncedCommands.push(k):this.syncedCommands.push(k)};l.prototype.addCommands=function(k,q){var l,r,n,m;null==q&&(q=!0);m=[];r=0;for(n=k.length;r<
|
|
7
|
+
n;r++)l=k[r],m.push(this.addCommand(l,q));return m};l.prototype.markAsSynced=function(k){var q,l,r;l=0;for(r=k.length;l<r;l++)q=k[l],0>m.call(this.syncedCommands,q)&&this.syncedCommands.push(q);var n,B;n=this.unsyncedCommands;B=[];l=0;for(r=n.length;l<r;l++)q=n[l],0>m.call(k,q)&&B.push(q);return this.unsyncedCommands=B};l.prototype.markAsInactive=function(k){var l,n,r;n=0;for(r=k.length;n<r;n++)l=k[n],this.inactiveCommands.push(l);var A,B;A=this.syncedCommands;B=[];n=0;for(r=A.length;n<r;n++)l=A[n],
|
|
8
|
+
0>m.call(k,l)&&B.push(l);return this.syncedCommands=B};l.prototype.activeCommands=function(){return this.unsyncedCommands.concat(this.syncedCommands).sort(function(k,l){return k.timestamp>l.timestamp?1:-1})};n=l}return n};window.modules=m})();
|
|
9
|
+
(function(){var m=window.modules||[],n=null;m.leonidas__commands__processor=function(){if(null===n){var m=function(l){this.handlers=l};m.prototype.processCommand=function(l){var k,q,n,r,m;r=this.handlers;m=[];q=0;for(n=r.length;q<n;q++)k=r[q],k.handles(l)?m.push(k.run(l)):m.push(void 0);return m};m.prototype.processCommands=function(l){var k,q,n,m;m=[];q=0;for(n=l.length;q<n;q++)k=l[q],m.push(this.processCommand(k));return m};n=m}return n};window.modules=m})();
|
|
10
|
+
(function(){var m=window.modules||[],n=null;m.leonidas__commands__stabilizer=function(){if(null===n){var m=function(l,k,q){this.client=l;this.organizer=k;this.processor=q};m.prototype.stabilize=function(l){var k,q,n,m,A;m=this.organizer.activeCommands();A=[];q=0;for(n=m.length;q<n;q++)k=m[q],k.timestamp<=l&&A.push(k);this.client.revertState();this.processor.processCommands(A);this.client.lockState();this.organizer.markAsInactive(A);return this.processor.processCommands(this.organizer.activeCommands())};
|
|
11
|
+
n=m}return n};window.modules=m})();
|
|
12
|
+
(function(){var m=window.modules||[],n=null;m.leonidas__commands__synchronizer=function(){if(null===n){var m,l=function(k,l){return function(){return k.apply(l,arguments)}};require("lib/jquery");m=require("leonidas/commands/command");var k=function(k,m,n,A){this.syncUrl=k;this.client=m;this.organizer=n;this.stabilizer=A;this.pull=l(this.pull,this);this.push=l(this.push,this);this.externalClients=[]};k.prototype.push=function(){var k,l=this,m,n,B,J;B=this.organizer.unsyncedCommands;J=[];m=0;for(n=
|
|
13
|
+
B.length;m<n;m++)k=B[m],J.push(k);return $.ajax({url:""+this.syncUrl,method:"POST",data:{clientId:this.client.id,commands:function(){var l,m,n;n=[];l=0;for(m=J.length;l<m;l++)k=J[l],n.push(k.toHash());return n}()},error:function(){return console.log("push error")},success:function(){return l.organizer.markAsSynced(J)}})};k.prototype.pull=function(){var k=this;return $.ajax({url:""+this.syncUrl,method:"GET",data:{clientId:this.client.id,clients:this.externalClients},error:function(){return console.log("pull error")},
|
|
14
|
+
success:function(l){var n;k.externalClients=l.data.currentClients;var A,B,J,Qa;J=l.data.commands;Qa=[];A=0;for(B=J.length;A<B;A++)n=J[A],Qa.push(new m(n.name,n.data,n.timestamp));k.organizer.addCommands(Qa,!1);return k.stabilizer.stabilize(l.data.stableTimestamp)}})};n=k}return n};window.modules=m})();
|
|
15
|
+
(function(){var m=window.modules||[],n=null,V=function(){(function(l,k){function n(a){var b=a.length,c=d.type(a);return d.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||"function"!==c&&(0===b||"number"==typeof b&&0<b&&b-1 in a)}function m(){Object.defineProperty(this.cache={},0,{get:function(){return{}}});this.expando=d.expando+Math.random()}function r(a,b,c){var e;if(c===k&&1===a.nodeType)if(e="data-"+b.replace(jc,"-$1").toLowerCase(),c=a.getAttribute(e),"string"==typeof c){try{c="true"===c?!0:
|
|
16
|
+
"false"===c?!1:"null"===c?null:+c+""===c?+c:kc.test(c)?JSON.parse(c):c}catch(d){}F.set(a,b,c)}else c=k;return c}function A(){return!0}function B(){return!1}function J(){try{return u.activeElement}catch(a){}}function V(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function ka(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return d.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(lc.test(b))return d.filter(b,a,c);b=d.filter(b,a)}return d.grep(a,
|
|
17
|
+
function(a){return 0<=wa.call(b,a)!==c})}function lb(a,b){return d.nodeName(a,"table")&&d.nodeName(1===b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function mc(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function nc(a){var b=oc.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ra(a,b){for(var c=a.length,e=0;c>e;e++)t.set(a[e],"globalEval",!b||t.get(b[e],"globalEval"))}function mb(a,
|
|
18
|
+
b){var c,e,f,g,h,j;if(1===b.nodeType){if(t.hasData(a)&&(c=t.access(a),e=d.extend({},c),j=c.events,t.set(b,e),j))for(f in delete e.handle,e.events={},j){c=0;for(e=j[f].length;e>c;c++)d.event.add(b,f,j[f][c])}F.hasData(a)&&(g=F.access(a),h=d.extend({},g),F.set(b,h))}}function K(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return b===k||b&&d.nodeName(a,b)?d.merge([a],c):c}function nb(a,b){if(b in a)return b;for(var c=b.charAt(0).toUpperCase()+
|
|
19
|
+
b.slice(1),e=b,d=ob.length;d--;)if(b=ob[d]+c,b in a)return b;return e}function pa(a,b){return a=b||a,"none"===d.css(a,"display")||!d.contains(a.ownerDocument,a)}function pb(a,b){for(var c,e,f,g=[],h=0,j=a.length;j>h;h++)e=a[h],e.style&&(g[h]=t.get(e,"olddisplay"),c=e.style.display,b?(g[h]||"none"!==c||(e.style.display=""),""===e.style.display&&pa(e)&&(g[h]=t.access(e,"olddisplay",pc(e.nodeName)))):g[h]||(f=pa(e),(c&&"none"!==c||!f)&&t.set(e,"olddisplay",f?c:d.css(e,"display"))));for(h=0;j>h;h++)e=
|
|
20
|
+
a[h],e.style&&(b&&"none"!==e.style.display&&""!==e.style.display||(e.style.display=b?g[h]||"":"none"));return a}function qb(a,b,c){return(a=qc.exec(b))?Math.max(0,a[1]-(c||0))+(a[2]||"px"):b}function rb(a,b,c,e,f){b=c===(e?"border":"content")?4:"width"===b?1:0;for(var g=0;4>b;b+=2)"margin"===c&&(g+=d.css(a,c+da[b],!0,f)),e?("content"===c&&(g-=d.css(a,"padding"+da[b],!0,f)),"margin"!==c&&(g-=d.css(a,"border"+da[b]+"Width",!0,f))):(g+=d.css(a,"padding"+da[b],!0,f),"padding"!==c&&(g+=d.css(a,"border"+
|
|
21
|
+
da[b]+"Width",!0,f)));return g}function sb(a,b,c){var e=!0,f="width"===b?a.offsetWidth:a.offsetHeight,g=l.getComputedStyle(a,null),h=d.support.boxSizing&&"border-box"===d.css(a,"boxSizing",!1,g);if(0>=f||null==f){if(f=la(a,b,g),(0>f||null==f)&&(f=a.style[b]),Sa.test(f))return f;e=h&&(d.support.boxSizingReliable||f===a.style[b]);f=parseFloat(f)||0}return f+rb(a,b,c||(h?"border":"content"),e,g)+"px"}function pc(a){var b=u,c=tb[a];return c||(c=ub(a,b),"none"!==c&&c||(qa=(qa||d("<iframe frameborder='0' width='0' height='0'/>").css("cssText",
|
|
22
|
+
"display:block !important")).appendTo(b.documentElement),b=(qa[0].contentWindow||qa[0].contentDocument).document,b.write("<!doctype html><html><body>"),b.close(),c=ub(a,b),qa.detach()),tb[a]=c),c}function ub(a,b){var c=d(b.createElement(a)).appendTo(b.body),e=d.css(c[0],"display");return c.remove(),e}function Ta(a,b,c,e){var f;if(d.isArray(b))d.each(b,function(b,d){c||rc.test(a)?e(a,d):Ta(a+"["+("object"==typeof d?b:"")+"]",d,c,e)});else if(c||"object"!==d.type(b))e(a,b);else for(f in b)Ta(a+"["+
|
|
23
|
+
f+"]",b[f],c,e)}function vb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var e,f=0,g=b.toLowerCase().match(R)||[];if(d.isFunction(c))for(;e=g[f++];)"+"===e[0]?(e=e.slice(1)||"*",(a[e]=a[e]||[]).unshift(c)):(a[e]=a[e]||[]).push(c)}}function wb(a,b,c,e){function f(j){var s;return g[j]=!0,d.each(a[j]||[],function(a,d){var j=d(b,c,e);return"string"!=typeof j||h||g[j]?h?!(s=j):k:(b.dataTypes.unshift(j),f(j),!1)}),s}var g={},h=a===Ua;return f(b.dataTypes[0])||!g["*"]&&f("*")}function Va(a,b){var c,
|
|
24
|
+
e,f=d.ajaxSettings.flatOptions||{};for(c in b)b[c]!==k&&((f[c]?a:e||(e={}))[c]=b[c]);return e&&d.extend(!0,a,e),a}function xb(){return setTimeout(function(){ma=k}),ma=d.now()}function yb(a,b,c){var e,f,g=0,h=xa.length,j=d.Deferred().always(function(){delete s.elem}),s=function(){if(f)return!1;for(var b=ma||xb(),b=Math.max(0,x.startTime+x.duration-b),c=1-(b/x.duration||0),e=0,d=x.tweens.length;d>e;e++)x.tweens[e].run(c);return j.notifyWith(a,[x,c,b]),1>c&&d?b:(j.resolveWith(a,[x]),!1)},x=j.promise({elem:a,
|
|
25
|
+
props:d.extend({},b),opts:d.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:ma||xb(),duration:c.duration,tweens:[],createTween:function(b,c){var e=d.Tween(a,x.opts,b,c,x.opts.specialEasing[b]||x.opts.easing);return x.tweens.push(e),e},stop:function(b){var c=0,e=b?x.tweens.length:0;if(f)return this;for(f=!0;e>c;c++)x.tweens[c].run(1);return b?j.resolveWith(a,[x,b]):j.rejectWith(a,[x,b]),this}});b=x.props;c=x.opts.specialEasing;var k,p,l,m;for(e in b)if(k=d.camelCase(e),
|
|
26
|
+
p=c[k],l=b[e],d.isArray(l)&&(p=l[1],l=b[e]=l[0]),e!==k&&(b[k]=l,delete b[e]),m=d.cssHooks[k],m&&"expand"in m)for(e in l=m.expand(l),delete b[k],l)e in b||(b[e]=l[e],c[e]=p);else c[k]=p;for(;h>g;g++)if(e=xa[g].call(x,a,b,x.opts))return e;var n=x;d.each(b,function(a,b){for(var c=(ra[a]||[]).concat(ra["*"]),e=0,d=c.length;d>e&&!c[e].call(n,a,b);e++);});return d.isFunction(x.opts.start)&&x.opts.start.call(a,x),d.fx.timer(d.extend(s,{elem:a,anim:x,queue:x.opts.queue})),x.progress(x.opts.progress).done(x.opts.done,
|
|
27
|
+
x.opts.complete).fail(x.opts.fail).always(x.opts.always)}function I(a,b,c,e,d){return new I.prototype.init(a,b,c,e,d)}function ya(a,b){var c,e={height:a},d=0;for(b=b?1:0;4>d;d+=2-b)c=da[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}var zb,za,Aa=typeof k,tc=l.location,u=l.document,Ab=u.documentElement,uc=l.jQuery,vc=l.$,Ba={},Ca=[],Bb=Ca.concat,Wa=Ca.push,ea=Ca.slice,wa=Ca.indexOf,wc=Ba.toString,Xa=Ba.hasOwnProperty,xc="2.0.0".trim,d=function(a,b){return new d.fn.init(a,b,zb)},
|
|
28
|
+
Da=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=/\S+/g,yc=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,Cb=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,zc=/^-ms-/,Ac=/-([\da-z])/gi,Bc=function(a,b){return b.toUpperCase()},Ea=function(){u.removeEventListener("DOMContentLoaded",Ea,!1);l.removeEventListener("load",Ea,!1);d.ready()};d.fn=d.prototype={jquery:"2.0.0",constructor:d,init:function(a,b,c){var e,f;if(!a)return this;if("string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&3<=a.length?[null,a,null]:
|
|
29
|
+
yc.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof d?b[0]:b,d.merge(this,d.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:u,!0)),Cb.test(e[1])&&d.isPlainObject(b))for(e in b)d.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=u.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=u,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):d.isFunction(a)?c.ready(a):
|
|
30
|
+
(a.selector!==k&&(this.selector=a.selector,this.context=a.context),d.makeArray(a,this))},selector:"",length:0,toArray:function(){return ea.call(this)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a){a=d.merge(this.constructor(),a);return a.prevObject=this,a.context=this.context,a},each:function(a,b){return d.each(this,a,b)},ready:function(a){return d.ready.promise().done(a),this},slice:function(){return this.pushStack(ea.apply(this,arguments))},
|
|
31
|
+
first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length;a=+a+(0>a?b:0);return this.pushStack(0<=a&&b>a?[this[a]]:[])},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:Wa,sort:[].sort,splice:[].splice};d.fn.init.prototype=d.fn;d.extend=d.fn.extend=function(){var a,b,c,e,f,g,h=arguments[0]||{},j=1,s=arguments.length,x=!1;"boolean"==typeof h&&(x=
|
|
32
|
+
h,h=arguments[1]||{},j=2);"object"==typeof h||d.isFunction(h)||(h={});for(s===j&&(h=this,--j);s>j;j++)if(null!=(a=arguments[j]))for(b in a)c=h[b],e=a[b],h!==e&&(x&&e&&(d.isPlainObject(e)||(f=d.isArray(e)))?(f?(f=!1,g=c&&d.isArray(c)?c:[]):g=c&&d.isPlainObject(c)?c:{},h[b]=d.extend(x,g,e)):e!==k&&(h[b]=e));return h};d.extend({expando:"jQuery"+("2.0.0"+Math.random()).replace(/\D/g,""),noConflict:function(a){return l.$===d&&(l.$=vc),a&&l.jQuery===d&&(l.jQuery=uc),d},isReady:!1,readyWait:1,holdReady:function(a){a?
|
|
33
|
+
d.readyWait++:d.ready(!0)},ready:function(a){(!0===a?--d.readyWait:d.isReady)||(d.isReady=!0,!0!==a&&0<--d.readyWait||(za.resolveWith(u,[d]),d.fn.trigger&&d(u).trigger("ready").off("ready")))},isFunction:function(a){return"function"===d.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?Ba[wc.call(a)]||"object":typeof a},isPlainObject:function(a){if("object"!==
|
|
34
|
+
d.type(a)||a.nodeType||d.isWindow(a))return!1;try{if(a.constructor&&!Xa.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw Error(a);},parseHTML:function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1);b=b||u;var e=Cb.exec(a);c=!c&&[];return e?[b.createElement(e[1])]:(e=d.buildFragment([a],b,c),c&&d(c).remove(),d.merge([],e.childNodes))},parseJSON:JSON.parse,
|
|
35
|
+
parseXML:function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(e){b=k}return(!b||b.getElementsByTagName("parsererror").length)&&d.error("Invalid XML: "+a),b},noop:function(){},globalEval:function(a){var b,c=eval;(a=d.trim(a))&&(1===a.indexOf("use strict")?(b=u.createElement("script"),b.text=a,u.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(zc,"ms-").replace(Ac,Bc)},nodeName:function(a,b){return a.nodeName&&
|
|
36
|
+
a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var e,d=0,g=a.length,h=n(a);if(c)if(h)for(;g>d&&!(e=b.apply(a[d],c),!1===e);d++);else for(d in a){if(e=b.apply(a[d],c),!1===e)break}else if(h)for(;g>d&&!(e=b.call(a[d],d,a[d]),!1===e);d++);else for(d in a)if(e=b.call(a[d],d,a[d]),!1===e)break;return a},trim:function(a){return null==a?"":xc.call(a)},makeArray:function(a,b){var c=b||[];return null!=a&&(n(Object(a))?d.merge(c,"string"==typeof a?[a]:a):Wa.call(c,a)),c},inArray:function(a,
|
|
37
|
+
b,c){return null==b?-1:wa.call(b,a,c)},merge:function(a,b){var c=b.length,e=a.length,d=0;if("number"==typeof c)for(;c>d;d++)a[e++]=b[d];else for(;b[d]!==k;)a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){var e,d=[],g=0,h=a.length;for(c=!!c;h>g;g++)e=!!b(a[g],g),c!==e&&d.push(a[g]);return d},map:function(a,b,c){var e,d=0,g=a.length,h=[];if(n(a))for(;g>d;d++)e=b(a[d],d,c),null!=e&&(h[h.length]=e);else for(d in a)e=b(a[d],d,c),null!=e&&(h[h.length]=e);return Bb.apply([],h)},guid:1,proxy:function(a,
|
|
38
|
+
b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),d.isFunction(a)?(e=ea.call(arguments,2),f=function(){return a.apply(b||this,e.concat(ea.call(arguments)))},f.guid=a.guid=a.guid||d.guid++,f):k},access:function(a,b,c,e,f,g,h){var j=0,s=a.length,x=null==c;if("object"===d.type(c))for(j in f=!0,c)d.access(a,b,j,c[j],!0,g,h);else if(e!==k&&(f=!0,d.isFunction(e)||(h=!0),x&&(h?(b.call(a,e),b=null):(x=b,b=function(a,b,c){return x.call(d(a),c)})),b))for(;s>j;j++)b(a[j],c,h?e:e.call(a[j],j,b(a[j],c)));
|
|
39
|
+
return f?a:x?b.call(a):s?b(a[0],c):g},now:Date.now,swap:function(a,b,c,e){var d,g={};for(d in b)g[d]=a.style[d],a.style[d]=b[d];c=c.apply(a,e||[]);for(d in b)a.style[d]=g[d];return c}});d.ready.promise=function(a){return za||(za=d.Deferred(),"complete"===u.readyState?setTimeout(d.ready):(u.addEventListener("DOMContentLoaded",Ea,!1),l.addEventListener("load",Ea,!1))),za.promise(a)};d.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){Ba["[object "+b+"]"]=
|
|
40
|
+
b.toLowerCase()});zb=d(u);var Ya=l,Za=function(){var a,b=[];return a=function(c,e){return b.push(c+=" ")>v.cacheLength&&delete a[b.shift()],a[c]=e}},P=function(a){return a[E]=!0,a},S=function(a){var b=C.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b)}},w=function(a,b,c,e){var d,g,h,j,s;if((b?b.ownerDocument||b:W)!==C&&na(b),b=b||C,c=c||[],!a||"string"!=typeof a)return c;if(1!==(j=b.nodeType)&&9!==j)return[];if(Q&&!e){if(d=Cc.exec(a))if(h=d[1])if(9===
|
|
41
|
+
j){if(g=b.getElementById(h),!g||!g.parentNode)return c;if(g.id===h)return c.push(g),c}else{if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&sa(b,g)&&g.id===h)return c.push(g),c}else{if(d[2])return X.apply(c,b.getElementsByTagName(a)),c;if((h=d[3])&&D.getElementsByClassName&&b.getElementsByClassName)return X.apply(c,b.getElementsByClassName(h)),c}if(D.qsa&&(!G||!G.test(a))){if(g=d=E,h=b,s=9===j&&a,1===j&&"object"!==b.nodeName.toLowerCase()){j=Fa(a);(d=b.getAttribute("id"))?g=d.replace(Dc,
|
|
42
|
+
"\\$&"):b.setAttribute("id",g);g="[id='"+g+"'] ";for(h=j.length;h--;)j[h]=g+Ga(j[h]);h=$a.test(a)&&b.parentNode||b;s=j.join(",")}if(s)try{return X.apply(c,h.querySelectorAll(s)),c}catch(k){}finally{d||b.removeAttribute("id")}}}var y;a:{a=a.replace(Ha,"$1");var p,l;g=Fa(a);if(!e&&1===g.length){if(y=g[0]=g[0].slice(0),2<y.length&&"ID"===(p=y[0]).type&&9===b.nodeType&&Q&&v.relative[y[1].type]){if(b=(v.find.ID(p.matches[0].replace(Y,Z),b)||[])[0],!b){y=c;break a}a=a.slice(y.shift().value.length)}for(j=
|
|
43
|
+
Ia.needsContext.test(a)?0:y.length;j--&&!(p=y[j],v.relative[d=p.type]);)if((l=v.find[d])&&(e=l(p.matches[0].replace(Y,Z),$a.test(y[0].type)&&b.parentNode||b))){if(y.splice(j,1),a=e.length&&Ga(y),!a){y=(X.apply(c,e),c);break a}break}}y=(ab(a,g)(e,b,!Q,c,$a.test(a)),c)}return y},Eb=function(a,b){var c=b&&a,e=c&&(~b.sourceIndex||Db)-(~a.sourceIndex||Db);if(e)return e;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1},Ec=function(a,b,c){var e;return c?void 0:(e=a.getAttributeNode(b))&&e.specified?
|
|
44
|
+
e.value:!0===a[b]?b.toLowerCase():null},Fc=function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)},Gc=function(a){return function(b){return"input"===b.nodeName.toLowerCase()&&b.type===a}},Hc=function(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}},fa=function(a){return P(function(b){return b=+b,P(function(c,e){for(var d,g=a([],c.length,b),h=g.length;h--;)c[d=g[h]]&&(c[d]=!(e[d]=c[d]))})})},Fa=function(a,b){var c,e,d,g,h,
|
|
45
|
+
j,s;if(h=Fb[a+" "])return b?0:h.slice(0);h=a;j=[];for(s=v.preFilter;h;){(!c||(e=Ic.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),j.push(d=[]));c=!1;(e=Jc.exec(h))&&(c=e.shift(),d.push({value:c,type:e[0].replace(Ha," ")}),h=h.slice(c.length));for(g in v.filter)!(e=Ia[g].exec(h))||s[g]&&!(e=s[g](e))||(c=e.shift(),d.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?w.error(a):Fb(a,j).slice(0)},Ga=function(a){for(var b=0,c=a.length,e="";c>b;b++)e+=a[b].value;return e},
|
|
46
|
+
bb=function(a,b,c){var e=b.dir,d=c&&"parentNode"===e,g=Kc++;return b.first?function(b,c,g){for(;b=b[e];)if(1===b.nodeType||d)return a(b,c,g)}:function(b,c,s){var k,y,p,l=T+" "+g;if(s)for(;b=b[e];){if((1===b.nodeType||d)&&a(b,c,s))return!0}else for(;b=b[e];)if(1===b.nodeType||d)if(p=b[E]||(b[E]={}),(y=p[e])&&y[0]===l){if(!0===(k=y[1])||k===Ja)return!0===k}else if(y=p[e]=[l],y[1]=a(b,c,s)||Ja,!0===y[1])return!0}},cb=function(a){return 1<a.length?function(b,c,e){for(var d=a.length;d--;)if(!a[d](b,c,
|
|
47
|
+
e))return!1;return!0}:a[0]},Ka=function(a,b,c,e,d){for(var g,h=[],j=0,s=a.length,k=null!=b;s>j;j++)(g=a[j])&&(!c||c(g,e,d))&&(h.push(g),k&&b.push(j));return h},db=function(a,b,c,e,d,g){return e&&!e[E]&&(e=db(e)),d&&!d[E]&&(d=db(d,g)),P(function(g,j,s,k){var y,p,l=[],m=[],n=j.length,q;if(!(q=g)){q=b||"*";for(var H=s.nodeType?[s]:s,t=[],r=0,v=H.length;v>r;r++)w(q,H[r],t);q=t}q=!a||!g&&b?q:Ka(q,l,a,s,k);H=c?d||(g?a:n||e)?[]:j:q;if(c&&c(q,H,s,k),e){y=Ka(H,m);e(y,[],s,k);for(s=y.length;s--;)(p=y[s])&&
|
|
48
|
+
(H[m[s]]=!(q[m[s]]=p))}if(g){if(d||a){if(d){y=[];for(s=H.length;s--;)(p=H[s])&&y.push(q[s]=p);d(null,H=[],y,k)}for(s=H.length;s--;)(p=H[s])&&-1<(y=d?ga.call(g,p):l[s])&&(g[y]=!(j[y]=p))}}else H=Ka(H===j?H.splice(n,H.length):H),d?d(null,j,H,k):X.apply(j,H)})},eb=function(a){var b,c,e,d=a.length,g=v.relative[a[0].type];c=g||v.relative[" "];for(var h=g?1:0,j=bb(function(a){return a===b},c,!0),s=bb(function(a){return-1<ga.call(b,a)},c,!0),k=[function(a,c,e){return!g&&(e||c!==La)||((b=c).nodeType?j(a,
|
|
49
|
+
c,e):s(a,c,e))}];d>h;h++)if(c=v.relative[a[h].type])k=[bb(cb(k),c)];else{if(c=v.filter[a[h].type].apply(null,a[h].matches),c[E]){for(e=++h;d>e&&!v.relative[a[e].type];e++);return db(1<h&&cb(k),1<h&&Ga(a.slice(0,h-1)).replace(Ha,"$1"),c,e>h&&eb(a.slice(h,e)),d>e&&eb(a=a.slice(e)),d>e&&Ga(a))}k.push(c)}return cb(k)},Gb=function(){},oa,Ja,v,Ma,Hb,ab,La,ha,na,C,U,Q,G,ia,Na,sa,E="sizzle"+-new Date,W=Ya.document,D={},T=0,Kc=0,Ib=Za(),Fb=Za(),Jb=Za(),ta=!1,Oa=function(){return 0},Db=-2147483648,aa=[],Lc=
|
|
50
|
+
aa.pop,Mc=aa.push,X=aa.push,Kb=aa.slice,ga=aa.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},Lb="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w","w#"),Mb="\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)[\\x20\\t\\r\\n\\f]*(?:([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+Lb+")|)|)[\\x20\\t\\r\\n\\f]*\\]",fb=":((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+Mb.replace(3,8)+")*)|.*)\\)|)",
|
|
51
|
+
Ha=/^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$/g,Ic=/^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/,Jc=/^[\x20\t\r\n\f]*([>+~]|[\x20\t\r\n\f])[\x20\t\r\n\f]*/,$a=/[\x20\t\r\n\f]*[+~]/,Nc=/=[\x20\t\r\n\f]*([^\]'"]*)[\x20\t\r\n\f]*\]/g,Oc=RegExp(fb),Pc=RegExp("^"+Lb+"$"),Ia={ID:/^#((?:\\.|[\w-]|[^\x00-\xa0])+)/,CLASS:/^\.((?:\\.|[\w-]|[^\x00-\xa0])+)/,TAG:RegExp("^("+"(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w","w*")+")"),ATTR:RegExp("^"+Mb),PSEUDO:RegExp("^"+fb),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)",
|
|
52
|
+
"i"),"boolean":RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},gb=/^[^{]+\{\s*\[native \w/,Cc=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Qc=/^(?:input|select|textarea|button)$/i,Rc=/^h\d$/i,Dc=/'|\\/g,Y=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Z=function(a,
|
|
53
|
+
b){var c="0x"+b-65536;return c!==c?b:0>c?String.fromCharCode(c+65536):String.fromCharCode(55296|c>>10,56320|1023&c)};try{X.apply(aa=Kb.call(W.childNodes),W.childNodes),aa[W.childNodes.length].nodeType}catch(qd){X={apply:aa.length?function(a,b){Mc.apply(a,Kb.call(b))}:function(a,b){for(var c=a.length,e=0;a[c++]=b[e++];);a.length=c-1}}}Hb=w.isXML=function(a){return(a=a&&(a.ownerDocument||a).documentElement)?"HTML"!==a.nodeName:!1};na=w.setDocument=function(a){var b=a?a.ownerDocument||a:W;if(b!==C&&
|
|
54
|
+
9===b.nodeType&&b.documentElement){C=b;U=b.documentElement;Q=!Hb(b);D.getElementsByTagName=S(function(a){return a.appendChild(b.createComment("")),!a.getElementsByTagName("*").length});D.attributes=S(function(a){return a.className="i",!a.getAttribute("className")});D.getElementsByClassName=S(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length});D.sortDetached=S(function(a){return 1&a.compareDocumentPosition(C.createElement("div"))});
|
|
55
|
+
D.getById=S(function(a){return U.appendChild(a).id=E,!b.getElementsByName||!b.getElementsByName(E).length});D.getById?(v.find.ID=function(a,b){if("undefined"!==typeof b.getElementById&&Q){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},v.filter.ID=function(a){var b=a.replace(Y,Z);return function(a){return a.getAttribute("id")===b}}):(v.find.ID=function(a,b){if("undefined"!==typeof b.getElementById&&Q){var c=b.getElementById(a);return c?c.id===a||"undefined"!==typeof c.getAttributeNode&&
|
|
56
|
+
c.getAttributeNode("id").value===a?[c]:void 0:[]}},v.filter.ID=function(a){var b=a.replace(Y,Z);return function(a){return(a="undefined"!==typeof a.getAttributeNode&&a.getAttributeNode("id"))&&a.value===b}});v.find.TAG=D.getElementsByTagName?function(a,b){return"undefined"!==typeof b.getElementsByTagName?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],j=0,s=b.getElementsByTagName(a);if("*"===a){for(;c=s[j++];)1===c.nodeType&&d.push(c);return d}return s};v.find.CLASS=D.getElementsByClassName&&
|
|
57
|
+
function(a,b){return"undefined"!==typeof b.getElementsByClassName&&Q?b.getElementsByClassName(a):void 0};ia=[];G=[];(D.qsa=gb.test(b.querySelectorAll+""))&&(S(function(a){a.innerHTML="<select><option selected=''></option></select>";a.querySelectorAll("[selected]").length||G.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)");a.querySelectorAll(":checked").length||G.push(":checked")}),S(function(a){var b=
|
|
58
|
+
C.createElement("input");b.setAttribute("type","hidden");a.appendChild(b).setAttribute("t","");a.querySelectorAll("[t^='']").length&&G.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")");a.querySelectorAll(":enabled").length||G.push(":enabled",":disabled");a.querySelectorAll("*,:x");G.push(",.*:")}));a=D;var c;c=Na=U.webkitMatchesSelector||U.mozMatchesSelector||U.oMatchesSelector||U.msMatchesSelector;c=gb.test(c+"");a=((a.matchesSelector=c)&&S(function(a){D.disconnectedMatch=Na.call(a,"div");Na.call(a,
|
|
59
|
+
"[s!='']:x");ia.push("!=",fb)}),G=G.length&&RegExp(G.join("|")),ia=ia.length&&RegExp(ia.join("|")),sa=gb.test(U.contains+"")||U.compareDocumentPosition?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},Oa=U.compareDocumentPosition?function(a,c){if(a===c)return ta=!0,0;var d=c.compareDocumentPosition&&
|
|
60
|
+
a.compareDocumentPosition&&a.compareDocumentPosition(c);return d?1&d||!D.sortDetached&&c.compareDocumentPosition(a)===d?a===b||sa(W,a)?-1:c===b||sa(W,c)?1:ha?ga.call(ha,a)-ga.call(ha,c):0:4&d?-1:1:a.compareDocumentPosition?-1:1}:function(a,c){var d,h=0;d=a.parentNode;var j=c.parentNode,s=[a],k=[c];if(a===c)return ta=!0,0;if(!d||!j)return a===b?-1:c===b?1:d?-1:j?1:ha?ga.call(ha,a)-ga.call(ha,c):0;if(d===j)return Eb(a,c);for(d=a;d=d.parentNode;)s.unshift(d);for(d=c;d=d.parentNode;)k.unshift(d);for(;s[h]===
|
|
61
|
+
k[h];)h++;return h?Eb(s[h],k[h]):s[h]===W?-1:k[h]===W?1:0},C)}else a=C;return a};w.matches=function(a,b){return w(a,null,null,b)};w.matchesSelector=function(a,b){if((a.ownerDocument||a)!==C&&na(a),b=b.replace(Nc,"='$1']"),!(!D.matchesSelector||!Q||ia&&ia.test(b)||G&&G.test(b)))try{var c=Na.call(a,b);if(c||D.disconnectedMatch||a.document&&11!==a.document.nodeType)return c}catch(d){}return 0<w(b,C,null,[a]).length};w.contains=function(a,b){return(a.ownerDocument||a)!==C&&na(a),sa(a,b)};w.attr=function(a,
|
|
62
|
+
b){(a.ownerDocument||a)!==C&&na(a);var c=v.attrHandle[b.toLowerCase()],c=c&&c(a,b,!Q);return void 0===c?D.attributes||!Q?a.getAttribute(b):(c=a.getAttributeNode(b))&&c.specified?c.value:null:c};w.error=function(a){throw Error("Syntax error, unrecognized expression: "+a);};w.uniqueSort=function(a){var b,c=[],d=0,f=0;if(ta=!D.detectDuplicates,ha=!D.sortStable&&a.slice(0),a.sort(Oa),ta){for(;b=a[f++];)b===a[f]&&(d=c.push(f));for(;d--;)a.splice(c[d],1)}return a};Ma=w.getText=function(a){var b,c="",d=
|
|
63
|
+
0;if(b=a.nodeType)if(1===b||9===b||11===b){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=Ma(a)}else{if(3===b||4===b)return a.nodeValue}else for(;b=a[d];d++)c+=Ma(b);return c};v=w.selectors={cacheLength:50,createPseudo:P,match:Ia,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(Y,Z),a[3]=(a[4]||
|
|
64
|
+
a[5]||"").replace(Y,Z),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||w.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&w.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return Ia.CHILD.test(a[0])?null:(a[4]?a[2]=a[4]:c&&Oc.test(c)&&(b=Fa(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=
|
|
65
|
+
a.replace(Y,Z).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=Ib[a+" "];return b||(b=RegExp("(^|[\\x20\\t\\r\\n\\f])"+a+"([\\x20\\t\\r\\n\\f]|$)"))&&Ib(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!==typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){d=w.attr(d,a);return null==d?"!="===b:b?(d+="","="===b?d===c:"!="===b?d!==c:"^="===
|
|
66
|
+
b?c&&0===d.indexOf(c):"*="===b?c&&-1<d.indexOf(c):"$="===b?c&&d.slice(-c.length)===c:"~="===b?-1<(" "+d+" ").indexOf(c):"|="===b?d===c||d.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,f){var g="nth"!==a.slice(0,3),h="last"!==a.slice(-4),j="of-type"===b;return 1===d&&0===f?function(a){return!!a.parentNode}:function(b,c,k){var p,l,m,n,q;c=g!==h?"nextSibling":"previousSibling";var H=b.parentNode,t=j&&b.nodeName.toLowerCase();k=!k&&!j;if(H){if(g){for(;c;){for(l=b;l=l[c];)if(j?l.nodeName.toLowerCase()===
|
|
67
|
+
t:1===l.nodeType)return!1;q=c="only"===a&&!q&&"nextSibling"}return!0}if(q=[h?H.firstChild:H.lastChild],h&&k){k=H[E]||(H[E]={});p=k[a]||[];n=p[0]===T&&p[1];m=p[0]===T&&p[2];for(l=n&&H.childNodes[n];l=++n&&l&&l[c]||(m=n=0)||q.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[T,n,m];break}}else if(k&&(p=(b[E]||(b[E]={}))[a])&&p[0]===T)m=p[1];else for(;(l=++n&&l&&l[c]||(m=n=0)||q.pop())&&(!(j?l.nodeName.toLowerCase()===t:1===l.nodeType)||!++m||!(k&&((l[E]||(l[E]={}))[a]=[T,m]),l===b)););return m-=f,m===d||
|
|
68
|
+
0===m%d&&0<=m/d}}},PSEUDO:function(a,b){var c,d=v.pseudos[a]||v.setFilters[a.toLowerCase()]||w.error("unsupported pseudo: "+a);return d[E]?d(b):1<d.length?(c=[a,a,"",b],v.setFilters.hasOwnProperty(a.toLowerCase())?P(function(a,c){for(var h,j=d(a,b),k=j.length;k--;)h=ga.call(a,j[k]),a[h]=!(c[h]=j[k])}):function(a){return d(a,0,c)}):d}},pseudos:{not:P(function(a){var b=[],c=[],d=ab(a.replace(Ha,"$1"));return d[E]?P(function(a,b,c,j){var k;c=d(a,null,j,[]);for(j=a.length;j--;)(k=c[j])&&(a[j]=!(b[j]=
|
|
69
|
+
k))}):function(a,g,h){return b[0]=a,d(b,null,h,c),!c.pop()}}),has:P(function(a){return function(b){return 0<w(a,b).length}}),contains:P(function(a){return function(b){return-1<(b.textContent||b.innerText||Ma(b)).indexOf(a)}}),lang:P(function(a){return Pc.test(a||"")||w.error("unsupported lang: "+a),a=a.replace(Y,Z).toLowerCase(),function(b){var c;do if(c=Q?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);
|
|
70
|
+
return!1}}),target:function(a){var b=Ya.location&&Ya.location.hash;return b&&b.slice(1)===a.id},root:function(a){return a===U},focus:function(a){return a===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!(!a.type&&!a.href&&!~a.tabIndex)},enabled:function(a){return!1===a.disabled},disabled:function(a){return!0===a.disabled},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,
|
|
71
|
+
!0===a.selected},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if("@"<a.nodeName||3===a.nodeType||4===a.nodeType)return!1;return!0},parent:function(a){return!v.pseudos.empty(a)},header:function(a){return Rc.test(a.nodeName)},input:function(a){return Qc.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||b.toLowerCase()===
|
|
72
|
+
a.type)},first:fa(function(){return[0]}),last:fa(function(a,b){return[b-1]}),eq:fa(function(a,b,c){return[0>c?c+b:c]}),even:fa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:fa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:fa(function(a,b,c){for(b=0>c?c+b:c;0<=--b;)a.push(b);return a}),gt:fa(function(a,b,c){for(c=0>c?c+b:c;b>++c;)a.push(c);return a})}};for(oa in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})v.pseudos[oa]=Gc(oa);for(oa in{submit:!0,reset:!0})v.pseudos[oa]=
|
|
73
|
+
Hc(oa);ab=w.compile=function(a,b){var c,d=[],f=[],g=Jb[a+" "];if(!g){b||(b=Fa(a));for(c=b.length;c--;)g=eb(b[c]),g[E]?d.push(g):f.push(g);var h=0,j=0<d.length,k=0<f.length;c=function(a,b,c,g,l){var m,n,q=[],t=0,r="0",u=a&&[],B=null!=l,z=La,D=a||k&&v.find.TAG("*",l&&b.parentNode||b),Nb=T+=null==z?1:Math.random()||0.1;for(B&&(La=b!==C&&b,Ja=h);null!=(l=D[r]);r++){if(k&&l){for(m=0;n=f[m++];)if(n(l,b,c)){g.push(l);break}B&&(T=Nb,Ja=++h)}j&&((l=!n&&l)&&t--,a&&u.push(l))}if(t+=r,j&&r!==t){for(m=0;n=d[m++];)n(u,
|
|
74
|
+
q,b,c);if(a){if(0<t)for(;r--;)u[r]||q[r]||(q[r]=Lc.call(g));q=Ka(q)}X.apply(g,q);B&&!a&&0<q.length&&1<t+d.length&&w.uniqueSort(g)}return B&&(T=Nb,La=z),u};c=j?P(c):c;g=Jb(a,c)}return g};v.pseudos.nth=v.pseudos.eq;Gb.prototype=v.filters=v.pseudos;v.setFilters=new Gb;D.sortStable=E.split("").sort(Oa).join("")===E;na();[0,0].sort(Oa);D.detectDuplicates=ta;S(function(a){if(a.innerHTML="<a href='#'></a>","#"!==a.firstChild.getAttribute("href")){a=["type","href","height","width"];for(var b=a.length;b--;)v.attrHandle[a[b]]=
|
|
75
|
+
Fc}});S(function(a){if(null!=a.getAttribute("disabled")){a="checked selected async autofocus autoplay controls defer disabled hidden ismap loop multiple open readonly required scoped".split(" ");for(var b=a.length;b--;)v.attrHandle[a[b]]=Ec}});d.find=w;d.expr=w.selectors;d.expr[":"]=d.expr.pseudos;d.unique=w.uniqueSort;d.text=w.getText;d.isXMLDoc=w.isXML;d.contains=w.contains;var Ob={};d.Callbacks=function(a){var b;if("string"==typeof a){if(!(b=Ob[a])){b=a;var c=Ob[b]={};b=(d.each(b.match(R)||[],
|
|
76
|
+
function(a,b){c[b]=!0}),c)}}else b=d.extend({},a);a=b;var e,f,g,h,j,s,l=[],m=!a.once&&[],p=function(b){e=a.memory&&b;f=!0;s=h||0;h=0;j=l.length;for(g=!0;l&&j>s;s++)if(!1===l[s].apply(b[0],b[1])&&a.stopOnFalse){e=!1;break}g=!1;l&&(m?m.length&&p(m.shift()):e?l=[]:n.disable())},n={add:function(){if(l){var b=l.length;(function sc(b){d.each(b,function(b,c){var e=d.type(c);"function"===e?a.unique&&n.has(c)||l.push(c):c&&c.length&&"string"!==e&&sc(c)})})(arguments);g?j=l.length:e&&(h=b,p(e))}return this},
|
|
77
|
+
remove:function(){return l&&d.each(arguments,function(a,b){for(var c;-1<(c=d.inArray(b,l,c));)l.splice(c,1),g&&(j>=c&&j--,s>=c&&s--)}),this},has:function(a){return a?-1<d.inArray(a,l):!(!l||!l.length)},empty:function(){return l=[],j=0,this},disable:function(){return l=m=e=k,this},disabled:function(){return!l},lock:function(){return m=k,e||n.disable(),this},locked:function(){return!m},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],!l||f&&!m||(g?m.push(b):p(b)),this},fire:function(){return n.fireWith(this,
|
|
78
|
+
arguments),this},fired:function(){return!!f}};return n};d.extend({Deferred:function(a){var b=[["resolve","done",d.Callbacks("once memory"),"resolved"],["reject","fail",d.Callbacks("once memory"),"rejected"],["notify","progress",d.Callbacks("memory")]],c="pending",e={state:function(){return c},always:function(){return f.done(arguments).fail(arguments),this},then:function(){var a=arguments;return d.Deferred(function(c){d.each(b,function(b,k){var l=k[0],m=d.isFunction(a[b])&&a[b];f[k[1]](function(){var a=
|
|
79
|
+
m&&m.apply(this,arguments);a&&d.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[l+"With"](this===e?c.promise():this,m?[a]:arguments)})});a=null}).promise()},promise:function(a){return null!=a?d.extend(a,e):e}},f={};return e.pipe=e.then,d.each(b,function(a,d){var j=d[2],k=d[3];e[d[1]]=j.add;k&&j.add(function(){c=k},b[1^a][2].disable,b[2][2].lock);f[d[0]]=function(){return f[d[0]+"With"](this===f?e:this,arguments),this};f[d[0]+"With"]=j.fireWith}),e.promise(f),
|
|
80
|
+
a&&a.call(f,f),f},when:function(a){var b=0,c=ea.call(arguments),e=c.length,f=1!==e||a&&d.isFunction(a.promise)?e:0,g=1===f?a:d.Deferred(),h=function(a,b,c){return function(d){b[a]=this;c[a]=1<arguments.length?ea.call(arguments):d;c===j?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},j,k,l;if(1<e){j=Array(e);k=Array(e);for(l=Array(e);e>b;b++)c[b]&&d.isFunction(c[b].promise)?c[b].promise().done(h(b,l,c)).fail(g.reject).progress(h(b,k,j)):--f}return f||g.resolveWith(l,c),g.promise()}});var Sc=d,Pb,L={},
|
|
81
|
+
N=u.createElement("input"),Qb=u.createDocumentFragment(),O=u.createElement("div"),Rb=u.createElement("select"),Sb=Rb.appendChild(u.createElement("option"));Pb=N.type?(N.type="checkbox",L.checkOn=""!==N.value,L.optSelected=Sb.selected,L.reliableMarginRight=!0,L.boxSizingReliable=!0,L.pixelPosition=!1,N.checked=!0,L.noCloneChecked=N.cloneNode(!0).checked,Rb.disabled=!0,L.optDisabled=!Sb.disabled,N=u.createElement("input"),N.value="t",N.type="radio",L.radioValue="t"===N.value,N.setAttribute("checked",
|
|
82
|
+
"t"),N.setAttribute("name","t"),Qb.appendChild(N),L.checkClone=Qb.cloneNode(!0).cloneNode(!0).lastChild.checked,L.focusinBubbles="onfocusin"in l,O.style.backgroundClip="content-box",O.cloneNode(!0).style.backgroundClip="",L.clearCloneStyle="content-box"===O.style.backgroundClip,d(function(){var a,b,c=u.getElementsByTagName("body")[0];c&&(a=u.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",c.appendChild(a).appendChild(O),O.innerHTML=
|
|
83
|
+
"",O.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",d.swap(c,null!=c.style.zoom?{zoom:1}:{},function(){L.boxSizing=4===O.offsetWidth}),l.getComputedStyle&&(L.pixelPosition="1%"!==(l.getComputedStyle(O,null)||{}).top,L.boxSizingReliable="4px"===(l.getComputedStyle(O,null)||{width:"4px"}).width,b=O.appendChild(u.createElement("div")),b.style.cssText=O.style.cssText="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",
|
|
84
|
+
b.style.marginRight=b.style.width="0",O.style.width="1px",L.reliableMarginRight=!parseFloat((l.getComputedStyle(b,null)||{}).marginRight)),c.removeChild(a))}),L):L;Sc.support=Pb;var F,t,kc=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,jc=/([A-Z])/g;m.uid=1;m.accepts=function(a){return a.nodeType?1===a.nodeType||9===a.nodeType:!0};m.prototype={key:function(a){if(!m.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=m.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(e){b[this.expando]=c,
|
|
85
|
+
d.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var e;a=this.key(a);var f=this.cache[a];if("string"==typeof b)f[b]=c;else if(d.isEmptyObject(f))this.cache[a]=b;else for(e in b)f[e]=b[e]},get:function(a,b){var c=this.cache[this.key(a)];return b===k?c:c[b]},access:function(a,b,c){return b===k||b&&"string"==typeof b&&c===k?this.get(a,b):(this.set(a,b,c),c!==k?c:b)},remove:function(a,b){var c,e;c=this.key(a);var f=this.cache[c];if(b===k)this.cache[c]={};else{d.isArray(b)?
|
|
86
|
+
e=b.concat(b.map(d.camelCase)):b in f?e=[b]:(e=d.camelCase(b),e=e in f?[e]:e.match(R)||[]);for(c=e.length;c--;)delete f[e[c]]}},hasData:function(a){return!d.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){delete this.cache[this.key(a)]}};F=new m;t=new m;d.extend({acceptData:m.accepts,hasData:function(a){return F.hasData(a)||t.hasData(a)},data:function(a,b,c){return F.access(a,b,c)},removeData:function(a,b){F.remove(a,b)},_data:function(a,b,c){return t.access(a,b,c)},_removeData:function(a,
|
|
87
|
+
b){t.remove(a,b)}});d.fn.extend({data:function(a,b){var c,e,f=this[0],g=0,h=null;if(a===k){if(this.length&&(h=F.get(f),1===f.nodeType&&!t.get(f,"hasDataAttrs"))){for(c=f.attributes;c.length>g;g++)e=c[g].name,0===e.indexOf("data-")&&(e=d.camelCase(e.substring(5)),r(f,e,h[e]));t.set(f,"hasDataAttrs",!0)}return h}return"object"==typeof a?this.each(function(){F.set(this,a)}):d.access(this,function(b){var c,e=d.camelCase(a);if(f&&b===k){if((c=F.get(f,a),c!==k)||(c=F.get(f,e),c!==k)||(c=r(f,e,k),c!==k))return c}else this.each(function(){var c=
|
|
88
|
+
F.get(this,e);F.set(this,e,b);-1!==a.indexOf("-")&&c!==k&&F.set(this,a,b)})},null,b,1<arguments.length,null,!0)},removeData:function(a){return this.each(function(){F.remove(this,a)})}});d.extend({queue:function(a,b,c){var e;return a?(b=(b||"fx")+"queue",e=t.get(a,b),c&&(!e||d.isArray(c)?e=t.access(a,b,d.makeArray(c)):e.push(c)),e||[]):k},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.length,f=c.shift(),g=d._queueHooks(a,b),h=function(){d.dequeue(a,b)};"inprogress"===f&&(f=c.shift(),e--);(g.cur=
|
|
89
|
+
f)&&("fx"===b&&c.unshift("inprogress"),delete g.stop,f.call(a,h,g));!e&&g&&g.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return t.get(a,c)||t.access(a,c,{empty:d.Callbacks("once memory").add(function(){t.remove(a,[b+"queue",c])})})}});d.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),c>arguments.length?d.queue(this[0],a):b===k?this:this.each(function(){var c=d.queue(this,a,b);d._queueHooks(this,a);"fx"===a&&"inprogress"!==c[0]&&d.dequeue(this,a)})},
|
|
90
|
+
dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){return a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,d){var f=setTimeout(b,a);d.stop=function(){clearTimeout(f)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,e=1,f=d.Deferred(),g=this,h=this.length,j=function(){--e||f.resolveWith(g,[g])};"string"!=typeof a&&(b=a,a=k);for(a=a||"fx";h--;)(c=t.get(g[h],a+"queueHooks"))&&c.empty&&(e++,c.empty.add(j));return j(),
|
|
91
|
+
f.promise(b)}});var Tb,hb=/[\t\r\n]/g,Tc=/\r/g,Uc=/^(?:input|select|textarea|button)$/i;d.fn.extend({attr:function(a,b){return d.access(this,d.attr,a,b,1<arguments.length)},removeAttr:function(a){return this.each(function(){d.removeAttr(this,a)})},prop:function(a,b){return d.access(this,d.prop,a,b,1<arguments.length)},removeProp:function(a){return this.each(function(){delete this[d.propFix[a]||a]})},addClass:function(a){var b,c,e,f,g,h=0,j=this.length;b="string"==typeof a&&a;if(d.isFunction(a))return this.each(function(b){d(this).addClass(a.call(this,
|
|
92
|
+
b,this.className))});if(b)for(b=(a||"").match(R)||[];j>h;h++)if(c=this[h],e=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(hb," "):" ")){for(g=0;f=b[g++];)0>e.indexOf(" "+f+" ")&&(e+=f+" ");c.className=d.trim(e)}return this},removeClass:function(a){var b,c,e,f,g,h=0,j=this.length;b=0===arguments.length||"string"==typeof a&&a;if(d.isFunction(a))return this.each(function(b){d(this).removeClass(a.call(this,b,this.className))});if(b)for(b=(a||"").match(R)||[];j>h;h++)if(c=this[h],e=1===c.nodeType&&
|
|
93
|
+
(c.className?(" "+c.className+" ").replace(hb," "):"")){for(g=0;f=b[g++];)for(;0<=e.indexOf(" "+f+" ");)e=e.replace(" "+f+" "," ");c.className=a?d.trim(e):""}return this},toggleClass:function(a,b){var c=typeof a,e="boolean"==typeof b;return d.isFunction(a)?this.each(function(c){d(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===c)for(var f,g=0,h=d(this),j=b,k=a.match(R)||[];f=k[g++];)j=e?j:!h.hasClass(f),h[j?"addClass":"removeClass"](f);else(c===Aa||"boolean"===
|
|
94
|
+
c)&&(this.className&&t.set(this,"__className__",this.className),this.className=this.className||!1===a?"":t.get(this,"__className__")||"")})},hasClass:function(a){a=" "+a+" ";for(var b=0,c=this.length;c>b;b++)if(1===this[b].nodeType&&0<=(" "+this[b].className+" ").replace(hb," ").indexOf(a))return!0;return!1},val:function(a){var b,c,e,f=this[0];if(arguments.length)return e=d.isFunction(a),this.each(function(c){var f,j=d(this);1===this.nodeType&&(f=e?a.call(this,c,j.val()):a,null==f?f="":"number"==
|
|
95
|
+
typeof f?f+="":d.isArray(f)&&(f=d.map(f,function(a){return null==a?"":a+""})),b=d.valHooks[this.type]||d.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&b.set(this,f,"value")!==k||(this.value=f))});if(f)return b=d.valHooks[f.type]||d.valHooks[f.nodeName.toLowerCase()],b&&"get"in b&&(c=b.get(f,"value"))!==k?c:(c=f.value,"string"==typeof c?c.replace(Tc,""):null==c?"":c)}});d.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){for(var b,
|
|
96
|
+
c=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:c.length,j=0>e?h:f?e:0;h>j;j++)if(b=c[j],!(!b.selected&&j!==e||(d.support.optDisabled?b.disabled:null!==b.getAttribute("disabled"))||b.parentNode.disabled&&d.nodeName(b.parentNode,"optgroup"))){if(a=d(b).val(),f)return a;g.push(a)}return g},set:function(a,b){for(var c,e,f=a.options,g=d.makeArray(b),h=f.length;h--;)e=f[h],(e.selected=0<=d.inArray(d(e).val(),g))&&(c=!0);return c||(a.selectedIndex=-1),g}}},attr:function(a,
|
|
97
|
+
b,c){var e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return typeof a.getAttribute===Aa?d.prop(a,b,c):(1===g&&d.isXMLDoc(a)||(b=b.toLowerCase(),e=d.attrHooks[b]||(d.expr.match.boolean.test(b)?Tb:void 0)),c===k?e&&"get"in e&&null!==(f=e.get(a,b))?f:(f=d.find.attr(a,b),null==f?k:f):null!==c?e&&"set"in e&&(f=e.set(a,c,b))!==k?f:(a.setAttribute(b,c+""),c):(d.removeAttr(a,b),k))},removeAttr:function(a,b){var c,e,f=0,g=b&&b.match(R);if(g&&1===a.nodeType)for(;c=g[f++];)e=d.propFix[c]||c,d.expr.match.boolean.test(c)&&
|
|
98
|
+
(a[e]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!d.support.radioValue&&"radio"===b&&d.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var e,f,g,h=a.nodeType;if(a&&3!==h&&8!==h&&2!==h)return g=1!==h||!d.isXMLDoc(a),g&&(b=d.propFix[b]||b,f=d.propHooks[b]),c!==k?f&&"set"in f&&(e=f.set(a,c,b))!==k?e:a[b]=c:f&&"get"in f&&null!==(e=f.get(a,b))?e:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||
|
|
99
|
+
Uc.test(a.nodeName)||a.href?a.tabIndex:-1}}}});Tb={set:function(a,b,c){return!1===b?d.removeAttr(a,c):a.setAttribute(c,c),c}};d.each(d.expr.match.boolean.source.match(/\w+/g),function(a,b){var c=d.expr.attrHandle[b]||d.find.attr;d.expr.attrHandle[b]=function(a,b,g){var h=d.expr.attrHandle[b];a=g?k:(d.expr.attrHandle[b]=k)!=c(a,b,g)?b.toLowerCase():null;return d.expr.attrHandle[b]=h,a}});d.support.optSelected||(d.propHooks.selected={get:function(a){a=a.parentNode;return a&&a.parentNode&&a.parentNode.selectedIndex,
|
|
100
|
+
null}});d.each("tabIndex readOnly maxLength cellSpacing cellPadding rowSpan colSpan useMap frameBorder contentEditable".split(" "),function(){d.propFix[this.toLowerCase()]=this});d.each(["radio","checkbox"],function(){d.valHooks[this]={set:function(a,b){return d.isArray(b)?a.checked=0<=d.inArray(d(a).val(),b):k}};d.support.checkOn||(d.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var Vc=/^key/,Wc=/^(?:mouse|contextmenu)|click/,Ub=/^(?:focusinfocus|focusoutblur)$/,
|
|
101
|
+
Vb=/^([^.]*)(?:\.(.+)|)$/;d.event={global:{},add:function(a,b,c,e,f){var g,h,j,l,m,n,p,q,r,u;if(m=t.get(a)){c.handler&&(g=c,c=g.handler,f=g.selector);c.guid||(c.guid=d.guid++);(l=m.events)||(l=m.events={});(h=m.handle)||(h=m.handle=function(a){return typeof d===Aa||a&&d.event.triggered===a.type?k:d.event.dispatch.apply(h.elem,arguments)},h.elem=a);b=(b||"").match(R)||[""];for(m=b.length;m--;)j=Vb.exec(b[m])||[],r=u=j[1],j=(j[2]||"").split(".").sort(),r&&(p=d.event.special[r]||{},r=(f?p.delegateType:
|
|
102
|
+
p.bindType)||r,p=d.event.special[r]||{},n=d.extend({type:r,origType:u,data:e,handler:c,guid:c.guid,selector:f,needsContext:f&&d.expr.match.needsContext.test(f),namespace:j.join(".")},g),(q=l[r])||(q=l[r]=[],q.delegateCount=0,p.setup&&!1!==p.setup.call(a,e,j,h)||a.addEventListener&&a.addEventListener(r,h,!1)),p.add&&(p.add.call(a,n),n.handler.guid||(n.handler.guid=c.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),d.event.global[r]=!0);a=null}},remove:function(a,b,c,e,f){var g,h,j,k,l,m,p,n,q,r,
|
|
103
|
+
u,v=t.hasData(a)&&t.get(a);if(v&&(k=v.events)){b=(b||"").match(R)||[""];for(l=b.length;l--;)if(j=Vb.exec(b[l])||[],q=u=j[1],r=(j[2]||"").split(".").sort(),q){p=d.event.special[q]||{};q=(e?p.delegateType:p.bindType)||q;n=k[q]||[];j=j[2]&&RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)");for(h=g=n.length;g--;)m=n[g],!f&&u!==m.origType||c&&c.guid!==m.guid||j&&!j.test(m.namespace)||e&&e!==m.selector&&("**"!==e||!m.selector)||(n.splice(g,1),m.selector&&n.delegateCount--,p.remove&&p.remove.call(a,m));
|
|
104
|
+
h&&!n.length&&(p.teardown&&!1!==p.teardown.call(a,r,v.handle)||d.removeEvent(a,q,v.handle),delete k[q])}else for(q in k)d.event.remove(a,q+b[l],c,e,!0);d.isEmptyObject(k)&&(delete v.handle,t.remove(a,"events"))}},trigger:function(a,b,c,e){var f,g,h,j,m,n,q,p=[c||u],r=Xa.call(a,"type")?a.type:a;f=Xa.call(a,"namespace")?a.namespace.split("."):[];if(g=h=c=c||u,3!==c.nodeType&&8!==c.nodeType&&!Ub.test(r+d.event.triggered)&&(0<=r.indexOf(".")&&(f=r.split("."),r=f.shift(),f.sort()),m=0>r.indexOf(":")&&
|
|
105
|
+
"on"+r,a=a[d.expando]?a:new d.Event(r,"object"==typeof a&&a),a.isTrigger=e?2:3,a.namespace=f.join("."),a.namespace_re=a.namespace?RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,a.result=k,a.target||(a.target=c),b=null==b?[a]:d.makeArray(b,[a]),q=d.event.special[r]||{},e||!q.trigger||!1!==q.trigger.apply(c,b))){if(!e&&!q.noBubble&&!d.isWindow(c)){j=q.delegateType||r;for(Ub.test(j+r)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(c.ownerDocument||u)&&p.push(h.defaultView||h.parentWindow||
|
|
106
|
+
l)}for(f=0;(g=p[f++])&&!a.isPropagationStopped();)a.type=1<f?j:q.bindType||r,(n=(t.get(g,"events")||{})[a.type]&&t.get(g,"handle"))&&n.apply(g,b),(n=m&&g[m])&&d.acceptData(g)&&n.apply&&!1===n.apply(g,b)&&a.preventDefault();return a.type=r,e||a.isDefaultPrevented()||q._default&&!1!==q._default.apply(p.pop(),b)||!d.acceptData(c)||m&&d.isFunction(c[r])&&!d.isWindow(c)&&(h=c[m],h&&(c[m]=null),d.event.triggered=r,c[r](),d.event.triggered=k,h&&(c[m]=h)),a.result}},dispatch:function(a){a=d.event.fix(a);
|
|
107
|
+
var b,c,e,f,g,h=[],j=ea.call(arguments);b=(t.get(this,"events")||{})[a.type]||[];var l=d.event.special[a.type]||{};if(j[0]=a,a.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,a)){h=d.event.handlers.call(this,a,b);for(b=0;(f=h[b++])&&!a.isPropagationStopped();){a.currentTarget=f.elem;for(c=0;(g=f.handlers[c++])&&!a.isImmediatePropagationStopped();)(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((d.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,
|
|
108
|
+
j),e!==k&&!1===(a.result=e)&&(a.preventDefault(),a.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,e,f,g,h=[],j=b.delegateCount,l=a.target;if(j&&l.nodeType&&(!a.button||"click"!==a.type))for(;l!==this;l=l.parentNode||this)if(!0!==l.disabled||"click"!==a.type){e=[];for(c=0;j>c;c++)g=b[c],f=g.selector+" ",e[f]===k&&(e[f]=g.needsContext?0<=d(f,this).index(l):d.find(f,this,null,[l]).length),e[f]&&e.push(g);e.length&&h.push({elem:l,handlers:e})}return b.length>
|
|
109
|
+
j&&h.push({elem:this,handlers:b.slice(j)}),h},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:["char","charCode","key","keyCode"],filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,f,g=b.button;return null==
|
|
110
|
+
a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||u,d=c.documentElement,f=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||f&&f.scrollLeft||0)-(d&&d.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||f&&f.scrollTop||0)-(d&&d.clientTop||f&&f.clientTop||0)),a.which||g===k||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[d.expando])return a;var b,c,e;b=a.type;var f=a,g=this.fixHooks[b];g||(this.fixHooks[b]=g=Wc.test(b)?this.mouseHooks:Vc.test(b)?this.keyHooks:{});e=g.props?this.props.concat(g.props):
|
|
111
|
+
this.props;a=new d.Event(f);for(b=e.length;b--;)c=e[b],a[c]=f[c];return 3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==J()&&this.focus?(this.focus(),!1):k},delegateType:"focusin"},blur:{trigger:function(){return this===J()&&this.blur?(this.blur(),!1):k},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&d.nodeName(this,"input")?(this.click(),!1):k},_default:function(a){return d.nodeName(a.target,
|
|
112
|
+
"a")}},beforeunload:{postDispatch:function(a){a.result!==k&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,e){a=d.extend(new d.Event,c,{type:a,isSimulated:!0,originalEvent:{}});e?d.event.trigger(a,null,b):d.event.dispatch.call(b,a);a.isDefaultPrevented()&&c.preventDefault()}};d.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)};d.Event=function(a,b){return this instanceof d.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=
|
|
113
|
+
a.defaultPrevented||a.getPreventDefault&&a.getPreventDefault()?A:B):this.type=a,b&&d.extend(this,b),this.timeStamp=a&&a.timeStamp||d.now(),this[d.expando]=!0,k):new d.Event(a,b)};d.Event.prototype={isDefaultPrevented:B,isPropagationStopped:B,isImmediatePropagationStopped:B,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=A;a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=A;a&&a.stopPropagation&&a.stopPropagation()},
|
|
114
|
+
stopImmediatePropagation:function(){this.isImmediatePropagationStopped=A;this.stopPropagation()}};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={delegateType:b,bindType:b,handle:function(a){var e,f=a.relatedTarget,g=a.handleObj;return(!f||f!==this&&!d.contains(this,f))&&(a.type=g.origType,e=g.handler.apply(this,arguments),a.type=b),e}}});d.support.focusinBubbles||d.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,e=function(a){d.event.simulate(b,
|
|
115
|
+
a.target,d.event.fix(a),!0)};d.event.special[b]={setup:function(){0===c++&&u.addEventListener(a,e,!0)},teardown:function(){0===--c&&u.removeEventListener(a,e,!0)}}});d.fn.extend({on:function(a,b,c,e,f){var g,h;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=k);for(h in a)this.on(h,b,c,a[h],f);return this}if(null==c&&null==e?(e=b,c=b=k):null==e&&("string"==typeof b?(e=c,c=k):(e=c,c=b,b=k)),!1===e)e=B;else if(!e)return this;return 1===f&&(g=e,e=function(a){return d().off(a),g.apply(this,arguments)},
|
|
116
|
+
e.guid=g.guid||(g.guid=d.guid++)),this.each(function(){d.event.add(this,a,e,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,d(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if("object"==typeof a){for(f in a)this.off(f,b,a[f]);return this}return(!1===b||"function"==typeof b)&&(c=b,b=k),!1===c&&(c=B),this.each(function(){d.event.remove(this,a,c,b)})},trigger:function(a,
|
|
117
|
+
b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?d.event.trigger(a,b,c,!0):k}});var lc=/^.[^:#\[\.,]*$/,Wb=d.expr.match.needsContext,Xc={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b,c,e,f=this.length;if("string"!=typeof a)return b=this,this.pushStack(d(a).filter(function(){for(e=0;f>e;e++)if(d.contains(b[e],this))return!0}));c=[];for(e=0;f>e;e++)d.find(a,this[e],c);return c=this.pushStack(1<f?d.unique(c):
|
|
118
|
+
c),c.selector=(this.selector?this.selector+" ":"")+a,c},has:function(a){var b=d(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(ka(this,a||[],!0))},filter:function(a){return this.pushStack(ka(this,a||[],!1))},is:function(a){return!!a&&("string"==typeof a?Wb.test(a)?0<=d(a,this.context).index(this[0]):0<d.filter(a,this).length:0<this.filter(a).length)},closest:function(a,b){for(var c,e=0,f=this.length,g=
|
|
119
|
+
[],h=Wb.test(a)||"string"!=typeof a?d(a,b||this.context):0;f>e;e++)for(c=this[e];c&&c!==b;c=c.parentNode)if(11>c.nodeType&&(h?-1<h.index(c):1===c.nodeType&&d.find.matchesSelector(c,a))){g.push(c);break}return this.pushStack(1<g.length?d.unique(g):g)},index:function(a){return a?"string"==typeof a?wa.call(d(a),this[0]):wa.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){var c="string"==typeof a?d(a,b):d.makeArray(a&&a.nodeType?[a]:a),c=d.merge(this.get(),
|
|
120
|
+
c);return this.pushStack(d.unique(c))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});d.each({parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return V(a,"nextSibling")},prev:function(a){return V(a,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},
|
|
121
|
+
nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.merge([],a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c);return"Until"!==a.slice(-5)&&(e=c),e&&"string"==typeof e&&(f=d.filter(e,f)),
|
|
122
|
+
1<this.length&&(Xc[a]||d.unique(f),"p"===a[0]&&f.reverse()),this.pushStack(f)}});d.extend({filter:function(a,b,c){var e=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===e.nodeType?d.find.matchesSelector(e,a)?[e]:[]:d.find.matches(a,d.grep(b,function(a){return 1===a.nodeType}))},dir:function(a,b,c){for(var e=[],f=c!==k;(a=a[b])&&9!==a.nodeType;)if(1===a.nodeType){if(f&&d(a).is(c))break;e.push(a)}return e},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});
|
|
123
|
+
var Xb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Yb=/<([\w:]+)/,Yc=/<|&#?\w+;/,Zc=/<(?:script|style|link)/i,Zb=/^(?:checkbox|radio)$/i,$c=/checked\s*(?:[^=]|=\s*.checked.)/i,$b=/^$|\/(?:java|ecma)script/i,oc=/^true\/(.*)/,ad=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,M={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};
|
|
124
|
+
M.optgroup=M.option;M.tbody=M.tfoot=M.colgroup=M.caption=M.col=M.thead;M.th=M.td;d.fn.extend({text:function(a){return d.access(this,function(a){return a===k?d.text(this):this.empty().append((this[0]&&this[0].ownerDocument||u).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&lb(this,a).appendChild(a)})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||
|
|
125
|
+
11===this.nodeType||9===this.nodeType){var b=lb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,e=a?d.filter(a,this):this,f=0;null!=(c=e[f]);f++)b||1!==c.nodeType||d.cleanData(K(c)),c.parentNode&&(b&&d.contains(c.ownerDocument,c)&&
|
|
126
|
+
Ra(K(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(d.cleanData(K(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return d.clone(this,a,b)})},html:function(a){return d.access(this,function(a){var c=this[0]||{},e=0,f=this.length;if(a===k&&1===c.nodeType)return c.innerHTML;if("string"==typeof a&&!Zc.test(a)&&!M[(Yb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Xb,
|
|
127
|
+
"<$1></$2>");try{for(;f>e;e++)c=this[e]||{},1===c.nodeType&&(d.cleanData(K(c,!1)),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=d.map(this,function(a){return[a.nextSibling,a.parentNode]}),b=0;return this.domManip(arguments,function(c){var e=a[b++],f=a[b++];f&&(d(this).remove(),f.insertBefore(c,e))},!0),b?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b,c){a=Bb.apply([],a);var e,f,g,h,j=0,k=this.length,
|
|
128
|
+
l=this,m=k-1,p=a[0],n=d.isFunction(p);if(n||!(1>=k||"string"!=typeof p||d.support.checkClone)&&$c.test(p))return this.each(function(d){var e=l.eq(d);n&&(a[0]=p.call(this,d,e.html()));e.domManip(a,b,c)});if(k&&(e=d.buildFragment(a,this[0].ownerDocument,!1,!c&&this),f=e.firstChild,1===e.childNodes.length&&(e=f),f)){f=d.map(K(e,"script"),mc);for(g=f.length;k>j;j++)h=e,j!==m&&(h=d.clone(h,!0,!0),g&&d.merge(f,K(h,"script"))),b.call(this[j],h,j);if(g){e=f[f.length-1].ownerDocument;d.map(f,nc);for(j=0;g>
|
|
129
|
+
j;j++)h=f[j],$b.test(h.type||"")&&!t.access(h,"globalEval")&&d.contains(e,h)&&(h.src?d._evalUrl(h.src):d.globalEval(h.textContent.replace(ad,"")))}}return this}});d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(a){for(var e=[],f=d(a),g=f.length-1,h=0;g>=h;h++)a=h===g?this:this.clone(!0),d(f[h])[b](a),Wa.apply(e,a.get());return this.pushStack(e)}});d.extend({clone:function(a,b,c){var e,f,g,h,j=a.cloneNode(!0),
|
|
130
|
+
k=d.contains(a.ownerDocument,a);if(!d.support.noCloneChecked&&!(1!==a.nodeType&&11!==a.nodeType||d.isXMLDoc(a))){h=K(j);g=K(a);e=0;for(f=g.length;f>e;e++){var l=g[e],m=h[e],p=m.nodeName.toLowerCase();"input"===p&&Zb.test(l.type)?m.checked=l.checked:("input"===p||"textarea"===p)&&(m.defaultValue=l.defaultValue)}}if(b)if(c){g=g||K(a);h=h||K(j);e=0;for(f=g.length;f>e;e++)mb(g[e],h[e])}else mb(a,j);return h=K(j,"script"),0<h.length&&Ra(h,!k&&K(a,"script")),j},buildFragment:function(a,b,c,e){for(var f,
|
|
131
|
+
g,h,j,k=0,l=a.length,m=b.createDocumentFragment(),p=[];l>k;k++)if(f=a[k],f||0===f)if("object"===d.type(f))d.merge(p,f.nodeType?[f]:f);else if(Yc.test(f)){g=g||m.appendChild(b.createElement("div"));h=(Yb.exec(f)||["",""])[1].toLowerCase();h=M[h]||M._default;g.innerHTML=h[1]+f.replace(Xb,"<$1></$2>")+h[2];for(h=h[0];h--;)g=g.firstChild;d.merge(p,g.childNodes);g=m.firstChild;g.textContent=""}else p.push(b.createTextNode(f));m.textContent="";for(k=0;f=p[k++];)if((!e||-1===d.inArray(f,e))&&(j=d.contains(f.ownerDocument,
|
|
132
|
+
f),g=K(m.appendChild(f),"script"),j&&Ra(g),c))for(h=0;f=g[h++];)$b.test(f.type||"")&&c.push(f);return m},cleanData:function(a){for(var b,c,e,f=a.length,g=0,h=d.event.special;f>g;g++){if(c=a[g],d.acceptData(c)&&(b=t.access(c)))for(e in b.events)h[e]?d.event.remove(c,e):d.removeEvent(c,e,b.handle);F.discard(c);t.discard(c)}},_evalUrl:function(a){return d.ajax({url:a,type:"GET",dataType:"text",async:!1,global:!1,success:d.globalEval})}});d.fn.extend({wrapAll:function(a){var b;return d.isFunction(a)?
|
|
133
|
+
this.each(function(b){d(this).wrapAll(a.call(this,b))}):(this[0]&&(b=d(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstElementChild;)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return d.isFunction(a)?this.each(function(b){d(this).wrapInner(a.call(this,b))}):this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=d.isFunction(a);return this.each(function(c){d(this).wrapAll(b?
|
|
134
|
+
a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()}});var la,qa,bd=/^(none|table(?!-c[ea]).+)/,ac=/^margin/,qc=RegExp("^("+Da+")(.*)$","i"),Sa=RegExp("^("+Da+")(?!px)[a-z%]+$","i"),cd=RegExp("^([+-])=("+Da+")","i"),tb={BODY:"block"},dd={position:"absolute",visibility:"hidden",display:"block"},bc={letterSpacing:0,fontWeight:400},da=["Top","Right","Bottom","Left"],ob=["Webkit","O","Moz","ms"];d.fn.extend({css:function(a,
|
|
135
|
+
b){return d.access(this,function(a,b,f){var g,h={},j=0;if(d.isArray(b)){f=l.getComputedStyle(a,null);for(g=b.length;g>j;j++)h[b[j]]=d.css(a,b[j],!1,f);return h}return f!==k?d.style(a,b,f):d.css(a,b)},a,b,1<arguments.length)},show:function(){return pb(this,!0)},hide:function(){return pb(this)},toggle:function(a){var b="boolean"==typeof a;return this.each(function(){(b?a:pa(this))?d(this).show():d(this).hide()})}});d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=la(a,"opacity");return""===
|
|
136
|
+
c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g,h,j=d.camelCase(b),l=a.style;return b=d.cssProps[j]||(d.cssProps[j]=nb(l,j)),h=d.cssHooks[b]||d.cssHooks[j],c===k?h&&"get"in h&&(f=h.get(a,!1,e))!==k?f:l[b]:(g=typeof c,"string"===g&&(f=cd.exec(c))&&(c=(f[1]+1)*f[2]+parseFloat(d.css(a,b)),g="number"),null==c||
|
|
137
|
+
"number"===g&&isNaN(c)||("number"!==g||d.cssNumber[j]||(c+="px"),d.support.clearCloneStyle||""!==c||0!==b.indexOf("background")||(l[b]="inherit"),h&&"set"in h&&(c=h.set(a,c,e))===k||(l[b]=c)),k)}},css:function(a,b,c,e){var f,g,h,j=d.camelCase(b);return b=d.cssProps[j]||(d.cssProps[j]=nb(a.style,j)),h=d.cssHooks[b]||d.cssHooks[j],h&&"get"in h&&(f=h.get(a,!0,c)),f===k&&(f=la(a,b,e)),"normal"===f&&b in bc&&(f=bc[b]),""===c||c?(g=parseFloat(f),!0===c||d.isNumeric(g)?g||0:f):f}});la=function(a,b,c){var e,
|
|
138
|
+
f,g,h=(c=c||l.getComputedStyle(a,null))?c.getPropertyValue(b)||c[b]:k,j=a.style;return c&&(""!==h||d.contains(a.ownerDocument,a)||(h=d.style(a,b)),Sa.test(h)&&ac.test(b)&&(e=j.width,f=j.minWidth,g=j.maxWidth,j.minWidth=j.maxWidth=j.width=h,h=c.width,j.width=e,j.minWidth=f,j.maxWidth=g)),h};d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,e,f){return e?0===a.offsetWidth&&bd.test(d.css(a,"display"))?d.swap(a,dd,function(){return sb(a,b,f)}):sb(a,b,f):k},set:function(a,e,f){var g=
|
|
139
|
+
f&&l.getComputedStyle(a,null);return qb(a,e,f?rb(a,b,f,d.support.boxSizing&&"border-box"===d.css(a,"boxSizing",!1,g),g):0)}}});d(function(){d.support.reliableMarginRight||(d.cssHooks.marginRight={get:function(a,b){return b?d.swap(a,{display:"inline-block"},la,[a,"marginRight"]):k}});!d.support.pixelPosition&&d.fn.position&&d.each(["top","left"],function(a,b){d.cssHooks[b]={get:function(a,e){return e?(e=la(a,b),Sa.test(e)?d(a).position()[b]+"px":e):k}}})});d.expr&&d.expr.filters&&(d.expr.filters.hidden=
|
|
140
|
+
function(a){return 0>=a.offsetWidth&&0>=a.offsetHeight},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});d.each({margin:"",padding:"",border:"Width"},function(a,b){d.cssHooks[a+b]={expand:function(c){var d=0,f={};for(c="string"==typeof c?c.split(" "):[c];4>d;d++)f[a+da[d]+b]=c[d]||c[d-2]||c[0];return f}};ac.test(a)||(d.cssHooks[a+b].set=qb)});var ed=/%20/g,rc=/\[\]$/,cc=/\r?\n/g,fd=/^(?:submit|button|image|reset|file)$/i,gd=/^(?:input|select|textarea|keygen)/i;d.fn.extend({serialize:function(){return d.param(this.serializeArray())},
|
|
141
|
+
serializeArray:function(){return this.map(function(){var a=d.prop(this,"elements");return a?d.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!d(this).is(":disabled")&&gd.test(this.nodeName)&&!fd.test(a)&&(this.checked||!Zb.test(a))}).map(function(a,b){var c=d(this).val();return null==c?null:d.isArray(c)?d.map(c,function(a){return{name:b.name,value:a.replace(cc,"\r\n")}}):{name:b.name,value:c.replace(cc,"\r\n")}}).get()}});d.param=function(a,b){var c,e=[],f=function(a,b){b=
|
|
142
|
+
d.isFunction(b)?b():null==b?"":b;e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(b===k&&(b=d.ajaxSettings&&d.ajaxSettings.traditional),d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(c in a)Ta(c,a[c],b,f);return e.join("&").replace(ed,"+")};d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),
|
|
143
|
+
function(a,b){d.fn[b]=function(a,d){return 0<arguments.length?this.on(b,null,a,d):this.trigger(b)}});d.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var ja,ba,ib=d.now(),jb=/\?/,hd=/#.*$/,dc=/([?&])_=[^&]*/,id=/^(.*?):[ \t]*([^\r\n]*)$/gm,
|
|
144
|
+
jd=/^(?:GET|HEAD)$/,kd=/^\/\//,ec=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,fc=d.fn.load,gc={},Ua={},hc="*/".concat("*");try{ba=tc.href}catch(rd){ba=u.createElement("a"),ba.href="",ba=ba.href}ja=ec.exec(ba.toLowerCase())||[];d.fn.load=function(a,b,c){if("string"!=typeof a&&fc)return fc.apply(this,arguments);var e,f,g,h=this,j=a.indexOf(" ");return 0<=j&&(e=a.slice(j),a=a.slice(0,j)),d.isFunction(b)?(c=b,b=k):b&&"object"==typeof b&&(f="POST"),0<h.length&&d.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){g=
|
|
145
|
+
arguments;h.html(e?d("<div>").append(d.parseHTML(a)).find(e):a)}).complete(c&&function(a,b){h.each(c,g||[a.responseText,b,a])}),this};d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.on(b,a)}});d.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ba,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ja[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",
|
|
146
|
+
accepts:{"*":hc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Va(Va(a,d.ajaxSettings),b):Va(d.ajaxSettings,a)},ajaxPrefilter:vb(gc),ajaxTransport:vb(Ua),ajax:function(a,
|
|
147
|
+
b){function c(a,b,c,h){var l,n,s,y,w=b;if(2!==D){D=2;j&&clearTimeout(j);e=k;g=h||"";z.readyState=0<a?4:0;h=200<=a&&300>a||304===a;if(c){s=p;for(var B=z,A,E,F,C,L=s.contents,I=s.dataTypes;"*"===I[0];)I.shift(),A===k&&(A=s.mimeType||B.getResponseHeader("Content-Type"));if(A)for(E in L)if(L[E]&&L[E].test(A)){I.unshift(E);break}if(I[0]in c)F=I[0];else{for(E in c){if(!I[0]||s.converters[E+" "+I[0]]){F=E;break}C||(C=E)}F=F||C}s=F?(F!==I[0]&&I.unshift(F),c[F]):k}var K;a:{c=p;A=s;E=z;F=h;var G,M,J;s={};B=
|
|
148
|
+
c.dataTypes.slice();if(B[1])for(G in c.converters)s[G.toLowerCase()]=c.converters[G];for(C=B.shift();C;)if(c.responseFields[C]&&(E[c.responseFields[C]]=A),!J&&F&&c.dataFilter&&(A=c.dataFilter(A,c.dataType)),J=C,C=B.shift())if("*"===C)C=J;else if("*"!==J&&J!==C){if(G=s[J+" "+C]||s["* "+C],!G)for(K in s)if(M=K.split(" "),M[1]===C&&(G=s[J+" "+M[0]]||s["* "+M[0]])){!0===G?G=s[K]:!0!==s[K]&&(C=M[0],B.unshift(M[1]));break}if(!0!==G)if(G&&c["throws"])A=G(A);else try{A=G(A)}catch(N){K={state:"parsererror",
|
|
149
|
+
error:G?N:"No conversion from "+J+" to "+C};break a}}K={state:"success",data:A}}s=K;h?(p.ifModified&&(y=z.getResponseHeader("Last-Modified"),y&&(d.lastModified[f]=y),y=z.getResponseHeader("etag"),y&&(d.etag[f]=y)),204===a?w="nocontent":304===a?w="notmodified":(w=s.state,l=s.data,n=s.error,h=!n)):(n=w,(a||!w)&&(w="error",0>a&&(a=0)));z.status=a;z.statusText=(b||w)+"";h?t.resolveWith(q,[l,w,z]):t.rejectWith(q,[z,w,n]);z.statusCode(v);v=k;m&&r.trigger(h?"ajaxSuccess":"ajaxError",[z,p,h?l:n]);u.fireWith(q,
|
|
150
|
+
[z,w]);m&&(r.trigger("ajaxComplete",[z,p]),--d.active||d.event.trigger("ajaxStop"))}}"object"==typeof a&&(b=a,a=k);b=b||{};var e,f,g,h,j,l,m,n,p=d.ajaxSetup({},b),q=p.context||p,r=p.context&&(q.nodeType||q.jquery)?d(q):d.event,t=d.Deferred(),u=d.Callbacks("once memory"),v=p.statusCode||{},w={},B={},D=0,A="canceled",z={readyState:0,getResponseHeader:function(a){var b;if(2===D){if(!h)for(h={};b=id.exec(g);)h[b[1].toLowerCase()]=b[2];b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===
|
|
151
|
+
D?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return D||(a=B[c]=B[c]||a,w[a]=b),this},overrideMimeType:function(a){return D||(p.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>D)for(b in a)v[b]=[v[b],a[b]];else z.always(a[z.status]);return this},abort:function(a){a=a||A;return e&&e.abort(a),c(0,a),this}};if(t.promise(z).complete=u.add,z.success=z.done,z.error=z.fail,p.url=((a||p.url||ba)+"").replace(hd,"").replace(kd,ja[1]+"//"),p.type=b.method||b.type||p.method||p.type,
|
|
152
|
+
p.dataTypes=d.trim(p.dataType||"*").toLowerCase().match(R)||[""],null==p.crossDomain&&(l=ec.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===ja[1]&&l[2]===ja[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(ja[3]||("http:"===ja[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=d.param(p.data,p.traditional)),wb(gc,p,b,z),2===D)return z;(m=p.global)&&0===d.active++&&d.event.trigger("ajaxStart");p.type=p.type.toUpperCase();p.hasContent=!jd.test(p.type);f=p.url;p.hasContent||(p.data&&
|
|
153
|
+
(f=p.url+=(jb.test(f)?"&":"?")+p.data,delete p.data),!1===p.cache&&(p.url=dc.test(f)?f.replace(dc,"$1_="+ib++):f+(jb.test(f)?"&":"?")+"_="+ib++));p.ifModified&&(d.lastModified[f]&&z.setRequestHeader("If-Modified-Since",d.lastModified[f]),d.etag[f]&&z.setRequestHeader("If-None-Match",d.etag[f]));(p.data&&p.hasContent&&!1!==p.contentType||b.contentType)&&z.setRequestHeader("Content-Type",p.contentType);z.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==
|
|
154
|
+
p.dataTypes[0]?", "+hc+"; q=0.01":""):p.accepts["*"]);for(n in p.headers)z.setRequestHeader(n,p.headers[n]);if(p.beforeSend&&(!1===p.beforeSend.call(q,z,p)||2===D))return z.abort();A="abort";for(n in{success:1,error:1,complete:1})z[n](p[n]);if(e=wb(Ua,p,b,z)){z.readyState=1;m&&r.trigger("ajaxSend",[z,p]);p.async&&0<p.timeout&&(j=setTimeout(function(){z.abort("timeout")},p.timeout));try{D=1,e.send(w,c)}catch(E){if(!(2>D))throw E;c(-1,E)}}else c(-1,"No Transport");return z},getJSON:function(a,b,c){return d.get(a,
|
|
155
|
+
b,c,"json")},getScript:function(a,b){return d.get(a,k,b,"script")}});d.each(["get","post"],function(a,b){d[b]=function(a,e,f,g){return d.isFunction(e)&&(g=g||f,f=e,e=k),d.ajax({url:a,type:b,dataType:g,data:e,success:f})}});d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return d.globalEval(a),a}}});d.ajaxPrefilter("script",function(a){a.cache===k&&
|
|
156
|
+
(a.cache=!1);a.crossDomain&&(a.type="GET")});d.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=d("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove();c=null;a&&f("error"===a.type?404:200,a.type)});u.head.appendChild(b[0])},abort:function(){c&&c()}}}});var ic=[],kb=/(=)\?(?=&|$)|\?\?/;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ic.pop()||d.expando+"_"+ib++;return this[a]=!0,a}});d.ajaxPrefilter("json jsonp",
|
|
157
|
+
function(a,b,c){var e,f,g,h=!1!==a.jsonp&&(kb.test(a.url)?"url":"string"==typeof a.data&&!(a.contentType||"").indexOf("application/x-www-form-urlencoded")&&kb.test(a.data)&&"data");return h||"jsonp"===a.dataTypes[0]?(e=a.jsonpCallback=d.isFunction(a.jsonpCallback)?a.jsonpCallback():a.jsonpCallback,h?a[h]=a[h].replace(kb,"$1"+e):!1!==a.jsonp&&(a.url+=(jb.test(a.url)?"&":"?")+a.jsonp+"="+e),a.converters["script json"]=function(){return g||d.error(e+" was not called"),g[0]},a.dataTypes[0]="json",f=l[e],
|
|
158
|
+
l[e]=function(){g=arguments},c.always(function(){l[e]=f;a[e]&&(a.jsonpCallback=b.jsonpCallback,ic.push(e));g&&d.isFunction(f)&&f(g[0]);g=f=k}),"script"):k});d.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var ua=d.ajaxSettings.xhr(),ld={"0":200,1223:204},md=0,va={};l.ActiveXObject&&d(l).on("unload",function(){for(var a in va)va[a]();va=k});d.support.cors=!!ua&&"withCredentials"in ua;d.support.ajax=ua=!!ua;d.ajaxTransport(function(a){var b;return d.support.cors||ua&&!a.crossDomain?
|
|
159
|
+
{send:function(c,d){var f,g,h=a.xhr();if(h.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(f in a.xhrFields)h[f]=a.xhrFields[f];a.mimeType&&h.overrideMimeType&&h.overrideMimeType(a.mimeType);a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(f in c)h.setRequestHeader(f,c[f]);b=function(a){return function(){b&&(delete va[g],b=h.onload=h.onerror=null,"abort"===a?h.abort():"error"===a?d(h.status||404,h.statusText):d(ld[h.status]||h.status,h.statusText,
|
|
160
|
+
"string"==typeof h.responseText?{text:h.responseText}:k,h.getAllResponseHeaders()))}};h.onload=b();h.onerror=b("error");b=va[g=md++]=b("abort");h.send(a.hasContent&&a.data||null)},abort:function(){b&&b()}}:k});var ma,Pa,nd=/^(?:toggle|show|hide)$/,od=RegExp("^(?:([+-])=|)("+Da+")([a-z%]*)$","i"),pd=/queueHooks$/,xa=[function(a,b,c){var e,f,g,h,j,l,m=this,n=a.style,p={},q=[],r=a.nodeType&&pa(a);c.queue||(j=d._queueHooks(a,"fx"),null==j.unqueued&&(j.unqueued=0,l=j.empty.fire,j.empty.fire=function(){j.unqueued||
|
|
161
|
+
l()}),j.unqueued++,m.always(function(){m.always(function(){j.unqueued--;d.queue(a,"fx").length||j.empty.fire()})}));1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[n.overflow,n.overflowX,n.overflowY],"inline"===d.css(a,"display")&&"none"===d.css(a,"float")&&(n.display="inline-block"));c.overflow&&(n.overflow="hidden",m.always(function(){n.overflow=c.overflow[0];n.overflowX=c.overflow[1];n.overflowY=c.overflow[2]}));h=t.get(a,"fxshow");for(e in b)if(g=b[e],nd.exec(g)){if(delete b[e],f=f||
|
|
162
|
+
"toggle"===g,g===(r?"hide":"show")){if("show"!==g||h===k||h[e]===k)continue;r=!0}q.push(e)}if(b=q.length){h=t.get(a,"fxshow")||t.access(a,"fxshow",{});"hidden"in h&&(r=h.hidden);f&&(h.hidden=!r);r?d(a).show():m.done(function(){d(a).hide()});m.done(function(){var b;t.remove(a,"fxshow");for(b in p)d.style(a,b,p[b])});for(e=0;b>e;e++)f=q[e],g=m.createTween(f,r?h[f]:0),p[f]=h[f]||d.style(a,f),f in h||(h[f]=g.start,r&&(g.end=g.start,g.start="width"===f||"height"===f?1:0))}}],ra={"*":[function(a,b){var c,
|
|
163
|
+
e,f=this.createTween(a,b),g=od.exec(b),h=f.cur(),j=+h||0,k=1,l=20;if(g){if(c=+g[2],e=g[3]||(d.cssNumber[a]?"":"px"),"px"!==e&&j){j=d.css(f.elem,a,!0)||c||1;do k=k||".5",j/=k,d.style(f.elem,a,j+e);while(k!==(k=f.cur()/h)&&1!==k&&--l)}f.unit=e;f.start=j;f.end=g[1]?j+(g[1]+1)*c:c}return f}]};d.Animation=d.extend(yb,{tweener:function(a,b){d.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,e=0,f=a.length;f>e;e++)c=a[e],ra[c]=ra[c]||[],ra[c].unshift(b)},prefilter:function(a,b){b?xa.unshift(a):xa.push(a)}});
|
|
164
|
+
d.Tween=I;I.prototype={constructor:I,init:function(a,b,c,e,f,g){this.elem=a;this.prop=c;this.easing=f||"swing";this.options=b;this.start=this.now=this.cur();this.end=e;this.unit=g||(d.cssNumber[c]?"":"px")},cur:function(){var a=I.propHooks[this.prop];return a&&a.get?a.get(this):I.propHooks._default.get(this)},run:function(a){var b,c=I.propHooks[this.prop];return this.pos=b=this.options.duration?d.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*
|
|
165
|
+
b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):I.propHooks._default.set(this),this}};I.prototype.init.prototype=I.prototype;I.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=d.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){d.fx.step[a.prop]?d.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[d.cssProps[a.prop]]||d.cssHooks[a.prop])?d.style(a.elem,a.prop,
|
|
166
|
+
a.now+a.unit):a.elem[a.prop]=a.now}}};I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}};d.each(["toggle","show","hide"],function(a,b){var c=d.fn[b];d.fn[b]=function(a,d,g){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(ya(b,!0),a,d,g)}});d.fn.extend({fadeTo:function(a,b,c,d){return this.filter(pa).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.isEmptyObject(a),
|
|
167
|
+
g=d.speed(b,c,e),h=function(){var b=yb(this,d.extend({},a),g);h.finish=function(){b.stop(!0)};(f||t.get(this,"finish"))&&b.stop(!0)};return h.finish=h,f||!1===g.queue?this.each(h):this.queue(g.queue,h)},stop:function(a,b,c){var e=function(a){var b=a.stop;delete a.stop;b(c)};return"string"!=typeof a&&(c=b,b=a,a=k),b&&!1!==a&&this.queue(a||"fx",[]),this.each(function(){var b=!0,g=null!=a&&a+"queueHooks",h=d.timers,j=t.get(this);if(g)j[g]&&j[g].stop&&e(j[g]);else for(g in j)j[g]&&j[g].stop&&pd.test(g)&&
|
|
168
|
+
e(j[g]);for(g=h.length;g--;)h[g].elem!==this||null!=a&&h[g].queue!==a||(h[g].anim.stop(c),b=!1,h.splice(g,1));(b||!c)&&d.dequeue(this,a)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var b,c=t.get(this),e=c[a+"queue"];b=c[a+"queueHooks"];var f=d.timers,g=e?e.length:0;c.finish=!0;d.queue(this,a,[]);b&&b.cur&&b.cur.finish&&b.cur.finish.call(this);for(b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)e[b]&&e[b].finish&&e[b].finish.call(this);
|
|
169
|
+
delete c.finish})}});d.each({slideDown:ya("show"),slideUp:ya("hide"),slideToggle:ya("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,d,f){return this.animate(b,a,d,f)}});d.speed=function(a,b,c){var e=a&&"object"==typeof a?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};return e.duration=d.fx.off?0:"number"==typeof e.duration?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:
|
|
170
|
+
d.fx.speeds._default,(null==e.queue||!0===e.queue)&&(e.queue="fx"),e.old=e.complete,e.complete=function(){d.isFunction(e.old)&&e.old.call(this);e.queue&&d.dequeue(this,e.queue)},e};d.easing={linear:function(a){return a},swing:function(a){return 0.5-Math.cos(a*Math.PI)/2}};d.timers=[];d.fx=I.prototype.init;d.fx.tick=function(){var a,b=d.timers,c=0;for(ma=d.now();b.length>c;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||d.fx.stop();ma=k};d.fx.timer=function(a){a()&&d.timers.push(a)&&d.fx.start()};
|
|
171
|
+
d.fx.interval=13;d.fx.start=function(){Pa||(Pa=setInterval(d.fx.tick,d.fx.interval))};d.fx.stop=function(){clearInterval(Pa);Pa=null};d.fx.speeds={slow:600,fast:200,_default:400};d.fx.step={};d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});d.fn.offset=function(a){if(arguments.length)return a===k?this:this.each(function(b){d.offset.setOffset(this,a,b)});var b,c,e=this[0],f={top:0,left:0},g=e&&e.ownerDocument;if(g)return b=
|
|
172
|
+
g.documentElement,d.contains(b,e)?(typeof e.getBoundingClientRect!==Aa&&(f=e.getBoundingClientRect()),c=d.isWindow(g)?g:9===g.nodeType&&g.defaultView,{top:f.top+c.pageYOffset-b.clientTop,left:f.left+c.pageXOffset-b.clientLeft}):f};d.offset={setOffset:function(a,b,c){var e,f,g,h,j,k,l=d.css(a,"position"),m=d(a),n={};"static"===l&&(a.style.position="relative");j=m.offset();g=d.css(a,"top");k=d.css(a,"left");("absolute"===l||"fixed"===l)&&-1<(g+k).indexOf("auto")?(e=m.position(),h=e.top,f=e.left):(h=
|
|
173
|
+
parseFloat(g)||0,f=parseFloat(k)||0);d.isFunction(b)&&(b=b.call(a,c,j));null!=b.top&&(n.top=b.top-j.top+h);null!=b.left&&(n.left=b.left-j.left+f);"using"in b?b.using.call(a,n):m.css(n)}};d.fn.extend({position:function(){if(this[0]){var a,b,c=this[0],e={top:0,left:0};return"fixed"===d.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),d.nodeName(a[0],"html")||(e=a.offset()),e.top+=d.css(a[0],"borderTopWidth",!0),e.left+=d.css(a[0],"borderLeftWidth",!0)),{top:b.top-
|
|
174
|
+
e.top-d.css(c,"marginTop",!0),left:b.left-e.left-d.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||Ab;a&&!d.nodeName(a,"html")&&"static"===d.css(a,"position");)a=a.offsetParent;return a||Ab})}});d.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;d.fn[a]=function(e){return d.access(this,function(a,e,h){var j=d.isWindow(a)?a:9===a.nodeType&&a.defaultView;return h===k?j?j[b]:a[e]:(j?j.scrollTo(c?l.pageXOffset:
|
|
175
|
+
h,c?h:l.pageYOffset):a[e]=h,k)},a,e,arguments.length,null)}});d.each({Height:"height",Width:"width"},function(a,b){d.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,e){d.fn[e]=function(e,g){var h=arguments.length&&(c||"boolean"!=typeof e),j=c||(!0===e||!0===g?"margin":"border");return d.access(this,function(b,c,e){var f;return d.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+
|
|
176
|
+
a],f["client"+a])):e===k?d.css(b,c,j):d.style(b,c,e,j)},b,h?e:k,h,null)}})});d.fn.size=function(){return this.length};d.fn.andSelf=d.fn.addBack;"object"==typeof module&&"object"==typeof module.exports?module.exports=d:"function"==typeof define&&define.amd&&define("jquery",[],function(){return d});"object"==typeof l&&"object"==typeof l.document&&(l.jQuery=l.$=d)})(window)};m.lib__jquery=function(){null===n&&(n=V());return n};window.modules=m})();
|
|
177
|
+
(function(){var m=window.modules||[];window.require=function(n){n=n.replace(/\//g,"__");-1===n.indexOf("__")&&(n="__"+n);return null===m[n]?null:m[n]()}})();
|
|
178
|
+
|
data/config/assets.rb
ADDED
data/leonidas.gemspec
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |s|
|
|
4
|
+
s.name = "leonidas"
|
|
5
|
+
s.version = "0.0.1"
|
|
6
|
+
|
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
|
8
|
+
s.authors = ["Tim Shelburne"]
|
|
9
|
+
s.date = "2013-05-01"
|
|
10
|
+
s.description = ""
|
|
11
|
+
s.email = "shelburt02@gmail.com"
|
|
12
|
+
s.executables = ["leonidas.js"]
|
|
13
|
+
s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.md", "bin/leonidas.js", "lib/leonidas.rb", "lib/leonidas/app/app.rb", "lib/leonidas/app/connection.rb", "lib/leonidas/app/repository.rb", "lib/leonidas/commands/aggregator.rb", "lib/leonidas/commands/command.rb", "lib/leonidas/commands/handler.rb", "lib/leonidas/commands/processor.rb", "lib/leonidas/dsl/configuration_expression.rb", "lib/leonidas/memory_layer/memory_registry.rb", "lib/leonidas/persistence_layer/persister.rb", "lib/leonidas/persistence_layer/state_builder.rb", "lib/leonidas/persistence_layer/state_loader.rb", "lib/leonidas/routes/sync.rb", "lib/leonidas/symbols.rb"]
|
|
14
|
+
s.files = ["CHANGELOG", "Gemfile", "Gemfile.lock", "LICENSE", "Manifest", "README.md", "Rakefile", "assets/scripts/coffee/leonidas/client.coffee", "assets/scripts/coffee/leonidas/commander.coffee", "assets/scripts/coffee/leonidas/commands/command.coffee", "assets/scripts/coffee/leonidas/commands/organizer.coffee", "assets/scripts/coffee/leonidas/commands/processor.coffee", "assets/scripts/coffee/leonidas/commands/stabilizer.coffee", "assets/scripts/coffee/leonidas/commands/synchronizer.coffee", "assets/scripts/js/lib/jquery.js", "bin/leonidas.js", "config/assets.rb", "lib/leonidas.rb", "lib/leonidas/app/app.rb", "lib/leonidas/app/connection.rb", "lib/leonidas/app/repository.rb", "lib/leonidas/commands/aggregator.rb", "lib/leonidas/commands/command.rb", "lib/leonidas/commands/handler.rb", "lib/leonidas/commands/processor.rb", "lib/leonidas/dsl/configuration_expression.rb", "lib/leonidas/memory_layer/memory_registry.rb", "lib/leonidas/persistence_layer/persister.rb", "lib/leonidas/persistence_layer/state_builder.rb", "lib/leonidas/persistence_layer/state_loader.rb", "lib/leonidas/routes/sync.rb", "lib/leonidas/symbols.rb", "spec/jasmine/jasmine.yml", "spec/jasmine/runner.html", "spec/jasmine/support/classes.coffee", "spec/jasmine/support/helpers.coffee", "spec/jasmine/support/mocks.coffee", "spec/jasmine/support/objects.coffee", "spec/jasmine/support/requirements.coffee", "spec/jasmine/tests/client_spec.coffee", "spec/jasmine/tests/commander_spec.coffee", "spec/jasmine/tests/commands/command_spec.coffee", "spec/jasmine/tests/commands/organizer_spec.coffee", "spec/jasmine/tests/commands/processor_spec.coffee", "spec/jasmine/tests/commands/stabilizer_spec.coffee", "spec/jasmine/tests/commands/synchronizer_spec.coffee", "spec/rspec/spec_helper.rb", "spec/rspec/support/classes/app.rb", "spec/rspec/support/classes/commands.rb", "spec/rspec/support/classes/persistence.rb", "spec/rspec/support/config.rb", "spec/rspec/support/mocks.rb", "spec/rspec/support/objects.rb", "spec/rspec/unit/app/app_spec.rb", "spec/rspec/unit/app/repository_spec.rb", "spec/rspec/unit/commands/aggregator_spec.rb", "spec/rspec/unit/commands/command.rb", "spec/rspec/unit/commands/processor_spec.rb", "spec/rspec/unit/dsl/configuration_expression_spec.rb", "spec/rspec/unit/leonidas_spec.rb", "spec/rspec/unit/memory_layer/memory_registry_spec.rb", "spec/rspec/unit/persistence_layer/persister_spec.rb", "spec/rspec/unit/persistence_layer/state_loader_spec.rb", "leonidas.gemspec"]
|
|
15
|
+
s.homepage = "https://github.com/tshelburne/leonidas"
|
|
16
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Leonidas", "--main", "README.md"]
|
|
17
|
+
s.require_paths = ["lib"]
|
|
18
|
+
s.rubyforge_project = "leonidas"
|
|
19
|
+
s.rubygems_version = "1.8.24"
|
|
20
|
+
s.summary = ""
|
|
21
|
+
|
|
22
|
+
if s.respond_to? :specification_version then
|
|
23
|
+
s.specification_version = 3
|
|
24
|
+
|
|
25
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
26
|
+
s.add_development_dependency(%q<jasmine>, [">= 0"])
|
|
27
|
+
s.add_development_dependency(%q<jasmine-headless-webkit>, [">= 0"])
|
|
28
|
+
else
|
|
29
|
+
s.add_dependency(%q<jasmine>, [">= 0"])
|
|
30
|
+
s.add_dependency(%q<jasmine-headless-webkit>, [">= 0"])
|
|
31
|
+
end
|
|
32
|
+
else
|
|
33
|
+
s.add_dependency(%q<jasmine>, [">= 0"])
|
|
34
|
+
s.add_dependency(%q<jasmine-headless-webkit>, [">= 0"])
|
|
35
|
+
end
|
|
36
|
+
end
|
data/lib/leonidas.rb
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'leonidas/symbols'
|
|
2
|
+
%w(aggregator command handler processor).each {|file| require "leonidas/commands/#{file}"}
|
|
3
|
+
%w(app connection repository).each {|file| require "leonidas/app/#{file}"}
|
|
4
|
+
%w(configuration_expression).each {|file| require "leonidas/dsl/#{file}"}
|
|
5
|
+
%w(memory_registry).each {|file| require "leonidas/memory_layer/#{file}"}
|
|
6
|
+
%w(state_loader persister state_builder).each {|file| require "leonidas/persistence_layer/#{file}"}
|
|
7
|
+
%w(sync).each {|file| require "leonidas/routes/#{file}"}
|
|
8
|
+
|
|
9
|
+
module Leonidas
|
|
10
|
+
def self.bootstrap(config_path)
|
|
11
|
+
dsl = ::Leonidas::Dsl::ConfigurationExpression.new
|
|
12
|
+
dsl.instance_eval File.read(config_path)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
module Leonidas
|
|
2
|
+
module App
|
|
3
|
+
|
|
4
|
+
module App
|
|
5
|
+
|
|
6
|
+
def name
|
|
7
|
+
@name
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def current_state
|
|
11
|
+
@active_state
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def create_connection!
|
|
15
|
+
connection = ::Leonidas::App::Connection.new
|
|
16
|
+
@connections << connection
|
|
17
|
+
connection
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def close_connection!(id)
|
|
21
|
+
@connections.delete connection(id) if has_connection? id
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def connection(id)
|
|
25
|
+
@connections.select {|connection| connection.id == id}.first
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def has_connection?(id)
|
|
29
|
+
not connection(id).nil?
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def connections
|
|
33
|
+
@connections
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def stable_timestamp
|
|
37
|
+
return 0 if @connections.empty?
|
|
38
|
+
now = Time.now.to_i
|
|
39
|
+
@connections.reduce(now) {|min, connection| connection.last_update < min ? connection.last_update : min }
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def stabilize!
|
|
43
|
+
revert_state!
|
|
44
|
+
@processor.process stable_commands, persistent_state?
|
|
45
|
+
lock_state!
|
|
46
|
+
@connections.each {|connection| connection.deactivate_commands!(stable_commands)}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def process_commands!
|
|
50
|
+
stabilize!
|
|
51
|
+
@processor.process active_commands
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def active_commands
|
|
55
|
+
@connections.reduce([ ]) {|commands, connection| commands.concat connection.active_commands}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
private
|
|
60
|
+
|
|
61
|
+
def stable_commands
|
|
62
|
+
@connections.reduce([ ]) {|commands, connection| commands.concat connection.commands_through(stable_timestamp)}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def revert_state!
|
|
66
|
+
@active_state = @locked_state.dup
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def lock_state!
|
|
70
|
+
@locked_state = @active_state.dup
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def persistent_state?
|
|
74
|
+
@persist_state || false
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
end
|
|
80
|
+
end
|